diff --git a/ThirdPartyNotice b/ThirdPartyNotice index 5fa2ad822e0a..c003db6eba3f 100644 --- a/ThirdPartyNotice +++ b/ThirdPartyNotice @@ -872,6 +872,7 @@ General Public License. 854. yauzl 2.4.1 (https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz) 855. yeast 0.1.2 (https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz) 856. seriously.js 513d2b8696b76fe764b3033aa6dc7c99005acccd (https://github.com/brianchirls/Seriously.js) +857. @zip.js/@zip.js 2.4.20 (https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.4.20.tgz) @@ -1620,8 +1621,8 @@ END OF argparse NOTICES AND INFORMATION %% argsarray 0.0.1 NOTICES AND INFORMATION BEGIN HERE (https://registry.npmjs.org/argsarray/-/argsarray-0.0.1.tgz) ========================================= -# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE -## TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +## TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. ========================================= @@ -4118,7 +4119,7 @@ exhaustive, and do not form part of our licenses. 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: + for the public: wiki.creativecommons.org/Considerations_for_licensees ======================================================================= @@ -5031,7 +5032,7 @@ END OF colors NOTICES AND INFORMATION %% combine-source-map 0.8.0 NOTICES AND INFORMATION BEGIN HERE (https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz) ========================================= -Copyright 2013 Thorsten Lorenz. +Copyright 2013 Thorsten Lorenz. All rights reserved. Permission is hereby granted, free of charge, to any person @@ -5227,25 +5228,25 @@ The MIT License Copyright (c) 2013 Max Ogden -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, +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 +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 +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-stream NOTICES AND INFORMATION @@ -5369,7 +5370,7 @@ END OF content-type NOTICES AND INFORMATION %% convert-source-map 1.1.3 NOTICES AND INFORMATION BEGIN HERE (https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz) ========================================= -Copyright 2013 Thorsten Lorenz. +Copyright 2013 Thorsten Lorenz. All rights reserved. Permission is hereby granted, free of charge, to any person @@ -5654,25 +5655,25 @@ The MIT License Copyright (c) 2013 Dominic Tarr -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, +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 +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 +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 crypto-browserify NOTICES AND INFORMATION @@ -5683,7 +5684,7 @@ END OF crypto-browserify NOTICES AND INFORMATION [The MIT License (MIT)](http://opensource.org/licenses/MIT) -Copyright (c) 2009-2013 Jeff Mott +Copyright (c) 2009-2013 Jeff Mott Copyright (c) 2013-2016 Evan Vosberg Permission is hereby granted, free of charge, to any person obtaining a copy @@ -6298,19 +6299,19 @@ END OF date-format NOTICES AND INFORMATION Copyright (c) 2014 TJ Holowaychuk -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, +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 +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 +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. @@ -7008,18 +7009,18 @@ Copyright (c) 2013, Deoxxa Development ====================================== All rights reserved. -------------------- - + Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +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. + 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. + documentation and/or other materials provided with the distribution. 3. Neither the name of Deoxxa Development nor the names of its contributors may be used to endorse or promote products derived from this software - without specific prior written permission. - + without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY DEOXXA DEVELOPMENT ''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 @@ -7307,19 +7308,19 @@ END OF end-stream NOTICES AND INFORMATION Copyright (c) 2014 Guillermo Rauch -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 +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 +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, +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. @@ -8336,7 +8337,7 @@ The MIT License (MIT) Copyright (c) 2016 David Mark Clements Copyright (c) 2017 David Mark Clements & Matteo Collina -Copyright (c) 2018 David Mark Clements, Matteo Collina & Ruben Bridgewater +Copyright (c) 2018 David Mark Clements, Matteo Collina & Ruben Bridgewater Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -10038,8 +10039,8 @@ modification, are permitted provided that the following conditions are met: * 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 name of highlight.js nor the names of its contributors - may be used to endorse or promote products derived from this software + * Neither the name of highlight.js 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY @@ -10278,10 +10279,10 @@ 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 @@ -10386,7 +10387,7 @@ of nodejs/io.js: Jan Schär (jscissr). Node.js is licensed for use as follows: - + """ Copyright Node.js contributors. All rights reserved. @@ -10432,7 +10433,7 @@ of nodejs/io.js: FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ - + ========================================= END OF http-parser-js NOTICES AND INFORMATION @@ -10657,25 +10658,25 @@ END OF imports-loader NOTICES AND INFORMATION ========================================= Copyright (c) 2013 Dominic Tarr -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, +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 +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 +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. ========================================= @@ -10775,7 +10776,7 @@ END OF ini NOTICES AND INFORMATION %% inline-source-map 0.6.2 NOTICES AND INFORMATION BEGIN HERE (https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz) ========================================= -Copyright 2013 Thorsten Lorenz. +Copyright 2013 Thorsten Lorenz. All rights reserved. Permission is hereby granted, free of charge, to any person @@ -11919,9 +11920,9 @@ This software is covered under the following copyright: * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER @@ -11994,7 +11995,7 @@ the directories in which they reside and in the code itself. No external contributions are allowed under licenses which are fundamentally incompatible with the AFL-2.1 OR and BSD-3-Clause licenses that Dojo is distributed under. -The text of the AFL-2.1 and BSD-3-Clause licenses is reproduced below. +The text of the AFL-2.1 and BSD-3-Clause licenses is reproduced below. ------------------------------------------------------------------------------- BSD 3-Clause "New" License: @@ -12334,25 +12335,25 @@ The MIT License Copyright (c) 2012 Tim Caswell -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, +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 +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 +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. ========================================= @@ -13888,25 +13889,25 @@ END OF lru-cache NOTICES AND INFORMATION ========================================= Copyright (c) 2014 Dominic Tarr -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, +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 +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 +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. ========================================= @@ -13998,25 +13999,25 @@ The MIT License (MIT) Copyright (c) 2011 Dominic Tarr -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, +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 +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 +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. ========================================= @@ -14083,8 +14084,8 @@ THE SOFTWARE. ## Markdown -Copyright © 2004, John Gruber -http://daringfireball.net/ +Copyright © 2004, John Gruber +http://daringfireball.net/ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -14926,7 +14927,7 @@ END OF neo-async NOTICES AND INFORMATION ========================================= The MIT License -Copyright (C) 2012-2016 Mariusz Nowak +Copyright (C) 2012-2016 Mariusz Nowak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21180,21 +21181,21 @@ END OF regex-not NOTICES AND INFORMATION ========================================= Copyright (c) 2012-2014 Daniel Brockman -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, +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 +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 +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. ========================================= @@ -21731,7 +21732,7 @@ 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. +THE SOFTWARE. ========================================= END OF ret NOTICES AND INFORMATION @@ -21740,18 +21741,18 @@ END OF ret NOTICES AND INFORMATION ========================================= Copyright 2019 "David Mark Clements " -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 +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 +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 +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. ========================================= @@ -22321,25 +22322,25 @@ END OF sha.js NOTICES AND INFORMATION ========================================= Copyright (c) 2012 'Dominic Tarr' -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, +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 +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 +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. ========================================= @@ -22372,25 +22373,25 @@ The MIT License Copyright (c) 2013 James Halliday (mail@substack.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, +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 +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 +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 shell-quote NOTICES AND INFORMATION @@ -23310,25 +23311,25 @@ END OF stream-browserify NOTICES AND INFORMATION ========================================= Copyright (c) 2012 'Dominic Tarr' -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, +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 +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 +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. ========================================= @@ -23340,25 +23341,25 @@ The MIT License Copyright (c) 2015 John Hiesey -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, +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 +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 +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 stream-http NOTICES AND INFORMATION @@ -24604,25 +24605,25 @@ The MIT License Copyright (c) 2016 John Hiesey -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, +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 +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 +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-arraybuffer NOTICES AND INFORMATION @@ -24828,7 +24829,7 @@ Apache License Version 2.0, January 2004 -http://www.apache.org/licenses/ +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -25481,7 +25482,7 @@ Apache License Version 2.0, January 2004 -http://www.apache.org/licenses/ +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -27832,4 +27833,35 @@ 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 yeast NOTICES AND INFORMATION \ No newline at end of file +END OF yeast NOTICES AND INFORMATION + +%% @zip.js/zip.js 2.4.20 NOTICES AND INFORMATION BEGIN HERE (https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.4.20.tgz) +========================================= + Copyright (c) 2022 Gildas Lormeau. 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. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED 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 JCRAFT, + INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE 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 @zip.js/zip.js NOTICES AND INFORMATION \ No newline at end of file diff --git a/package.json b/package.json index bd0cd58e6eb8..ef35b2c1c5fd 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@blockly/plugin-workspace-search": "^4.0.10", "@fortawesome/fontawesome-free": "^5.15.4", "@microsoft/immersive-reader-sdk": "1.1.0", + "@zip.js/zip.js": "2.4.20", "applicationinsights-js": "^1.0.20", "browserify": "16.2.3", "chai": "^3.5.0", diff --git a/webapp/public/index.html b/webapp/public/index.html index 3e10d18e9624..ed40316c3133 100644 --- a/webapp/public/index.html +++ b/webapp/public/index.html @@ -106,7 +106,8 @@ "blockly.css": "/blb/blockly.css", "rtlblockly.css": "/blb/rtlblockly.css", "gifjs/gif.js": "/blb/gifjs/gif.js", - "qrcode/qrcode.min.js": "/blb/qrcode/qrcode.min.js" + "qrcode/qrcode.min.js": "/blb/qrcode/qrcode.min.js", + "zip.js/zip.min.js": "/blb/zip.js/zip.min.js" } diff --git a/webapp/public/zip.js/zip.min.js b/webapp/public/zip.js/zip.min.js new file mode 100755 index 000000000000..f01355117e53 --- /dev/null +++ b/webapp/public/zip.js/zip.min.js @@ -0,0 +1,28 @@ + /* + Copyright (c) 2022 Gildas Lormeau. 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. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED 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 JCRAFT, + INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE 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. + */ +((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})})(this,(function(t){"use strict";const{Array:e,Object:n,String:r,BigInt:i,Math:s,Date:o,Map:a,URL:c,Error:l,Uint8Array:f,Uint16Array:d,Uint32Array:u,DataView:h,Blob:p,Promise:w,TextEncoder:g,TextDecoder:y,FileReader:m,document:b,crypto:k,btoa:v}=globalThis,S={chunkSize:524288,maxWorkers:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},_=n.assign({},S);function A(){return _}function z(t){if(void 0!==t.baseURL&&(_.baseURL=t.baseURL),void 0!==t.chunkSize&&(_.chunkSize=t.chunkSize),void 0!==t.maxWorkers&&(_.maxWorkers=t.maxWorkers),void 0!==t.terminateWorkerTimeout&&(_.terminateWorkerTimeout=t.terminateWorkerTimeout),void 0!==t.useWebWorkers&&(_.useWebWorkers=t.useWebWorkers),void 0!==t.Deflate&&(_.Deflate=t.Deflate),void 0!==t.Inflate&&(_.Inflate=t.Inflate),void 0!==t.workerScripts){if(t.workerScripts.deflate){if(!e.isArray(t.workerScripts.deflate))throw new l("workerScripts.deflate must be an array");_.workerScripts||(_.workerScripts={}),_.workerScripts.deflate=t.workerScripts.deflate}if(t.workerScripts.inflate){if(!e.isArray(t.workerScripts.inflate))throw new l("workerScripts.inflate must be an array");_.workerScripts||(_.workerScripts={}),_.workerScripts.inflate=t.workerScripts.inflate}}}function R(t,e,r){return class{constructor(i){const s=this;s.codec=new t(n.assign({},e,i)),r(s.codec,(t=>{if(s.pendingData){const e=s.pendingData;s.pendingData=new f(e.length+t.length),s.pendingData.set(e,0),s.pendingData.set(t,e.length)}else s.pendingData=new f(t)}))}append(t){return this.codec.push(t),i(this)}flush(){return this.codec.push(new f(0),!0),i(this)}};function i(t){if(t.pendingData){const e=t.pendingData;return t.pendingData=null,e}return new f(0)}}const C=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;C[t]=e}class E{constructor(t){this.crc=t||-1}append(t){let e=0|this.crc;for(let n=0,r=0|t.length;r>n;n++)e=e>>>8^C[255&(e^t[n])];this.crc=e}get(){return~this.crc}}function D(t){if(void 0===g){const e=new f((t=unescape(encodeURIComponent(t))).length);for(let n=0;n0&&e&&(t[n-1]=F.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,getPartial:t=>s.round(t/1099511627776)||32,_shiftRight(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let i=0;i>>e),n=t[i]<<32-e;const i=t.length?t[t.length-1]:0,s=F.getPartial(i);return r.push(F.partial(e+s&31,e+s>32?n:r.pop(),1)),r}},x={bytes:{fromBits(t){const e=F.bitLength(t)/8,n=new f(e);let r;for(let i=0;e>i;i++)0==(3&i)&&(r=t[i/4]),n[i]=r>>>24,r<<=8;return n},toBits(t){const e=[];let n,r=0;for(n=0;n9007199254740991)throw new l("Cannot hash more than 2^53 - 1 bits");const s=new u(n);let o=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);i>=t;t+=e.blockSize)e._block(s.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e},finalize:function(){const t=this;let e=t._buffer;const n=t._h;e=F.concat(e,[F.partial(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t._length/4294967296)),e.push(0|t._length);e.length;)t._block(e.splice(0,16));return t.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(t,e,n,r)=>t>19?t>39?t>59?t>79?void 0:e^n^r:e&n|e&r|n&r:e^n^r:e&n|~e&r,_S:(t,e)=>e<>>32-t,_block:function(t){const n=this,r=n._h,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=r[0],a=r[1],c=r[2],l=r[3],f=r[4];for(let t=0;79>=t;t++){16>t||(i[t]=n._S(1,i[t-3]^i[t-8]^i[t-14]^i[t-16]));const e=n._S(5,o)+n._f(t,a,c,l)+f+i[t]+n._key[s.floor(t/20)]|0;f=l,l=c,c=n._S(30,a),a=o,o=e}r[0]=r[0]+o|0,r[1]=r[1]+a|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+f|0}};const I={getRandomValues(t){const e=new u(t.buffer),n=t=>{let e=987654321;const n=4294967295;return()=>(e=36969*(65535&e)+(e>>16)&n,(((e<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,i=0;inew U.hmacSha1(x.bytes.toBits(t)),pbkdf2(t,e,n,r){if(n=n||1e4,0>r||0>n)throw new l("invalid params to pbkdf2");const i=1+(r>>5)<<2;let s,o,a,c,f;const d=new ArrayBuffer(i),u=new h(d);let p=0;const w=F;for(e=x.bytes.toBits(e),f=1;(i||1)>p;f++){for(s=o=t.encrypt(w.concat(e,[f])),a=1;n>a;a++)for(o=t.encrypt(o),c=0;cp&&ai&&(t=n.hash(t));for(let e=0;i>e;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e._baseHash[0].update(r[0]),e._baseHash[1].update(r[1]),e._resultHash=new n(e._baseHash[0])}reset(){const t=this;t._resultHash=new t._hash(t._baseHash[0]),t._updated=!1}update(t){this._updated=!0,this._resultHash.update(t)}digest(){const t=this,e=t._resultHash.finalize(),n=new t._hash(t._baseHash[1]).update(e).finalize();return t.reset(),n}encrypt(t){if(this._updated)throw new l("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},B="Invalid pasword",W=16,Q={name:"PBKDF2"},V=n.assign({hash:{name:"HMAC"}},Q),L=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Q),M=["deriveBits"],H=[8,12,16],N=[16,24,32],Z=10,O=[0,0,0,0],K=void 0!==k,P=K&&void 0!==k.subtle,q=x.bytes,X=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],r=e._tables[1],i=t.length;let s,o,a,c=1;if(4!==i&&6!==i&&8!==i)throw new l("invalid aes key size");for(e._key=[o=t.slice(0),a=[]],s=i;4*i+28>s;s++){let t=o[s-1];(s%i==0||8===i&&s%i==4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],s%i==0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),o[s]=o[s-i]^t}for(let t=0;s;t++,s--){const e=o[3&t?s:s-4];a[t]=4>=s||4>t?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],r=e[4],i=[],s=[];let o,a,c,l;for(let t=0;256>t;t++)s[(i[t]=t<<1^283*(t>>7))^t]=t;for(let f=o=0;!n[f];f^=a||1,o=s[o]||1){let s=o^o<<1^o<<2^o<<3^o<<4;s=s>>8^255&s^99,n[f]=s,r[s]=f,l=i[c=i[a=i[f]]];let d=16843009*l^65537*c^257*a^16843008*f,u=257*i[s]^16843008*s;for(let n=0;4>n;n++)t[n][f]=u=u<<24^u>>>8,e[n][s]=d=d<<24^d>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}_crypt(t,e){if(4!==t.length)throw new l("invalid aes block size");const n=this._key[e],r=n.length/4-2,i=[0,0,0,0],s=this._tables[e],o=s[0],a=s[1],c=s[2],f=s[3],d=s[4];let u,h,p,w=t[0]^n[0],g=t[e?3:1]^n[1],y=t[2]^n[2],m=t[e?1:3]^n[3],b=4;for(let t=0;r>t;t++)u=o[w>>>24]^a[g>>16&255]^c[y>>8&255]^f[255&m]^n[b],h=o[g>>>24]^a[y>>16&255]^c[m>>8&255]^f[255&w]^n[b+1],p=o[y>>>24]^a[m>>16&255]^c[w>>8&255]^f[255&g]^n[b+2],m=o[m>>>24]^a[w>>16&255]^c[g>>8&255]^f[255&y]^n[b+3],b+=4,w=u,g=h,y=p;for(let t=0;4>t;t++)i[e?3&-t:t]=d[w>>>24]<<24^d[g>>16&255]<<16^d[y>>8&255]<<8^d[255&m]^n[b++],u=w,w=g,g=y,y=m,m=u;return i}},Y=class{constructor(t,e){this._prf=t,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(t){return this.calculate(this._prf,t,this._iv)}incWord(t){if(255==(t>>24&255)){let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t}incCounter(t){0===(t[0]=this.incWord(t[0]))&&(t[1]=this.incWord(t[1]))}calculate(t,e,n){let r;if(!(r=e.length))return[];const i=F.bitLength(e);for(let i=0;r>i;i+=4){this.incCounter(n);const r=t.encrypt(n);e[i]^=r[0],e[i+1]^=r[1],e[i+2]^=r[2],e[i+3]^=r[3]}return F.clamp(e,i)}},$=U.hmacSha1;class j{constructor(t,e,r){n.assign(this,{password:t,signed:e,strength:r-1,pendingInput:new f(0)})}async append(t){const n=this;if(n.password){const r=nt(t,0,H[n.strength]+2);await(async(t,e,n)=>{await tt(t,n,nt(e,0,H[t.strength]));const r=nt(e,H[t.strength]),i=t.keys.passwordVerification;if(i[0]!=r[0]||i[1]!=r[1])throw new l(B)})(n,r,n.password),n.password=null,n.aesCtrGladman=new Y(new X(n.keys.key),e.from(O)),n.hmac=new $(n.keys.authentication),t=nt(t,H[n.strength]+2)}return J(n,t,new f(t.length-Z-(t.length-Z)%W),0,Z,!0)}flush(){const t=this,e=t.pendingInput,n=nt(e,0,e.length-Z),r=nt(e,e.length-Z);let i=new f(0);if(n.length){const e=q.toBits(n);t.hmac.update(e);const r=t.aesCtrGladman.update(e);i=q.fromBits(r)}let s=!0;if(t.signed){const e=nt(q.fromBits(t.hmac.digest()),0,Z);for(let t=0;Z>t;t++)e[t]!=r[t]&&(s=!1)}return{valid:s,data:i}}}class G{constructor(t,e){n.assign(this,{password:t,strength:e-1,pendingInput:new f(0)})}async append(t){const n=this;let r=new f(0);n.password&&(r=await(async(t,e)=>{const n=(r=new f(H[t.strength]),K&&"function"==typeof k.getRandomValues?k.getRandomValues(r):I.getRandomValues(r));var r;return await tt(t,e,n),et(n,t.keys.passwordVerification)})(n,n.password),n.password=null,n.aesCtrGladman=new Y(new X(n.keys.key),e.from(O)),n.hmac=new $(n.keys.authentication));const i=new f(r.length+t.length-t.length%W);return i.set(r,0),J(n,t,i,r.length,0)}flush(){const t=this;let e=new f(0);if(t.pendingInput.length){const n=t.aesCtrGladman.update(q.toBits(t.pendingInput));t.hmac.update(n),e=q.fromBits(n)}const n=nt(q.fromBits(t.hmac.digest()),0,Z);return{data:et(e,n),signature:n}}}function J(t,e,n,r,i,s){const o=e.length-i;let a;for(t.pendingInput.length&&(e=et(t.pendingInput,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new f(e)).set(n,0)}return t})(n,o-o%W)),a=0;o-W>=a;a+=W){const i=q.toBits(nt(e,a,a+W));s&&t.hmac.update(i);const o=t.aesCtrGladman.update(i);s||t.hmac.update(o),n.set(q.fromBits(o),a+r)}return t.pendingInput=nt(e,a),n}async function tt(t,e,r){const i=D(e),s=await((t,e,n,r,i)=>K&&P&&"function"==typeof k.subtle.importKey?k.subtle.importKey("raw",e,n,!1,i):U.importKey(e))(0,i,V,0,M),o=await(async(t,e,n)=>K&&P&&"function"==typeof k.subtle.deriveBits?await k.subtle.deriveBits(t,e,n):U.pbkdf2(e,t.salt,L.iterations,n))(n.assign({salt:r},L),s,8*(2*N[t.strength]+2)),a=new f(o);t.keys={key:q.toBits(nt(a,0,N[t.strength])),authentication:q.toBits(nt(a,N[t.strength],2*N[t.strength])),passwordVerification:nt(a,2*N[t.strength])}}function et(t,e){let n=t;return t.length+e.length&&(n=new f(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function nt(t,e,n){return t.subarray(e,n)}class rt{constructor(t,e){n.assign(this,{password:t,passwordVerification:e}),at(this,t)}append(t){const e=this;if(e.password){const n=st(e,t.subarray(0,12));if(e.password=null,n[11]!=e.passwordVerification)throw new l(B);t=t.subarray(12)}return st(e,t)}flush(){return{valid:!0,data:new f(0)}}}class it{constructor(t,e){n.assign(this,{password:t,passwordVerification:e}),at(this,t)}append(t){const e=this;let n,r;if(e.password){e.password=null;const i=k.getRandomValues(new f(12));i[11]=e.passwordVerification,n=new f(t.length+i.length),n.set(ot(e,i),0),r=12}else n=new f(t.length),r=0;return n.set(ot(e,t),r),n}flush(){return{data:new f(0)}}}function st(t,e){const n=new f(e.length);for(let r=0;r>>24]),t.keys[2]=~t.crcKey2.get()}function lt(t){const e=2|t.keys[2];return ft(s.imul(e,1^e)>>>8)}function ft(t){return 255&t}function dt(t){return 4294967295&t}const ut="deflate",ht="inflate",pt="Invalid signature";class wt{constructor(t,{signature:e,password:r,signed:i,compressed:s,zipCrypto:o,passwordVerification:a,encryptionStrength:c},{chunkSize:l}){const f=!!r;n.assign(this,{signature:e,encrypted:f,signed:i,compressed:s,inflate:s&&new t({chunkSize:l}),crc32:i&&new E,zipCrypto:o,decrypt:f&&o?new rt(r,a):new j(r,i,c)})}async append(t){const e=this;return e.encrypted&&t.length&&(t=await e.decrypt.append(t)),e.compressed&&t.length&&(t=await e.inflate.append(t)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),t}async flush(){const t=this;let e,n=new f(0);if(t.encrypted){const e=t.decrypt.flush();if(!e.valid)throw new l(pt);n=e.data}if((!t.encrypted||t.zipCrypto)&&t.signed){const n=new h(new f(4).buffer);if(e=t.crc32.get(),n.setUint32(0,e),t.signature!=n.getUint32(0,!1))throw new l(pt)}return t.compressed&&(n=await t.inflate.append(n)||new f(0),await t.inflate.flush()),{data:n,signature:e}}}class gt{constructor(t,{encrypted:e,signed:r,compressed:i,level:s,zipCrypto:o,password:a,passwordVerification:c,encryptionStrength:l},{chunkSize:f}){n.assign(this,{encrypted:e,signed:r,compressed:i,deflate:i&&new t({level:s||5,chunkSize:f}),crc32:r&&new E,zipCrypto:o,encrypt:e&&o?new it(a,c):new G(a,l)})}async append(t){const e=this;let n=t;return e.compressed&&t.length&&(n=await e.deflate.append(t)),e.encrypted&&n.length&&(n=await e.encrypt.append(n)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),n}async flush(){const t=this;let e,n=new f(0);if(t.compressed&&(n=await t.deflate.flush()||new f(0)),t.encrypted){n=await t.encrypt.append(n);const r=t.encrypt.flush();e=r.signature;const i=new f(n.length+r.data.length);i.set(n,0),i.set(r.data,n.length),n=i}return t.encrypted&&!t.zipCrypto||!t.signed||(e=t.crc32.get()),{data:n,signature:e}}}const yt="init",mt="append",bt="flush";let kt=!0;var vt=(t,e,r,i,s,o,a)=>(n.assign(t,{busy:!0,codecConstructor:e,options:n.assign({},r),scripts:a,terminate(){t.worker&&!t.busy&&(t.worker.terminate(),t.interface=null)},onTaskFinished(){t.busy=!1,s(t)}}),o?((t,e)=>{let n;const r={type:"module"};if(!t.interface){if(kt)try{t.worker=i({},e.baseURL)}catch(n){kt=!1,t.worker=i(r,e.baseURL)}else t.worker=i(r,e.baseURL);t.worker.addEventListener("message",(e=>{const r=e.data;if(n){const e=r.error,i=r.type;if(e){const r=new l(e.message);r.stack=e.stack,n.reject(r),n=null,t.onTaskFinished()}else if(i==yt||i==bt||i==mt){const e=r.data;i==bt?(n.resolve({data:new f(e),signature:r.signature}),n=null,t.onTaskFinished()):n.resolve(e&&new f(e))}}}),!1),t.interface={append:t=>s({type:mt,data:t}),flush:()=>s({type:bt}),abort(){t.onTaskFinished()}}}return t.interface;function i(e,n){let r,i;r=t.scripts[0],"function"==typeof r&&(r=r());try{i=new c(r,n)}catch(t){i=r}return new Worker(i,e)}async function s(r){if(!n){const n=t.options,r=t.scripts.slice(1);await o({scripts:r,type:yt,options:n,config:{chunkSize:e.chunkSize}})}return o(r)}function o(e){const r=t.worker,i=new w(((t,e)=>n={resolve:t,reject:e}));try{if(e.data)try{e.data=e.data.buffer,r.postMessage(e,[e.data])}catch(t){r.postMessage(e)}else r.postMessage(e)}catch(e){n.reject(e),n=null,t.onTaskFinished()}return i}})(t,i):((t,e)=>{const n=((t,e,n)=>e.codecType.startsWith(ut)?new gt(t,e,n):e.codecType.startsWith(ht)?new wt(t,e,n):void 0)(t.codecConstructor,t.options,e);return{async append(e){try{return await n.append(e)}catch(e){throw t.onTaskFinished(),e}},async flush(){try{return await n.flush()}finally{t.onTaskFinished()}},abort(){t.onTaskFinished()}}})(t,i));let St=[];const _t=[];function At(t,e,n){const r=!(!e.compressed&&!e.signed&&!e.encrypted)&&(e.useWebWorkers||void 0===e.useWebWorkers&&n.useWebWorkers),i=r&&n.workerScripts?n.workerScripts[e.codecType]:[];if(St.length!t.busy));return o?(zt(o),vt(o,t,e,n,s,r,i)):new w((n=>_t.push({resolve:n,codecConstructor:t,options:e,webWorker:r,scripts:i})))}function s(t){if(_t.length){const[{resolve:e,codecConstructor:r,options:i,webWorker:o,scripts:a}]=_t.splice(0,1);e(vt(t,r,i,n,s,o,a))}else t.worker?(zt(t),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(t.terminateTimeout=setTimeout((()=>{St=St.filter((e=>e!=t)),t.terminate()}),n.terminateWorkerTimeout))):St=St.filter((e=>e!=t))}}function zt(t){t.terminateTimeout&&(clearTimeout(t.terminateTimeout),t.terminateTimeout=null)}const Rt="Abort error";async function Ct(t,e,n,r,i,o,a){const c=s.max(o.chunkSize,64);return async function o(l=0,f=0){const d=a.signal;if(i>l){Et(d,t);const u=await e.readUint8Array(l+r,s.min(c,i-l)),h=u.length;Et(d,t);const p=await t.append(u);if(Et(d,t),f+=await Dt(n,p),a.onprogress)try{a.onprogress(l+h,i)}catch(t){}return o(l+c,f)}{const e=await t.flush();return f+=await Dt(n,e.data),{signature:e.signature,length:f}}}()}function Et(t,e){if(t&&t.aborted)throw e.abort(),new l(Rt)}async function Dt(t,e){return e.length&&await t.writeUint8Array(e),e.length}const Ft="HTTP error ",xt="HTTP Range not supported",Tt="text/plain",It="GET";class Ut{constructor(){this.size=0}init(){this.initialized=!0}}class Bt extends Ut{}class Wt extends Ut{writeUint8Array(t){this.size+=t.length}}class Qt extends Bt{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,e){if(this.blob.arrayBuffer)return new f(await this.blob.slice(t,t+e).arrayBuffer());{const n=new m;return new w(((r,i)=>{n.onload=t=>r(new f(t.target.result)),n.onerror=()=>i(n.error),n.readAsArrayBuffer(this.blob.slice(t,t+e))}))}}}class Vt extends Wt{constructor(t){super(),this.contentType=t,this.arrayBuffersMaxlength=8,Lt(this)}writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.length==this.arrayBuffersMaxlength&&Mt(this),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.arrayBuffers.length&&Mt(this),this.blob=this.pendingBlob,Lt(this)),this.blob}}function Lt(t){t.pendingBlob=new p([],{type:t.contentType}),t.arrayBuffers=[]}function Mt(t){t.pendingBlob=new p([t.pendingBlob,...t.arrayBuffers],{type:t.contentType}),t.arrayBuffers=[]}class Ht extends Bt{constructor(t,e){super(),this.url=t,this.preventHeadRequest=e.preventHeadRequest,this.useRangeHeader=e.useRangeHeader,this.forceRangeRequests=e.forceRangeRequests,this.options=n.assign({},e),delete this.options.preventHeadRequest,delete this.options.useRangeHeader,delete this.options.forceRangeRequests,delete this.options.useXHR}async init(){super.init(),await Zt(this,jt,qt)}readUint8Array(t,e){return Ot(this,t,e,jt,qt)}}class Nt extends Bt{constructor(t,e){super(),this.url=t,this.preventHeadRequest=e.preventHeadRequest,this.useRangeHeader=e.useRangeHeader,this.forceRangeRequests=e.forceRangeRequests,this.options=e}async init(){super.init(),await Zt(this,Gt,Xt)}readUint8Array(t,e){return Ot(this,t,e,Gt,Xt)}}async function Zt(t,e,n){if((t=>{if(void 0!==b){const e=b.createElement("a");return e.href=t,"http:"==e.protocol||"https:"==e.protocol}return/^https?:\/\//i.test(t)})(t.url)&&(t.useRangeHeader||t.forceRangeRequests)){const r=await e(It,t,Kt(t));if(!t.forceRangeRequests&&"bytes"!=r.headers.get("Accept-Ranges"))throw new l(xt);{let i;const s=r.headers.get("Content-Range");if(s){const t=s.trim().split(/\s*\/\s*/);if(t.length){const e=t[1];e&&"*"!=e&&(i=Number(e))}}void 0===i?await $t(t,e,n):t.size=i}}else await $t(t,e,n)}async function Ot(t,e,n,r,i){if(t.useRangeHeader||t.forceRangeRequests){const i=await r(It,t,Kt(t,e,n));if(206!=i.status)throw new l(xt);return new f(await i.arrayBuffer())}return t.data||await i(t,t.options),new f(t.data.subarray(e,e+n))}function Kt(t,e=0,r=1){return n.assign({},Pt(t),{Range:"bytes="+e+"-"+(e+r-1)})}function Pt(t){const e=t.options.headers;if(e)return Symbol.iterator in e?n.fromEntries(e):e}async function qt(t){await Yt(t,jt)}async function Xt(t){await Yt(t,Gt)}async function Yt(t,e){const n=await e(It,t,Pt(t));t.data=new f(await n.arrayBuffer()),t.size||(t.size=t.data.length)}async function $t(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=(await e("HEAD",t,Pt(t))).headers.get("Content-Length");r?t.size=Number(r):await n(t,t.options)}}async function jt(t,{options:e,url:r},i){const s=await fetch(r,n.assign({},e,{method:t,headers:i}));if(400>s.status)return s;throw new l(Ft+(s.statusText||s.status))}function Gt(t,{url:e},r){return new w(((i,s)=>{const o=new XMLHttpRequest;if(o.addEventListener("load",(()=>{if(400>o.status){const t=[];o.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,(t=>t.toUpperCase())),t.push(n)})),i({status:o.status,arrayBuffer:()=>o.response,headers:new a(t)})}else s(new l(Ft+(o.statusText||o.status)))}),!1),o.addEventListener("error",(t=>s(t.detail.error)),!1),o.open(t,e),r)for(const t of n.entries(r))o.setRequestHeader(t[0],t[1]);o.responseType="arraybuffer",o.send()}))}class Jt extends Bt{constructor(t,e={}){super(),this.url=t,e.useXHR?this.reader=new Nt(t,e):this.reader=new Ht(t,e)}set size(t){}get size(){return this.reader.size}async init(){super.init(),await this.reader.init()}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}const te=4294967295,ee=65535,ne=67324752,re=33639248,ie=101075792,se=117853008,oe=21589,ae=2048,ce="/",le=new o(2107,11,31),fe=new o(1980,0,1),de="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function ue(t,e){if(e&&"cp437"==e.trim().toLowerCase())return(t=>{let e="";for(let n=0;n{e.onload=t=>n(t.target.result),e.onerror=()=>r(e.error),e.readAsText(new p([t]))}))}return new y(e).decode(t)}const he=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"];class pe{constructor(t){he.forEach((e=>this[e]=t[e]))}}const we="File format is not recognized",ge="End of central directory not found",ye="End of Zip64 central directory not found",me="End of Zip64 central directory locator not found",be="Central directory header not found",ke="Local file header not found",ve="Zip64 extra field not found",Se="File contains encrypted entry",_e="Encryption method not supported",Ae="Compression method not supported",ze="utf-8",Re="cp437",Ce=["uncompressedSize","compressedSize","offset"];class Ee{constructor(t,e,r){n.assign(this,{reader:t,config:e,options:r})}async getData(t,e,n={}){const r=this,{reader:i,offset:s,extraFieldAES:o,compressionMethod:a,config:c,bitFlag:f,signature:d,rawLastModDate:u,compressedSize:h}=r,p=r.localDirectory={};i.initialized||await i.init();let w=await Me(i,s,30);const g=Le(w);let y=Te(r,n,"password");if(y=y&&y.length&&y,o&&99!=o.originalCompressionMethod)throw new l(Ae);if(0!=a&&8!=a)throw new l(Ae);if(Qe(g,0)!=ne)throw new l(ke);De(p,g,4),w=await Me(i,s,30+p.filenameLength+p.extraFieldLength),p.rawExtraField=w.subarray(30+p.filenameLength),await Fe(r,p,g,4),e.lastAccessDate=p.lastAccessDate,e.creationDate=p.creationDate;const m=r.encrypted&&p.encrypted,b=m&&!o;if(m){if(!b&&void 0===o.strength)throw new l(_e);if(!y)throw new l(Se)}const k=await At(c.Inflate,{codecType:ht,password:y,zipCrypto:b,encryptionStrength:o&&o.strength,signed:Te(r,n,"checkSignature"),passwordVerification:b&&(f.dataDescriptor?u>>>8&255:d>>>24&255),signature:d,compressed:0!=a,encrypted:m,useWebWorkers:Te(r,n,"useWebWorkers")},c);t.initialized||await t.init();const v=Te(r,n,"signal"),S=s+30+p.filenameLength+p.extraFieldLength;return await Ct(k,i,t,S,h,c,{onprogress:n.onprogress,signal:v}),t.getData()}}function De(t,e,r){const i=t.rawBitFlag=We(e,r+2),s=1==(1&i),o=Qe(e,r+6);n.assign(t,{encrypted:s,version:We(e,r),bitFlag:{level:(6&i)>>1,dataDescriptor:8==(8&i),languageEncodingFlag:(i&ae)==ae},rawLastModDate:o,lastModDate:Ie(o),filenameLength:We(e,r+22),extraFieldLength:We(e,r+24)})}async function Fe(t,e,r,i){const c=e.rawExtraField,d=e.extraField=new a,u=Le(new f(c));let h=0;try{for(;h{e.zip64=!0;const n=Le(t.data);t.values=[];for(let e=0;ee[t]==te));for(let e=0;e{if(e[n]==te){if(void 0===t[n])throw new l(ve);e[n]=t[n]}}))})(w,e),e.extraFieldZip64=w);const g=d.get(28789);g&&(await xe(g,"filename","rawFilename",e,t),e.extraFieldUnicodePath=g);const y=d.get(25461);y&&(await xe(y,"comment","rawComment",e,t),e.extraFieldUnicodeComment=y);const m=d.get(39169);m?(((t,e,n)=>{const r=Le(t.data);t.vendorVersion=Be(r,0),t.vendorId=Be(r,2);const i=Be(r,4);t.strength=i,t.originalCompressionMethod=n,e.compressionMethod=t.compressionMethod=We(r,5)})(m,e,p),e.extraFieldAES=m):e.compressionMethod=p;const b=d.get(10);b&&(((t,e)=>{const r=Le(t.data);let i,s=4;try{for(;s{const n=Le(t.data),r=Be(n,0),i=[],s=[];1==(1&r)&&(i.push("lastModDate"),s.push("rawLastModDate")),2==(2&r)&&(i.push("lastAccessDate"),s.push("rawLastAccessDate")),4==(4&r)&&(i.push("creationDate"),s.push("rawCreationDate"));let a=1;i.forEach(((r,i)=>{if(t.data.length>=a+4){const c=Qe(n,a);e[r]=t[r]=new o(1e3*c);const l=s[i];t[l]=c}a+=4}))})(k,e),e.extraFieldExtendedTimestamp=k)}async function xe(t,e,n,r,i){const s=Le(t.data);t.version=Be(s,0),t.signature=Qe(s,1);const o=new E;o.append(i[n]);const a=Le(new f(4));a.setUint32(0,o.get(),!0),t[e]=await ue(t.data.subarray(5)),t.valid=!i.bitFlag.languageEncodingFlag&&t.signature==Qe(a,0),t.valid&&(r[e]=t[e],r[e+"UTF8"]=!0)}function Te(t,e,n){return void 0===e[n]?t.options[n]:e[n]}function Ie(t){const e=(4294901760&t)>>16,n=65535&t;try{return new o(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch(t){}}function Ue(t){return new o(Number(t/i(1e4)-i(116444736e5)))}function Be(t,e){return t.getUint8(e)}function We(t,e){return t.getUint16(e,!0)}function Qe(t,e){return t.getUint32(e,!0)}function Ve(t,e){return Number(t.getBigUint64(e,!0))}function Le(t){return new h(t.buffer)}function Me(t,e,n){return t.readUint8Array(e,n)}const He="File already exists",Ne="Zip file comment exceeds 64KB",Ze="File entry comment exceeds 64KB",Oe="File entry name exceeds 64KB",Ke="Version exceeds 65535",Pe="The strength must equal 1, 2, or 3",qe="Extra field type exceeds 65535",Xe="Extra field data exceeds 64KB",Ye="Zip64 is not supported",$e=new f([7,0,2,0,65,69,3,0,0]);let je,Ge=0;function Je(t,e,n){if(t.arrayBuffer)return e||n?t.slice(e,n).arrayBuffer():t.arrayBuffer();{const r=new m;return new w(((i,s)=>{r.onload=t=>i(t.target.result),r.onerror=()=>s(r.error),r.readAsArrayBuffer(e||n?t.slice(e,n):t)}))}}function tn(t){if(t)return(i(t.getTime())+i(116444736e5))*i(1e4)}function en(t,e,n){return void 0===e[n]?t.options[n]:e[n]}function nn(t,e,n){t.setUint8(e,n)}function rn(t,e,n){t.setUint16(e,n,!0)}function sn(t,e,n){t.setUint32(e,n,!0)}function on(t,e,n){t.setBigUint64(e,n,!0)}function an(t,e,n){t.set(e,n)}function cn(t){return new h(t.buffer)}try{je=void 0===b&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:void 0===b?location.href:b.currentScript&&b.currentScript.src||new c("zip.min.js",b.baseURI).href}catch(t){}z({baseURL:je}),(t=>{if("function"==typeof c.createObjectURL){const e=()=>c.createObjectURL(new p(['const{Array:t,Object:e,Math:n,Error:r,Uint8Array:i,Uint16Array:o,Uint32Array:s,Int32Array:f,DataView:c,TextEncoder:l,crypto:u,postMessage:a}=globalThis,w=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;w[t]=e}class h{constructor(t){this.t=t||-1}append(t){let e=0|this.t;for(let n=0,r=0|t.length;r>n;n++)e=e>>>8^w[255&(e^t[n])];this.t=e}get(){return~this.t}}const d={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=d.i(n);return 32===r?t.concat(e):d.o(e,r,0|n,t.slice(0,t.length-1))},l(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+d.i(n)},u(t,e){if(32*t.length0&&e&&(t[r-1]=d.h(e,t[r-1]&2147483648>>e-1,1)),t},h:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,i:t=>n.round(t/1099511627776)||32,o(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let i=0;i>>e),n=t[i]<<32-e;const i=t.length?t[t.length-1]:0,o=d.i(i);return r.push(d.h(e+o&31,e+o>32?n:r.pop(),1)),r}},p={p:{k(t){const e=d.l(t)/8,n=new i(e);let r;for(let i=0;e>i;i++)0==(3&i)&&(r=t[i/4]),n[i]=r>>>24,r<<=8;return n},g(t){const e=[];let n,r=0;for(n=0;n9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const f=new s(n);let c=0;for(let t=e.blockSize+i-(e.blockSize+i&e.blockSize-1);o>=t;t+=e.blockSize)e.C(f.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),e},V:function(){const t=this;let e=t.S;const r=t.m;e=d.concat(e,[d.h(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(n.floor(t._/4294967296)),e.push(0|t._);e.length;)t.C(e.splice(0,16));return t.reset(),r},I:[1732584193,4023233417,2562383102,271733878,3285377520],B:[1518500249,1859775393,2400959708,3395469782],D:(t,e,n,r)=>t>19?t>39?t>59?t>79?void 0:e^n^r:e&n|e&r|n&r:e^n^r:e&n|~e&r,U:(t,e)=>e<>>32-t,C:function(e){const r=this,i=r.m,o=t(80);for(let t=0;16>t;t++)o[t]=e[t];let s=i[0],f=i[1],c=i[2],l=i[3],u=i[4];for(let t=0;79>=t;t++){16>t||(o[t]=r.U(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=r.U(5,s)+r.D(t,f,c,l)+u+o[t]+r.B[n.floor(t/20)]|0;u=l,l=c,c=r.U(30,f),f=s,s=e}i[0]=i[0]+s|0,i[1]=i[1]+f|0,i[2]=i[2]+c|0,i[3]=i[3]+l|0,i[4]=i[4]+u|0}};const b={getRandomValues(t){const e=new s(t.buffer),r=t=>{let e=987654321;const r=4294967295;return()=>(e=36969*(65535&e)+(e>>16)&r,(((e<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r)/4294967296+.5)*(n.random()>.5?1:-1))};for(let i,o=0;onew k.M(p.p.g(t)),P(t,e,n,i){if(n=n||1e4,0>i||0>n)throw new r("invalid params to pbkdf2");const o=1+(i>>5)<<2;let s,f,l,u,a;const w=new ArrayBuffer(o),h=new c(w);let y=0;const b=d;for(e=p.p.g(e),a=1;(o||1)>y;a++){for(s=f=t.encrypt(b.concat(e,[a])),l=1;n>l;l++)for(f=t.encrypt(f),u=0;uy&&li&&(t=n.hash(t));for(let e=0;i>e;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.H[0].update(r[0]),e.H[1].update(r[1]),e.K=new n(e.H[0])}reset(){const t=this;t.K=new t.R(t.H[0]),t.L=!1}update(t){this.L=!0,this.K.update(t)}digest(){const t=this,e=t.K.V(),n=new t.R(t.H[1]).update(e).V();return t.reset(),n}encrypt(t){if(this.L)throw new r("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},g={name:"PBKDF2"},v=e.assign({hash:{name:"HMAC"}},g),m=e.assign({iterations:1e3,hash:{name:"SHA-1"}},g),S=["deriveBits"],z=[8,12,16],_=[16,24,32],I=[0,0,0,0],A=void 0!==u,C=A&&void 0!==u.subtle,V=p.p,B=class{constructor(t){const e=this;e.T=[[[],[],[],[],[]],[[],[],[],[],[]]],e.T[0][0][0]||e.j();const n=e.T[0][4],i=e.T[1],o=t.length;let s,f,c,l=1;if(4!==o&&6!==o&&8!==o)throw new r("invalid aes key size");for(e.B=[f=t.slice(0),c=[]],s=o;4*o+28>s;s++){let t=f[s-1];(s%o==0||8===o&&s%o==4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],s%o==0&&(t=t<<8^t>>>24^l<<24,l=l<<1^283*(l>>7))),f[s]=f[s-o]^t}for(let t=0;s;t++,s--){const e=f[3&t?s:s-4];c[t]=4>=s||4>t?e:i[0][n[e>>>24]]^i[1][n[e>>16&255]]^i[2][n[e>>8&255]]^i[3][n[255&e]]}}encrypt(t){return this.F(t,0)}decrypt(t){return this.F(t,1)}j(){const t=this.T[0],e=this.T[1],n=t[4],r=e[4],i=[],o=[];let s,f,c,l;for(let t=0;256>t;t++)o[(i[t]=t<<1^283*(t>>7))^t]=t;for(let u=s=0;!n[u];u^=f||1,s=o[s]||1){let o=s^s<<1^s<<2^s<<3^s<<4;o=o>>8^255&o^99,n[u]=o,r[o]=u,l=i[c=i[f=i[u]]];let a=16843009*l^65537*c^257*f^16843008*u,w=257*i[o]^16843008*o;for(let n=0;4>n;n++)t[n][u]=w=w<<24^w>>>8,e[n][o]=a=a<<24^a>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}F(t,e){if(4!==t.length)throw new r("invalid aes block size");const n=this.B[e],i=n.length/4-2,o=[0,0,0,0],s=this.T[e],f=s[0],c=s[1],l=s[2],u=s[3],a=s[4];let w,h,d,p=t[0]^n[0],y=t[e?3:1]^n[1],b=t[2]^n[2],k=t[e?1:3]^n[3],g=4;for(let t=0;i>t;t++)w=f[p>>>24]^c[y>>16&255]^l[b>>8&255]^u[255&k]^n[g],h=f[y>>>24]^c[b>>16&255]^l[k>>8&255]^u[255&p]^n[g+1],d=f[b>>>24]^c[k>>16&255]^l[p>>8&255]^u[255&y]^n[g+2],k=f[k>>>24]^c[p>>16&255]^l[y>>8&255]^u[255&b]^n[g+3],g+=4,p=w,y=h,b=d;for(let t=0;4>t;t++)o[e?3&-t:t]=a[p>>>24]<<24^a[y>>16&255]<<16^a[b>>8&255]<<8^a[255&k]^n[g++],w=p,p=y,y=b,b=k,k=w;return o}},E=class{constructor(t,e){this.O=t,this.W=e,this.q=e}reset(){this.q=this.W}update(t){return this.G(this.O,t,this.q)}J(t){if(255==(t>>24&255)){let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t}N(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}G(t,e,n){let r;if(!(r=e.length))return[];const i=d.l(e);for(let i=0;r>i;i+=4){this.N(n);const r=t.encrypt(n);e[i]^=r[0],e[i+1]^=r[1],e[i+2]^=r[2],e[i+3]^=r[3]}return d.u(e,i)}},D=k.M;class U{constructor(t,n,r){e.assign(this,{password:t,signed:n,X:r-1,Y:new i(0)})}async append(e){const n=this;if(n.password){const i=K(e,0,z[n.X]+2);await(async(t,e,n)=>{await R(t,n,K(e,0,z[t.X]));const i=K(e,z[t.X]),o=t.keys.passwordVerification;if(o[0]!=i[0]||o[1]!=i[1])throw new r("Invalid pasword")})(n,i,n.password),n.password=null,n.Z=new E(new B(n.keys.key),t.from(I)),n.$=new D(n.keys.tt),e=K(e,z[n.X]+2)}return P(n,e,new i(e.length-10-(e.length-10)%16),0,10,!0)}flush(){const t=this,e=t.Y,n=K(e,0,e.length-10),r=K(e,e.length-10);let o=new i(0);if(n.length){const e=V.g(n);t.$.update(e);const r=t.Z.update(e);o=V.k(r)}let s=!0;if(t.signed){const e=K(V.k(t.$.digest()),0,10);for(let t=0;10>t;t++)e[t]!=r[t]&&(s=!1)}return{valid:s,data:o}}}class M{constructor(t,n){e.assign(this,{password:t,X:n-1,Y:new i(0)})}async append(e){const n=this;let r=new i(0);n.password&&(r=await(async(t,e)=>{const n=(r=new i(z[t.X]),A&&"function"==typeof u.getRandomValues?u.getRandomValues(r):b.getRandomValues(r));var r;return await R(t,e,n),H(n,t.keys.passwordVerification)})(n,n.password),n.password=null,n.Z=new E(new B(n.keys.key),t.from(I)),n.$=new D(n.keys.tt));const o=new i(r.length+e.length-e.length%16);return o.set(r,0),P(n,e,o,r.length,0)}flush(){const t=this;let e=new i(0);if(t.Y.length){const n=t.Z.update(V.g(t.Y));t.$.update(n),e=V.k(n)}const n=K(V.k(t.$.digest()),0,10);return{data:H(e,n),signature:n}}}function P(t,e,n,r,o,s){const f=e.length-o;let c;for(t.Y.length&&(e=H(t.Y,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new i(e)).set(n,0)}return t})(n,f-f%16)),c=0;f-16>=c;c+=16){const i=V.g(K(e,c,c+16));s&&t.$.update(i);const o=t.Z.update(i);s||t.$.update(o),n.set(V.k(o),c+r)}return t.Y=K(e,c),n}async function R(t,n,r){const o=(t=>{if(void 0===l){const e=new i((t=unescape(encodeURIComponent(t))).length);for(let n=0;nA&&C&&"function"==typeof u.subtle.importKey?u.subtle.importKey("raw",e,n,!1,i):k.importKey(e))(0,o,v,0,S),f=await(async(t,e,n)=>A&&C&&"function"==typeof u.subtle.deriveBits?await u.subtle.deriveBits(t,e,n):k.P(e,t.salt,m.iterations,n))(e.assign({salt:r},m),s,8*(2*_[t.X]+2)),c=new i(f);t.keys={key:V.g(K(c,0,_[t.X])),tt:V.g(K(c,_[t.X],2*_[t.X])),passwordVerification:K(c,2*_[t.X])}}function H(t,e){let n=t;return t.length+e.length&&(n=new i(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function K(t,e,n){return t.subarray(e,n)}class L{constructor(t,n){e.assign(this,{password:t,passwordVerification:n}),F(this,t)}append(t){const e=this;if(e.password){const n=j(e,t.subarray(0,12));if(e.password=null,n[11]!=e.passwordVerification)throw new r("Invalid pasword");t=t.subarray(12)}return j(e,t)}flush(){return{valid:!0,data:new i(0)}}}class T{constructor(t,n){e.assign(this,{password:t,passwordVerification:n}),F(this,t)}append(t){const e=this;let n,r;if(e.password){e.password=null;const o=u.getRandomValues(new i(12));o[11]=e.passwordVerification,n=new i(t.length+o.length),n.set(x(e,o),0),r=12}else n=new i(t.length),r=0;return n.set(x(e,t),r),n}flush(){return{data:new i(0)}}}function j(t,e){const n=new i(e.length);for(let r=0;r>>24]),t.keys[2]=~t.nt.get()}function W(t){const e=2|t.keys[2];return q(n.imul(e,1^e)>>>8)}function q(t){return 255&t}function G(t){return 4294967295&t}class J{constructor(t,{signature:n,password:r,signed:i,compressed:o,zipCrypto:s,passwordVerification:f,encryptionStrength:c},{rt:l}){const u=!!r;e.assign(this,{signature:n,encrypted:u,signed:i,compressed:o,it:o&&new t({rt:l}),ot:i&&new h,zipCrypto:s,decrypt:u&&s?new L(r,f):new U(r,i,c)})}async append(t){const e=this;return e.encrypted&&t.length&&(t=await e.decrypt.append(t)),e.compressed&&t.length&&(t=await e.it.append(t)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.ot.append(t),t}async flush(){const t=this;let e,n=new i(0);if(t.encrypted){const e=t.decrypt.flush();if(!e.valid)throw new r("Invalid signature");n=e.data}if((!t.encrypted||t.zipCrypto)&&t.signed){const n=new c(new i(4).buffer);if(e=t.ot.get(),n.setUint32(0,e),t.signature!=n.getUint32(0,!1))throw new r("Invalid signature")}return t.compressed&&(n=await t.it.append(n)||new i(0),await t.it.flush()),{data:n,signature:e}}}class N{constructor(t,{encrypted:n,signed:r,compressed:i,level:o,zipCrypto:s,password:f,passwordVerification:c,encryptionStrength:l},{rt:u}){e.assign(this,{encrypted:n,signed:r,compressed:i,st:i&&new t({level:o||5,rt:u}),ot:r&&new h,zipCrypto:s,encrypt:n&&s?new T(f,c):new M(f,l)})}async append(t){const e=this;let n=t;return e.compressed&&t.length&&(n=await e.st.append(t)),e.encrypted&&n.length&&(n=await e.encrypt.append(n)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.ot.append(t),n}async flush(){const t=this;let e,n=new i(0);if(t.compressed&&(n=await t.st.flush()||new i(0)),t.encrypted){n=await t.encrypt.append(n);const r=t.encrypt.flush();e=r.signature;const o=new i(n.length+r.data.length);o.set(n,0),o.set(r.data,n.length),n=o}return t.encrypted&&!t.zipCrypto||!t.signed||(e=t.ot.get()),{data:n,signature:e}}}const Q={init(t){t.scripts&&t.scripts.length&&importScripts.apply(void 0,t.scripts);const e=t.options;let n;self.initCodec&&self.initCodec(),e.codecType.startsWith("deflate")?n=self.Deflate:e.codecType.startsWith("inflate")&&(n=self.Inflate),X=((t,e,n)=>e.codecType.startsWith("deflate")?new N(t,e,n):e.codecType.startsWith("inflate")?new J(t,e,n):void 0)(n,e,t.config)},append:async t=>({data:await X.append(t.data)}),flush:()=>X.flush()};let X;function Y(e){return Z(e.map((([e,n])=>new t(e).fill(n,0,e))))}function Z(e){return e.reduce(((e,n)=>e.concat(t.isArray(n)?Z(n):n)),[])}addEventListener("message",(async t=>{const e=t.data,n=e.type,r=Q[n];if(r)try{e.data&&(e.data=new i(e.data));const t=await r(e)||{};if(t.type=n,t.data)try{t.data=t.data.buffer,a(t,[t.data])}catch(e){a(t)}else a(t)}catch(t){a({type:n,error:{message:t.message,stack:t.stack}})}}));const $=[0,1,2,3].concat(...Y([[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 tt(){const t=this;function e(t,e){let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}t.ft=r=>{const i=t.ct,o=t.ut.lt,s=t.ut.wt;let f,c,l,u=-1;for(r.ht=0,r.dt=573,f=0;s>f;f++)0!==i[2*f]?(r.yt[++r.ht]=u=f,r.bt[f]=0):i[2*f+1]=0;for(;2>r.ht;)l=r.yt[++r.ht]=2>u?++u:0,i[2*l]=1,r.bt[l]=0,r.kt--,o&&(r.gt-=o[2*l+1]);for(t.vt=u,f=n.floor(r.ht/2);f>=1;f--)r.St(i,f);l=s;do{f=r.yt[1],r.yt[1]=r.yt[r.ht--],r.St(i,1),c=r.yt[1],r.yt[--r.dt]=f,r.yt[--r.dt]=c,i[2*l]=i[2*f]+i[2*c],r.bt[l]=n.max(r.bt[f],r.bt[c])+1,i[2*f+1]=i[2*c+1]=l,r.yt[1]=l++,r.St(i,1)}while(r.ht>=2);r.yt[--r.dt]=r.yt[1],(e=>{const n=t.ct,r=t.ut.lt,i=t.ut.zt,o=t.ut._t,s=t.ut.It;let f,c,l,u,a,w,h=0;for(u=0;15>=u;u++)e.At[u]=0;for(n[2*e.yt[e.dt]+1]=0,f=e.dt+1;573>f;f++)c=e.yt[f],u=n[2*n[2*c+1]+1]+1,u>s&&(u=s,h++),n[2*c+1]=u,c>t.vt||(e.At[u]++,a=0,o>c||(a=i[c-o]),w=n[2*c],e.kt+=w*(u+a),r&&(e.gt+=w*(r[2*c+1]+a)));if(0!==h){do{for(u=s-1;0===e.At[u];)u--;e.At[u]--,e.At[u+1]+=2,e.At[s]--,h-=2}while(h>0);for(u=s;0!==u;u--)for(c=e.At[u];0!==c;)l=e.yt[--f],l>t.vt||(n[2*l+1]!=u&&(e.kt+=(u-n[2*l+1])*n[2*l],n[2*l+1]=u),c--)}})(r),((t,n,r)=>{const i=[];let o,s,f,c=0;for(o=1;15>=o;o++)i[o]=c=c+r[o-1]<<1;for(s=0;n>=s;s++)f=t[2*s+1],0!==f&&(t[2*s]=e(i[f]++,f))})(i,t.vt,r.At)}}function et(t,e,n,r,i){const o=this;o.lt=t,o.zt=e,o._t=n,o.wt=r,o.It=i}tt.Ct=[0,1,2,3,4,5,6,7].concat(...Y([[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]])),tt.Vt=[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],tt.Bt=[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],tt.Et=t=>256>t?$[t]:$[256+(t>>>7)],tt.Dt=[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],tt.Ut=[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],tt.Mt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],tt.Pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const nt=Y([[144,8],[112,9],[24,7],[8,8]]);et.Rt=Z([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].map(((t,e)=>[t,nt[e]])));const rt=Y([[30,5]]);function it(t,e,n,r,i){const o=this;o.Ht=t,o.Kt=e,o.Lt=n,o.Tt=r,o.jt=i}et.xt=Z([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].map(((t,e)=>[t,rt[e]]))),et.Ft=new et(et.Rt,tt.Dt,257,286,15),et.Ot=new et(et.xt,tt.Ut,0,30,15),et.Wt=new et(null,tt.Mt,0,19,7);const ot=[new it(0,0,0,0,0),new it(4,4,8,4,1),new it(4,5,16,8,1),new it(4,6,32,32,1),new it(4,4,16,16,2),new it(8,16,32,32,2),new it(8,16,128,128,2),new it(8,32,128,256,2),new it(32,128,258,1024,2),new it(32,258,258,4096,2)],st=["need dictionary","stream end","","","stream error","data error","","buffer error","",""];function ft(t,e,n,r){const i=t[2*e],o=t[2*n];return o>i||i==o&&r[e]<=r[n]}function ct(){const t=this;let e,r,s,f,c,l,u,a,w,h,d,p,y,b,k,g,v,m,S,z,_,I,A,C,V,B,E,D,U,M,P,R,H;const K=new tt,L=new tt,T=new tt;let j,x,F,O,W,q;function G(){let e;for(e=0;286>e;e++)P[2*e]=0;for(e=0;30>e;e++)R[2*e]=0;for(e=0;19>e;e++)H[2*e]=0;P[512]=1,t.kt=t.gt=0,x=F=0}function J(t,e){let n,r=-1,i=t[1],o=0,s=7,f=4;0===i&&(s=138,f=3),t[2*(e+1)+1]=65535;for(let c=0;e>=c;c++)n=i,i=t[2*(c+1)+1],++oo?H[2*n]+=o:0!==n?(n!=r&&H[2*n]++,H[32]++):o>10?H[36]++:H[34]++,o=0,r=n,0===i?(s=138,f=3):n==i?(s=6,f=3):(s=7,f=4))}function N(e){t.qt[t.pending++]=e}function Q(t){N(255&t),N(t>>>8&255)}function X(t,e){let n;const r=e;q>16-r?(n=t,W|=n<>>16-q,q+=r-16):(W|=t<=n;n++)if(r=o,o=t[2*(n+1)+1],++s>=f||r!=o){if(c>s)do{Y(r,H)}while(0!=--s);else 0!==r?(r!=i&&(Y(r,H),s--),Y(16,H),X(s-3,2)):s>10?(Y(18,H),X(s-11,7)):(Y(17,H),X(s-3,3));s=0,i=r,0===o?(f=138,c=3):r==o?(f=6,c=3):(f=7,c=4)}}function $(){16==q?(Q(W),W=0,q=0):8>q||(N(255&W),W>>>=8,q-=8)}function nt(e,r){let i,o,s;if(t.Gt[x]=e,t.Jt[x]=255&r,x++,0===e?P[2*r]++:(F++,e--,P[2*(tt.Ct[r]+256+1)]++,R[2*tt.Et(e)]++),0==(8191&x)&&E>2){for(i=8*x,o=_-v,s=0;30>s;s++)i+=R[2*s]*(5+tt.Ut[s]);if(i>>>=3,Ff);Y(256,e),O=e[513]}function it(){q>8?Q(W):q>0&&N(255&W),W=0,q=0}function ct(e,n,r){X(0+(r?1:0),3),((e,n)=>{it(),O=8,Q(n),Q(~n),t.qt.set(a.subarray(e,e+n),t.pending),t.pending+=n})(e,n)}function lt(n){((e,n,r)=>{let i,o,s=0;E>0?(K.ft(t),L.ft(t),s=(()=>{let e;for(J(P,K.vt),J(R,L.vt),T.ft(t),e=18;e>=3&&0===H[2*tt.Pt[e]+1];e--);return t.kt+=14+3*(e+1),e})(),i=t.kt+3+7>>>3,o=t.gt+3+7>>>3,o>i||(i=o)):i=o=n+5,n+4>i||-1==e?o==i?(X(2+(r?1:0),3),rt(et.Rt,et.xt)):(X(4+(r?1:0),3),((t,e,n)=>{let r;for(X(t-257,5),X(e-1,5),X(n-4,4),r=0;n>r;r++)X(H[2*tt.Pt[r]+1],3);Z(P,t-1),Z(R,e-1)})(K.vt+1,L.vt+1,s+1),rt(P,R)):ct(e,n,r),G(),r&&it()})(0>v?-1:v,_-v,n),v=_,e.Nt()}function ut(){let t,n,r,i;do{if(i=w-A-_,0===i&&0===_&&0===A)i=c;else if(-1==i)i--;else if(_>=c+c-262){a.set(a.subarray(c,c+c),0),I-=c,_-=c,v-=c,t=y,r=t;do{n=65535&d[--r],d[r]=c>n?0:n-c}while(0!=--t);t=c,r=t;do{n=65535&h[--r],h[r]=c>n?0:n-c}while(0!=--t);i+=c}if(0===e.Qt)return;t=e.Xt(a,_+A,i),A+=t,3>A||(p=255&a[_],p=(p<A&&0!==e.Qt)}function at(t){let e,n,r=V,i=_,o=C;const s=_>c-262?_-(c-262):0;let f=M;const l=u,w=_+258;let d=a[i+o-1],p=a[i+o];U>C||(r>>=2),f>A&&(f=A);do{if(e=t,a[e+o]==p&&a[e+o-1]==d&&a[e]==a[i]&&a[++e]==a[i+1]){i+=2,e++;do{}while(a[++i]==a[++e]&&a[++i]==a[++e]&&a[++i]==a[++e]&&a[++i]==a[++e]&&a[++i]==a[++e]&&a[++i]==a[++e]&&a[++i]==a[++e]&&a[++i]==a[++e]&&w>i);if(n=258-(w-i),i=w-258,n>o){if(I=t,o=n,n>=f)break;d=a[i+o-1],p=a[i+o]}}}while((t=65535&h[t&l])>s&&0!=--r);return o>A?A:o}t.bt=[],t.At=[],t.yt=[],P=[],R=[],H=[],t.St=(e,n)=>{const r=t.yt,i=r[n];let o=n<<1;for(;o<=t.ht&&(o(x||(x=8),F||(F=8),J||(J=0),e.Zt=null,-1==S&&(S=6),1>F||F>9||8!=x||9>I||I>15||0>S||S>9||0>J||J>2?-2:(e.$t=t,l=I,c=1<(e.te=e.ee=0,e.Zt=null,t.pending=0,t.ne=0,r=113,f=0,K.ct=P,K.ut=et.Ft,L.ct=R,L.ut=et.Ot,T.ct=H,T.ut=et.Wt,W=0,q=0,O=8,G(),(()=>{w=2*c,d[y-1]=0;for(let t=0;y-1>t;t++)d[t]=0;B=ot[E].Kt,U=ot[E].Ht,M=ot[E].Lt,V=ot[E].Tt,_=0,v=0,A=0,m=C=2,z=0,p=0})(),0))(e))),t.re=()=>42!=r&&113!=r&&666!=r?-2:(t.Jt=null,t.Gt=null,t.qt=null,d=null,h=null,a=null,t.$t=null,113==r?-3:0),t.ie=(t,e,n)=>{let r=0;return-1==e&&(e=6),0>e||e>9||0>n||n>2?-2:(ot[E].jt!=ot[e].jt&&0!==t.te&&(r=t.st(1)),E!=e&&(E=e,B=ot[E].Kt,U=ot[E].Ht,M=ot[E].Lt,V=ot[E].Tt),D=n,r)},t.oe=(t,e,n)=>{let i,o=n,s=0;if(!e||42!=r)return-2;if(3>o)return 0;for(o>c-262&&(o=c-262,s=n-o),a.set(e.subarray(s,s+o),0),_=o,v=o,p=255&a[0],p=(p<=i;i++)p=(p<{let o,w,b,V,U;if(i>4||0>i)return-2;if(!n.se||!n.fe&&0!==n.Qt||666==r&&4!=i)return n.Zt=st[4],-2;if(0===n.ce)return n.Zt=st[7],-5;var M;if(e=n,V=f,f=i,42==r&&(w=8+(l-8<<4)<<8,b=(E-1&255)>>1,b>3&&(b=3),w|=b<<6,0!==_&&(w|=32),w+=31-w%31,r=113,N((M=w)>>8&255),N(255&M)),0!==t.pending){if(e.Nt(),0===e.ce)return f=-1,0}else if(0===e.Qt&&V>=i&&4!=i)return e.Zt=st[7],-5;if(666==r&&0!==e.Qt)return n.Zt=st[7],-5;if(0!==e.Qt||0!==A||0!=i&&666!=r){switch(U=-1,ot[E].jt){case 0:U=(t=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ut(),0===A&&0==t)return 0;if(0===A)break}if(_+=A,A=0,n=v+r,(0===_||_>=n)&&(A=_-n,_=n,lt(!1),0===e.ce))return 0;if(_-v>=c-262&&(lt(!1),0===e.ce))return 0}return lt(4==t),0===e.ce?4==t?2:0:4==t?3:1})(i);break;case 1:U=(t=>{let n,r=0;for(;;){if(262>A){if(ut(),262>A&&0==t)return 0;if(0===A)break}if(3>A||(p=(p<c-262||2!=D&&(m=at(r)),3>m)n=nt(0,255&a[_]),A--,_++;else if(n=nt(_-I,m-3),A-=m,m>B||3>A)_+=m,m=0,p=255&a[_],p=(p<{let n,r,i=0;for(;;){if(262>A){if(ut(),262>A&&0==t)return 0;if(0===A)break}if(3>A||(p=(p<C&&c-262>=(_-i&65535)&&(2!=D&&(m=at(i)),5>=m&&(1==D||3==m&&_-I>4096)&&(m=2)),3>C||m>C)if(0!==z){if(n=nt(0,255&a[_-1]),n&<(!1),_++,A--,0===e.ce)return 0}else z=1,_++,A--;else{r=_+A-3,n=nt(_-1-S,C-3),A-=C-1,C-=2;do{++_>r||(p=(p<1+O+10-q&&(X(2,3),Y(256,et.Rt),$()),O=7;else if(ct(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(e.Nt(),0===e.ce)return f=-1,0}}return 4!=i?0:1}}function lt(){const t=this;t.le=0,t.ue=0,t.Qt=0,t.te=0,t.ce=0,t.ee=0}function ut(t){const e=new lt,o=(s=t&&t.rt?t.rt:65536)+5*(n.floor(s/16383)+1);var s;const f=new i(o);let c=t?t.level:-1;void 0===c&&(c=-1),e.Yt(c),e.se=f,this.append=(t,n)=>{let s,c,l=0,u=0,a=0;const w=[];if(t.length){e.le=0,e.fe=t,e.Qt=t.length;do{if(e.ue=0,e.ce=o,s=e.st(0),0!=s)throw new r("deflating: "+e.Zt);e.ue&&(e.ue==o?w.push(new i(f)):w.push(f.slice(0,e.ue))),a+=e.ue,n&&e.le>0&&e.le!=l&&(n(e.le),l=e.le)}while(e.Qt>0||0===e.ce);return w.length>1?(c=new i(a),w.forEach((t=>{c.set(t,u),u+=t.length}))):c=w[0]||new i(0),c}},this.flush=()=>{let t,n,s=0,c=0;const l=[];do{if(e.ue=0,e.ce=o,t=e.st(4),1!=t&&0!=t)throw new r("deflating: "+e.Zt);o-e.ce>0&&l.push(f.slice(0,e.ue)),c+=e.ue}while(e.Qt>0||0===e.ce);return e.re(),n=new i(c),l.forEach((t=>{n.set(t,s),s+=t.length})),n}}lt.prototype={Yt:function(t,e){const n=this;return n.$t=new ct,e||(e=15),n.$t.Yt(n,t,e)},st:function(t){const e=this;return e.$t?e.$t.st(e,t):-2},re:function(){const t=this;if(!t.$t)return-2;const e=t.$t.re();return t.$t=null,e},ie:function(t,e){const n=this;return n.$t?n.$t.ie(n,t,e):-2},oe:function(t,e){const n=this;return n.$t?n.$t.oe(n,t,e):-2},Xt:function(t,e,n){const r=this;let i=r.Qt;return i>n&&(i=n),0===i?0:(r.Qt-=i,t.set(r.fe.subarray(r.le,r.le+i),e),r.le+=i,r.te+=i,i)},Nt:function(){const t=this;let e=t.$t.pending;e>t.ce&&(e=t.ce),0!==e&&(t.se.set(t.$t.qt.subarray(t.$t.ne,t.$t.ne+e),t.ue),t.ue+=e,t.$t.ne+=e,t.ee+=e,t.ce-=e,t.$t.pending-=e,0===t.$t.pending&&(t.$t.ne=0))}};const at=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],wt=[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],ht=[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],dt=[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],pt=[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],yt=[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],bt=[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];function kt(){let t,e,n,r,i,o;function s(t,e,s,f,c,l,u,a,w,h,d){let p,y,b,k,g,v,m,S,z,_,I,A,C,V,B;_=0,g=s;do{n[t[e+_]]++,_++,g--}while(0!==g);if(n[0]==s)return u[0]=-1,a[0]=0,0;for(S=a[0],v=1;15>=v&&0===n[v];v++);for(m=v,v>S&&(S=v),g=15;0!==g&&0===n[g];g--);for(b=g,S>g&&(S=g),a[0]=S,V=1<v;v++,V<<=1)if(0>(V-=n[v]))return-3;if(0>(V-=n[g]))return-3;for(n[g]+=V,o[1]=v=0,_=1,C=2;0!=--g;)o[C]=v+=n[_],C++,_++;g=0,_=0;do{0!==(v=t[e+_])&&(d[o[v]++]=g),_++}while(++g=m;m++)for(p=n[m];0!=p--;){for(;m>A+S;){if(k++,A+=S,B=b-A,B=B>S?S:B,(y=1<<(v=m-A))>p+1&&(y-=p+1,C=m,B>v))for(;++vn[++C];)y-=n[C];if(B=1<1440)return-3;i[k]=I=h[0],h[0]+=B,0!==k?(o[k]=g,r[0]=v,r[1]=S,v=g>>>A-S,r[2]=I-i[k-1]-v,w.set(r,3*(i[k-1]+v))):u[0]=I}for(r[1]=m-A,s>_?d[_]d[_]?0:96,r[2]=d[_++]):(r[0]=l[d[_]-f]+16+64,r[2]=c[d[_++]-f]):r[0]=192,y=1<>>A;B>v;v+=y)w.set(r,3*(I+v));for(v=1<>>=1)g^=v;for(g^=v,z=(1<c;c++)e[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;i.set(n.subarray(0,15),0),o.set(n.subarray(0,16),0)}this.ae=(n,r,i,o,f)=>{let l;return c(19),t[0]=0,l=s(n,0,19,19,null,null,i,r,o,t,e),-3==l?f.Zt="oversubscribed dynamic bit lengths tree":-5!=l&&0!==r[0]||(f.Zt="incomplete dynamic bit lengths tree",l=-3),l},this.we=(n,r,i,o,f,l,u,a,w)=>{let h;return c(288),t[0]=0,h=s(i,0,n,257,dt,pt,l,o,a,t,e),0!=h||0===o[0]?(-3==h?w.Zt="oversubscribed literal/length tree":-4!=h&&(w.Zt="incomplete literal/length tree",h=-3),h):(c(288),h=s(i,n,r,0,yt,bt,u,f,a,t,e),0!=h||0===f[0]&&n>257?(-3==h?w.Zt="oversubscribed distance tree":-5==h?(w.Zt="incomplete distance tree",h=-3):-4!=h&&(w.Zt="empty distance tree with lengths",h=-3),h):0)}}function gt(){const t=this;let e,n,r,i,o=0,s=0,f=0,c=0,l=0,u=0,a=0,w=0,h=0,d=0;function p(t,e,n,r,i,o,s,f){let c,l,u,a,w,h,d,p,y,b,k,g,v,m,S,z;d=f.le,p=f.Qt,w=s.he,h=s.de,y=s.write,b=yh;)p--,w|=(255&f.pe(d++))<>=l[z+1],h-=l[z+1],0!=(16&a)){for(a&=15,v=l[z+2]+(w&at[a]),w>>=a,h-=a;15>h;)p--,w|=(255&f.pe(d++))<>=l[z+1],h-=l[z+1],0!=(16&a)){for(a&=15;a>h;)p--,w|=(255&f.pe(d++))<>=a,h-=a,b-=v,m>y){S=y-m;do{S+=s.end}while(0>S);if(a=s.end-S,v>a){if(v-=a,y-S>0&&a>y-S)do{s.ye[y++]=s.ye[S++]}while(0!=--a);else s.ye.set(s.ye.subarray(S,S+a),y),y+=a,S+=a,a=0;S=0}}else S=y-m,y-S>0&&2>y-S?(s.ye[y++]=s.ye[S++],s.ye[y++]=s.ye[S++],v-=2):(s.ye.set(s.ye.subarray(S,S+2),y),y+=2,S+=2,v-=2);if(y-S>0&&v>y-S)do{s.ye[y++]=s.ye[S++]}while(0!=--v);else s.ye.set(s.ye.subarray(S,S+v),y),y+=v,S+=v,v=0;break}if(0!=(64&a))return f.Zt="invalid distance code",v=f.Qt-p,v=v>h>>3?h>>3:v,p+=v,d-=v,h-=v<<3,s.he=w,s.de=h,f.Qt=p,f.te+=d-f.le,f.le=d,s.write=y,-3;c+=l[z+2],c+=w&at[a],z=3*(u+c),a=l[z]}break}if(0!=(64&a))return 0!=(32&a)?(v=f.Qt-p,v=v>h>>3?h>>3:v,p+=v,d-=v,h-=v<<3,s.he=w,s.de=h,f.Qt=p,f.te+=d-f.le,f.le=d,s.write=y,1):(f.Zt="invalid literal/length code",v=f.Qt-p,v=v>h>>3?h>>3:v,p+=v,d-=v,h-=v<<3,s.he=w,s.de=h,f.Qt=p,f.te+=d-f.le,f.le=d,s.write=y,-3);if(c+=l[z+2],c+=w&at[a],z=3*(u+c),0===(a=l[z])){w>>=l[z+1],h-=l[z+1],s.ye[y++]=l[z+2],b--;break}}else w>>=l[z+1],h-=l[z+1],s.ye[y++]=l[z+2],b--}while(b>=258&&p>=10);return v=f.Qt-p,v=v>h>>3?h>>3:v,p+=v,d-=v,h-=v<<3,s.he=w,s.de=h,f.Qt=p,f.te+=d-f.le,f.le=d,s.write=y,0}t.init=(t,o,s,f,c,l)=>{e=0,a=t,w=o,r=s,h=f,i=c,d=l,n=null},t.be=(t,y,b)=>{let k,g,v,m,S,z,_,I=0,A=0,C=0;for(C=y.le,m=y.Qt,I=t.he,A=t.de,S=t.write,z=S=258&&m>=10&&(t.he=I,t.de=A,y.Qt=m,y.te+=C-y.le,y.le=C,t.write=S,b=p(a,w,r,h,i,d,t,y),C=y.le,m=y.Qt,I=t.he,A=t.de,S=t.write,z=SA;){if(0===m)return t.he=I,t.de=A,y.Qt=m,y.te+=C-y.le,y.le=C,t.write=S,t.ke(y,b);b=0,m--,I|=(255&y.pe(C++))<>>=n[g+1],A-=n[g+1],v=n[g],0===v){c=n[g+2],e=6;break}if(0!=(16&v)){l=15&v,o=n[g+2],e=2;break}if(0==(64&v)){f=v,s=g/3+n[g+2];break}if(0!=(32&v)){e=7;break}return e=9,y.Zt="invalid literal/length code",b=-3,t.he=I,t.de=A,y.Qt=m,y.te+=C-y.le,y.le=C,t.write=S,t.ke(y,b);case 2:for(k=l;k>A;){if(0===m)return t.he=I,t.de=A,y.Qt=m,y.te+=C-y.le,y.le=C,t.write=S,t.ke(y,b);b=0,m--,I|=(255&y.pe(C++))<>=k,A-=k,f=w,n=i,s=d,e=3;case 3:for(k=f;k>A;){if(0===m)return t.he=I,t.de=A,y.Qt=m,y.te+=C-y.le,y.le=C,t.write=S,t.ke(y,b);b=0,m--,I|=(255&y.pe(C++))<>=n[g+1],A-=n[g+1],v=n[g],0!=(16&v)){l=15&v,u=n[g+2],e=4;break}if(0==(64&v)){f=v,s=g/3+n[g+2];break}return e=9,y.Zt="invalid distance code",b=-3,t.he=I,t.de=A,y.Qt=m,y.te+=C-y.le,y.le=C,t.write=S,t.ke(y,b);case 4:for(k=l;k>A;){if(0===m)return t.he=I,t.de=A,y.Qt=m,y.te+=C-y.le,y.le=C,t.write=S,t.ke(y,b);b=0,m--,I|=(255&y.pe(C++))<>=k,A-=k,e=5;case 5:for(_=S-u;0>_;)_+=t.end;for(;0!==o;){if(0===z&&(S==t.end&&0!==t.read&&(S=0,z=S7&&(A-=8,m++,C--),t.write=S,b=t.ke(y,b),S=t.write,z=S{}}kt.ve=(t,e,n,r)=>(t[0]=9,e[0]=5,n[0]=wt,r[0]=ht,0);const vt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function mt(t,e){const n=this;let r,o=0,s=0,c=0,l=0;const u=[0],a=[0],w=new gt;let h=0,d=new f(4320);const p=new kt;n.de=0,n.he=0,n.ye=new i(e),n.end=e,n.read=0,n.write=0,n.reset=(t,e)=>{e&&(e[0]=0),6==o&&w.ge(t),o=0,n.de=0,n.he=0,n.read=n.write=0},n.reset(t,null),n.ke=(t,e)=>{let r,i,o;return i=t.ue,o=n.read,r=(o>n.write?n.end:n.write)-o,r>t.ce&&(r=t.ce),0!==r&&-5==e&&(e=0),t.ce-=r,t.ee+=r,t.se.set(n.ye.subarray(o,o+r),i),i+=r,o+=r,o==n.end&&(o=0,n.write==n.end&&(n.write=0),r=n.write-o,r>t.ce&&(r=t.ce),0!==r&&-5==e&&(e=0),t.ce-=r,t.ee+=r,t.se.set(n.ye.subarray(o,o+r),i),i+=r,o+=r),t.ue=i,n.read=o,e},n.be=(t,e)=>{let i,f,y,b,k,g,v,m;for(b=t.le,k=t.Qt,f=n.he,y=n.de,g=n.write,v=gy;){if(0===k)return n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);e=0,k--,f|=(255&t.pe(b++))<>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,o=1;break;case 1:S=[],z=[],_=[[]],I=[[]],kt.ve(S,z,_,I),w.init(S[0],z[0],_[0],0,I[0],0),f>>>=3,y-=3,o=6;break;case 2:f>>>=3,y-=3,o=3;break;case 3:return f>>>=3,y-=3,o=9,t.Zt="invalid block type",e=-3,n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e)}break;case 1:for(;32>y;){if(0===k)return n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);e=0,k--,f|=(255&t.pe(b++))<>>16&65535)!=(65535&f))return o=9,t.Zt="invalid stored block lengths",e=-3,n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);s=65535&f,f=y=0,o=0!==s?2:0!==h?7:0;break;case 2:if(0===k)return n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);if(0===v&&(g==n.end&&0!==n.read&&(g=0,v=gk&&(i=k),i>v&&(i=v),n.ye.set(t.Xt(b,i),g),b+=i,k-=i,g+=i,v-=i,0!=(s-=i))break;o=0!==h?7:0;break;case 3:for(;14>y;){if(0===k)return n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);e=0,k--,f|=(255&t.pe(b++))<29||(i>>5&31)>29)return o=9,t.Zt="too many length or distance symbols",e=-3,n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);if(i=258+(31&i)+(i>>5&31),!r||r.lengthm;m++)r[m]=0;f>>>=14,y-=14,l=0,o=4;case 4:for(;4+(c>>>10)>l;){for(;3>y;){if(0===k)return n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);e=0,k--,f|=(255&t.pe(b++))<>>=3,y-=3}for(;19>l;)r[vt[l++]]=0;if(u[0]=7,i=p.ae(r,u,a,d,t),0!=i)return-3==(e=i)&&(r=null,o=9),n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);l=0,o=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>l;){let s,w;for(i=u[0];i>y;){if(0===k)return n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);e=0,k--,f|=(255&t.pe(b++))<w)f>>>=i,y-=i,r[l++]=w;else{for(m=18==w?7:w-14,s=18==w?11:3;i+m>y;){if(0===k)return n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);e=0,k--,f|=(255&t.pe(b++))<>>=i,y-=i,s+=f&at[m],f>>>=m,y-=m,m=l,i=c,m+s>258+(31&i)+(i>>5&31)||16==w&&1>m)return r=null,o=9,t.Zt="invalid bit length repeat",e=-3,n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);w=16==w?r[m-1]:0;do{r[m++]=w}while(0!=--s);l=m}}if(a[0]=-1,A=[],C=[],V=[],B=[],A[0]=9,C[0]=6,i=c,i=p.we(257+(31&i),1+(i>>5&31),r,A,C,V,B,d,t),0!=i)return-3==i&&(r=null,o=9),e=i,n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,n.ke(t,e);w.init(A[0],C[0],d,V[0],d,B[0]),o=6;case 6:if(n.he=f,n.de=y,t.Qt=k,t.te+=b-t.le,t.le=b,n.write=g,1!=(e=w.be(n,t,e)))return n.ke(t,e);if(e=0,w.ge(t),b=t.le,k=t.Qt,f=n.he,y=n.de,g=n.write,v=g{n.reset(t,null),n.ye=null,d=null},n.me=(t,e,r)=>{n.ye.set(t.subarray(e,e+r),0),n.read=n.write=r},n.Se=()=>1==o?1:0}const St=[0,0,255,255];function zt(){const t=this;function e(t){return t&&t.ze?(t.te=t.ee=0,t.Zt=null,t.ze.mode=7,t.ze._e.reset(t,null),0):-2}t.mode=0,t.method=0,t.Ie=[0],t.Ae=0,t.marker=0,t.Ce=0,t.Ve=e=>(t._e&&t._e.ge(e),t._e=null,0),t.Be=(n,r)=>(n.Zt=null,t._e=null,8>r||r>15?(t.Ve(n),-2):(t.Ce=r,n.ze._e=new mt(n,1<{let n,r;if(!t||!t.ze||!t.fe)return-2;const i=t.ze;for(e=4==e?-5:0,n=-5;;)switch(i.mode){case 0:if(0===t.Qt)return n;if(n=e,t.Qt--,t.te++,8!=(15&(i.method=t.pe(t.le++)))){i.mode=13,t.Zt="unknown compression method",i.marker=5;break}if(8+(i.method>>4)>i.Ce){i.mode=13,t.Zt="invalid win size",i.marker=5;break}i.mode=1;case 1:if(0===t.Qt)return n;if(n=e,t.Qt--,t.te++,r=255&t.pe(t.le++),((i.method<<8)+r)%31!=0){i.mode=13,t.Zt="incorrect header check",i.marker=5;break}if(0==(32&r)){i.mode=7;break}i.mode=2;case 2:if(0===t.Qt)return n;n=e,t.Qt--,t.te++,i.Ae=(255&t.pe(t.le++))<<24&4278190080,i.mode=3;case 3:if(0===t.Qt)return n;n=e,t.Qt--,t.te++,i.Ae+=(255&t.pe(t.le++))<<16&16711680,i.mode=4;case 4:if(0===t.Qt)return n;n=e,t.Qt--,t.te++,i.Ae+=(255&t.pe(t.le++))<<8&65280,i.mode=5;case 5:return 0===t.Qt?n:(n=e,t.Qt--,t.te++,i.Ae+=255&t.pe(t.le++),i.mode=6,2);case 6:return i.mode=13,t.Zt="need dictionary",i.marker=0,-2;case 7:if(n=i._e.be(t,n),-3==n){i.mode=13,i.marker=0;break}if(0==n&&(n=e),1!=n)return n;n=e,i._e.reset(t,i.Ie),i.mode=12;case 12:return t.Qt=0,1;case 13:return-3;default:return-2}},t.Ee=(t,e,n)=>{let r=0,i=n;if(!t||!t.ze||6!=t.ze.mode)return-2;const o=t.ze;return i<1<{let n,r,i,o,s;if(!t||!t.ze)return-2;const f=t.ze;if(13!=f.mode&&(f.mode=13,f.marker=0),0===(n=t.Qt))return-5;for(r=t.le,i=f.marker;0!==n&&4>i;)t.pe(r)==St[i]?i++:i=0!==t.pe(r)?0:4-i,r++,n--;return t.te+=r-t.le,t.le=r,t.Qt=n,f.marker=i,4!=i?-3:(o=t.te,s=t.ee,e(t),t.te=o,t.ee=s,f.mode=7,0)},t.Ue=t=>t&&t.ze&&t.ze._e?t.ze._e.Se():-2}function _t(){}function It(t){const e=new _t,o=t&&t.rt?n.floor(2*t.rt):131072,s=new i(o);let f=!1;e.Be(),e.se=s,this.append=(t,n)=>{const c=[];let l,u,a=0,w=0,h=0;if(0!==t.length){e.le=0,e.fe=t,e.Qt=t.length;do{if(e.ue=0,e.ce=o,0!==e.Qt||f||(e.le=0,f=!0),l=e.it(0),f&&-5===l){if(0!==e.Qt)throw new r("inflating: bad input")}else if(0!==l&&1!==l)throw new r("inflating: "+e.Zt);if((f||1===l)&&e.Qt===t.length)throw new r("inflating: bad input");e.ue&&(e.ue===o?c.push(new i(s)):c.push(s.slice(0,e.ue))),h+=e.ue,n&&e.le>0&&e.le!=a&&(n(e.le),a=e.le)}while(e.Qt>0||0===e.ce);return c.length>1?(u=new i(h),c.forEach((t=>{u.set(t,w),w+=t.length}))):u=c[0]||new i(0),u}},this.flush=()=>{e.Ve()}}_t.prototype={Be:function(t){const e=this;return e.ze=new zt,t||(t=15),e.ze.Be(e,t)},it:function(t){const e=this;return e.ze?e.ze.it(e,t):-2},Ve:function(){const t=this;if(!t.ze)return-2;const e=t.ze.Ve(t);return t.ze=null,e},De:function(){const t=this;return t.ze?t.ze.De(t):-2},Ee:function(t,e){const n=this;return n.ze?n.ze.Ee(n,t,e):-2},pe:function(t){return this.fe[t]},Xt:function(t,e){return this.fe.subarray(t,t+e)}},self.initCodec=()=>{self.Deflate=ut,self.Inflate=It};\n'],{type:"text/javascript"}));t({workerScripts:{inflate:[e],deflate:[e]}})}})(z),t.BlobReader=Qt,t.BlobWriter=Vt,t.Data64URIReader=class extends Bt{constructor(t){super(),this.dataURI=t;let e=t.length;for(;"="==t.charAt(e-1);)e--;this.dataStart=t.indexOf(",")+1,this.size=s.floor(.75*(e-this.dataStart))}readUint8Array(t,e){const n=new f(e),r=4*s.floor(t/3),i=atob(this.dataURI.substring(r+this.dataStart,4*s.ceil((t+e)/3)+this.dataStart)),o=t-3*s.floor(r/4);for(let t=o;o+e>t;t++)n[t-o]=i.charCodeAt(t);return n}},t.Data64URIWriter=class extends Wt{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}writeUint8Array(t){super.writeUint8Array(t);let e=0,n=this.pending;const i=this.pending.length;for(this.pending="",e=0;e<3*s.floor((i+t.length)/3)-i;e++)n+=r.fromCharCode(t[e]);for(;e2?this.data+=v(n):this.pending=n}getData(){return this.data+v(this.pending)}},t.ERR_ABORT=Rt,t.ERR_BAD_FORMAT=we,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=be,t.ERR_DUPLICATED_NAME=He,t.ERR_ENCRYPTED=Se,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=me,t.ERR_EOCDR_NOT_FOUND=ge,t.ERR_EOCDR_ZIP64_NOT_FOUND=ye,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=ve,t.ERR_HTTP_RANGE=xt,t.ERR_INVALID_COMMENT=Ne,t.ERR_INVALID_ENCRYPTION_STRENGTH=Pe,t.ERR_INVALID_ENTRY_COMMENT=Ze,t.ERR_INVALID_ENTRY_NAME=Oe,t.ERR_INVALID_EXTRAFIELD_DATA=Xe,t.ERR_INVALID_EXTRAFIELD_TYPE=qe,t.ERR_INVALID_PASSWORD=B,t.ERR_INVALID_SIGNATURE=pt,t.ERR_INVALID_VERSION=Ke,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=ke,t.ERR_UNSUPPORTED_COMPRESSION=Ae,t.ERR_UNSUPPORTED_ENCRYPTION=_e,t.ERR_UNSUPPORTED_FORMAT=Ye,t.HttpRangeReader=class extends Jt{constructor(t,e={}){e.useRangeHeader=!0,super(t,e)}},t.HttpReader=Jt,t.Reader=Bt,t.TextReader=class extends Bt{constructor(t){super(),this.blobReader=new Qt(new p([t],{type:Tt}))}init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}readUint8Array(t,e){return this.blobReader.readUint8Array(t,e)}},t.TextWriter=class extends Wt{constructor(t){super(),this.encoding=t,this.blob=new p([],{type:Tt})}writeUint8Array(t){super.writeUint8Array(t),this.blob=new p([this.blob,t.buffer],{type:Tt})}getData(){if(this.blob.text)return this.blob.text();{const t=new m;return new w(((e,n)=>{t.onload=t=>e(t.target.result),t.onerror=()=>n(t.error),t.readAsText(this.blob,this.encoding)}))}}},t.Uint8ArrayReader=class extends Bt{constructor(t){super(),this.array=t,this.size=t.length}readUint8Array(t,e){return this.array.slice(t,t+e)}},t.Uint8ArrayWriter=class extends Wt{constructor(){super(),this.array=new f(0)}writeUint8Array(t){super.writeUint8Array(t);const e=this.array;this.array=new f(e.length+t.length),this.array.set(e),this.array.set(t,e.length)}getData(){return this.array}},t.WritableStreamWriter=class extends Wt{constructor(t){super(),this.writableStream=t,this.writer=t.getWriter()}async writeUint8Array(t){return await this.writer.ready,this.writer.write(t)}async getData(){return await this.writer.ready,await this.writer.close(),this.writableStream}},t.Writer=Wt,t.ZipReader=class{constructor(t,e={}){n.assign(this,{reader:t,options:e,config:A()})}async*getEntriesGenerator(t={}){const e=this,r=e.reader;if(r.initialized||await r.init(),22>r.size)throw new l(we);const i=await(async(t,e,n)=>{const r=new f(4);return Le(r).setUint32(0,101010256,!0),await i(22)||await i(s.min(1048582,n));async function i(e){const i=n-e,s=await Me(t,i,e);for(let t=s.length-22;t>=0;t--)if(s[t]==r[0]&&s[t+1]==r[1]&&s[t+2]==r[2]&&s[t+3]==r[3])return{offset:i+t,buffer:s.slice(t,t+22).buffer}}})(r,0,r.size);if(!i)throw new l(ge);const o=Le(i);let a=Qe(o,12),c=Qe(o,16),d=We(o,8),u=0;if(c==te||a==te||d==ee){const t=Le(await Me(r,i.offset-20,20));if(Qe(t,0)!=se)throw new l(ye);c=Ve(t,8);let e=await Me(r,c,56),n=Le(e);const s=i.offset-20-56;if(Qe(n,0)!=ie&&c!=s){const t=c;c=s,u=c-t,e=await Me(r,c,56),n=Le(e)}if(Qe(n,0)!=ie)throw new l(me);d=Ve(n,32),a=Ve(n,40),c-=a}if(0>c||c>=r.size)throw new l(we);let h=0,p=await Me(r,c,a),g=Le(p);if(a){const t=i.offset-a;if(Qe(g,h)!=re&&c!=t){const e=c;c=t,u=c-e,p=await Me(r,c,a),g=Le(p)}}if(0>c||c>=r.size)throw new l(we);for(let i=0;d>i;i++){const s=new Ee(r,e.config,e.options);if(Qe(g,h)!=re)throw new l(be);De(s,g,h+6);const o=!!s.bitFlag.languageEncodingFlag,a=h+46,c=a+s.filenameLength,f=c+s.extraFieldLength,y=We(g,h+4),m=0==(0&y);n.assign(s,{versionMadeBy:y,msDosCompatible:m,compressedSize:0,uncompressedSize:0,commentLength:We(g,h+32),directory:m&&16==(16&Be(g,h+38)),offset:Qe(g,h+42)+u,internalFileAttribute:Qe(g,h+34),externalFileAttribute:Qe(g,h+38),rawFilename:p.subarray(a,c),filenameUTF8:o,commentUTF8:o,rawExtraField:p.subarray(c,f)});const b=f+s.commentLength;s.rawComment=p.subarray(f,b);const k=Te(e,t,"filenameEncoding"),v=Te(e,t,"commentEncoding"),[S,_]=await w.all([ue(s.rawFilename,s.filenameUTF8?ze:k||Re),ue(s.rawComment,s.commentUTF8?ze:v||Re)]);s.filename=S,s.comment=_,!s.directory&&s.filename.endsWith(ce)&&(s.directory=!0),await Fe(s,s,g,h+6);const A=new pe(s);if(A.getData=(t,e)=>s.getData(t,A,e),h=b,t.onprogress)try{t.onprogress(i+1,d,new pe(s))}catch(t){}yield A}return!0}async getEntries(t={}){const e=[],n=this.getEntriesGenerator(t);let r=n.next();for(;!(await r).done;)e.push((await r).value),r=n.next();return e}async close(){}},t.ZipWriter=class{constructor(t,e={}){n.assign(this,{writer:t,options:e,config:A(),files:new a,offset:t.size,pendingCompressedSize:0,pendingEntries:[]})}async add(t="",r,a={}){const c=this;if(Ge>=c.config.maxWorkers)return new w(((e,n)=>c.pendingEntries.push({name:t,reader:r,options:a,resolve:e,reject:n})));Ge++;try{return await(async(t,r,a,c)=>{if(r=r.trim(),c.directory&&!r.endsWith(ce)?r+=ce:c.directory=r.endsWith(ce),t.files.has(r))throw new l(He);const p=D(r);if(p.length>ee)throw new l(Oe);const g=c.comment||"",y=D(g);if(y.length>ee)throw new l(Ze);const m=t.options.version||c.version||0;if(m>ee)throw new l(Ke);const b=t.options.versionMadeBy||c.versionMadeBy||20;if(b>ee)throw new l(Ke);const k=en(t,c,"lastModDate")||new o,v=en(t,c,"lastAccessDate"),S=en(t,c,"creationDate"),_=en(t,c,"password"),A=en(t,c,"encryptionStrength")||3,z=en(t,c,"zipCrypto");if(void 0!==_&&void 0!==A&&(1>A||A>3))throw new l(Pe);let R=new f(0);const C=c.extraField;if(C){let t=0,e=0;C.forEach((e=>t+=4+e.length)),R=new f(t),C.forEach(((t,n)=>{if(n>ee)throw new l(qe);if(t.length>ee)throw new l(Xe);an(R,new d([n]),e),an(R,new d([t.length]),e+2),an(R,t,e+4),e+=4+t.length}))}let E=en(t,c,"extendedTimestamp");void 0===E&&(E=!0);let F=0,x=en(t,c,"keepOrder");void 0===x&&(x=!0);let T=0,I=en(t,c,"msDosCompatible");void 0===I&&(I=!0);const U=en(t,c,"internalFileAttribute")||0,B=en(t,c,"externalFileAttribute")||0;a&&(a.initialized||await a.init(),T=a.size,F=(t=>t+5*(s.floor(t/16383)+1))(T));let W=c.zip64||t.options.zip64||!1;if(t.offset+t.pendingCompressedSize>=te||T>=te||F>=te){if(!1===c.zip64||!1===t.options.zip64||!x)throw new l(Ye);W=!0}t.pendingCompressedSize+=F,await w.resolve();const Q=en(t,c,"level"),V=en(t,c,"useWebWorkers"),L=en(t,c,"bufferedWrite");let M=en(t,c,"dataDescriptor"),H=en(t,c,"dataDescriptorSignature");const N=en(t,c,"signal");void 0===M&&(M=!0),M&&void 0===H&&(H=!0);const Z=await(async(t,r,o,a)=>{const c=t.files,d=t.writer,p=e.from(c.values()).pop();let g,y,m,b={};c.set(r,b);try{let k,v,S;if(a.keepOrder&&(k=p&&p.lock),b.lock=S=new w((t=>m=t)),a.bufferedWrite||t.lockWrite||!a.dataDescriptor?(v=new Vt,v.init(),g=!0):(t.lockWrite=new w((t=>y=t)),d.initialized||await d.init(),v=d),b=await(async(t,e,r,o)=>{const{rawFilename:a,lastAccessDate:c,creationDate:l,password:d,level:h,zip64:p,zipCrypto:w,dataDescriptor:g,dataDescriptorSignature:y,directory:m,version:b,versionMadeBy:k,rawComment:v,rawExtraField:S,useWebWorkers:_,onprogress:A,signal:z,encryptionStrength:R,extendedTimestamp:C,msDosCompatible:E,internalFileAttribute:D,externalFileAttribute:F}=o,x=!(!d||!d.length),T=0!==h&&!m;let I,U,B;if(x&&!w){I=new f($e.length+2);const t=cn(I);rn(t,0,39169),an(I,$e,2),nn(t,8,R)}else I=new f(0);if(C){B=new f(9+(c?4:0)+(l?4:0));const t=cn(B);rn(t,0,oe),rn(t,2,B.length-4),nn(t,4,1+(c?2:0)+(l?4:0)),sn(t,5,s.floor(o.lastModDate.getTime()/1e3)),c&&sn(t,9,s.floor(c.getTime()/1e3)),l&&sn(t,13,s.floor(l.getTime()/1e3));try{U=new f(36);const t=cn(U),e=tn(o.lastModDate);rn(t,0,10),rn(t,2,32),rn(t,8,1),rn(t,10,24),on(t,12,e),on(t,20,tn(c)||e),on(t,28,tn(l)||e)}catch(t){U=new f(0)}}else U=B=new f(0);const W={version:b||20,versionMadeBy:k,zip64:p,directory:!!m,filenameUTF8:!0,rawFilename:a,commentUTF8:!0,rawComment:v,rawExtraFieldZip64:new f(p?28:0),rawExtraFieldExtendedTimestamp:B,rawExtraFieldNTFS:U,rawExtraFieldAES:I,rawExtraField:S,extendedTimestamp:C,msDosCompatible:E,internalFileAttribute:D,externalFileAttribute:F};let Q=W.uncompressedSize=0,V=ae;g&&(V|=8);let L=0;T&&(L=8),p&&(W.version=W.version>45?W.version:45),x&&(V|=1,w||(W.version=W.version>51?W.version:51,L=99,T&&(W.rawExtraFieldAES[9]=8))),W.compressionMethod=L;const M=W.headerArray=new f(26),H=cn(M);rn(H,0,W.version),rn(H,2,V),rn(H,4,L);const N=new u(1),Z=cn(N);let O;O=o.lastModDatele?le:o.lastModDate,rn(Z,0,(O.getHours()<<6|O.getMinutes())<<5|O.getSeconds()/2),rn(Z,2,(O.getFullYear()-1980<<4|O.getMonth()+1)<<5|O.getDate());const K=N[0];sn(H,6,K),rn(H,22,a.length);const P=I.length+B.length+U.length+W.rawExtraField.length;rn(H,24,P);const q=new f(30+a.length+P);let X;sn(cn(q),0,ne),an(q,M,4),an(q,a,30),an(q,I,30+a.length),an(q,B,30+a.length+I.length),an(q,U,30+a.length+I.length+B.length),an(q,W.rawExtraField,30+a.length+I.length+B.length+U.length);let Y=0;if(t){Q=W.uncompressedSize=t.size;const n=await At(r.Deflate,{codecType:ut,level:h,password:d,encryptionStrength:R,zipCrypto:x&&w,passwordVerification:x&&w&&K>>8&255,signed:!0,compressed:T,encrypted:x,useWebWorkers:_},r);await e.writeUint8Array(q),W.dataWritten=!0,X=await Ct(n,t,e,0,Q,r,{onprogress:A,signal:z}),Y=X.length}else await e.writeUint8Array(q),W.dataWritten=!0;let $,j=new f(0),G=0;if(g&&(j=new f(p?y?24:20:y?16:12),$=cn(j),y&&(G=4,sn($,0,134695760))),t){const t=X.signature;if(x&&!w||void 0===t||(sn(H,10,t),W.signature=t,g&&sn($,G,t)),p){const t=cn(W.rawExtraFieldZip64);rn(t,0,1),rn(t,2,24),sn(H,14,te),on(t,12,i(Y)),sn(H,18,te),on(t,4,i(Q)),g&&(on($,G+4,i(Y)),on($,G+12,i(Q)))}else sn(H,14,Y),sn(H,18,Q),g&&(sn($,G+4,Y),sn($,G+8,Q))}g&&await e.writeUint8Array(j);const J=q.length+Y+j.length;return n.assign(W,{compressedSize:Y,lastModDate:O,rawLastModDate:K,creationDate:l,lastAccessDate:c,encrypted:x,length:J}),W})(o,v,t.config,a),b.lock=S,c.set(r,b),b.filename=r,g){let n=0;const r=v.getData();let i;await w.all([t.lockWrite,k]);do{i=e.from(c.values()).find((t=>t.writingBufferedData)),i&&await i.lock}while(i&&i.lock);if(b.writingBufferedData=!0,!a.dataDescriptor){const t=26,e=await Je(r,0,t),i=new h(e);b.encrypted&&!a.zipCrypto||sn(i,14,b.signature),b.zip64?(sn(i,18,te),sn(i,22,te)):(sn(i,18,b.compressedSize),sn(i,22,b.uncompressedSize)),await d.writeUint8Array(new f(e)),n=t}await(async(t,e,n=0)=>{const r=536870912;await async function i(){if(n=te)throw new l(Ye);return t.offset+=b.length,b}catch(e){throw(g&&b.writingBufferedData||!g&&b.dataWritten)&&(e.corruptedEntry=t.hasCorruptedEntries=!0,b.uncompressedSize&&(t.offset+=b.uncompressedSize)),c.delete(r),e}finally{m(),y&&y()}})(t,r,a,n.assign({},c,{rawFilename:p,rawComment:y,version:m,versionMadeBy:b,lastModDate:k,lastAccessDate:v,creationDate:S,rawExtraField:R,zip64:W,password:_,level:Q,useWebWorkers:V,encryptionStrength:A,extendedTimestamp:E,zipCrypto:z,bufferedWrite:L,keepOrder:x,dataDescriptor:M,dataDescriptorSignature:H,signal:N,msDosCompatible:I,internalFileAttribute:U,externalFileAttribute:B}));return F&&(t.pendingCompressedSize-=F),n.assign(Z,{name:r,comment:g,extraField:C}),new pe(Z)})(c,t,r,a)}finally{Ge--;const t=c.pendingEntries.shift();t&&c.add(t.name,t.reader,t.options).then(t.resolve).catch(t.reject)}}async close(t=new f(0),n={}){return await(async(t,n,r)=>{const o=t.writer,a=t.files;let c=0,d=0,u=t.offset,h=a.size;for(const[,t]of a)d+=46+t.rawFilename.length+t.rawComment.length+t.rawExtraFieldZip64.length+t.rawExtraFieldAES.length+t.rawExtraFieldExtendedTimestamp.length+t.rawExtraFieldNTFS.length+t.rawExtraField.length;let p=r.zip64||t.options.zip64||!1;if(u>=te||d>=te||h>=ee){if(!1===r.zip64||!1===t.options.zip64)throw new l(Ye);p=!0}const w=new f(d+(p?98:22)),g=cn(w);if(n&&n.length){if(n.length>ee)throw new l(Ne);rn(g,c+20,n.length)}for(const[t,n]of e.from(a.values()).entries()){const{rawFilename:e,rawExtraFieldZip64:i,rawExtraFieldAES:o,rawExtraField:l,rawComment:d,versionMadeBy:u,headerArray:h,directory:p,zip64:y,msDosCompatible:m,internalFileAttribute:b,externalFileAttribute:k}=n;let v,S;if(n.extendedTimestamp){S=n.rawExtraFieldNTFS,v=new f(9);const t=cn(v);rn(t,0,oe),rn(t,2,v.length-4),nn(t,4,1),sn(t,5,s.floor(n.lastModDate.getTime()/1e3))}else S=v=new f(0);const _=i.length+o.length+v.length+S.length+l.length;if(sn(g,c,re),rn(g,c+4,u),an(w,h,c+6),rn(g,c+30,_),rn(g,c+32,d.length),sn(g,c+34,b),k?sn(g,c+38,k):p&&m&&nn(g,c+38,16),sn(g,c+42,y?te:n.offset),an(w,e,c+46),an(w,i,c+46+e.length),an(w,o,c+46+e.length+i.length),an(w,v,c+46+e.length+i.length+o.length),an(w,S,c+46+e.length+i.length+o.length+v.length),an(w,l,c+46+e.length+i.length+o.length+v.length+S.length),an(w,d,c+46+e.length+_),c+=46+e.length+_+d.length,r.onprogress)try{r.onprogress(t+1,a.size,new pe(n))}catch(t){}}p&&(sn(g,c,ie),on(g,c+4,i(44)),rn(g,c+12,45),rn(g,c+14,45),on(g,c+24,i(h)),on(g,c+32,i(h)),on(g,c+40,i(d)),on(g,c+48,i(u)),sn(g,c+56,se),on(g,c+64,i(u)+i(d)),sn(g,c+72,1),h=ee,u=te,d=te,c+=76),sn(g,c,101010256),rn(g,c+8,h),rn(g,c+10,h),sn(g,c+12,d),sn(g,c+16,u),await o.writeUint8Array(w),n&&n.length&&await o.writeUint8Array(n)})(this,t,n),this.writer.getData()}},t.configure=z,t.getMimeType=()=>"application/octet-stream",t.initShimAsyncCodec=(t,e={},n)=>({Deflate:R(t.Deflate,e.deflate,n),Inflate:R(t.Inflate,e.inflate,n)}),t.terminateWorkers=()=>{St.forEach((t=>{zt(t),t.terminate()}))},n.defineProperty(t,"__esModule",{value:!0})})); diff --git a/webapp/src/app.tsx b/webapp/src/app.tsx index 2f41b5aaabd5..9e2f576d2b9c 100644 --- a/webapp/src/app.tsx +++ b/webapp/src/app.tsx @@ -67,6 +67,8 @@ type FileHistoryEntry = pxt.editor.FileHistoryEntry; type EditorSettings = pxt.editor.EditorSettings; type ProjectCreationOptions = pxt.editor.ProjectCreationOptions; +declare const zip: any; + import Cloud = pxt.Cloud; import Util = pxt.Util; import { HintManager } from "./hinttooltip"; @@ -1987,6 +1989,10 @@ export class ProjectView return false } + isZipFile(filename: string): boolean { + return /\.zip$/i.test(filename) + } + importProjectCoreAsync(buf: Uint8Array, options?: pxt.editor.ImportFileOptions) { return (buf[0] == '{'.charCodeAt(0) ? Promise.resolve(pxt.U.uint8ArrayToString(buf)) : @@ -2055,6 +2061,71 @@ export class ProjectView .then(buf => this.importProjectCoreAsync(buf, options)) } + async importZipFileAsync(file: File, options?: pxt.editor.ImportFileOptions) { + if (!file) return; + pxt.tickEvent("import.zip"); + + await scriptmanager.loadZipAsync(); + const reader = new zip.ZipReader(new zip.BlobReader(file)); + + const zippedFiles = (await reader.getEntries()).filter((zipped: any) => this.isProjectFile(zipped.filename)); + let progress = { + done: 0 + } + + if (zippedFiles.length === 0) { + core.warningNotification(lf("No projects available to import found inside zip file.")); + return; + } + + const confirmed = await core.confirmAsync({ + header: lf("Import zip file?"), + body: lf("Do you want to import all projects in this zip file? This will import {0} projects.", zippedFiles.length), + agreeLbl: lf("Okay"), + hasCloseIcon: true, + }); + + if (!confirmed) return; + + let cancelled = false; + + core.dialogAsync({ + header: lf("Extracting files..."), + jsxd: () => , + onClose: () => cancelled = true + }) + + for (const zipped of zippedFiles) { + try { + const buf: Uint8Array = await zipped.getData(new zip.Uint8ArrayWriter()); + + const data = JSON.parse(await pxt.lzmaDecompressAsync(buf)) as pxt.cpp.HexFile; + + let h: pxt.workspace.InstallHeader = { + target: pxt.appTarget.id, + targetVersion: data.meta.targetVersions ? data.meta.targetVersions.target : undefined, + editor: data.meta.editor, + name: data.meta.name, + meta: {}, + pubId: "", + pubCurrent: false + } + + const files = JSON.parse(data.source) as pxt.Map; + await workspace.installAsync(h, files); + } + catch (e) { + + } + + if (cancelled) break; + progress.done ++; + core.forceUpdate(); + } + + core.hideDialog(); + } + importPNGBuffer(buf: ArrayBuffer) { pxt.Util.decodeBlobAsync("data:image/png;base64," + btoa(pxt.Util.uint8ArrayToString(new Uint8Array(buf)))) @@ -2224,7 +2295,7 @@ export class ProjectView initDragAndDrop() { draganddrop.setupDragAndDrop(document.body, - file => file.size < 1000000 && this.isHexFile(file.name) || this.isBlocksFile(file.name), + file => file.size < 1000000 && this.isHexFile(file.name) || this.isBlocksFile(file.name) || this.isZipFile(file.name), files => { if (files) { pxt.tickEvent("dragandrop.open") @@ -2267,6 +2338,8 @@ export class ProjectView this.importAssetFile(file) } else if (this.isPNGFile(file.name)) { this.importPNGFile(file, options); + } else if (this.isZipFile(file.name)) { + this.importZipFileAsync(file, options); } else { const importer = this.resourceImporters.filter(fi => fi.canImport(file))[0]; if (importer) { diff --git a/webapp/src/dialogs.tsx b/webapp/src/dialogs.tsx index 5d1d252166b2..ce2d60a54034 100644 --- a/webapp/src/dialogs.tsx +++ b/webapp/src/dialogs.tsx @@ -305,7 +305,7 @@ interface ProgressBarProps { cornerRadius?: number; } -class ProgressBar extends React.Component { +export class ProgressBar extends React.Component { render() { let { percentage, label, cornerRadius } = this.props; diff --git a/webapp/src/scriptmanager.tsx b/webapp/src/scriptmanager.tsx index 11ab7ba4d72f..c44ef0134506 100644 --- a/webapp/src/scriptmanager.tsx +++ b/webapp/src/scriptmanager.tsx @@ -9,6 +9,19 @@ import * as auth from "./auth"; import { SearchInput } from "./components/searchInput"; import { ProjectsCodeCard } from "./projects"; import { fireClickOnEnter } from "./util"; +import { Modal } from "../../react-common/components/controls/Modal"; +import { ProgressBar } from "./dialogs"; + +declare const zip: any; + +let loadZipJsPromise: Promise; +export function loadZipAsync(): Promise { + if (!loadZipJsPromise) + loadZipJsPromise = pxt.BrowserUtils.loadScriptAsync("zip.js/zip.min.js") + .then(() => typeof zip !== "undefined") + .catch(e => false) + return loadZipJsPromise; +} type ISettingsProps = pxt.editor.ISettingsProps; @@ -30,6 +43,13 @@ export interface ScriptManagerDialogState { sortedBy?: string; sortedAsc?: boolean; + + download?: DownloadProgress; +} + +interface DownloadProgress { + completed: number; + max: number; } export class ScriptManagerDialog extends data.Component { @@ -280,6 +300,125 @@ export class ScriptManagerDialog extends data.Component { + pxt.tickEvent("scriptmanager.downloadZip", undefined, { interactiveConsent: true }); + + await loadZipAsync(); + + const { selected } = this.state; + const zipWriter = new zip.ZipWriter(new zip.Data64URIWriter("application/zip")); + const selectedHeaders = this.getSortedHeaders().filter(h => selected[this.getId(h)]); + + let done = 0; + + const takenNames: {[index: string]: boolean} = {}; + + const format = (val: number, len = 2) => { + let out = val + ""; + while (out.length < len) { + out = "0" + out + } + + return out.substring(0, len); + } + + this.setState({ + download: { + completed: 0, + max: selectedHeaders.length + } + }); + + const targetNickname = pxt.appTarget.nickname || pxt.appTarget.id; + + for (const header of selectedHeaders) { + const text = await workspace.getTextAsync(header.id); + + let preferredEditor = "blocksprj"; + try { + const config = JSON.parse(text["pxt.json"]) as pxt.PackageConfig; + + preferredEditor = config.preferredEditor || "blocksprj" + } + catch (e) { + // ignore invalid configs + } + + const project: pxt.cpp.HexFile = { + meta: { + cloudId: pxt.CLOUD_ID + pxt.appTarget.id, + targetVersions: pxt.appTarget.versions, + editor: preferredEditor, + name: header.name + }, + source: JSON.stringify(text, null, 2) + }; + + const compressed = await pxt.lzmaCompressAsync(JSON.stringify(project, null, 2)); + + /* eslint-disable no-control-regex */ + let sanitizedName = header.name.replace(/[()\\\/.,?*^:<>!;'#$%^&|"@+=«»°{}\[\]¾½¼³²¦¬¤¢£~­¯¸`±\x00-\x1F]/g, ''); + sanitizedName = sanitizedName.trim().replace(/\s+/g, '-'); + /* eslint-enable no-control-regex */ + + if (pxt.appTarget.appTheme && pxt.appTarget.appTheme.fileNameExclusiveFilter) { + const rx = new RegExp(pxt.appTarget.appTheme.fileNameExclusiveFilter, 'g'); + sanitizedName = sanitizedName.replace(rx, ''); + } + + if (!sanitizedName) { + sanitizedName = "Untitled"; // do not translate to avoid unicode issues + } + + // Include the recent use time in the filename + const date = new Date(header.recentUse * 1000); + const dateSnippet = `${date.getFullYear()}-${format(date.getMonth())}-${format(date.getDate())}` + + // FIXME: handle different date formatting? + let fn = `${targetNickname}-${dateSnippet}-${sanitizedName}.mkcd`; + + // zip.js can't handle multiple files with the same name + if (takenNames[fn]) { + let index = 2; + do { + fn = `${targetNickname}-${dateSnippet}-${sanitizedName}${index}.mkcd` + index ++; + } while(takenNames[fn]) + } + + takenNames[fn] = true; + + await zipWriter.add(fn, new zip.Uint8ArrayReader(compressed)); + + // Check for cancellation + if (!this.state.download) return; + + done++; + this.setState({ + download: { + completed: done, + max: selectedHeaders.length + } + }); + } + + const datauri = await zipWriter.close(); + + const zipName = `makecode-${targetNickname}-project-download.zip` + + pxt.BrowserUtils.browserDownloadDataUri(datauri, zipName); + + this.setState({ + download: null + }); + } + + handleDownloadProgressClose = () => { + this.setState({ + download: null + }); + } + private getSelectedHeader() { const { selected } = this.state; const indexes = Object.keys(selected); @@ -315,7 +454,7 @@ export class ScriptManagerDialog extends data.Component; const darkTheme = pxt.appTarget.appTheme.baseTheme == 'dark'; @@ -344,8 +483,10 @@ export class ScriptManagerDialog extends data.Component); - if (Object.keys(selected).length > 0) { - if (Object.keys(selected).length == 1) { + + const numSelected = Object.keys(selected).length + if (numSelected > 0) { + if (numSelected == 1) { const openBtn = ; if (!openNewTab) @@ -363,6 +504,10 @@ export class ScriptManagerDialog extends data.Component); + if (numSelected > 1) { + headerActions.push(); + } headerActions.push(
); } headerActions.push( : undefined} + + {download && + + + } ) }