diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..29f6cd4ee03babac8abe1408b16a4a767e1df289 --- /dev/null +++ b/.gitignore @@ -0,0 +1,78 @@ +# Python build +.eggs/ +gradio.egg-info +dist/ +*.pyc +__pycache__/ +*.py[cod] +*$py.class +build/ +__tmp/* + +# JS build +gradio/templates/cdn +gradio/templates/frontend + +# Secrets +.env + +# Gradio run artifacts +*.db +*.sqlite3 +gradio/launches.json +flagged/ +gradio_cached_examples/ +tmp.zip + +# Tests +.coverage +coverage.xml +test.txt +**/snapshots/**/*.png +playwright-report/ + +# Demos +demo/tmp.zip +demo/files/*.avi +demo/files/*.mp4 +demo/all_demos/demos/* +demo/all_demos/requirements.txt +demo/*/config.json +demo/annotatedimage_component/*.png + +# Etc +.idea/* +.DS_Store +*.bak +workspace.code-workspace +*.h5 + +# dev containers +.pnpm-store/ + +# log files +.pnpm-debug.log + +# Local virtualenv for devs +.venv* + +# FRP +gradio/frpc_* +.vercel + +# js +node_modules +public/build/ +test-results +client/js/test.js +.config/test.py + +# storybook +storybook-static +build-storybook.log +js/storybook/theme.css + +# playwright +.config/playwright +!.config/playwright/index.html +!.config/playwright/index.ts diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/PKG-INFO b/PKG-INFO new file mode 100644 index 0000000000000000000000000000000000000000..539e69f510ae16dcfc0b9b8ab1d95094391e0575 --- /dev/null +++ b/PKG-INFO @@ -0,0 +1,374 @@ +Metadata-Version: 2.1 +Name: gradio +Version: 3.39.0 +Summary: Python library for easily interacting with trained machine learning models +Project-URL: Homepage, https://github.com/gradio-app/gradio +Author-email: Abubakar Abid , Ali Abid , Ali Abdalla , Dawood Khan , Ahsen Khaliq , Pete Allen , Ömer Faruk Özdemir +License-Expression: Apache-2.0 +License-File: LICENSE +Keywords: machine learning,reproducibility,visualization +Classifier: Development Status :: 5 - Production/Stable +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Topic :: Scientific/Engineering +Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence +Classifier: Topic :: Scientific/Engineering :: Visualization +Requires-Python: >=3.8 +Requires-Dist: aiofiles<24.0,>=22.0 +Requires-Dist: aiohttp~=3.0 +Requires-Dist: altair<6.0,>=4.2.0 +Requires-Dist: fastapi +Requires-Dist: ffmpy +Requires-Dist: gradio-client>=0.3.0 +Requires-Dist: httpx +Requires-Dist: huggingface-hub>=0.14.0 +Requires-Dist: jinja2<4.0 +Requires-Dist: markdown-it-py[linkify]>=2.0.0 +Requires-Dist: markupsafe~=2.0 +Requires-Dist: matplotlib~=3.0 +Requires-Dist: mdit-py-plugins<=0.3.3 +Requires-Dist: numpy~=1.0 +Requires-Dist: orjson~=3.0 +Requires-Dist: packaging +Requires-Dist: pandas<3.0,>=1.0 +Requires-Dist: pillow<11.0,>=8.0 +Requires-Dist: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4 +Requires-Dist: pydub +Requires-Dist: python-multipart +Requires-Dist: pyyaml<7.0,>=5.0 +Requires-Dist: requests~=2.0 +Requires-Dist: semantic-version~=2.0 +Requires-Dist: typing-extensions~=4.0 +Requires-Dist: uvicorn>=0.14.0 +Requires-Dist: websockets<12.0,>=10.0 +Description-Content-Type: text/markdown + + + +
+ + [gradio](https://gradio.app)
+ Build & share delightful machine learning apps easily + + [![gradio-backend](https://github.com/gradio-app/gradio/actions/workflows/backend.yml/badge.svg)](https://github.com/gradio-app/gradio/actions/workflows/backend.yml) + [![gradio-ui](https://github.com/gradio-app/gradio/actions/workflows/ui.yml/badge.svg)](https://github.com/gradio-app/gradio/actions/workflows/ui.yml) + [![PyPI](https://img.shields.io/pypi/v/gradio)](https://pypi.org/project/gradio/) + [![PyPI downloads](https://img.shields.io/pypi/dm/gradio)](https://pypi.org/project/gradio/) + ![Python version](https://img.shields.io/badge/python-3.8+-important) + [![Twitter follow](https://img.shields.io/twitter/follow/gradio?style=social&label=follow)](https://twitter.com/gradio) + + [Website](https://gradio.app) + | [Documentation](https://gradio.app/docs/) + | [Guides](https://gradio.app/guides/) + | [Getting Started](https://gradio.app/getting_started/) + | [Examples](demo/) + | [中文](https://raw.githubusercontent.com/gradio-app/gradio/main/readme_files/zh-cn#readme) +
+ +# Gradio: Build Machine Learning Web Apps — in Python + +Gradio is an open-source Python library that is used to build machine learning and data science demos and web applications. + +With Gradio, you can quickly create a beautiful user interface around your machine learning models or data science workflow and let people "try it out" by dragging-and-dropping in their own images, +pasting text, recording their own voice, and interacting with your demo, all through the browser. + +![Interface montage](https://raw.githubusercontent.com/gradio-app/gradio/main/readme_files/header-image.jpg) + +Gradio is useful for: + +- **Demoing** your machine learning models for clients/collaborators/users/students. + +- **Deploying** your models quickly with automatic shareable links and getting feedback on model performance. + +- **Debugging** your model interactively during development using built-in manipulation and interpretation tools. + +## Quickstart + +**Prerequisite**: Gradio requires Python 3.8 or higher, that's all! + +### What Does Gradio Do? + +One of the *best ways to share* your machine learning model, API, or data science workflow with others is to create an **interactive app** that allows your users or colleagues to try out the demo in their browsers. + +Gradio allows you to **build demos and share them, all in Python.** And usually in just a few lines of code! So let's get started. + +### Hello, World + +To get Gradio running with a simple "Hello, World" example, follow these three steps: + +1\. Install Gradio using pip: + +```bash +pip install gradio +``` + +2\. Run the code below as a Python script or in a Jupyter Notebook (or [Google Colab](https://colab.research.google.com/drive/18ODkJvyxHutTN0P5APWyGFO_xwNcgHDZ?usp=sharing)): + +```python +import gradio as gr + +def greet(name): + return "Hello " + name + "!" + +demo = gr.Interface(fn=greet, inputs="text", outputs="text") + +demo.launch() +``` + + +We shorten the imported name to `gr` for better readability of code using Gradio. This is a widely adopted convention that you should follow so that anyone working with your code can easily understand it. + +3\. The demo below will appear automatically within the Jupyter Notebook, or pop in a browser on [http://localhost:7860](http://localhost:7860) if running from a script: + +![`hello_world` demo](https://raw.githubusercontent.com/gradio-app/gradio/main/demo/hello_world/screenshot.gif) + +When developing locally, if you want to run the code as a Python script, you can use the Gradio CLI to launch the application **in reload mode**, which will provide seamless and fast development. Learn more about reloading in the [Auto-Reloading Guide](https://gradio.app/developing-faster-with-reload-mode/). + +```bash +gradio app.py +``` + +Note: you can also do `python app.py`, but it won't provide the automatic reload mechanism. + +### The `Interface` Class + +You'll notice that in order to make the demo, we created a `gr.Interface`. This `Interface` class can wrap any Python function with a user interface. In the example above, we saw a simple text-based function, but the function could be anything from music generator to a tax calculator to the prediction function of a pretrained machine learning model. + +The core `Interface` class is initialized with three required parameters: + +- `fn`: the function to wrap a UI around +- `inputs`: which component(s) to use for the input (e.g. `"text"`, `"image"` or `"audio"`) +- `outputs`: which component(s) to use for the output (e.g. `"text"`, `"image"` or `"label"`) + +Let's take a closer look at these components used to provide input and output. + +### Components Attributes + +We saw some simple `Textbox` components in the previous examples, but what if you want to change how the UI components look or behave? + +Let's say you want to customize the input text field — for example, you wanted it to be larger and have a text placeholder. If we use the actual class for `Textbox` instead of using the string shortcut, you have access to much more customizability through component attributes. + +```python +import gradio as gr + +def greet(name): + return "Hello " + name + "!" + +demo = gr.Interface( + fn=greet, + inputs=gr.Textbox(lines=2, placeholder="Name Here..."), + outputs="text", +) +demo.launch() +``` + +![`hello_world_2` demo](https://raw.githubusercontent.com/gradio-app/gradio/main/demo/hello_world_2/screenshot.gif) + +### Multiple Input and Output Components + +Suppose you had a more complex function, with multiple inputs and outputs. In the example below, we define a function that takes a string, boolean, and number, and returns a string and number. Take a look how you pass a list of input and output components. + +```python +import gradio as gr + +def greet(name, is_morning, temperature): + salutation = "Good morning" if is_morning else "Good evening" + greeting = f"{salutation} {name}. It is {temperature} degrees today" + celsius = (temperature - 32) * 5 / 9 + return greeting, round(celsius, 2) + +demo = gr.Interface( + fn=greet, + inputs=["text", "checkbox", gr.Slider(0, 100)], + outputs=["text", "number"], +) +demo.launch() +``` + +![`hello_world_3` demo](https://raw.githubusercontent.com/gradio-app/gradio/main/demo/hello_world_3/screenshot.gif) + +You simply wrap the components in a list. Each component in the `inputs` list corresponds to one of the parameters of the function, in order. Each component in the `outputs` list corresponds to one of the values returned by the function, again in order. + +### An Image Example + +Gradio supports many types of components, such as `Image`, `DataFrame`, `Video`, or `Label`. Let's try an image-to-image function to get a feel for these! + +```python +import numpy as np +import gradio as gr + +def sepia(input_img): + sepia_filter = np.array([ + [0.393, 0.769, 0.189], + [0.349, 0.686, 0.168], + [0.272, 0.534, 0.131] + ]) + sepia_img = input_img.dot(sepia_filter.T) + sepia_img /= sepia_img.max() + return sepia_img + +demo = gr.Interface(sepia, gr.Image(shape=(200, 200)), "image") +demo.launch() +``` + +![`sepia_filter` demo](https://raw.githubusercontent.com/gradio-app/gradio/main/demo/sepia_filter/screenshot.gif) + +When using the `Image` component as input, your function will receive a NumPy array with the shape `(height, width, 3)`, where the last dimension represents the RGB values. We'll return an image as well in the form of a NumPy array. + +You can also set the datatype used by the component with the `type=` keyword argument. For example, if you wanted your function to take a file path to an image instead of a NumPy array, the input `Image` component could be written as: + +```python +gr.Image(type="filepath", shape=...) +``` + +Also note that our input `Image` component comes with an edit button 🖉, which allows for cropping and zooming into images. Manipulating images in this way can help reveal biases or hidden flaws in a machine learning model! + +You can read more about the many components and how to use them in the [Gradio docs](https://gradio.app/docs). + +### Chatbots + +Gradio includes a high-level class, `gr.ChatInterface`, which is similar to `gr.Interface`, but is specifically designed for chatbot UIs. The `gr.ChatInterface` class also wraps a function but this function must have a specific signature. The function should take two arguments: `message` and then `history` (the arguments can be named anything, but must be in this order) + +* `message`: a `str` representing the user's input +* `history`: a `list` of `list` representing the conversations up until that point. Each inner list consists of two `str` representing a pair: `[user input, bot response]`. + +Your function should return a single string response, which is the bot's response to the particular user input `message`. + +Other than that, `gr.ChatInterface` has no required parameters (though several are available for customization of the UI). + +Here's a toy example: + +```python +import random +import gradio as gr + +def random_response(message, history): + return random.choice(["Yes", "No"]) + +demo = gr.ChatInterface(random_response) + +demo.launch() +``` + +![`chatinterface_random_response` demo](https://raw.githubusercontent.com/gradio-app/gradio/main/demo/chatinterface_random_response/screenshot.gif) + +You can [read more about `gr.ChatInterface` here](https://gradio.app/guides/creating-a-chatbot-fast). + +### Blocks: More Flexibility and Control + +Gradio offers two approaches to build apps: + +1\. **Interface** and **ChatInterface**, which provide a high-level abstraction for creating demos that we've been discussing so far. + +2\. **Blocks**, a low-level API for designing web apps with more flexible layouts and data flows. Blocks allows you to do things like feature multiple data flows and demos, control where components appear on the page, handle complex data flows (e.g. outputs can serve as inputs to other functions), and update properties/visibility of components based on user interaction — still all in Python. If this customizability is what you need, try `Blocks` instead! + +### Hello, Blocks + +Let's take a look at a simple example. Note how the API here differs from `Interface`. + +```python +import gradio as gr + +def greet(name): + return "Hello " + name + "!" + +with gr.Blocks() as demo: + name = gr.Textbox(label="Name") + output = gr.Textbox(label="Output Box") + greet_btn = gr.Button("Greet") + greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet") + + +demo.launch() +``` + +![`hello_blocks` demo](https://raw.githubusercontent.com/gradio-app/gradio/main/demo/hello_blocks/screenshot.gif) + +Things to note: + +- `Blocks` are made with a `with` clause, and any component created inside this clause is automatically added to the app. +- Components appear vertically in the app in the order they are created. (Later we will cover customizing layouts!) +- A `Button` was created, and then a `click` event-listener was added to this button. The API for this should look familiar! Like an `Interface`, the `click` method takes a Python function, input components, and output components. + +### More Complexity + +Here's an app to give you a taste of what's possible with `Blocks`: + +```python +import numpy as np +import gradio as gr + + +def flip_text(x): + return x[::-1] + + +def flip_image(x): + return np.fliplr(x) + + +with gr.Blocks() as demo: + gr.Markdown("Flip text or image files using this demo.") + with gr.Tab("Flip Text"): + text_input = gr.Textbox() + text_output = gr.Textbox() + text_button = gr.Button("Flip") + with gr.Tab("Flip Image"): + with gr.Row(): + image_input = gr.Image() + image_output = gr.Image() + image_button = gr.Button("Flip") + + with gr.Accordion("Open for More!"): + gr.Markdown("Look at me...") + + text_button.click(flip_text, inputs=text_input, outputs=text_output) + image_button.click(flip_image, inputs=image_input, outputs=image_output) + +demo.launch() +``` + +![`blocks_flipper` demo](https://raw.githubusercontent.com/gradio-app/gradio/main/demo/blocks_flipper/screenshot.gif) + +A lot more going on here! We'll cover how to create complex `Blocks` apps like this in the [building with blocks](https://gradio.app/building_with_blocks) section for you. + +Congrats, you're now familiar with the basics of Gradio! 🥳 Go to our [next guide](https://gradio.app/key_features) to learn more about the key features of Gradio. + + +## Open Source Stack + +Gradio is built with many wonderful open-source libraries, please support them as well! + +[huggingface](https://huggingface.co) +[python](https://www.python.org) +[fastapi](https://fastapi.tiangolo.com) +[encode](https://www.encode.io) +[svelte](https://svelte.dev) +[vite](https://vitejs.dev) +[pnpm](https://pnpm.io) +[tailwind](https://tailwindcss.com) +[storybook](https://storybook.js.org/) +[chromatic](https://www.chromatic.com/) + +## License + +Gradio is licensed under the Apache License 2.0 found in the [LICENSE](LICENSE) file in the root directory of this repository. + +## Citation + +Also check out the paper *[Gradio: Hassle-Free Sharing and Testing of ML Models in the Wild](https://arxiv.org/abs/1906.02569), ICML HILL 2019*, and please cite it if you use Gradio in your work. + +``` +@article{abid2019gradio, + title = {Gradio: Hassle-Free Sharing and Testing of ML Models in the Wild}, + author = {Abid, Abubakar and Abdalla, Ali and Abid, Ali and Khan, Dawood and Alfozan, Abdulrahman and Zou, James}, + journal = {arXiv preprint arXiv:1906.02569}, + year = {2019}, +} +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4e17474bd213d42414ec2cf973466f2df533497a --- /dev/null +++ b/README.md @@ -0,0 +1,323 @@ + + +
+ + [gradio](https://gradio.app)
+ Build & share delightful machine learning apps easily + + [![gradio-backend](https://github.com/gradio-app/gradio/actions/workflows/backend.yml/badge.svg)](https://github.com/gradio-app/gradio/actions/workflows/backend.yml) + [![gradio-ui](https://github.com/gradio-app/gradio/actions/workflows/ui.yml/badge.svg)](https://github.com/gradio-app/gradio/actions/workflows/ui.yml) + [![PyPI](https://img.shields.io/pypi/v/gradio)](https://pypi.org/project/gradio/) + [![PyPI downloads](https://img.shields.io/pypi/dm/gradio)](https://pypi.org/project/gradio/) + ![Python version](https://img.shields.io/badge/python-3.8+-important) + [![Twitter follow](https://img.shields.io/twitter/follow/gradio?style=social&label=follow)](https://twitter.com/gradio) + + [Website](https://gradio.app) + | [Documentation](https://gradio.app/docs/) + | [Guides](https://gradio.app/guides/) + | [Getting Started](https://gradio.app/getting_started/) + | [Examples](demo/) + | [中文](readme_files/zh-cn#readme) +
+ +# Gradio: Build Machine Learning Web Apps — in Python + +Gradio is an open-source Python library that is used to build machine learning and data science demos and web applications. + +With Gradio, you can quickly create a beautiful user interface around your machine learning models or data science workflow and let people "try it out" by dragging-and-dropping in their own images, +pasting text, recording their own voice, and interacting with your demo, all through the browser. + +![Interface montage](readme_files/header-image.jpg) + +Gradio is useful for: + +- **Demoing** your machine learning models for clients/collaborators/users/students. + +- **Deploying** your models quickly with automatic shareable links and getting feedback on model performance. + +- **Debugging** your model interactively during development using built-in manipulation and interpretation tools. + +## Quickstart + +**Prerequisite**: Gradio requires Python 3.8 or higher, that's all! + +### What Does Gradio Do? + +One of the *best ways to share* your machine learning model, API, or data science workflow with others is to create an **interactive app** that allows your users or colleagues to try out the demo in their browsers. + +Gradio allows you to **build demos and share them, all in Python.** And usually in just a few lines of code! So let's get started. + +### Hello, World + +To get Gradio running with a simple "Hello, World" example, follow these three steps: + +1\. Install Gradio using pip: + +```bash +pip install gradio +``` + +2\. Run the code below as a Python script or in a Jupyter Notebook (or [Google Colab](https://colab.research.google.com/drive/18ODkJvyxHutTN0P5APWyGFO_xwNcgHDZ?usp=sharing)): + +```python +import gradio as gr + +def greet(name): + return "Hello " + name + "!" + +demo = gr.Interface(fn=greet, inputs="text", outputs="text") + +demo.launch() +``` + + +We shorten the imported name to `gr` for better readability of code using Gradio. This is a widely adopted convention that you should follow so that anyone working with your code can easily understand it. + +3\. The demo below will appear automatically within the Jupyter Notebook, or pop in a browser on [http://localhost:7860](http://localhost:7860) if running from a script: + +![`hello_world` demo](demo/hello_world/screenshot.gif) + +When developing locally, if you want to run the code as a Python script, you can use the Gradio CLI to launch the application **in reload mode**, which will provide seamless and fast development. Learn more about reloading in the [Auto-Reloading Guide](https://gradio.app/developing-faster-with-reload-mode/). + +```bash +gradio app.py +``` + +Note: you can also do `python app.py`, but it won't provide the automatic reload mechanism. + +### The `Interface` Class + +You'll notice that in order to make the demo, we created a `gr.Interface`. This `Interface` class can wrap any Python function with a user interface. In the example above, we saw a simple text-based function, but the function could be anything from music generator to a tax calculator to the prediction function of a pretrained machine learning model. + +The core `Interface` class is initialized with three required parameters: + +- `fn`: the function to wrap a UI around +- `inputs`: which component(s) to use for the input (e.g. `"text"`, `"image"` or `"audio"`) +- `outputs`: which component(s) to use for the output (e.g. `"text"`, `"image"` or `"label"`) + +Let's take a closer look at these components used to provide input and output. + +### Components Attributes + +We saw some simple `Textbox` components in the previous examples, but what if you want to change how the UI components look or behave? + +Let's say you want to customize the input text field — for example, you wanted it to be larger and have a text placeholder. If we use the actual class for `Textbox` instead of using the string shortcut, you have access to much more customizability through component attributes. + +```python +import gradio as gr + +def greet(name): + return "Hello " + name + "!" + +demo = gr.Interface( + fn=greet, + inputs=gr.Textbox(lines=2, placeholder="Name Here..."), + outputs="text", +) +demo.launch() +``` + +![`hello_world_2` demo](demo/hello_world_2/screenshot.gif) + +### Multiple Input and Output Components + +Suppose you had a more complex function, with multiple inputs and outputs. In the example below, we define a function that takes a string, boolean, and number, and returns a string and number. Take a look how you pass a list of input and output components. + +```python +import gradio as gr + +def greet(name, is_morning, temperature): + salutation = "Good morning" if is_morning else "Good evening" + greeting = f"{salutation} {name}. It is {temperature} degrees today" + celsius = (temperature - 32) * 5 / 9 + return greeting, round(celsius, 2) + +demo = gr.Interface( + fn=greet, + inputs=["text", "checkbox", gr.Slider(0, 100)], + outputs=["text", "number"], +) +demo.launch() +``` + +![`hello_world_3` demo](demo/hello_world_3/screenshot.gif) + +You simply wrap the components in a list. Each component in the `inputs` list corresponds to one of the parameters of the function, in order. Each component in the `outputs` list corresponds to one of the values returned by the function, again in order. + +### An Image Example + +Gradio supports many types of components, such as `Image`, `DataFrame`, `Video`, or `Label`. Let's try an image-to-image function to get a feel for these! + +```python +import numpy as np +import gradio as gr + +def sepia(input_img): + sepia_filter = np.array([ + [0.393, 0.769, 0.189], + [0.349, 0.686, 0.168], + [0.272, 0.534, 0.131] + ]) + sepia_img = input_img.dot(sepia_filter.T) + sepia_img /= sepia_img.max() + return sepia_img + +demo = gr.Interface(sepia, gr.Image(shape=(200, 200)), "image") +demo.launch() +``` + +![`sepia_filter` demo](demo/sepia_filter/screenshot.gif) + +When using the `Image` component as input, your function will receive a NumPy array with the shape `(height, width, 3)`, where the last dimension represents the RGB values. We'll return an image as well in the form of a NumPy array. + +You can also set the datatype used by the component with the `type=` keyword argument. For example, if you wanted your function to take a file path to an image instead of a NumPy array, the input `Image` component could be written as: + +```python +gr.Image(type="filepath", shape=...) +``` + +Also note that our input `Image` component comes with an edit button 🖉, which allows for cropping and zooming into images. Manipulating images in this way can help reveal biases or hidden flaws in a machine learning model! + +You can read more about the many components and how to use them in the [Gradio docs](https://gradio.app/docs). + +### Chatbots + +Gradio includes a high-level class, `gr.ChatInterface`, which is similar to `gr.Interface`, but is specifically designed for chatbot UIs. The `gr.ChatInterface` class also wraps a function but this function must have a specific signature. The function should take two arguments: `message` and then `history` (the arguments can be named anything, but must be in this order) + +* `message`: a `str` representing the user's input +* `history`: a `list` of `list` representing the conversations up until that point. Each inner list consists of two `str` representing a pair: `[user input, bot response]`. + +Your function should return a single string response, which is the bot's response to the particular user input `message`. + +Other than that, `gr.ChatInterface` has no required parameters (though several are available for customization of the UI). + +Here's a toy example: + +```python +import random +import gradio as gr + +def random_response(message, history): + return random.choice(["Yes", "No"]) + +demo = gr.ChatInterface(random_response) + +demo.launch() +``` + +![`chatinterface_random_response` demo](demo/chatinterface_random_response/screenshot.gif) + +You can [read more about `gr.ChatInterface` here](https://gradio.app/guides/creating-a-chatbot-fast). + +### Blocks: More Flexibility and Control + +Gradio offers two approaches to build apps: + +1\. **Interface** and **ChatInterface**, which provide a high-level abstraction for creating demos that we've been discussing so far. + +2\. **Blocks**, a low-level API for designing web apps with more flexible layouts and data flows. Blocks allows you to do things like feature multiple data flows and demos, control where components appear on the page, handle complex data flows (e.g. outputs can serve as inputs to other functions), and update properties/visibility of components based on user interaction — still all in Python. If this customizability is what you need, try `Blocks` instead! + +### Hello, Blocks + +Let's take a look at a simple example. Note how the API here differs from `Interface`. + +```python +import gradio as gr + +def greet(name): + return "Hello " + name + "!" + +with gr.Blocks() as demo: + name = gr.Textbox(label="Name") + output = gr.Textbox(label="Output Box") + greet_btn = gr.Button("Greet") + greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet") + + +demo.launch() +``` + +![`hello_blocks` demo](demo/hello_blocks/screenshot.gif) + +Things to note: + +- `Blocks` are made with a `with` clause, and any component created inside this clause is automatically added to the app. +- Components appear vertically in the app in the order they are created. (Later we will cover customizing layouts!) +- A `Button` was created, and then a `click` event-listener was added to this button. The API for this should look familiar! Like an `Interface`, the `click` method takes a Python function, input components, and output components. + +### More Complexity + +Here's an app to give you a taste of what's possible with `Blocks`: + +```python +import numpy as np +import gradio as gr + + +def flip_text(x): + return x[::-1] + + +def flip_image(x): + return np.fliplr(x) + + +with gr.Blocks() as demo: + gr.Markdown("Flip text or image files using this demo.") + with gr.Tab("Flip Text"): + text_input = gr.Textbox() + text_output = gr.Textbox() + text_button = gr.Button("Flip") + with gr.Tab("Flip Image"): + with gr.Row(): + image_input = gr.Image() + image_output = gr.Image() + image_button = gr.Button("Flip") + + with gr.Accordion("Open for More!"): + gr.Markdown("Look at me...") + + text_button.click(flip_text, inputs=text_input, outputs=text_output) + image_button.click(flip_image, inputs=image_input, outputs=image_output) + +demo.launch() +``` + +![`blocks_flipper` demo](demo/blocks_flipper/screenshot.gif) + +A lot more going on here! We'll cover how to create complex `Blocks` apps like this in the [building with blocks](https://gradio.app/building_with_blocks) section for you. + +Congrats, you're now familiar with the basics of Gradio! 🥳 Go to our [next guide](https://gradio.app/key_features) to learn more about the key features of Gradio. + + +## Open Source Stack + +Gradio is built with many wonderful open-source libraries, please support them as well! + +[huggingface](https://huggingface.co) +[python](https://www.python.org) +[fastapi](https://fastapi.tiangolo.com) +[encode](https://www.encode.io) +[svelte](https://svelte.dev) +[vite](https://vitejs.dev) +[pnpm](https://pnpm.io) +[tailwind](https://tailwindcss.com) +[storybook](https://storybook.js.org/) +[chromatic](https://www.chromatic.com/) + +## License + +Gradio is licensed under the Apache License 2.0 found in the [LICENSE](LICENSE) file in the root directory of this repository. + +## Citation + +Also check out the paper *[Gradio: Hassle-Free Sharing and Testing of ML Models in the Wild](https://arxiv.org/abs/1906.02569), ICML HILL 2019*, and please cite it if you use Gradio in your work. + +``` +@article{abid2019gradio, + title = {Gradio: Hassle-Free Sharing and Testing of ML Models in the Wild}, + author = {Abid, Abubakar and Abdalla, Ali and Abid, Ali and Khan, Dawood and Alfozan, Abdulrahman and Zou, James}, + journal = {arXiv preprint arXiv:1906.02569}, + year = {2019}, +} +``` diff --git a/gradio/.dockerignore b/gradio/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..450a3af270f5d285eb3a59a03593d06078b145eb --- /dev/null +++ b/gradio/.dockerignore @@ -0,0 +1,2 @@ +templates/frontend +templates/frontend/**/* diff --git a/gradio/CHANGELOG.md b/gradio/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..48e72bae0078e504ca7e714f7711e400c32de4a7 --- /dev/null +++ b/gradio/CHANGELOG.md @@ -0,0 +1,3627 @@ +# gradio + +## 3.39.0 + +### Highlights + +#### Create Discord Bots from Gradio Apps 🤖 ([#4960](https://github.com/gradio-app/gradio/pull/4960) [`46e4ef67`](https://github.com/gradio-app/gradio/commit/46e4ef67d287dd68a91473b73172b29cbad064bc)) + +We're excited to announce that Gradio can now automatically create a discord bot from any `gr.ChatInterface` app. + +It's as easy as importing `gradio_client`, connecting to the app, and calling `deploy_discord`! + +*🦙 Turning Llama 2 70b into a discord bot 🦙* +```python +import gradio_client as grc +grc.Client("ysharma/Explore_llamav2_with_TGI").deploy_discord(to_id="llama2-70b-discord-bot") +``` + + + +#### Getting started with template spaces + +To help get you started, we have created an organization on Hugging Face called [gradio-discord-bots](https://huggingface.co/gradio-discord-bots) with template spaces you can use to turn state of the art LLMs powered by Gradio to discord bots. + +Currently we have template spaces for: + +* [Llama-2-70b-chat-hf](https://huggingface.co/spaces/gradio-discord-bots/Llama-2-70b-chat-hf) powered by a FREE Hugging Face Inference Endpoint! +* [Llama-2-13b-chat-hf](https://huggingface.co/spaces/gradio-discord-bots/Llama-2-13b-chat-hf) powered by Hugging Face Inference Endpoints. +* [Llama-2-13b-chat-hf](https://huggingface.co/spaces/gradio-discord-bots/llama-2-13b-chat-transformers) powered by Hugging Face transformers. +* [falcon-7b-instruct](https://huggingface.co/spaces/gradio-discord-bots/falcon-7b-instruct) powered by Hugging Face Inference Endpoints. +* [gpt-3.5-turbo](https://huggingface.co/spaces/gradio-discord-bots/gpt-35-turbo), powered by openai. Requires an OpenAI key. + +But once again, you can deploy ANY `gr.ChatInterface` app exposed on the internet! So don't hesitate to try it on your own Chatbots. + +❗️ Additional Note ❗️: Technically, any gradio app that exposes an api route that takes in a single string and outputs a single string can be deployed to discord. But `gr.ChatInterface` apps naturally lend themselves to discord's chat functionality so we suggest you start with those. + + Thanks [@freddyaboulton](https://github.com/freddyaboulton)! + +### Features + +- [#4995](https://github.com/gradio-app/gradio/pull/4995) [`3f8c210b`](https://github.com/gradio-app/gradio/commit/3f8c210b01ef1ceaaf8ee73be4bf246b5b745bbf) - Implement left and right click in `Gallery` component and show implicit images in `Gallery` grid. Thanks [@hannahblair](https://github.com/hannahblair)! +- [#4993](https://github.com/gradio-app/gradio/pull/4993) [`dc07a9f9`](https://github.com/gradio-app/gradio/commit/dc07a9f947de44b419d8384987a02dcf94977851) - Bringing back the "Add download button for audio" PR by [@leuryr](https://github.com/leuryr). Thanks [@abidlabs](https://github.com/abidlabs)! +- [#4979](https://github.com/gradio-app/gradio/pull/4979) [`44ac8ad0`](https://github.com/gradio-app/gradio/commit/44ac8ad08d82ea12c503dde5c78f999eb0452de2) - Allow setting sketch color default. Thanks [@aliabid94](https://github.com/aliabid94)! +- [#4985](https://github.com/gradio-app/gradio/pull/4985) [`b74f8453`](https://github.com/gradio-app/gradio/commit/b74f8453034328f0e42da8e41785f5eb039b45d7) - Adds `additional_inputs` to `gr.ChatInterface`. Thanks [@abidlabs](https://github.com/abidlabs)! + +### Fixes + +- [#4997](https://github.com/gradio-app/gradio/pull/4997) [`41c83070`](https://github.com/gradio-app/gradio/commit/41c83070b01632084e7d29123048a96c1e261407) - Add CSS resets and specifiers to play nice with HF blog. Thanks [@aliabid94](https://github.com/aliabid94)! + +## 3.38 + +### New Features: + +- Provide a parameter `animate` (`False` by default) in `gr.make_waveform()` which animates the overlayed waveform by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4918](https://github.com/gradio-app/gradio/pull/4918) +- Add `show_download_button` param to allow the download button in static Image components to be hidden by [@hannahblair](https://github.com/hannahblair) in [PR 4959](https://github.com/gradio-app/gradio/pull/4959) +- Added autofocus argument to Textbox by [@aliabid94](https://github.com/aliabid94) in [PR 4978](https://github.com/gradio-app/gradio/pull/4978) +- The `gr.ChatInterface` UI now converts the "Submit" button to a "Stop" button in ChatInterface while streaming, which can be used to pause generation. By [@abidlabs](https://github.com/abidlabs) in [PR 4971](https://github.com/gradio-app/gradio/pull/4971). +- Add a `border_color_accent_subdued` theme variable to add a subdued border color to accented items. This is used by chatbot user messages. Set the value of this variable in `Default` theme to `*primary_200`. By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4989](https://github.com/gradio-app/gradio/pull/4989) +- Add default sketch color argument `brush_color`. Also, masks drawn on images are now slightly translucent (and mask color can also be set via brush_color). By [@aliabid94](https://github.com/aliabid94) in [PR 4979](https://github.com/gradio-app/gradio/pull/4979) + +### Bug Fixes: + +- Fixes `cancels` for generators so that if a generator is canceled before it is complete, subsequent runs of the event do not continue from the previous iteration, but rather start from the beginning. By [@abidlabs](https://github.com/abidlabs) in [PR 4969](https://github.com/gradio-app/gradio/pull/4969). +- Use `gr.State` in `gr.ChatInterface` to reduce latency by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4976](https://github.com/gradio-app/gradio/pull/4976) +- Fix bug with `gr.Interface` where component labels inferred from handler parameters were including special args like `gr.Request` or `gr.EventData`. By [@cbensimon](https://github.com/cbensimon) in [PR 4956](https://github.com/gradio-app/gradio/pull/4956) + +### Breaking Changes: + +No changes to highlight. + +### Other Changes: + +- Apply pyright to the `components` directory by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4948](https://github.com/gradio-app/gradio/pull/4948) +- Improved look of ChatInterface by [@aliabid94](https://github.com/aliabid94) in [PR 4978](https://github.com/gradio-app/gradio/pull/4978) + +## 3.37 + +### New Features: + +Introducing a new `gr.ChatInterface` abstraction, which allows Gradio users to build fully functioning Chat interfaces very easily. The only required parameter is a chat function `fn`, which accepts a (string) user input `message` and a (list of lists) chat `history` and returns a (string) response. Here's a toy example: + +```py +import gradio as gr + +def echo(message, history): + return message + +demo = gr.ChatInterface(fn=echo, examples=["hello", "hola", "merhaba"], title="Echo Bot") +demo.launch() +``` + +Which produces: + +image + +And a corresponding easy-to-use API at `/chat`: + +image + + +The `gr.ChatInterface` abstraction works nicely with various LLM libraries, such as `langchain`. See the [dedicated guide](https://gradio.app/guides/creating-a-chatbot-fast) for more examples using `gr.ChatInterface`. Collective team effort in [PR 4869](https://github.com/gradio-app/gradio/pull/4869) + +- Chatbot messages now show hyperlinks to download files uploaded to `gr.Chatbot()` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4848](https://github.com/gradio-app/gradio/pull/4848) +- Cached examples now work with generators and async generators by [@abidlabs](https://github.com/abidlabs) in [PR 4927](https://github.com/gradio-app/gradio/pull/4927) +- Add RTL support to `gr.Markdown`, `gr.Chatbot`, `gr.Textbox` (via the `rtl` boolean parameter) and text-alignment to `gr.Textbox`(via the string `text_align` parameter) by [@abidlabs](https://github.com/abidlabs) in [PR 4933](https://github.com/gradio-app/gradio/pull/4933) + +Examples of usage: + +```py +with gr.Blocks() as demo: + gr.Textbox(interactive=True, text_align="right") +demo.launch() +``` + +```py +with gr.Blocks() as demo: + gr.Markdown("سلام", rtl=True) +demo.launch() +``` +- The `get_api_info` method of `Blocks` now supports layout output components [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4871](https://github.com/gradio-app/gradio/pull/4871) + +- Added the support for the new command `gradio environment`to make it easier for people to file bug reports if we shipped an easy command to list the OS, gradio version, and versions of gradio/gradio-client dependencies. bu [@varshneydevansh](https://github.com/varshneydevansh) in [PR 4915](https://github.com/gradio-app/gradio/pull/4915). + +### Bug Fixes: + +* The `.change()` event is fixed in `Video` and `Image` so that it only fires once by [@abidlabs](https://github.com/abidlabs) in [PR 4793](https://github.com/gradio-app/gradio/pull/4793) +* The `.change()` event is fixed in `Audio` so that fires when the component value is programmatically updated by [@abidlabs](https://github.com/abidlabs) in [PR 4793](https://github.com/gradio-app/gradio/pull/4793) +- Add missing `display: flex` property to `Row` so that flex styling is applied to children by [@hannahblair] in [PR 4896](https://github.com/gradio-app/gradio/pull/4896) +- Fixed bug where `gr.Video` could not preprocess urls by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4904](https://github.com/gradio-app/gradio/pull/4904) +- Fixed copy button rendering in API page on Safari by [@aliabid94](https://github.com/aliabid94) in [PR 4924](https://github.com/gradio-app/gradio/pull/4924) +- Fixed `gr.Group` and `container=False`. `container` parameter only available for `Textbox`, `Number`, and `Dropdown`, the only elements where it makes sense. By [@aliabid94](https://github.com/aliabid94) in [PR 4916](https://github.com/gradio-app/gradio/pull/4916) +- Fixed broken image link in auto-generated `app.py` from `ThemeClass.push_to_hub` by [@deepkyu](https://github.com/deepkyu) in [PR 4944](https://github.com/gradio-app/gradio/pull/4944) + +### Other Changes: + +- Warning on mobile that if a user leaves the tab, websocket connection may break. On broken connection, tries to rejoin queue and displays error conveying connection broke. By [@aliabid94](https://github.com/aliabid94) in [PR 4742](https://github.com/gradio-app/gradio/pull/4742) +- Remove blocking network calls made before the local URL gets printed - these slow down the display of the local URL, especially when no internet is available. [@aliabid94](https://github.com/aliabid94) in [PR 4905](https://github.com/gradio-app/gradio/pull/4905). +- Pinned dependencies to major versions to reduce the likelihood of a broken `gradio` due to changes in downstream dependencies by [@abidlabs](https://github.com/abidlabs) in [PR 4885](https://github.com/gradio-app/gradio/pull/4885) +- Queue `max_size` defaults to parent Blocks `max_thread` when running on Spaces with ZeroGPU hardware. By [@cbensimon](https://github.com/cbensimon) in [PR 4937](https://github.com/gradio-app/gradio/pull/4937) + +### Breaking Changes: + +Motivated by the release of `pydantic==2.0`, which included breaking changes that broke a large number of Gradio apps, we've pinned many gradio dependencies. Note that pinned dependencies can cause downstream conflicts, so this may be a breaking change. That being said, we've kept the pins pretty loose, and we're expecting change to be better for the long-term stability of Gradio apps. + +## 3.36.1 + +### New Features: + +- Hotfix to support pydantic v1 and v2 by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4835](https://github.com/gradio-app/gradio/pull/4835) + +### Bug Fixes: + +- Fix bug where `gr.File` change event was not triggered when the value was changed by another event by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4811](https://github.com/gradio-app/gradio/pull/4811) + +### Other Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +## 3.36.0 + +### New Features: + +- The `gr.Video`, `gr.Audio`, `gr.Image`, `gr.Chatbot`, and `gr.Gallery` components now include a share icon when deployed on Spaces. This behavior can be modified by setting the `show_share_button` parameter in the component classes. by [@aliabid94](https://github.com/aliabid94) in [PR 4651](https://github.com/gradio-app/gradio/pull/4651) +- Allow the web component `space`, `src`, and `host` attributes to be updated dynamically by [@pngwn](https://github.com/pngwn) in [PR 4461](https://github.com/gradio-app/gradio/pull/4461) +- Suggestion for Spaces Duplication built into Gradio, by [@aliabid94](https://github.com/aliabid94) in [PR 4458](https://github.com/gradio-app/gradio/pull/4458) +- The `api_name` parameter now accepts `False` as a value, which means it does not show up in named or unnamed endpoints. By [@abidlabs](https://github.com/aliabid94) in [PR 4683](https://github.com/gradio-app/gradio/pull/4683) +- Added support for `pathlib.Path` in `gr.Video`, `gr.Gallery`, and `gr.Chatbot` by [sunilkumardash9](https://github.com/sunilkumardash9) in [PR 4581](https://github.com/gradio-app/gradio/pull/4581). + +### Bug Fixes: + +- Updated components with `info` attribute to update when `update()` is called on them. by [@jebarpg](https://github.com/jebarpg) in [PR 4715](https://github.com/gradio-app/gradio/pull/4715). +- Ensure the `Image` components undo button works mode is `mask` or `color-sketch` by [@amyorz](https://github.com/AmyOrz) in [PR 4692](https://github.com/gradio-app/gradio/pull/4692) +- Load the iframe resizer external asset asynchronously, by [@akx](https://github.com/akx) in [PR 4336](https://github.com/gradio-app/gradio/pull/4336) +- Restored missing imports in `gr.components` by [@abidlabs](https://github.com/abidlabs) in [PR 4566](https://github.com/gradio-app/gradio/pull/4566) +- Fix bug where `select` event was not triggered in `gr.Gallery` if `height` was set to be large with `allow_preview=False` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4551](https://github.com/gradio-app/gradio/pull/4551) +- Fix bug where setting `visible=False` in `gr.Group` event did not work by [@abidlabs](https://github.com/abidlabs) in [PR 4567](https://github.com/gradio-app/gradio/pull/4567) +- Fix `make_waveform` to work with paths that contain spaces [@akx](https://github.com/akx) in [PR 4570](https://github.com/gradio-app/gradio/pull/4570) & [PR 4578](https://github.com/gradio-app/gradio/pull/4578) +- Send captured data in `stop_recording` event for `gr.Audio` and `gr.Video` components by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4554](https://github.com/gradio-app/gradio/pull/4554) +- Fix bug in `gr.Gallery` where `height` and `object_fit` parameters where being ignored by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4576](https://github.com/gradio-app/gradio/pull/4576) +- Fixes an HTML sanitization issue in DOMPurify where links in markdown were not opening in a new window by [@hannahblair] in [PR 4577](https://github.com/gradio-app/gradio/pull/4577) +- Fixed Dropdown height rendering in Columns by [@aliabid94](https://github.com/aliabid94) in [PR 4584](https://github.com/gradio-app/gradio/pull/4584) +- Fixed bug where `AnnotatedImage` css styling was causing the annotation masks to not be displayed correctly by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4628](https://github.com/gradio-app/gradio/pull/4628) +- Ensure that Gradio does not silently fail when running on a port that is occupied by [@abidlabs](https://github.com/abidlabs) in [PR 4624](https://github.com/gradio-app/gradio/pull/4624). +- Fix double upload bug that caused lag in file uploads by [@aliabid94](https://github.com/aliabid94) in [PR 4661](https://github.com/gradio-app/gradio/pull/4661) +- `Progress` component now appears even when no `iterable` is specified in `tqdm` constructor by [@itrushkin](https://github.com/itrushkin) in [PR 4475](https://github.com/gradio-app/gradio/pull/4475) +- Deprecation warnings now point at the user code using those deprecated features, instead of Gradio internals, by (https://github.com/akx) in [PR 4694](https://github.com/gradio-app/gradio/pull/4694) +- Adapt column widths in gr.Examples based on content by [@pngwn](https://github.com/pngwn) & [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4700](https://github.com/gradio-app/gradio/pull/4700) +- The `plot` parameter deprecation warnings should now only be emitted for `Image` components by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4709](https://github.com/gradio-app/gradio/pull/4709) +- Removed uncessessary `type` deprecation warning by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4709](https://github.com/gradio-app/gradio/pull/4709) +- Ensure Audio autoplays works when `autoplay=True` and the video source is dynamically updated [@pngwn](https://github.com/pngwn) in [PR 4705](https://github.com/gradio-app/gradio/pull/4705) +- When an error modal is shown in spaces, ensure we scroll to the top so it can be seen by [@pngwn](https://github.com/pngwn) in [PR 4712](https://github.com/gradio-app/gradio/pull/4712) +- Update depedencies by [@pngwn](https://github.com/pngwn) in [PR 4675](https://github.com/gradio-app/gradio/pull/4675) +- Fixes `gr.Dropdown` being cutoff at the bottom by [@abidlabs](https://github.com/abidlabs) in [PR 4691](https://github.com/gradio-app/gradio/pull/4691). +- Scroll top when clicking "View API" in spaces by [@pngwn](https://github.com/pngwn) in [PR 4714](https://github.com/gradio-app/gradio/pull/4714) +- Fix bug where `show_label` was hiding the entire component for `gr.Label` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4713](https://github.com/gradio-app/gradio/pull/4713) +- Don't crash when uploaded image has broken EXIF data, by [@akx](https://github.com/akx) in [PR 4764](https://github.com/gradio-app/gradio/pull/4764) +- Place toast messages at the top of the screen by [@pngwn](https://github.com/pngwn) in [PR 4796](https://github.com/gradio-app/gradio/pull/4796) +- Fix regressed styling of Login page when auth is enabled by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4797](https://github.com/gradio-app/gradio/pull/4797) +- Prevent broken scrolling to output on Spaces by [@aliabid94](https://github.com/aliabid94) in [PR 4822](https://github.com/gradio-app/gradio/pull/4822) + +### Other Changes: + +- Add `.git-blame-ignore-revs` by [@akx](https://github.com/akx) in [PR 4586](https://github.com/gradio-app/gradio/pull/4586) +- Update frontend dependencies in [PR 4601](https://github.com/gradio-app/gradio/pull/4601) +- Use `typing.Literal` where possible in gradio library and client by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4608](https://github.com/gradio-app/gradio/pull/4608) +- Remove unnecessary mock json files for frontend E2E tests by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4625](https://github.com/gradio-app/gradio/pull/4625) +- Update dependencies by [@pngwn](https://github.com/pngwn) in [PR 4643](https://github.com/gradio-app/gradio/pull/4643) +- The theme builder now launches successfully, and the API docs are cleaned up. By [@abidlabs](https://github.com/aliabid94) in [PR 4683](https://github.com/gradio-app/gradio/pull/4683) +- Remove `cleared_value` from some components as its no longer used internally by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4685](https://github.com/gradio-app/gradio/pull/4685) +- Better errors when you define two Blocks and reference components in one Blocks from the events in the other Blocks [@abidlabs](https://github.com/abidlabs) in [PR 4738](https://github.com/gradio-app/gradio/pull/4738). +- Better message when share link is not created by [@abidlabs](https://github.com/abidlabs) in [PR 4773](https://github.com/gradio-app/gradio/pull/4773). +- Improve accessibility around selected images in gr.Gallery component by [@hannahblair](https://github.com/hannahblair) in [PR 4790](https://github.com/gradio-app/gradio/pull/4790) + +### Breaking Changes: + +[PR 4683](https://github.com/gradio-app/gradio/pull/4683) removes the explict named endpoint "load_examples" from gr.Interface that was introduced in [PR 4456](https://github.com/gradio-app/gradio/pull/4456). + +## 3.35.2 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Fix chatbot streaming by [@aliabid94](https://github.com/aliabid94) in [PR 4537](https://github.com/gradio-app/gradio/pull/4537) +- Fix chatbot height and scrolling by [@aliabid94](https://github.com/aliabid94) in [PR 4540](https://github.com/gradio-app/gradio/pull/4540) + +### Other Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +## 3.35.1 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Fix chatbot streaming by [@aliabid94](https://github.com/aliabid94) in [PR 4537](https://github.com/gradio-app/gradio/pull/4537) +- Fix error modal position and text size by [@pngwn](https://github.com/pngwn) in [PR 4538](https://github.com/gradio-app/gradio/pull/4538). + +### Other Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +## 3.35.0 + +### New Features: + +- A `gr.ClearButton` which allows users to easily clear the values of components by [@abidlabs](https://github.com/abidlabs) in [PR 4456](https://github.com/gradio-app/gradio/pull/4456) + +Example usage: + +```py +import gradio as gr + +with gr.Blocks() as demo: + chatbot = gr.Chatbot([("Hello", "How are you?")]) + with gr.Row(): + textbox = gr.Textbox(scale=3, interactive=True) + gr.ClearButton([textbox, chatbot], scale=1) + +demo.launch() +``` + +- Min and max value for gr.Number by [@artegoser](https://github.com/artegoser) and [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3991](https://github.com/gradio-app/gradio/pull/3991) +- Add `start_recording` and `stop_recording` events to `Video` and `Audio` components by [@pngwn](https://github.com/pngwn) in [PR 4422](https://github.com/gradio-app/gradio/pull/4422) +- Allow any function to generate an error message and allow multiple messages to appear at a time. Other error modal improvements such as auto dismiss after a time limit and a new layout on mobile [@pngwn](https://github.com/pngwn) in [PR 4459](https://github.com/gradio-app/gradio/pull/4459). +- Add `autoplay` kwarg to `Video` and `Audio` components by [@pngwn](https://github.com/pngwn) in [PR 4453](https://github.com/gradio-app/gradio/pull/4453) +- Add `allow_preview` parameter to `Gallery` to control whether a detailed preview is displayed on click by +[@freddyaboulton](https://github.com/freddyaboulton) in [PR 4470](https://github.com/gradio-app/gradio/pull/4470) +- Add `latex_delimiters` parameter to `Chatbot` to control the delimiters used for LaTeX and to disable LaTeX in the `Chatbot` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4516](https://github.com/gradio-app/gradio/pull/4516) +- Can now issue `gr.Warning` and `gr.Info` modals. Simply put the code `gr.Warning("Your warning message")` or `gr.Info("Your info message")` as a standalone line in your function. By [@aliabid94](https://github.com/aliabid94) in [PR 4518](https://github.com/gradio-app/gradio/pull/4518). + +Example: +```python +def start_process(name): + gr.Info("Starting process") + if name is None: + gr.Warning("Name is empty") + ... + if success == False: + raise gr.Error("Process failed") +``` + + +### Bug Fixes: + +- Add support for PAUSED state in the JS client by [@abidlabs](https://github.com/abidlabs) in [PR 4438](https://github.com/gradio-app/gradio/pull/4438) +- Ensure Tabs only occupy the space required by [@pngwn](https://github.com/pngwn) in [PR 4419](https://github.com/gradio-app/gradio/pull/4419) +- Ensure components have the correct empty sizes to prevent empty containers from collapsing by [@pngwn](https://github.com/pngwn) in [PR 4447](https://github.com/gradio-app/gradio/pull/4447). +- Frontend code no longer crashes when there is a relative URL in an `` element, by [@akx](https://github.com/akx) in [PR 4449](https://github.com/gradio-app/gradio/pull/4449). +- Fix bug where setting `format='mp4'` on a video component would cause the function to error out if the uploaded video was not playable by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4467](https://github.com/gradio-app/gradio/pull/4467) +- Fix `_js` parameter to work even without backend function, by [@aliabid94](https://github.com/aliabid94) in [PR 4486](https://github.com/gradio-app/gradio/pull/4486). +- Fix new line issue with `gr.Chatbot()` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4491](https://github.com/gradio-app/gradio/pull/4491) +- Fixes issue with Clear button not working for `Label` component by [@abidlabs](https://github.com/abidlabs) in [PR 4456](https://github.com/gradio-app/gradio/pull/4456) +- Restores the ability to pass in a tuple (sample rate, audio array) to gr.Audio() by [@abidlabs](https://github.com/abidlabs) in [PR 4525](https://github.com/gradio-app/gradio/pull/4525) +- Ensure code is correctly formatted and copy button is always present in Chatbot by [@pngwn](https://github.com/pngwn) in [PR 4527](https://github.com/gradio-app/gradio/pull/4527) +- `show_label` will not automatically be set to `True` in `gr.BarPlot.update` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4531](https://github.com/gradio-app/gradio/pull/4531) +- `gr.BarPlot` group text now respects darkmode by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4531](https://github.com/gradio-app/gradio/pull/4531) +- Fix dispatched errors from within components [@aliabid94](https://github.com/aliabid94) in [PR 4786](https://github.com/gradio-app/gradio/pull/4786) + +### Other Changes: + +- Change styling of status and toast error components by [@hannahblair](https://github.com/hannahblair) in [PR 4454](https://github.com/gradio-app/gradio/pull/4454). +- Clean up unnecessary `new Promise()`s by [@akx](https://github.com/akx) in [PR 4442](https://github.com/gradio-app/gradio/pull/4442). +- Minor UI cleanup for Examples and Dataframe components [@aliabid94](https://github.com/aliabid94) in [PR 4455](https://github.com/gradio-app/gradio/pull/4455). +- Minor UI cleanup for Examples and Dataframe components [@aliabid94](https://github.com/aliabid94) in [PR 4455](https://github.com/gradio-app/gradio/pull/4455). +- Add Catalan translation [@jordimas](https://github.com/jordimas) in [PR 4483](https://github.com/gradio-app/gradio/pull/4483). +- The API endpoint that loads examples upon click has been given an explicit name ("/load_examples") by [@abidlabs](https://github.com/abidlabs) in [PR 4456](https://github.com/gradio-app/gradio/pull/4456). +- Allows configuration of FastAPI app when calling `mount_gradio_app`, by [@charlesfrye](https://github.com/charlesfrye) in [PR4519](https://github.com/gradio-app/gradio/pull/4519). + +### Breaking Changes: + +- The behavior of the `Clear` button has been changed for `Slider`, `CheckboxGroup`, `Radio`, `Dropdown` components by [@abidlabs](https://github.com/abidlabs) in [PR 4456](https://github.com/gradio-app/gradio/pull/4456). The Clear button now sets the value of these components to be empty as opposed to the original default set by the developer. This is to make them in line with the rest of the Gradio components. +- Python 3.7 end of life is June 27 2023. Gradio will no longer support python 3.7 by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4484](https://github.com/gradio-app/gradio/pull/4484) +- Removed `$` as a default LaTeX delimiter for the `Chatbot` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4516](https://github.com/gradio-app/gradio/pull/4516). The specific LaTeX delimeters can be set using the new `latex_delimiters` parameter in `Chatbot`. + +## 3.34.0 + +### New Features: + +- The `gr.UploadButton` component now supports the `variant` and `interactive` parameters by [@abidlabs](https://github.com/abidlabs) in [PR 4436](https://github.com/gradio-app/gradio/pull/4436). + +### Bug Fixes: + +- Remove target="\_blank" override on anchor tags with internal targets by [@hannahblair](https://github.com/hannahblair) in [PR 4405](https://github.com/gradio-app/gradio/pull/4405) +- Fixed bug where `gr.File(file_count='multiple')` could not be cached as output by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4421](https://github.com/gradio-app/gradio/pull/4421) +- Restricts the domains that can be proxied via `/proxy` route by [@abidlabs](https://github.com/abidlabs) in [PR 4406](https://github.com/gradio-app/gradio/pull/4406). +- Fixes issue where `gr.UploadButton` could not be used to upload the same file twice by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4437](https://github.com/gradio-app/gradio/pull/4437) +- Fixes bug where `/proxy` route was being incorrectly constructed by the frontend by [@abidlabs](https://github.com/abidlabs) in [PR 4430](https://github.com/gradio-app/gradio/pull/4430). +- Fix z-index of status component by [@hannahblair](https://github.com/hannahblair) in [PR 4429](https://github.com/gradio-app/gradio/pull/4429) +- Fix video rendering in Safari by [@aliabid94](https://github.com/aliabid94) in [PR 4433](https://github.com/gradio-app/gradio/pull/4433). +- The output directory for files downloaded when calling Blocks as a function is now set to a temporary directory by default (instead of the working directory in some cases) by [@abidlabs](https://github.com/abidlabs) in [PR 4501](https://github.com/gradio-app/gradio/pull/4501) + +### Other Changes: + +- When running on Spaces, handler functions will be transformed by the [PySpaces](https://pypi.org/project/spaces/) library in order to make them work with specific hardware. It will have no effect on standalone Gradio apps or regular Gradio Spaces and can be globally deactivated as follows : `import spaces; spaces.disable_gradio_auto_wrap()` by [@cbensimon](https://github.com/cbensimon) in [PR 4389](https://github.com/gradio-app/gradio/pull/4389). +- Deprecated `.style` parameter and moved arguments to constructor. Added support for `.update()` to all arguments initially in style. Added `scale` and `min_width` support to every Component. By [@aliabid94](https://github.com/aliabid94) in [PR 4374](https://github.com/gradio-app/gradio/pull/4374) + +### Breaking Changes: + +No changes to highlight. + +## 3.33.1 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Allow `every` to work with generators by [@dkjshk](https://github.com/dkjshk) in [PR 4434](https://github.com/gradio-app/gradio/pull/4434) +- Fix z-index of status component by [@hannahblair](https://github.com/hannahblair) in [PR 4429](https://github.com/gradio-app/gradio/pull/4429) +- Allow gradio to work offline, by [@aliabid94](https://github.com/aliabid94) in [PR 4398](https://github.com/gradio-app/gradio/pull/4398). +- Fixed `validate_url` to check for 403 errors and use a GET request in place of a HEAD by [@alvindaiyan](https://github.com/alvindaiyan) in [PR 4388](https://github.com/gradio-app/gradio/pull/4388). + +### Other Changes: + +- More explicit error message when share link binary is blocked by antivirus by [@abidlabs](https://github.com/abidlabs) in [PR 4380](https://github.com/gradio-app/gradio/pull/4380). + +### Breaking Changes: + +No changes to highlight. + +## 3.33.0 + +### New Features: + +- Introduced `gradio deploy` to launch a Gradio app to Spaces directly from your terminal. By [@aliabid94](https://github.com/aliabid94) in [PR 4033](https://github.com/gradio-app/gradio/pull/4033). +- Introduce `show_progress='corner'` argument to event listeners, which will not cover the output components with the progress animation, but instead show it in the corner of the components. By [@aliabid94](https://github.com/aliabid94) in [PR 4396](https://github.com/gradio-app/gradio/pull/4396). + +### Bug Fixes: + +- Fix bug where Label change event was triggering itself by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4371](https://github.com/gradio-app/gradio/pull/4371) +- Make `Blocks.load` behave like other event listeners (allows chaining `then` off of it) [@anentropic](https://github.com/anentropic/) in [PR 4304](https://github.com/gradio-app/gradio/pull/4304) +- Respect `interactive=True` in output components of a `gr.Interface` by [@abidlabs](https://github.com/abidlabs) in [PR 4356](https://github.com/gradio-app/gradio/pull/4356). +- Remove unused frontend code by [@akx](https://github.com/akx) in [PR 4275](https://github.com/gradio-app/gradio/pull/4275) +- Fixes favicon path on Windows by [@abidlabs](https://github.com/abidlabs) in [PR 4369](https://github.com/gradio-app/gradio/pull/4369). +- Prevent path traversal in `/file` routes by [@abidlabs](https://github.com/abidlabs) in [PR 4370](https://github.com/gradio-app/gradio/pull/4370). +- Do not send HF token to other domains via `/proxy` route by [@abidlabs](https://github.com/abidlabs) in [PR 4368](https://github.com/gradio-app/gradio/pull/4368). +- Replace default `markedjs` sanitize function with DOMPurify sanitizer for `gr.Chatbot()` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4360](https://github.com/gradio-app/gradio/pull/4360) +- Prevent the creation of duplicate copy buttons in the chatbot and ensure copy buttons work in non-secure contexts by [@binary-husky](https://github.com/binary-husky) in [PR 4350](https://github.com/gradio-app/gradio/pull/4350). + +### Other Changes: + +- Remove flicker of loading bar by adding opacity transition, by [@aliabid94](https://github.com/aliabid94) in [PR 4349](https://github.com/gradio-app/gradio/pull/4349). +- Performance optimization in the frontend's Blocks code by [@akx](https://github.com/akx) in [PR 4334](https://github.com/gradio-app/gradio/pull/4334) +- Upgrade the pnpm lock file format version from v6.0 to v6.1 by [@whitphx](https://github.com/whitphx) in [PR 4393](https://github.com/gradio-app/gradio/pull/4393) + +### Breaking Changes: + +- The `/file=` route no longer allows accessing dotfiles or files in "dot directories" by [@akx](https://github.com/akx) in [PR 4303](https://github.com/gradio-app/gradio/pull/4303) + +## 3.32.0 + +### New Features: + +- `Interface.launch()` and `Blocks.launch()` now accept an `app_kwargs` argument to allow customizing the configuration of the underlying FastAPI app, by [@akx](https://github.com/akx) in [PR 4282](https://github.com/gradio-app/gradio/pull/4282) + +### Bug Fixes: + +- Fixed Gallery/AnnotatedImage components not respecting GRADIO_DEFAULT_DIR variable by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4256](https://github.com/gradio-app/gradio/pull/4256) +- Fixed Gallery/AnnotatedImage components resaving identical images by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4256](https://github.com/gradio-app/gradio/pull/4256) +- Fixed Audio/Video/File components creating empty tempfiles on each run by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4256](https://github.com/gradio-app/gradio/pull/4256) +- Fixed the behavior of the `run_on_click` parameter in `gr.Examples` by [@abidlabs](https://github.com/abidlabs) in [PR 4258](https://github.com/gradio-app/gradio/pull/4258). +- Ensure error modal displays when the queue is enabled by [@pngwn](https://github.com/pngwn) in [PR 4273](https://github.com/gradio-app/gradio/pull/4273) +- Ensure js client respcts the full root when making requests to the server by [@pngwn](https://github.com/pngwn) in [PR 4271](https://github.com/gradio-app/gradio/pull/4271) + +### Other Changes: + +- Refactor web component `initial_height` attribute by [@whitphx](https://github.com/whitphx) in [PR 4223](https://github.com/gradio-app/gradio/pull/4223) +- Relocate `mount_css` fn to remove circular dependency [@whitphx](https://github.com/whitphx) in [PR 4222](https://github.com/gradio-app/gradio/pull/4222) +- Upgrade Black to 23.3 by [@akx](https://github.com/akx) in [PR 4259](https://github.com/gradio-app/gradio/pull/4259) +- Add frontend LaTeX support in `gr.Chatbot()` using `KaTeX` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4285](https://github.com/gradio-app/gradio/pull/4285). + +### Breaking Changes: + +No changes to highlight. + +## 3.31.0 + +### New Features: + +- The reloader command (`gradio app.py`) can now accept command line arguments by [@micky2be](https://github.com/micky2be) in [PR 4119](https://github.com/gradio-app/gradio/pull/4119) +- Added `format` argument to `Audio` component by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4178](https://github.com/gradio-app/gradio/pull/4178) +- Add JS client code snippets to use via api page by [@aliabd](https://github.com/aliabd) in [PR 3927](https://github.com/gradio-app/gradio/pull/3927). +- Update to the JS client by [@pngwn](https://github.com/pngwn) in [PR 4202](https://github.com/gradio-app/gradio/pull/4202) + +### Bug Fixes: + +- Fix "TypeError: issubclass() arg 1 must be a class" When use Optional[Types] by [@lingfengchencn](https://github.com/lingfengchencn) in [PR 4200](https://github.com/gradio-app/gradio/pull/4200). +- Gradio will no longer send any analytics or call home if analytics are disabled with the GRADIO_ANALYTICS_ENABLED environment variable. By [@akx](https://github.com/akx) in [PR 4194](https://github.com/gradio-app/gradio/pull/4194) and [PR 4236](https://github.com/gradio-app/gradio/pull/4236) +- The deprecation warnings for kwargs now show the actual stack level for the invocation, by [@akx](https://github.com/akx) in [PR 4203](https://github.com/gradio-app/gradio/pull/4203). +- Fix "TypeError: issubclass() arg 1 must be a class" When use Optional[Types] by [@lingfengchencn](https://github.com/lingfengchencn) in [PR 4200](https://github.com/gradio-app/gradio/pull/4200). +- Ensure cancelling functions work correctly by [@pngwn](https://github.com/pngwn) in [PR 4225](https://github.com/gradio-app/gradio/pull/4225) +- Fixes a bug with typing.get_type_hints() on Python 3.9 by [@abidlabs](https://github.com/abidlabs) in [PR 4228](https://github.com/gradio-app/gradio/pull/4228). +- Fixes JSONDecodeError by [@davidai](https://github.com/davidai) in [PR 4241](https://github.com/gradio-app/gradio/pull/4241) +- Fix `chatbot_dialogpt` demo by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4238](https://github.com/gradio-app/gradio/pull/4238). + +### Other Changes: + +- Change `gr.Chatbot()` markdown parsing to frontend using `marked` library and `prism` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4150](https://github.com/gradio-app/gradio/pull/4150) +- Update the js client by [@pngwn](https://github.com/pngwn) in [PR 3899](https://github.com/gradio-app/gradio/pull/3899) +- Fix documentation for the shape of the numpy array produced by the `Image` component by [@der3318](https://github.com/der3318) in [PR 4204](https://github.com/gradio-app/gradio/pull/4204). +- Updates the timeout for websocket messaging from 1 second to 5 seconds by [@abidlabs](https://github.com/abidlabs) in [PR 4235](https://github.com/gradio-app/gradio/pull/4235) + +### Breaking Changes: + +No changes to highlight. + +## 3.30.0 + +### New Features: + +- Adds a `root_path` parameter to `launch()` that allows running Gradio applications on subpaths (e.g. www.example.com/app) behind a proxy, by [@abidlabs](https://github.com/abidlabs) in [PR 4133](https://github.com/gradio-app/gradio/pull/4133) +- Fix dropdown change listener to trigger on change when updated as an output by [@aliabid94](https://github.com/aliabid94) in [PR 4128](https://github.com/gradio-app/gradio/pull/4128). +- Add `.input` event listener, which is only triggered when a user changes the component value (as compared to `.change`, which is also triggered when a component updates as the result of a function trigger), by [@aliabid94](https://github.com/aliabid94) in [PR 4157](https://github.com/gradio-app/gradio/pull/4157). + +### Bug Fixes: + +- Records username when flagging by [@abidlabs](https://github.com/abidlabs) in [PR 4135](https://github.com/gradio-app/gradio/pull/4135) +- Fix website build issue by [@aliabd](https://github.com/aliabd) in [PR 4142](https://github.com/gradio-app/gradio/pull/4142) +- Fix lang agnostic type info for `gr.File(file_count='multiple')` output components by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4153](https://github.com/gradio-app/gradio/pull/4153) + +### Other Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +## 3.29.0 + +### New Features: + +- Returning language agnostic types in the `/info` route by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4039](https://github.com/gradio-app/gradio/pull/4039) + +### Bug Fixes: + +- Allow users to upload audio files in Audio component on iOS by by [@aliabid94](https://github.com/aliabid94) in [PR 4071](https://github.com/gradio-app/gradio/pull/4071). +- Fixes the gradio theme builder error that appeared on launch by [@aliabid94](https://github.com/aliabid94) and [@abidlabs](https://github.com/abidlabs) in [PR 4080](https://github.com/gradio-app/gradio/pull/4080) +- Keep Accordion content in DOM by [@aliabid94](https://github.com/aliabid94) in [PR 4070](https://github.com/gradio-app/gradio/pull/4073) +- Fixed bug where type hints in functions caused the event handler to crash by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4068](https://github.com/gradio-app/gradio/pull/4068) +- Fix dropdown default value not appearing by [@aliabid94](https://github.com/aliabid94) in [PR 4072](https://github.com/gradio-app/gradio/pull/4072). +- Soft theme label color fix by [@aliabid94](https://github.com/aliabid94) in [PR 4070](https://github.com/gradio-app/gradio/pull/4070) +- Fix `gr.Slider` `release` event not triggering on mobile by [@space-nuko](https://github.com/space-nuko) in [PR 4098](https://github.com/gradio-app/gradio/pull/4098) +- Removes extraneous `State` component info from the `/info` route by [@abidlabs](https://github.com/freddyaboulton) in [PR 4107](https://github.com/gradio-app/gradio/pull/4107) +- Make .then() work even if first event fails by [@aliabid94](https://github.com/aliabid94) in [PR 4115](https://github.com/gradio-app/gradio/pull/4115). + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Allow users to submit with enter in Interfaces with textbox / number inputs [@aliabid94](https://github.com/aliabid94) in [PR 4090](https://github.com/gradio-app/gradio/pull/4090). +- Updates gradio's requirements.txt to requires uvicorn>=0.14.0 by [@abidlabs](https://github.com/abidlabs) in [PR 4086](https://github.com/gradio-app/gradio/pull/4086) +- Updates some error messaging by [@abidlabs](https://github.com/abidlabs) in [PR 4086](https://github.com/gradio-app/gradio/pull/4086) +- Renames simplified Chinese translation file from `zh-cn.json` to `zh-CN.json` by [@abidlabs](https://github.com/abidlabs) in [PR 4086](https://github.com/gradio-app/gradio/pull/4086) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.28.3 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Fixes issue with indentation in `gr.Code()` component with streaming by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4043](https://github.com/gradio-app/gradio/pull/4043) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.28.2 + +### Bug Fixes + +- Code component visual updates by [@pngwn](https://github.com/pngwn) in [PR 4051](https://github.com/gradio-app/gradio/pull/4051) + +### New Features: + +- Add support for `visual-question-answering`, `document-question-answering`, and `image-to-text` using `gr.Interface.load("models/...")` and `gr.Interface.from_pipeline` by [@osanseviero](https://github.com/osanseviero) in [PR 3887](https://github.com/gradio-app/gradio/pull/3887) +- Add code block support in `gr.Chatbot()`, by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4048](https://github.com/gradio-app/gradio/pull/4048) +- Adds the ability to blocklist filepaths (and also improves the allowlist mechanism) by [@abidlabs](https://github.com/abidlabs) in [PR 4047](https://github.com/gradio-app/gradio/pull/4047). +- Adds the ability to specify the upload directory via an environment variable by [@abidlabs](https://github.com/abidlabs) in [PR 4047](https://github.com/gradio-app/gradio/pull/4047). + +### Bug Fixes: + +- Fixes issue with `matplotlib` not rendering correctly if the backend was not set to `Agg` by [@abidlabs](https://github.com/abidlabs) in [PR 4029](https://github.com/gradio-app/gradio/pull/4029) +- Fixes bug where rendering the same `gr.State` across different Interfaces/Blocks within larger Blocks would not work by [@abidlabs](https://github.com/abidlabs) in [PR 4030](https://github.com/gradio-app/gradio/pull/4030) +- Code component visual updates by [@pngwn](https://github.com/pngwn) in [PR 4051](https://github.com/gradio-app/gradio/pull/4051) + +### Documentation Changes: + +- Adds a Guide on how to use the Python Client within a FastAPI app, by [@abidlabs](https://github.com/abidlabs) in [PR 3892](https://github.com/gradio-app/gradio/pull/3892) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +- `gr.HuggingFaceDatasetSaver` behavior changed internally. The `flagging/` folder is not a `.git/` folder anymore when using it. `organization` parameter is now ignored in favor of passing a full dataset id as `dataset_name` (e.g. `"username/my-dataset"`). +- New lines (`\n`) are not automatically converted to `
` in `gr.Markdown()` or `gr.Chatbot()`. For multiple new lines, a developer must add multiple `
` tags. + +### Full Changelog: + +- Safer version of `gr.HuggingFaceDatasetSaver` using HTTP methods instead of git pull/push by [@Wauplin](https://github.com/Wauplin) in [PR 3973](https://github.com/gradio-app/gradio/pull/3973) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.28.1 + +### New Features: + +- Add a "clear mask" button to `gr.Image` sketch modes, by [@space-nuko](https://github.com/space-nuko) in [PR 3615](https://github.com/gradio-app/gradio/pull/3615) + +### Bug Fixes: + +- Fix dropdown default value not appearing by [@aliabid94](https://github.com/aliabid94) in [PR 3996](https://github.com/gradio-app/gradio/pull/3996). +- Fix faded coloring of output textboxes in iOS / Safari by [@aliabid94](https://github.com/aliabid94) in [PR 3993](https://github.com/gradio-app/gradio/pull/3993) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +- CI: Simplified Python CI workflow by [@akx](https://github.com/akx) in [PR 3982](https://github.com/gradio-app/gradio/pull/3982) +- Upgrade pyright to 1.1.305 by [@akx](https://github.com/akx) in [PR 4042](https://github.com/gradio-app/gradio/pull/4042) +- More Ruff rules are enabled and lint errors fixed by [@akx](https://github.com/akx) in [PR 4038](https://github.com/gradio-app/gradio/pull/4038) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.28.0 + +### Bug Fixes: + +- Fix duplicate play commands in full-screen mode of 'video'. by [@tomchang25](https://github.com/tomchang25) in [PR 3968](https://github.com/gradio-app/gradio/pull/3968). +- Fix the issue of the UI stuck caused by the 'selected' of DataFrame not being reset. by [@tomchang25](https://github.com/tomchang25) in [PR 3916](https://github.com/gradio-app/gradio/pull/3916). +- Fix issue where `gr.Video()` would not work inside a `gr.Tab()` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3891](https://github.com/gradio-app/gradio/pull/3891) +- Fixed issue with old_value check in File. by [@tomchang25](https://github.com/tomchang25) in [PR 3859](https://github.com/gradio-app/gradio/pull/3859). +- Fixed bug where all bokeh plots appeared in the same div by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3896](https://github.com/gradio-app/gradio/pull/3896) +- Fixed image outputs to automatically take full output image height, unless explicitly set, by [@aliabid94](https://github.com/aliabid94) in [PR 3905](https://github.com/gradio-app/gradio/pull/3905) +- Fix issue in `gr.Gallery()` where setting height causes aspect ratio of images to collapse by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3830](https://github.com/gradio-app/gradio/pull/3830) +- Fix issue where requesting for a non-existing file would trigger a 500 error by [@micky2be](https://github.com/micky2be) in `[PR 3895](https://github.com/gradio-app/gradio/pull/3895)`. +- Fix bugs with abspath about symlinks, and unresolvable path on Windows by [@micky2be](https://github.com/micky2be) in `[PR 3895](https://github.com/gradio-app/gradio/pull/3895)`. +- Fixes type in client `Status` enum by [@10zinten](https://github.com/10zinten) in [PR 3931](https://github.com/gradio-app/gradio/pull/3931) +- Fix `gr.ChatBot` to handle image url [tye-singwa](https://github.com/tye-signwa) in [PR 3953](https://github.com/gradio-app/gradio/pull/3953) +- Move Google Tag Manager related initialization code to analytics-enabled block by [@akx](https://github.com/akx) in [PR 3956](https://github.com/gradio-app/gradio/pull/3956) +- Fix bug where port was not reused if the demo was closed and then re-launched by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3896](https://github.com/gradio-app/gradio/pull/3959) +- Fixes issue where dropdown does not position itself at selected element when opened [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3639](https://github.com/gradio-app/gradio/pull/3639) + +### Documentation Changes: + +- Make use of `gr` consistent across the docs by [@duerrsimon](https://github.com/duerrsimon) in [PR 3901](https://github.com/gradio-app/gradio/pull/3901) +- Fixed typo in theming-guide.md by [@eltociear](https://github.com/eltociear) in [PR 3952](https://github.com/gradio-app/gradio/pull/3952) + +### Testing and Infrastructure Changes: + +- CI: Python backend lint is only run once, by [@akx](https://github.com/akx) in [PR 3960](https://github.com/gradio-app/gradio/pull/3960) +- Format invocations and concatenations were replaced by f-strings where possible by [@akx](https://github.com/akx) in [PR 3984](https://github.com/gradio-app/gradio/pull/3984) +- Linting rules were made more strict and issues fixed by [@akx](https://github.com/akx) in [PR 3979](https://github.com/gradio-app/gradio/pull/3979). + +### Breaking Changes: + +- Some re-exports in `gradio.themes` utilities (introduced in 3.24.0) have been eradicated. + By [@akx](https://github.com/akx) in [PR 3958](https://github.com/gradio-app/gradio/pull/3958) + +### Full Changelog: + +- Add DESCRIPTION.md to image_segmentation demo by [@aliabd](https://github.com/aliabd) in [PR 3866](https://github.com/gradio-app/gradio/pull/3866) +- Fix error in running `gr.themes.builder()` by [@deepkyu](https://github.com/deepkyu) in [PR 3869](https://github.com/gradio-app/gradio/pull/3869) +- Fixed a JavaScript TypeError when loading custom JS with `_js` and setting `outputs` to `None` in `gradio.Blocks()` by [@DavG25](https://github.com/DavG25) in [PR 3883](https://github.com/gradio-app/gradio/pull/3883) +- Fixed bg_background_fill theme property to expand to whole background, block_radius to affect form elements as well, and added block_label_shadow theme property by [@aliabid94](https://github.com/aliabid94) in [PR 3590](https://github.com/gradio-app/gradio/pull/3590) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.27.0 + +### New Features: + +###### AnnotatedImage Component + +New AnnotatedImage component allows users to highlight regions of an image, either by providing bounding boxes, or 0-1 pixel masks. This component is useful for tasks such as image segmentation, object detection, and image captioning. + +![AnnotatedImage screenshot](https://user-images.githubusercontent.com/7870876/232142720-86e0020f-beaf-47b9-a843-689c9621f09c.gif) + +Example usage: + +```python +with gr.Blocks() as demo: + img = gr.Image() + img_section = gr.AnnotatedImage() + def mask(img): + top_left_corner = [0, 0, 20, 20] + random_mask = np.random.randint(0, 2, img.shape[:2]) + return (img, [(top_left_corner, "left corner"), (random_mask, "random")]) + img.change(mask, img, img_section) +``` + +See the [image_segmentation demo](https://github.com/gradio-app/gradio/tree/main/demo/image_segmentation) for a full example. By [@aliabid94](https://github.com/aliabid94) in [PR 3836](https://github.com/gradio-app/gradio/pull/3836) + +### Bug Fixes: + +No changes to highlight. + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.26.0 + +### New Features: + +###### `Video` component supports subtitles + +- Allow the video component to accept subtitles as input, by [@tomchang25](https://github.com/tomchang25) in [PR 3673](https://github.com/gradio-app/gradio/pull/3673). To provide subtitles, simply return a tuple consisting of `(path_to_video, path_to_subtitles)` from your function. Both `.srt` and `.vtt` formats are supported: + +```py +with gr.Blocks() as demo: + gr.Video(("video.mp4", "captions.srt")) +``` + +### Bug Fixes: + +- Fix code markdown support in `gr.Chatbot()` component by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3816](https://github.com/gradio-app/gradio/pull/3816) + +### Documentation Changes: + +- Updates the "view API" page in Gradio apps to use the `gradio_client` library by [@aliabd](https://github.com/aliabd) in [PR 3765](https://github.com/gradio-app/gradio/pull/3765) + +- Read more about how to use the `gradio_client` library here: https://gradio.app/getting-started-with-the-python-client/ + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.25.0 + +### New Features: + +- Improve error messages when number of inputs/outputs to event handlers mismatch, by [@space-nuko](https://github.com/space-nuko) in [PR 3519](https://github.com/gradio-app/gradio/pull/3519) + +- Add `select` listener to Images, allowing users to click on any part of an image and get the coordinates of the click by [@aliabid94](https://github.com/aliabid94) in [PR 3786](https://github.com/gradio-app/gradio/pull/3786). + +```python +with gr.Blocks() as demo: + img = gr.Image() + textbox = gr.Textbox() + + def select_handler(img, evt: gr.SelectData): + selected_pixel = img[evt.index[1], evt.index[0]] + return f"Selected pixel: {selected_pixel}" + + img.select(select_handler, img, textbox) +``` + +![Recording 2023-04-08 at 17 44 39](https://user-images.githubusercontent.com/7870876/230748572-90a2a8d5-116d-4769-bb53-5516555fbd0f.gif) + +### Bug Fixes: + +- Increase timeout for sending analytics data by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3647](https://github.com/gradio-app/gradio/pull/3647) +- Fix bug where http token was not accessed over websocket connections by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3735](https://github.com/gradio-app/gradio/pull/3735) +- Add ability to specify `rows`, `columns` and `object-fit` in `style()` for `gr.Gallery()` component by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3586](https://github.com/gradio-app/gradio/pull/3586) +- Fix bug where recording an audio file through the microphone resulted in a corrupted file name by [@abidlabs](https://github.com/abidlabs) in [PR 3770](https://github.com/gradio-app/gradio/pull/3770) +- Added "ssl_verify" to blocks.launch method to allow for use of self-signed certs by [@garrettsutula](https://github.com/garrettsutula) in [PR 3873](https://github.com/gradio-app/gradio/pull/3873) +- Fix bug where iterators where not being reset for processes that terminated early by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3777](https://github.com/gradio-app/gradio/pull/3777) +- Fix bug where the upload button was not properly handling the `file_count='multiple'` case by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3782](https://github.com/gradio-app/gradio/pull/3782) +- Fix bug where use Via API button was giving error by [@Devang-C](https://github.com/Devang-C) in [PR 3783](https://github.com/gradio-app/gradio/pull/3783) + +### Documentation Changes: + +- Fix invalid argument docstrings, by [@akx](https://github.com/akx) in [PR 3740](https://github.com/gradio-app/gradio/pull/3740) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Fixed IPv6 listening to work with bracket [::1] notation, by [@dsully](https://github.com/dsully) in [PR 3695](https://github.com/gradio-app/gradio/pull/3695) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.24.1 + +### New Features: + +- No changes to highlight. + +### Bug Fixes: + +- Fixes Chatbot issue where new lines were being created every time a message was sent back and forth by [@aliabid94](https://github.com/aliabid94) in [PR 3717](https://github.com/gradio-app/gradio/pull/3717). +- Fixes data updating in DataFrame invoking a `select` event once the dataframe has been selected. By [@yiyuezhuo](https://github.com/yiyuezhuo) in [PR 3861](https://github.com/gradio-app/gradio/pull/3861) +- Fixes false positive warning which is due to too strict type checking by [@yiyuezhuo](https://github.com/yiyuezhuo) in [PR 3837](https://github.com/gradio-app/gradio/pull/3837). + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.24.0 + +### New Features: + +- Trigger the release event when Slider number input is released or unfocused by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3589](https://github.com/gradio-app/gradio/pull/3589) +- Created Theme Builder, which allows users to create themes without writing any code, by [@aliabid94](https://github.com/aliabid94) in [PR 3664](https://github.com/gradio-app/gradio/pull/3664). Launch by: + + ```python + import gradio as gr + gr.themes.builder() + ``` + + ![Theme Builder](https://user-images.githubusercontent.com/7870876/228204929-d71cbba5-69c2-45b3-bd20-e3a201d98b12.png) + +- The `Dropdown` component now has a `allow_custom_value` parameter that lets users type in custom values not in the original list of choices. +- The `Colorpicker` component now has a `.blur()` event + +###### Added a download button for videos! 📥 + +![download_video](https://user-images.githubusercontent.com/41651716/227009612-9bc5fb72-2a44-4c55-9b7b-a0fa098e7f25.gif) + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3581](https://github.com/gradio-app/gradio/pull/3581). + +- Trigger the release event when Slider number input is released or unfocused by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3589](https://github.com/gradio-app/gradio/pull/3589) + +### Bug Fixes: + +- Fixed bug where text for altair plots was not legible in dark mode by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3555](https://github.com/gradio-app/gradio/pull/3555) +- Fixes `Chatbot` and `Image` components so that files passed during processing are added to a directory where they can be served from, by [@abidlabs](https://github.com/abidlabs) in [PR 3523](https://github.com/gradio-app/gradio/pull/3523) +- Use Gradio API server to send telemetry using `huggingface_hub` [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3488](https://github.com/gradio-app/gradio/pull/3488) +- Fixes an an issue where if the Blocks scope was not exited, then State could be shared across sessions, by [@abidlabs](https://github.com/abidlabs) in [PR 3600](https://github.com/gradio-app/gradio/pull/3600) +- Ensures that `gr.load()` loads and applies the upstream theme, by [@abidlabs](https://github.com/abidlabs) in [PR 3641](https://github.com/gradio-app/gradio/pull/3641) +- Fixed bug where "or" was not being localized in file upload text by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3599](https://github.com/gradio-app/gradio/pull/3599) +- Fixed bug where chatbot does not autoscroll inside of a tab, row or column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637) +- Fixed bug where textbox shrinks when `lines` set to larger than 20 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637) +- Ensure CSS has fully loaded before rendering the application, by [@pngwn](https://github.com/pngwn) in [PR 3573](https://github.com/gradio-app/gradio/pull/3573) +- Support using an empty list as `gr.Dataframe` value, by [@space-nuko](https://github.com/space-nuko) in [PR 3646](https://github.com/gradio-app/gradio/pull/3646) +- Fixed `gr.Image` not filling the entire element size, by [@space-nuko](https://github.com/space-nuko) in [PR 3649](https://github.com/gradio-app/gradio/pull/3649) +- Make `gr.Code` support the `lines` property, by [@space-nuko](https://github.com/space-nuko) in [PR 3651](https://github.com/gradio-app/gradio/pull/3651) +- Fixes certain `_js` return values being double wrapped in an array, by [@space-nuko](https://github.com/space-nuko) in [PR 3594](https://github.com/gradio-app/gradio/pull/3594) +- Correct the documentation of `gr.File` component to state that its preprocessing method converts the uploaded file to a temporary file, by @RussellLuo in [PR 3660](https://github.com/gradio-app/gradio/pull/3660) +- Fixed bug in Serializer ValueError text by [@osanseviero](https://github.com/osanseviero) in [PR 3669](https://github.com/gradio-app/gradio/pull/3669) +- Fix default parameter argument and `gr.Progress` used in same function, by [@space-nuko](https://github.com/space-nuko) in [PR 3671](https://github.com/gradio-app/gradio/pull/3671) +- Hide `Remove All` button in `gr.Dropdown` single-select mode by [@space-nuko](https://github.com/space-nuko) in [PR 3678](https://github.com/gradio-app/gradio/pull/3678) +- Fix broken spaces in docs by [@aliabd](https://github.com/aliabd) in [PR 3698](https://github.com/gradio-app/gradio/pull/3698) +- Fix items in `gr.Dropdown` besides the selected item receiving a checkmark, by [@space-nuko](https://github.com/space-nuko) in [PR 3644](https://github.com/gradio-app/gradio/pull/3644) +- Fix several `gr.Dropdown` issues and improve usability, by [@space-nuko](https://github.com/space-nuko) in [PR 3705](https://github.com/gradio-app/gradio/pull/3705) + +### Documentation Changes: + +- Makes some fixes to the Theme Guide related to naming of variables, by [@abidlabs](https://github.com/abidlabs) in [PR 3561](https://github.com/gradio-app/gradio/pull/3561) +- Documented `HuggingFaceDatasetJSONSaver` by [@osanseviero](https://github.com/osanseviero) in [PR 3604](https://github.com/gradio-app/gradio/pull/3604) +- Makes some additions to documentation of `Audio` and `State` components, and fixes the `pictionary` demo by [@abidlabs](https://github.com/abidlabs) in [PR 3611](https://github.com/gradio-app/gradio/pull/3611) +- Fix outdated sharing your app guide by [@aliabd](https://github.com/aliabd) in [PR 3699](https://github.com/gradio-app/gradio/pull/3699) + +### Testing and Infrastructure Changes: + +- Removed heavily-mocked tests related to comet_ml, wandb, and mlflow as they added a significant amount of test dependencies that prevented installation of test dependencies on Windows environments. By [@abidlabs](https://github.com/abidlabs) in [PR 3608](https://github.com/gradio-app/gradio/pull/3608) +- Added Windows continuous integration, by [@space-nuko](https://github.com/space-nuko) in [PR 3628](https://github.com/gradio-app/gradio/pull/3628) +- Switched linting from flake8 + isort to `ruff`, by [@akx](https://github.com/akx) in [PR 3710](https://github.com/gradio-app/gradio/pull/3710) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Mobile responsive iframes in themes guide by [@aliabd](https://github.com/aliabd) in [PR 3562](https://github.com/gradio-app/gradio/pull/3562) +- Remove extra $demo from theme guide by [@aliabd](https://github.com/aliabd) in [PR 3563](https://github.com/gradio-app/gradio/pull/3563) +- Set the theme name to be the upstream repo name when loading from the hub by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3595](https://github.com/gradio-app/gradio/pull/3595) +- Copy everything in website Dockerfile, fix build issues by [@aliabd](https://github.com/aliabd) in [PR 3659](https://github.com/gradio-app/gradio/pull/3659) +- Raise error when an event is queued but the queue is not configured by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3640](https://github.com/gradio-app/gradio/pull/3640) +- Allows users to apss in a string name for a built-in theme, by [@abidlabs](https://github.com/abidlabs) in [PR 3641](https://github.com/gradio-app/gradio/pull/3641) +- Added `orig_name` to Video output in the backend so that the front end can set the right name for downloaded video files by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3700](https://github.com/gradio-app/gradio/pull/3700) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.23.0 + +### New Features: + +###### Theme Sharing! + +Once you have created a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it! You can also download, reuse, and remix other peoples' themes. See https://gradio.app/theming-guide/ for more details. + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3428](https://github.com/gradio-app/gradio/pull/3428) + +### Bug Fixes: + +- Removes leading spaces from all lines of code uniformly in the `gr.Code()` component. By [@abidlabs](https://github.com/abidlabs) in [PR 3556](https://github.com/gradio-app/gradio/pull/3556) +- Fixed broken login page, by [@aliabid94](https://github.com/aliabid94) in [PR 3529](https://github.com/gradio-app/gradio/pull/3529) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Fix rendering of dropdowns to take more space, and related bugs, by [@aliabid94](https://github.com/aliabid94) in [PR 3549](https://github.com/gradio-app/gradio/pull/3549) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.22.1 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Restore label bars by [@aliabid94](https://github.com/aliabid94) in [PR 3507](https://github.com/gradio-app/gradio/pull/3507) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.22.0 + +### New Features: + +###### Official Theme release + +Gradio now supports a new theme system, which allows you to customize the look and feel of your app. You can now use the `theme=` kwarg to pass in a prebuilt theme, or customize your own! See https://gradio.app/theming-guide/ for more details. By [@aliabid94](https://github.com/aliabid94) in [PR 3470](https://github.com/gradio-app/gradio/pull/3470) and [PR 3497](https://github.com/gradio-app/gradio/pull/3497) + +###### `elem_classes` + +Add keyword argument `elem_classes` to Components to control class names of components, in the same manner as existing `elem_id`. +By [@aliabid94](https://github.com/aliabid94) in [PR 3466](https://github.com/gradio-app/gradio/pull/3466) + +### Bug Fixes: + +- Fixes the File.upload() event trigger which broke as part of the change in how we uploaded files by [@abidlabs](https://github.com/abidlabs) in [PR 3462](https://github.com/gradio-app/gradio/pull/3462) +- Fixed issue with `gr.Request` object failing to handle dictionaries when nested keys couldn't be converted to variable names [#3454](https://github.com/gradio-app/gradio/issues/3454) by [@radames](https://github.com/radames) in [PR 3459](https://github.com/gradio-app/gradio/pull/3459) +- Fixed bug where css and client api was not working properly when mounted in a subpath by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3482](https://github.com/gradio-app/gradio/pull/3482) + +### Documentation Changes: + +- Document gr.Error in the docs by [@aliabd](https://github.com/aliabd) in [PR 3465](https://github.com/gradio-app/gradio/pull/3465) + +### Testing and Infrastructure Changes: + +- Pinned `pyright==1.1.298` for stability by [@abidlabs](https://github.com/abidlabs) in [PR 3475](https://github.com/gradio-app/gradio/pull/3475) +- Removed `IOComponent.add_interactive_to_config()` by [@space-nuko](https://github.com/space-nuko) in [PR 3476](https://github.com/gradio-app/gradio/pull/3476) +- Removed `IOComponent.generate_sample()` by [@space-nuko](https://github.com/space-nuko) in [PR 3475](https://github.com/gradio-app/gradio/pull/3483) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Revert primary button background color in dark mode by [@aliabid94](https://github.com/aliabid94) in [PR 3468](https://github.com/gradio-app/gradio/pull/3468) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.21.0 + +### New Features: + +###### Theme Sharing 🎨 🤝 + +You can now share your gradio themes with the world! + +After creating a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it! + +###### Uploading + +There are two ways to upload a theme, via the theme class instance or the command line. + +1. Via the class instance + +```python +my_theme.push_to_hub(repo_name="my_theme", + version="0.2.0", + hf_token="...") +``` + +2. Via the command line + +First save the theme to disk + +```python +my_theme.dump(filename="my_theme.json") +``` + +Then use the `upload_theme` command: + +```bash +upload_theme\ +"my_theme.json"\ +"my_theme"\ +"0.2.0"\ +"" +``` + +The `version` must be a valid [semantic version](https://www.geeksforgeeks.org/introduction-semantic-versioning/) string. + +This creates a space on the huggingface hub to host the theme files and show potential users a preview of your theme. + +An example theme space is here: https://huggingface.co/spaces/freddyaboulton/dracula_revamped + +###### Downloading + +To use a theme from the hub, use the `from_hub` method on the `ThemeClass` and pass it to your app: + +```python +my_theme = gr.Theme.from_hub("freddyaboulton/my_theme") + +with gr.Blocks(theme=my_theme) as demo: + .... +``` + +You can also pass the theme string directly to `Blocks` or `Interface` (`gr.Blocks(theme="freddyaboulton/my_theme")`) + +You can pin your app to an upstream theme version by using semantic versioning expressions. + +For example, the following would ensure the theme we load from the `my_theme` repo was between versions `0.1.0` and `0.2.0`: + +```python +with gr.Blocks(theme="freddyaboulton/my_theme@>=0.1.0,<0.2.0") as demo: + .... +``` + +by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3428](https://github.com/gradio-app/gradio/pull/3428) + +###### Code component 🦾 + +New code component allows you to enter, edit and display code with full syntax highlighting by [@pngwn](https://github.com/pngwn) in [PR 3421](https://github.com/gradio-app/gradio/pull/3421) + +###### The `Chatbot` component now supports audio, video, and images + +The `Chatbot` component now supports audio, video, and images with a simple syntax: simply +pass in a tuple with the URL or filepath (the second optional element of the tuple is alt text), and the image/audio/video will be displayed: + +```python +gr.Chatbot([ + (("driving.mp4",), "cool video"), + (("cantina.wav",), "cool audio"), + (("lion.jpg", "A lion"), "cool pic"), +]).style(height=800) +``` + +image + +Note: images were previously supported via Markdown syntax and that is still supported for backwards compatibility. By [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3413](https://github.com/gradio-app/gradio/pull/3413) + +- Allow consecutive function triggers with `.then` and `.success` by [@aliabid94](https://github.com/aliabid94) in [PR 3430](https://github.com/gradio-app/gradio/pull/3430) + +- New code component allows you to enter, edit and display code with full syntax highlighting by [@pngwn](https://github.com/pngwn) in [PR 3421](https://github.com/gradio-app/gradio/pull/3421) + +![](https://user-images.githubusercontent.com/12937446/224116643-5cfb94b3-93ce-43ee-bb7b-c25c3b66e0a1.png) + +- Added the `.select()` event listener, which also includes event data that can be passed as an argument to a function with type hint `gr.SelectData`. The following components support the `.select()` event listener: Chatbot, CheckboxGroup, Dataframe, Dropdown, File, Gallery, HighlightedText, Label, Radio, TabItem, Tab, Textbox. Example usage: + +```python +import gradio as gr + +with gr.Blocks() as demo: + gallery = gr.Gallery(["images/1.jpg", "images/2.jpg", "images/3.jpg"]) + selected_index = gr.Textbox() + + def on_select(evt: gr.SelectData): + return evt.index + + gallery.select(on_select, None, selected_index) +``` + +By [@aliabid94](https://github.com/aliabid94) in [PR 3399](https://github.com/gradio-app/gradio/pull/3399) + +- The `Textbox` component now includes a copy button by [@abidlabs](https://github.com/abidlabs) in [PR 3452](https://github.com/gradio-app/gradio/pull/3452) + +### Bug Fixes: + +- Use `huggingface_hub` to send telemetry on `interface` and `blocks`; eventually to replace segment by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3342](https://github.com/gradio-app/gradio/pull/3342) +- Ensure load events created by components (randomize for slider, callable values) are never queued unless every is passed by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3391](https://github.com/gradio-app/gradio/pull/3391) +- Prevent in-place updates of `generic_update` by shallow copying by [@gitgithan](https://github.com/gitgithan) in [PR 3405](https://github.com/gradio-app/gradio/pull/3405) to fix [#3282](https://github.com/gradio-app/gradio/issues/3282) +- Fix bug caused by not importing `BlockContext` in `utils.py` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3424](https://github.com/gradio-app/gradio/pull/3424) +- Ensure dropdown does not highlight partial matches by [@pngwn](https://github.com/pngwn) in [PR 3421](https://github.com/gradio-app/gradio/pull/3421) +- Fix mic button display by [@aliabid94](https://github.com/aliabid94) in [PR 3456](https://github.com/gradio-app/gradio/pull/3456) + +### Documentation Changes: + +- Added a section on security and access when sharing Gradio apps by [@abidlabs](https://github.com/abidlabs) in [PR 3408](https://github.com/gradio-app/gradio/pull/3408) +- Add Chinese README by [@uanu2002](https://github.com/uanu2002) in [PR 3394](https://github.com/gradio-app/gradio/pull/3394) +- Adds documentation for web components by [@abidlabs](https://github.com/abidlabs) in [PR 3407](https://github.com/gradio-app/gradio/pull/3407) +- Fixed link in Chinese readme by [@eltociear](https://github.com/eltociear) in [PR 3417](https://github.com/gradio-app/gradio/pull/3417) +- Document Blocks methods by [@aliabd](https://github.com/aliabd) in [PR 3427](https://github.com/gradio-app/gradio/pull/3427) +- Fixed bug where event handlers were not showing up in documentation by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3434](https://github.com/gradio-app/gradio/pull/3434) + +### Testing and Infrastructure Changes: + +- Fixes tests that were failing locally but passing on CI by [@abidlabs](https://github.com/abidlabs) in [PR 3411](https://github.com/gradio-app/gradio/pull/3411) +- Remove codecov from the repo by [@aliabd](https://github.com/aliabd) in [PR 3415](https://github.com/gradio-app/gradio/pull/3415) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Prevent in-place updates of `generic_update` by shallow copying by [@gitgithan](https://github.com/gitgithan) in [PR 3405](https://github.com/gradio-app/gradio/pull/3405) to fix [#3282](https://github.com/gradio-app/gradio/issues/3282) +- Persist file names of files uploaded through any Gradio component by [@abidlabs](https://github.com/abidlabs) in [PR 3412](https://github.com/gradio-app/gradio/pull/3412) +- Fix markdown embedded component in docs by [@aliabd](https://github.com/aliabd) in [PR 3410](https://github.com/gradio-app/gradio/pull/3410) +- Clean up event listeners code by [@aliabid94](https://github.com/aliabid94) in [PR 3420](https://github.com/gradio-app/gradio/pull/3420) +- Fix css issue with spaces logo by [@aliabd](https://github.com/aliabd) in [PR 3422](https://github.com/gradio-app/gradio/pull/3422) +- Makes a few fixes to the `JSON` component (show_label parameter, icons) in [@abidlabs](https://github.com/abidlabs) in [PR 3451](https://github.com/gradio-app/gradio/pull/3451) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.20.1 + +### New Features: + +- Add `height` kwarg to style in `gr.Chatbot()` component by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3369](https://github.com/gradio-app/gradio/pull/3369) + +```python +chatbot = gr.Chatbot().style(height=500) +``` + +### Bug Fixes: + +- Ensure uploaded images are always shown in the sketch tool by [@pngwn](https://github.com/pngwn) in [PR 3386](https://github.com/gradio-app/gradio/pull/3386) +- Fixes bug where when if fn is a non-static class member, then self should be ignored as the first param of the fn by [@or25](https://github.com/or25) in [PR #3227](https://github.com/gradio-app/gradio/pull/3227) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.20.0 + +### New Features: + +###### Release event for Slider + +Now you can trigger your python function to run when the slider is released as opposed to every slider change value! + +Simply use the `release` method on the slider + +```python +slider.release(function, inputs=[...], outputs=[...], api_name="predict") +``` + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3353](https://github.com/gradio-app/gradio/pull/3353) + +###### Dropdown Component Updates + +The standard dropdown component now supports searching for choices. Also when `multiselect` is `True`, you can specify `max_choices` to set the maximum number of choices you want the user to be able to select from the dropdown component. + +```python +gr.Dropdown(label="Choose your favorite colors", choices=["red", "blue", "green", "yellow", "orange"], multiselect=True, max_choices=2) +``` + +by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3211](https://github.com/gradio-app/gradio/pull/3211) + +###### Download button for images 🖼️ + +Output images will now automatically have a download button displayed to make it easier to save and share +the results of Machine Learning art models. + +![download_sketch](https://user-images.githubusercontent.com/41651716/221025113-e693bf41-eabd-42b3-a4f2-26f2708d98fe.gif) + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3297](https://github.com/gradio-app/gradio/pull/3297) + +- Updated image upload component to accept all image formats, including lossless formats like .webp by [@fienestar](https://github.com/fienestar) in [PR 3225](https://github.com/gradio-app/gradio/pull/3225) +- Adds a disabled mode to the `gr.Button` component by setting `interactive=False` by [@abidlabs](https://github.com/abidlabs) in [PR 3266](https://github.com/gradio-app/gradio/pull/3266) and [PR 3288](https://github.com/gradio-app/gradio/pull/3288) +- Adds visual feedback to the when the Flag button is clicked, by [@abidlabs](https://github.com/abidlabs) in [PR 3289](https://github.com/gradio-app/gradio/pull/3289) +- Adds ability to set `flagging_options` display text and saved flag separately by [@abidlabs](https://github.com/abidlabs) in [PR 3289](https://github.com/gradio-app/gradio/pull/3289) +- Allow the setting of `brush_radius` for the `Image` component both as a default and via `Image.update()` by [@pngwn](https://github.com/pngwn) in [PR 3277](https://github.com/gradio-app/gradio/pull/3277) +- Added `info=` argument to form components to enable extra context provided to users, by [@aliabid94](https://github.com/aliabid94) in [PR 3291](https://github.com/gradio-app/gradio/pull/3291) +- Allow developers to access the username of a logged-in user from the `gr.Request()` object using the `.username` attribute by [@abidlabs](https://github.com/abidlabs) in [PR 3296](https://github.com/gradio-app/gradio/pull/3296) +- Add `preview` option to `Gallery.style` that launches the gallery in preview mode when first loaded by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3345](https://github.com/gradio-app/gradio/pull/3345) + +### Bug Fixes: + +- Ensure `mirror_webcam` is always respected by [@pngwn](https://github.com/pngwn) in [PR 3245](https://github.com/gradio-app/gradio/pull/3245) +- Fix issue where updated markdown links were not being opened in a new tab by [@gante](https://github.com/gante) in [PR 3236](https://github.com/gradio-app/gradio/pull/3236) +- API Docs Fixes by [@aliabd](https://github.com/aliabd) in [PR 3287](https://github.com/gradio-app/gradio/pull/3287) +- Added a timeout to queue messages as some demos were experiencing infinitely growing queues from active jobs waiting forever for clients to respond by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3196](https://github.com/gradio-app/gradio/pull/3196) +- Fixes the height of rendered LaTeX images so that they match the height of surrounding text by [@abidlabs](https://github.com/abidlabs) in [PR 3258](https://github.com/gradio-app/gradio/pull/3258) and in [PR 3276](https://github.com/gradio-app/gradio/pull/3276) +- Fix bug where matplotlib images where always too small on the front end by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3274](https://github.com/gradio-app/gradio/pull/3274) +- Remove embed's `initial_height` when loading is complete so the embed finds its natural height once it is loaded [@pngwn](https://github.com/pngwn) in [PR 3292](https://github.com/gradio-app/gradio/pull/3292) +- Prevent Sketch from crashing when a default image is provided by [@pngwn](https://github.com/pngwn) in [PR 3277](https://github.com/gradio-app/gradio/pull/3277) +- Respect the `shape` argument on the front end when creating Image Sketches by [@pngwn](https://github.com/pngwn) in [PR 3277](https://github.com/gradio-app/gradio/pull/3277) +- Fix infinite loop caused by setting `Dropdown's` value to be `[]` and adding a change event on the dropdown by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3295](https://github.com/gradio-app/gradio/pull/3295) +- Fix change event listed twice in image docs by [@aliabd](https://github.com/aliabd) in [PR 3318](https://github.com/gradio-app/gradio/pull/3318) +- Fix bug that cause UI to be vertically centered at all times by [@pngwn](https://github.com/pngwn) in [PR 3336](https://github.com/gradio-app/gradio/pull/3336) +- Fix bug where `height` set in `Gallery.style` was not respected by the front-end by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3343](https://github.com/gradio-app/gradio/pull/3343) +- Ensure markdown lists are rendered correctly by [@pngwn](https://github.com/pngwn) in [PR 3341](https://github.com/gradio-app/gradio/pull/3341) +- Ensure that the initial empty value for `gr.Dropdown(Multiselect=True)` is an empty list and the initial value for `gr.Dropdown(Multiselect=False)` is an empty string by [@pngwn](https://github.com/pngwn) in [PR 3338](https://github.com/gradio-app/gradio/pull/3338) +- Ensure uploaded images respect the shape property when the canvas is also enabled by [@pngwn](https://github.com/pngwn) in [PR 3351](https://github.com/gradio-app/gradio/pull/3351) +- Ensure that Google Analytics works correctly when gradio apps are created with `analytics_enabled=True` by [@abidlabs](https://github.com/abidlabs) in [PR 3349](https://github.com/gradio-app/gradio/pull/3349) +- Fix bug where files were being re-uploaded after updates by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3375](https://github.com/gradio-app/gradio/pull/3375) +- Fix error when using backen_fn and custom js at the same time by [@jialeicui](https://github.com/jialeicui) in [PR 3358](https://github.com/gradio-app/gradio/pull/3358) +- Support new embeds for huggingface spaces subdomains by [@pngwn](https://github.com/pngwn) in [PR 3367](https://github.com/gradio-app/gradio/pull/3367) + +### Documentation Changes: + +- Added the `types` field to the dependency field in the config by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3315](https://github.com/gradio-app/gradio/pull/3315) +- Gradio Status Page by [@aliabd](https://github.com/aliabd) in [PR 3331](https://github.com/gradio-app/gradio/pull/3331) +- Adds a Guide on setting up a dashboard from Supabase data using the `gr.BarPlot` + component by [@abidlabs](https://github.com/abidlabs) in [PR 3275](https://github.com/gradio-app/gradio/pull/3275) + +### Testing and Infrastructure Changes: + +- Adds a script to benchmark the performance of the queue and adds some instructions on how to use it. By [@freddyaboulton](https://github.com/freddyaboulton) and [@abidlabs](https://github.com/abidlabs) in [PR 3272](https://github.com/gradio-app/gradio/pull/3272) +- Flaky python tests no longer cancel non-flaky tests by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3344](https://github.com/gradio-app/gradio/pull/3344) + +### Breaking Changes: + +- Chatbot bubble colors can no longer be set by `chatbot.style(color_map=)` by [@aliabid94] in [PR 3370](https://github.com/gradio-app/gradio/pull/3370) + +### Full Changelog: + +- Fixed comment typo in components.py by [@eltociear](https://github.com/eltociear) in [PR 3235](https://github.com/gradio-app/gradio/pull/3235) +- Cleaned up chatbot ui look and feel by [@aliabid94] in [PR 3370](https://github.com/gradio-app/gradio/pull/3370) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.19.1 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- UI fixes including footer and API docs by [@aliabid94](https://github.com/aliabid94) in [PR 3242](https://github.com/gradio-app/gradio/pull/3242) +- Updated image upload component to accept all image formats, including lossless formats like .webp by [@fienestar](https://github.com/fienestar) in [PR 3225](https://github.com/gradio-app/gradio/pull/3225) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Added backend support for themes by [@aliabid94](https://github.com/aliabid94) in [PR 2931](https://github.com/gradio-app/gradio/pull/2931) +- Added support for button sizes "lg" (default) and "sm". + +### Contributors Shoutout: + +No changes to highlight. + +## 3.19.0 + +### New Features: + +###### Improved embedding experience + +When embedding a spaces-hosted gradio app as a web component, you now get an improved UI linking back to the original space, better error handling and more intelligent load performance. No changes are required to your code to benefit from this enhanced experience; simply upgrade your gradio SDK to the latest version. + +![](https://user-images.githubusercontent.com/12937446/219653294-86937632-72c1-4e93-a77c-af705d49382a.png) + +This behaviour is configurable. You can disable the info panel at the bottom by passing `info="false"`. You can disable the container entirely by passing `container="false"`. + +Error statuses are reported in the UI with an easy way for end-users to report problems to the original space author via the community tab of that Hugginface space: + +![](https://user-images.githubusercontent.com/12937446/219655499-88019443-d694-44e7-9e6d-242e19d10a5c.png) + +By default, gradio apps are lazy loaded, vastly improving performance when there are several demos on the page. Metadata is loaded ahead of time, but the space will only be loaded and rendered when it is in view. + +This behaviour is configurable. You can pass `eager="true"` to load and render the space regardless of whether or not it is currently on the screen. + +by [@pngwn](https://github.com/pngwn) in [PR 3205](https://github.com/gradio-app/gradio/pull/3205) + +###### New `gr.BarPlot` component! 📊 + +Create interactive bar plots from a high-level interface with `gr.BarPlot`. +No need to remember matplotlib syntax anymore! + +Example usage: + +```python +import gradio as gr +import pandas as pd + +simple = pd.DataFrame({ + 'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'], + 'b': [28, 55, 43, 91, 81, 53, 19, 87, 52] +}) + +with gr.Blocks() as demo: + gr.BarPlot( + simple, + x="a", + y="b", + title="Simple Bar Plot with made up data", + tooltip=['a', 'b'], + ) + +demo.launch() +``` + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3157](https://github.com/gradio-app/gradio/pull/3157) + +###### Bokeh plots are back! 🌠 + +Fixed a bug that prevented bokeh plots from being displayed on the front end and extended support for both 2.x and 3.x versions of bokeh! + +![image](https://user-images.githubusercontent.com/41651716/219468324-0d82e07f-8fb4-4ff9-b40c-8250b29e45f7.png) + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3212](https://github.com/gradio-app/gradio/pull/3212) + +### Bug Fixes: + +- Adds ability to add a single message from the bot or user side. Ex: specify `None` as the second value in the tuple, to add a single message in the chatbot from the "bot" side. + +```python +gr.Chatbot([("Hi, I'm DialoGPT. Try asking me a question.", None)]) +``` + +By [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3165](https://github.com/gradio-app/gradio/pull/3165) + +- Fixes `gr.utils.delete_none` to only remove props whose values are `None` from the config by [@abidlabs](https://github.com/abidlabs) in [PR 3188](https://github.com/gradio-app/gradio/pull/3188) +- Fix bug where embedded demos were not loading files properly by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3177](https://github.com/gradio-app/gradio/pull/3177) +- The `change` event is now triggered when users click the 'Clear All' button of the multiselect DropDown component by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3195](https://github.com/gradio-app/gradio/pull/3195) +- Stops File component from freezing when a large file is uploaded by [@aliabid94](https://github.com/aliabid94) in [PR 3191](https://github.com/gradio-app/gradio/pull/3191) +- Support Chinese pinyin in Dataframe by [@aliabid94](https://github.com/aliabid94) in [PR 3206](https://github.com/gradio-app/gradio/pull/3206) +- The `clear` event is now triggered when images are cleared by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3218](https://github.com/gradio-app/gradio/pull/3218) +- Fix bug where auth cookies where not sent when connecting to an app via http by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3223](https://github.com/gradio-app/gradio/pull/3223) +- Ensure latext CSS is always applied in light and dark mode by [@pngwn](https://github.com/pngwn) in [PR 3233](https://github.com/gradio-app/gradio/pull/3233) + +### Documentation Changes: + +- Sort components in docs by alphabetic order by [@aliabd](https://github.com/aliabd) in [PR 3152](https://github.com/gradio-app/gradio/pull/3152) +- Changes to W&B guide by [@scottire](https://github.com/scottire) in [PR 3153](https://github.com/gradio-app/gradio/pull/3153) +- Keep pnginfo metadata for gallery by [@wfng92](https://github.com/wfng92) in [PR 3150](https://github.com/gradio-app/gradio/pull/3150) +- Add a section on how to run a Gradio app locally [@osanseviero](https://github.com/osanseviero) in [PR 3170](https://github.com/gradio-app/gradio/pull/3170) +- Fixed typos in gradio events function documentation by [@vidalmaxime](https://github.com/vidalmaxime) in [PR 3168](https://github.com/gradio-app/gradio/pull/3168) +- Added an example using Gradio's batch mode with the diffusers library by [@abidlabs](https://github.com/abidlabs) in [PR 3224](https://github.com/gradio-app/gradio/pull/3224) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Fix demos page css and add close demos button by [@aliabd](https://github.com/aliabd) in [PR 3151](https://github.com/gradio-app/gradio/pull/3151) +- Caches temp files from base64 input data by giving them a deterministic path based on the contents of data by [@abidlabs](https://github.com/abidlabs) in [PR 3197](https://github.com/gradio-app/gradio/pull/3197) +- Better warnings (when there is a mismatch between the number of output components and values returned by a function, or when the `File` component or `UploadButton` component includes a `file_types` parameter along with `file_count=="dir"`) by [@abidlabs](https://github.com/abidlabs) in [PR 3194](https://github.com/gradio-app/gradio/pull/3194) +- Raises a `gr.Error` instead of a regular Python error when you use `gr.Interface.load()` to load a model and there's an error querying the HF API by [@abidlabs](https://github.com/abidlabs) in [PR 3194](https://github.com/gradio-app/gradio/pull/3194) +- Fixed gradio share links so that they are persistent and do not reset if network + connection is disrupted by by [XciD](https://github.com/XciD), [Wauplin](https://github.com/Wauplin), and [@abidlabs](https://github.com/abidlabs) in [PR 3149](https://github.com/gradio-app/gradio/pull/3149) and a follow-up to allow it to work for users upgrading from a previous Gradio version in [PR 3221](https://github.com/gradio-app/gradio/pull/3221) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.18.0 + +### New Features: + +###### Revamped Stop Button for Interfaces 🛑 + +If your Interface function is a generator, there used to be a separate `Stop` button displayed next +to the `Submit` button. + +We've revamed the `Submit` button so that it turns into a `Stop` button during the generation process. +Clicking on the `Stop` button will cancel the generation and turn it back to a `Submit` button. +The `Stop` button will automatically turn back to a `Submit` button at the end of the generation if you don't use it! + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3124](https://github.com/gradio-app/gradio/pull/3124) + +###### Queue now works with reload mode! + +You can now call `queue` on your `demo` outside of the `if __name__ == "__main__"` block and +run the script in reload mode with the `gradio` command. + +Any changes to the `app.py` file will be reflected in the webpage automatically and the queue will work +properly! + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3089](https://github.com/gradio-app/gradio/pull/3089) + +###### Allow serving files from additional directories + +```python +demo = gr.Interface(...) +demo.launch( + file_directories=["/var/lib/demo/path/to/resources"] +) +``` + +By [@maxaudron](https://github.com/maxaudron) in [PR 3075](https://github.com/gradio-app/gradio/pull/3075) + +### Bug Fixes: + +- Fixes URL resolution on Windows by [@abidlabs](https://github.com/abidlabs) in [PR 3108](https://github.com/gradio-app/gradio/pull/3108) +- Example caching now works with components without a label attribute (e.g. `Column`) by [@abidlabs](https://github.com/abidlabs) in [PR 3123](https://github.com/gradio-app/gradio/pull/3123) +- Ensure the Video component correctly resets the UI state when a new video source is loaded and reduce choppiness of UI by [@pngwn](https://github.com/abidlabs) in [PR 3117](https://github.com/gradio-app/gradio/pull/3117) +- Fixes loading private Spaces by [@abidlabs](https://github.com/abidlabs) in [PR 3068](https://github.com/gradio-app/gradio/pull/3068) +- Added a warning when attempting to launch an `Interface` via the `%%blocks` jupyter notebook magic command by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3126](https://github.com/gradio-app/gradio/pull/3126) +- Fixes bug where interactive output image cannot be set when in edit mode by [@dawoodkhan82](https://github.com/@dawoodkhan82) in [PR 3135](https://github.com/gradio-app/gradio/pull/3135) +- A share link will automatically be created when running on Sagemaker notebooks so that the front-end is properly displayed by [@abidlabs](https://github.com/abidlabs) in [PR 3137](https://github.com/gradio-app/gradio/pull/3137) +- Fixes a few dropdown component issues; hide checkmark next to options as expected, and keyboard hover is visible by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3145]https://github.com/gradio-app/gradio/pull/3145) +- Fixed bug where example pagination buttons were not visible in dark mode or displayed under the examples table. By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3144](https://github.com/gradio-app/gradio/pull/3144) +- Fixed bug where the font color of axis labels and titles for native plots did not respond to dark mode preferences. By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3146](https://github.com/gradio-app/gradio/pull/3146) + +### Documentation Changes: + +- Added a guide on the 4 kinds of Gradio Interfaces by [@yvrjsharma](https://github.com/yvrjsharma) and [@abidlabs](https://github.com/abidlabs) in [PR 3003](https://github.com/gradio-app/gradio/pull/3003) +- Explained that the parameters in `launch` will not be respected when using reload mode, e.g. `gradio` command by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3089](https://github.com/gradio-app/gradio/pull/3089) +- Added a demo to show how to set up variable numbers of outputs in Gradio by [@abidlabs](https://github.com/abidlabs) in [PR 3127](https://github.com/gradio-app/gradio/pull/3127) +- Updated docs to reflect that the `equal_height` parameter should be passed to the `.style()` method of `gr.Row()` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3125](https://github.com/gradio-app/gradio/pull/3125) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Changed URL of final image for `fake_diffusion` demos by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3120](https://github.com/gradio-app/gradio/pull/3120) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.17.1 + +### New Features: + +###### iOS image rotation fixed 🔄 + +Previously photos uploaded via iOS would be rotated after processing. This has been fixed by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3089](https://github.com/gradio-app/gradio/pull/3091) + +######### Before + +![image](https://user-images.githubusercontent.com/41651716/215846507-a36e9d05-1ac2-4867-8ab3-ce045a9415d9.png) + +######### After + +![image](https://user-images.githubusercontent.com/41651716/215846554-e41773ed-70f0-491a-9952-6a18babf91ef.png) + +###### Run on Kaggle kernels 🧪 + +A share link will automatically be created when running on Kaggle kernels (notebooks) so that the front-end is properly displayed. + +![image](https://user-images.githubusercontent.com/41651716/216104254-2cf55599-449c-436c-b57e-40f6a83f9eee.png) + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3101](https://github.com/gradio-app/gradio/pull/3101) + +### Bug Fixes: + +- Fix bug where examples were not rendered correctly for demos created with Blocks api that had multiple input compinents by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3090](https://github.com/gradio-app/gradio/pull/3090) +- Fix change event listener for JSON, HighlightedText, Chatbot by [@aliabid94](https://github.com/aliabid94) in [PR 3095](https://github.com/gradio-app/gradio/pull/3095) +- Fixes bug where video and file change event not working [@tomchang25](https://github.com/tomchang25) in [PR 3098](https://github.com/gradio-app/gradio/pull/3098) +- Fixes bug where static_video play and pause event not working [@tomchang25](https://github.com/tomchang25) in [PR 3098](https://github.com/gradio-app/gradio/pull/3098) +- Fixed `Gallery.style(grid=...)` by by [@aliabd](https://github.com/aliabd) in [PR 3107](https://github.com/gradio-app/gradio/pull/3107) + +### Documentation Changes: + +- Update chatbot guide to include blocks demo and markdown support section by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3023](https://github.com/gradio-app/gradio/pull/3023) + +* Fix a broken link in the Quick Start guide, by [@cakiki](https://github.com/cakiki) in [PR 3109](https://github.com/gradio-app/gradio/pull/3109) +* Better docs navigation on mobile by [@aliabd](https://github.com/aliabd) in [PR 3112](https://github.com/gradio-app/gradio/pull/3112) +* Add a guide on using Gradio with [Comet](https://comet.com/), by [@DN6](https://github.com/DN6/) in [PR 3058](https://github.com/gradio-app/gradio/pull/3058) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Set minimum `markdown-it-py` version to `2.0.0` so that the dollar math plugin is compatible by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3102](https://github.com/gradio-app/gradio/pull/3102) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.17.0 + +### New Features: + +###### Extended support for Interface.load! 🏗️ + +You can now load `image-to-text` and `conversational` pipelines from the hub! + +###### Image-to-text Demo + +```python +io = gr.Interface.load("models/nlpconnect/vit-gpt2-image-captioning", + api_key="") +io.launch() +``` + +image + +###### conversational Demo + +```python +chatbot = gr.Interface.load("models/microsoft/DialoGPT-medium", + api_key="") +chatbot.launch() +``` + +![chatbot_load](https://user-images.githubusercontent.com/41651716/213260220-3eaa25b7-a38b-48c6-adeb-2718bdf297a2.gif) + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3011](https://github.com/gradio-app/gradio/pull/3011) + +###### Download Button added to Model3D Output Component 📥 + +No need for an additional file output component to enable model3d file downloads anymore. We now added a download button to the model3d component itself. + +Screenshot 2023-01-18 at 3 52 45 PM + +By [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3014](https://github.com/gradio-app/gradio/pull/3014) + +###### Fixing Auth on Spaces 🔑 + +Authentication on spaces works now! Third party cookies must be enabled on your browser to be able +to log in. Some browsers disable third party cookies by default (Safari, Chrome Incognito). + +![auth_spaces](https://user-images.githubusercontent.com/41651716/215528417-09538933-0576-4d1d-b3b9-1e877ab01905.gif) + +### Bug Fixes: + +- Fixes bug where interpretation event was not configured correctly by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2993](https://github.com/gradio-app/gradio/pull/2993) +- Fix relative import bug in reload mode by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2992](https://github.com/gradio-app/gradio/pull/2992) +- Fixes bug where png files were not being recognized when uploading images by [@abidlabs](https://github.com/abidlabs) in [PR 3002](https://github.com/gradio-app/gradio/pull/3002) +- Fixes bug where external Spaces could not be loaded and used as functions if they returned files by [@abidlabs](https://github.com/abidlabs) in [PR 3004](https://github.com/gradio-app/gradio/pull/3004) +- Fix bug where file serialization output was not JSON serializable by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2999](https://github.com/gradio-app/gradio/pull/2999) +- Fixes bug where png files were not being recognized when uploading images by [@abidlabs](https://github.com/abidlabs) in [PR 3002](https://github.com/gradio-app/gradio/pull/3002) +- Fixes bug where temporary uploaded files were not being added to temp sets by [@abidlabs](https://github.com/abidlabs) in [PR 3005](https://github.com/gradio-app/gradio/pull/3005) +- Fixes issue where markdown support in chatbot breaks older demos [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3006](https://github.com/gradio-app/gradio/pull/3006) +- Fixes the `/file/` route that was broken in a recent change in [PR 3010](https://github.com/gradio-app/gradio/pull/3010) +- Fix bug where the Image component could not serialize image urls by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2957](https://github.com/gradio-app/gradio/pull/2957) +- Fix forwarding for guides after SEO renaming by [@aliabd](https://github.com/aliabd) in [PR 3017](https://github.com/gradio-app/gradio/pull/3017) +- Switch all pages on the website to use latest stable gradio by [@aliabd](https://github.com/aliabd) in [PR 3016](https://github.com/gradio-app/gradio/pull/3016) +- Fix bug related to deprecated parameters in `huggingface_hub` for the HuggingFaceDatasetSaver in [PR 3025](https://github.com/gradio-app/gradio/pull/3025) +- Added better support for symlinks in the way absolute paths are resolved by [@abidlabs](https://github.com/abidlabs) in [PR 3037](https://github.com/gradio-app/gradio/pull/3037) +- Fix several minor frontend bugs (loading animation, examples as gallery) frontend [@aliabid94](https://github.com/3026) in [PR 2961](https://github.com/gradio-app/gradio/pull/3026). +- Fixes bug that the chatbot sample code does not work with certain input value by [@petrov826](https://github.com/petrov826) in [PR 3039](https://github.com/gradio-app/gradio/pull/3039). +- Fix shadows for form element and ensure focus styles more visible in dark mode [@pngwn](https://github.com/pngwn) in [PR 3042](https://github.com/gradio-app/gradio/pull/3042). +- Fixed bug where the Checkbox and Dropdown change events were not triggered in response to other component changes by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3045](https://github.com/gradio-app/gradio/pull/3045) +- Fix bug where the queue was not properly restarted after launching a `closed` app by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3022](https://github.com/gradio-app/gradio/pull/3022) +- Adding missing embedded components on docs by [@aliabd](https://github.com/aliabd) in [PR 3027](https://github.com/gradio-app/gradio/pull/3027) +- Fixes bug where app would crash if the `file_types` parameter of `gr.File` or `gr.UploadButton` was not a list by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3048](https://github.com/gradio-app/gradio/pull/3048) +- Ensure CSS mounts correctly regardless of how many Gradio instances are on the page [@pngwn](https://github.com/pngwn) in [PR 3059](https://github.com/gradio-app/gradio/pull/3059). +- Fix bug where input component was not hidden in the frontend for `UploadButton` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3053](https://github.com/gradio-app/gradio/pull/3053) +- Fixes issue where after clicking submit or undo, the sketch output wouldn't clear. [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3047](https://github.com/gradio-app/gradio/pull/3047) +- Ensure spaces embedded via the web component always use the correct URLs for server requests and change ports for testing to avoid strange collisions when users are working with embedded apps locally by [@pngwn](https://github.com/pngwn) in [PR 3065](https://github.com/gradio-app/gradio/pull/3065) +- Preserve selected image of Gallery through updated by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3061](https://github.com/gradio-app/gradio/pull/3061) +- Fix bug where auth was not respected on HF spaces by [@freddyaboulton](https://github.com/freddyaboulton) and [@aliabid94](https://github.com/aliabid94) in [PR 3049](https://github.com/gradio-app/gradio/pull/3049) +- Fixes bug where tabs selected attribute not working if manually change tab by [@tomchang25](https://github.com/tomchang25) in [3055](https://github.com/gradio-app/gradio/pull/3055) +- Change chatbot to show dots on progress, and fix bug where chatbot would not stick to bottom in the case of images by [@aliabid94](https://github.com/aliabid94) in [PR 3067](https://github.com/gradio-app/gradio/pull/3079) + +### Documentation Changes: + +- SEO improvements to guides by[@aliabd](https://github.com/aliabd) in [PR 2915](https://github.com/gradio-app/gradio/pull/2915) +- Use `gr.LinePlot` for the `blocks_kinematics` demo by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2998](https://github.com/gradio-app/gradio/pull/2998) +- Updated the `interface_series_load` to include some inline markdown code by [@abidlabs](https://github.com/abidlabs) in [PR 3051](https://github.com/gradio-app/gradio/pull/3051) + +### Testing and Infrastructure Changes: + +- Adds a GitHub action to test if any large files (> 5MB) are present by [@abidlabs](https://github.com/abidlabs) in [PR 3013](https://github.com/gradio-app/gradio/pull/3013) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Rewrote frontend using CSS variables for themes by [@pngwn](https://github.com/pngwn) in [PR 2840](https://github.com/gradio-app/gradio/pull/2840) +- Moved telemetry requests to run on background threads by [@abidlabs](https://github.com/abidlabs) in [PR 3054](https://github.com/gradio-app/gradio/pull/3054) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.16.2 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Fixed file upload fails for files with zero size by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2923](https://github.com/gradio-app/gradio/pull/2923) +- Fixed bug where `mount_gradio_app` would not launch if the queue was enabled in a gradio app by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2939](https://github.com/gradio-app/gradio/pull/2939) +- Fix custom long CSS handling in Blocks by [@anton-l](https://github.com/anton-l) in [PR 2953](https://github.com/gradio-app/gradio/pull/2953) +- Recovers the dropdown change event by [@abidlabs](https://github.com/abidlabs) in [PR 2954](https://github.com/gradio-app/gradio/pull/2954). +- Fix audio file output by [@aliabid94](https://github.com/aliabid94) in [PR 2961](https://github.com/gradio-app/gradio/pull/2961). +- Fixed bug where file extensions of really long files were not kept after download by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2929](https://github.com/gradio-app/gradio/pull/2929) +- Fix bug where outputs for examples where not being returned by the backend by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2955](https://github.com/gradio-app/gradio/pull/2955) +- Fix bug in `blocks_plug` demo that prevented switching tabs programmatically with python [@TashaSkyUp](https://github.com/https://github.com/TashaSkyUp) in [PR 2971](https://github.com/gradio-app/gradio/pull/2971). + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.16.1 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Fix audio file output by [@aliabid94](https://github.com/aliabid94) in [PR 2950](https://github.com/gradio-app/gradio/pull/2950). + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.16.0 + +### New Features: + +###### Send custom progress updates by adding a `gr.Progress` argument after the input arguments to any function. Example: + +```python +def reverse(word, progress=gr.Progress()): + progress(0, desc="Starting") + time.sleep(1) + new_string = "" + for letter in progress.tqdm(word, desc="Reversing"): + time.sleep(0.25) + new_string = letter + new_string + return new_string + +demo = gr.Interface(reverse, gr.Text(), gr.Text()) +``` + +Progress indicator bar by [@aliabid94](https://github.com/aliabid94) in [PR 2750](https://github.com/gradio-app/gradio/pull/2750). + +- Added `title` argument to `TabbedInterface` by @MohamedAliRashad in [#2888](https://github.com/gradio-app/gradio/pull/2888) +- Add support for specifying file extensions for `gr.File` and `gr.UploadButton`, using `file_types` parameter (e.g `gr.File(file_count="multiple", file_types=["text", ".json", ".csv"])`) by @dawoodkhan82 in [#2901](https://github.com/gradio-app/gradio/pull/2901) +- Added `multiselect` option to `Dropdown` by @dawoodkhan82 in [#2871](https://github.com/gradio-app/gradio/pull/2871) + +###### With `multiselect` set to `true` a user can now select multiple options from the `gr.Dropdown` component. + +```python +gr.Dropdown(["angola", "pakistan", "canada"], multiselect=True, value=["angola"]) +``` + +Screenshot 2023-01-03 at 4 14 36 PM + +### Bug Fixes: + +- Fixed bug where an error opening an audio file led to a crash by [@FelixDombek](https://github.com/FelixDombek) in [PR 2898](https://github.com/gradio-app/gradio/pull/2898) +- Fixed bug where setting `default_enabled=False` made it so that the entire queue did not start by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2876](https://github.com/gradio-app/gradio/pull/2876) +- Fixed bug where csv preview for DataFrame examples would show filename instead of file contents by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2877](https://github.com/gradio-app/gradio/pull/2877) +- Fixed bug where an error raised after yielding iterative output would not be displayed in the browser by + [@JaySmithWpg](https://github.com/JaySmithWpg) in [PR 2889](https://github.com/gradio-app/gradio/pull/2889) +- Fixed bug in `blocks_style` demo that was preventing it from launching by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2890](https://github.com/gradio-app/gradio/pull/2890) +- Fixed bug where files could not be downloaded by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2926](https://github.com/gradio-app/gradio/pull/2926) +- Fixed bug where cached examples were not displaying properly by [@a-rogalska](https://github.com/a-rogalska) in [PR 2974](https://github.com/gradio-app/gradio/pull/2974) + +### Documentation Changes: + +- Added a Guide on using Google Sheets to create a real-time dashboard with Gradio's `DataFrame` and `LinePlot` component, by [@abidlabs](https://github.com/abidlabs) in [PR 2816](https://github.com/gradio-app/gradio/pull/2816) +- Add a components - events matrix on the docs by [@aliabd](https://github.com/aliabd) in [PR 2921](https://github.com/gradio-app/gradio/pull/2921) + +### Testing and Infrastructure Changes: + +- Deployed PRs from forks to spaces by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2895](https://github.com/gradio-app/gradio/pull/2895) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- The `default_enabled` parameter of the `Blocks.queue` method has no effect by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2876](https://github.com/gradio-app/gradio/pull/2876) +- Added typing to several Python files in codebase by [@abidlabs](https://github.com/abidlabs) in [PR 2887](https://github.com/gradio-app/gradio/pull/2887) +- Excluding untracked files from demo notebook check action by [@aliabd](https://github.com/aliabd) in [PR 2897](https://github.com/gradio-app/gradio/pull/2897) +- Optimize images and gifs by [@aliabd](https://github.com/aliabd) in [PR 2922](https://github.com/gradio-app/gradio/pull/2922) +- Updated typing by [@1nF0rmed](https://github.com/1nF0rmed) in [PR 2904](https://github.com/gradio-app/gradio/pull/2904) + +### Contributors Shoutout: + +- @JaySmithWpg for making their first contribution to gradio! +- @MohamedAliRashad for making their first contribution to gradio! + +## 3.15.0 + +### New Features: + +Gradio's newest plotting component `gr.LinePlot`! 📈 + +With this component you can easily create time series visualizations with customizable +appearance for your demos and dashboards ... all without having to know an external plotting library. + +For an example of the api see below: + +```python +gr.LinePlot(stocks, + x="date", + y="price", + color="symbol", + color_legend_position="bottom", + width=600, height=400, title="Stock Prices") +``` + +![image](https://user-images.githubusercontent.com/41651716/208711646-81ae3745-149b-46a3-babd-0569aecdd409.png) + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2807](https://github.com/gradio-app/gradio/pull/2807) + +### Bug Fixes: + +- Fixed bug where the `examples_per_page` parameter of the `Examples` component was not passed to the internal `Dataset` component by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2861](https://github.com/gradio-app/gradio/pull/2861) +- Fixes loading Spaces that have components with default values by [@abidlabs](https://github.com/abidlabs) in [PR 2855](https://github.com/gradio-app/gradio/pull/2855) +- Fixes flagging when `allow_flagging="auto"` in `gr.Interface()` by [@abidlabs](https://github.com/abidlabs) in [PR 2695](https://github.com/gradio-app/gradio/pull/2695) +- Fixed bug where passing a non-list value to `gr.CheckboxGroup` would crash the entire app by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2866](https://github.com/gradio-app/gradio/pull/2866) + +### Documentation Changes: + +- Added a Guide on using BigQuery with Gradio's `DataFrame` and `ScatterPlot` component, + by [@abidlabs](https://github.com/abidlabs) in [PR 2794](https://github.com/gradio-app/gradio/pull/2794) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Fixed importing gradio can cause PIL.Image.registered_extensions() to break by `[@aliencaocao](https://github.com/aliencaocao)` in `[PR 2846](https://github.com/gradio-app/gradio/pull/2846)` +- Fix css glitch and navigation in docs by [@aliabd](https://github.com/aliabd) in [PR 2856](https://github.com/gradio-app/gradio/pull/2856) +- Added the ability to set `x_lim`, `y_lim` and legend positions for `gr.ScatterPlot` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2807](https://github.com/gradio-app/gradio/pull/2807) +- Remove footers and min-height the correct way by [@aliabd](https://github.com/aliabd) in [PR 2860](https://github.com/gradio-app/gradio/pull/2860) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.14.0 + +### New Features: + +###### Add Waveform Visual Support to Audio + +Adds a `gr.make_waveform()` function that creates a waveform video by combining an audio and an optional background image by [@dawoodkhan82](http://github.com/dawoodkhan82) and [@aliabid94](http://github.com/aliabid94) in [PR 2706](https://github.com/gradio-app/gradio/pull/2706. Helpful for making audio outputs much more shareable. + +![waveform screenrecording](https://user-images.githubusercontent.com/7870876/206062396-164a5e71-451a-4fe0-94a7-cbe9269d57e6.gif) + +###### Allows Every Component to Accept an `every` Parameter + +When a component's initial value is a function, the `every` parameter re-runs the function every `every` seconds. By [@abidlabs](https://github.com/abidlabs) in [PR 2806](https://github.com/gradio-app/gradio/pull/2806). Here's a code example: + +```py +import gradio as gr + +with gr.Blocks() as demo: + df = gr.DataFrame(run_query, every=60*60) + +demo.queue().launch() +``` + +### Bug Fixes: + +- Fixed issue where too many temporary files were created, all with randomly generated + filepaths. Now fewer temporary files are created and are assigned a path that is a + hash based on the file contents by [@abidlabs](https://github.com/abidlabs) in [PR 2758](https://github.com/gradio-app/gradio/pull/2758) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.13.2 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +\*No changes to highlight. + +- + +### Documentation Changes: + +- Improves documentation of several queuing-related parameters by [@abidlabs](https://github.com/abidlabs) in [PR 2825](https://github.com/gradio-app/gradio/pull/2825) + +### Testing and Infrastructure Changes: + +- Remove h11 pinning by [@ecederstrand](https://github.com/ecederstrand) in [PR 2820](https://github.com/gradio-app/gradio/pull/2820) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +No changes to highlight. + +### Contributors Shoutout: + +No changes to highlight. + +## 3.13.1 + +### New Features: + +###### New Shareable Links + +Replaces tunneling logic based on ssh port-forwarding to that based on `frp` by [XciD](https://github.com/XciD) and [Wauplin](https://github.com/Wauplin) in [PR 2509](https://github.com/gradio-app/gradio/pull/2509) + +You don't need to do anything differently, but when you set `share=True` in `launch()`, +you'll get this message and a public link that look a little bit different: + +```bash +Setting up a public link... we have recently upgraded the way public links are generated. If you encounter any problems, please downgrade to gradio version 3.13.0 +. +Running on public URL: https://bec81a83-5b5c-471e.gradio.live +``` + +These links are a more secure and scalable way to create shareable demos! + +### Bug Fixes: + +- Allows `gr.Dataframe()` to take a `pandas.DataFrame` that includes numpy array and other types as its initial value, by [@abidlabs](https://github.com/abidlabs) in [PR 2804](https://github.com/gradio-app/gradio/pull/2804) +- Add `altair` to requirements.txt by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2811](https://github.com/gradio-app/gradio/pull/2811) +- Added aria-labels to icon buttons that are built into UI components by [@emilyuhde](http://github.com/emilyuhde) in [PR 2791](https://github.com/gradio-app/gradio/pull/2791) + +### Documentation Changes: + +- Fixed some typos in the "Plot Component for Maps" guide by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2811](https://github.com/gradio-app/gradio/pull/2811) + +### Testing and Infrastructure Changes: + +- Fixed test for IP address by [@abidlabs](https://github.com/abidlabs) in [PR 2808](https://github.com/gradio-app/gradio/pull/2808) + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Fixed typo in parameter `visible` in classes in `templates.py` by [@abidlabs](https://github.com/abidlabs) in [PR 2805](https://github.com/gradio-app/gradio/pull/2805) +- Switched external service for getting IP address from `https://api.ipify.org` to `https://checkip.amazonaws.com/` by [@abidlabs](https://github.com/abidlabs) in [PR 2810](https://github.com/gradio-app/gradio/pull/2810) + +### Contributors Shoutout: + +No changes to highlight. + +- Fixed typo in parameter `visible` in classes in `templates.py` by [@abidlabs](https://github.com/abidlabs) in [PR 2805](https://github.com/gradio-app/gradio/pull/2805) +- Switched external service for getting IP address from `https://api.ipify.org` to `https://checkip.amazonaws.com/` by [@abidlabs](https://github.com/abidlabs) in [PR 2810](https://github.com/gradio-app/gradio/pull/2810) + +## 3.13.0 + +### New Features: + +###### Scatter plot component + +It is now possible to create a scatter plot natively in Gradio! + +The `gr.ScatterPlot` component accepts a pandas dataframe and some optional configuration parameters +and will automatically create a plot for you! + +This is the first of many native plotting components in Gradio! + +For an example of how to use `gr.ScatterPlot` see below: + +```python +import gradio as gr +from vega_datasets import data + +cars = data.cars() + +with gr.Blocks() as demo: + gr.ScatterPlot(show_label=False, + value=cars, + x="Horsepower", + y="Miles_per_Gallon", + color="Origin", + tooltip="Name", + title="Car Data", + y_title="Miles per Gallon", + color_legend_title="Origin of Car").style(container=False) + +demo.launch() +``` + +image + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2764](https://github.com/gradio-app/gradio/pull/2764) + +###### Support for altair plots + +The `Plot` component can now accept altair plots as values! +Simply return an altair plot from your event listener and gradio will display it in the front-end. +See the example below: + +```python +import gradio as gr +import altair as alt +from vega_datasets import data + +cars = data.cars() +chart = ( + alt.Chart(cars) + .mark_point() + .encode( + x="Horsepower", + y="Miles_per_Gallon", + color="Origin", + ) +) + +with gr.Blocks() as demo: + gr.Plot(value=chart) +demo.launch() +``` + +image + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2741](https://github.com/gradio-app/gradio/pull/2741) + +###### Set the background color of a Label component + +The `Label` component now accepts a `color` argument by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2736](https://github.com/gradio-app/gradio/pull/2736). +The `color` argument should either be a valid css color name or hexadecimal string. +You can update the color with `gr.Label.update`! + +This lets you create Alert and Warning boxes with the `Label` component. See below: + +```python +import gradio as gr +import random + +def update_color(value): + if value < 0: + # This is bad so use red + return "#FF0000" + elif 0 <= value <= 20: + # Ok but pay attention (use orange) + return "#ff9966" + else: + # Nothing to worry about + return None + +def update_value(): + choice = random.choice(['good', 'bad', 'so-so']) + color = update_color(choice) + return gr.Label.update(value=choice, color=color) + + +with gr.Blocks() as demo: + label = gr.Label(value=-10) + demo.load(lambda: update_value(), inputs=None, outputs=[label], every=1) +demo.queue().launch() +``` + +![label_bg_color_update](https://user-images.githubusercontent.com/41651716/204400372-80e53857-f26f-4a38-a1ae-1acadff75e89.gif) + +###### Add Brazilian Portuguese translation + +Add Brazilian Portuguese translation (pt-BR.json) by [@pstwh](http://github.com/pstwh) in [PR 2753](https://github.com/gradio-app/gradio/pull/2753): + +image + +### Bug Fixes: + +- Fixed issue where image thumbnails were not showing when an example directory was provided + by [@abidlabs](https://github.com/abidlabs) in [PR 2745](https://github.com/gradio-app/gradio/pull/2745) +- Fixed bug loading audio input models from the hub by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2779](https://github.com/gradio-app/gradio/pull/2779). +- Fixed issue where entities were not merged when highlighted text was generated from the + dictionary inputs [@payoto](https://github.com/payoto) in [PR 2767](https://github.com/gradio-app/gradio/pull/2767) +- Fixed bug where generating events did not finish running even if the websocket connection was closed by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2783](https://github.com/gradio-app/gradio/pull/2783). + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Images in the chatbot component are now resized if they exceed a max width by [@abidlabs](https://github.com/abidlabs) in [PR 2748](https://github.com/gradio-app/gradio/pull/2748) +- Missing parameters have been added to `gr.Blocks().load()` by [@abidlabs](https://github.com/abidlabs) in [PR 2755](https://github.com/gradio-app/gradio/pull/2755) +- Deindex share URLs from search by [@aliabd](https://github.com/aliabd) in [PR 2772](https://github.com/gradio-app/gradio/pull/2772) +- Redirect old links and fix broken ones by [@aliabd](https://github.com/aliabd) in [PR 2774](https://github.com/gradio-app/gradio/pull/2774) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.12.0 + +### New Features: + +###### The `Chatbot` component now supports a subset of Markdown (including bold, italics, code, images) + +You can now pass in some Markdown to the Chatbot component and it will show up, +meaning that you can pass in images as well! by [@abidlabs](https://github.com/abidlabs) in [PR 2731](https://github.com/gradio-app/gradio/pull/2731) + +Here's a simple example that references a local image `lion.jpg` that is in the same +folder as the Python script: + +```py +import gradio as gr + +with gr.Blocks() as demo: + gr.Chatbot([("hi", "hello **abubakar**"), ("![](/file=lion.jpg)", "cool pic")]) + +demo.launch() +``` + +![Alt text](https://user-images.githubusercontent.com/1778297/204357455-5c1a4002-eee7-479d-9a1e-ba2c12522723.png) + +To see a more realistic example, see the new demo `/demo/chatbot_multimodal/run.py`. + +###### Latex support + +Added mathtext (a subset of latex) support to gr.Markdown. Added by [@kashif](https://github.com/kashif) and [@aliabid94](https://github.com/aliabid94) in [PR 2696](https://github.com/gradio-app/gradio/pull/2696). + +Example of how it can be used: + +```python +gr.Markdown( + r""" + # Hello World! $\frac{\sqrt{x + y}}{4}$ is today's lesson. + """) +``` + +###### Update Accordion properties from the backend + +You can now update the Accordion `label` and `open` status with `gr.Accordion.update` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2690](https://github.com/gradio-app/gradio/pull/2690) + +```python +import gradio as gr + +with gr.Blocks() as demo: + with gr.Accordion(label="Open for greeting", open=False) as accordion: + gr.Textbox("Hello!") + open_btn = gr.Button(value="Open Accordion") + close_btn = gr.Button(value="Close Accordion") + open_btn.click( + lambda: gr.Accordion.update(open=True, label="Open Accordion"), + inputs=None, + outputs=[accordion], + ) + close_btn.click( + lambda: gr.Accordion.update(open=False, label="Closed Accordion"), + inputs=None, + outputs=[accordion], + ) +demo.launch() +``` + +![update_accordion](https://user-images.githubusercontent.com/41651716/203164176-b102eae3-babe-4986-ae30-3ab4f400cedc.gif) + +### Bug Fixes: + +- Fixed bug where requests timeout is missing from utils.version_check() by [@yujiehecs](https://github.com/yujiehecs) in [PR 2729](https://github.com/gradio-app/gradio/pull/2729) +- Fixed bug where so that the `File` component can properly preprocess files to "binary" byte-string format by [CoffeeVampir3](https://github.com/CoffeeVampir3) in [PR 2727](https://github.com/gradio-app/gradio/pull/2727) +- Fixed bug to ensure that filenames are less than 200 characters even for non-English languages by [@SkyTNT](https://github.com/SkyTNT) in [PR 2685](https://github.com/gradio-app/gradio/pull/2685) + +### Documentation Changes: + +- Performance improvements to docs on mobile by [@aliabd](https://github.com/aliabd) in [PR 2730](https://github.com/gradio-app/gradio/pull/2730) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Make try examples button more prominent by [@aliabd](https://github.com/aliabd) in [PR 2705](https://github.com/gradio-app/gradio/pull/2705) +- Fix id clashes in docs by [@aliabd](https://github.com/aliabd) in [PR 2713](https://github.com/gradio-app/gradio/pull/2713) +- Fix typos in guide docs by [@andridns](https://github.com/andridns) in [PR 2722](https://github.com/gradio-app/gradio/pull/2722) +- Add option to `include_audio` in Video component. When `True`, for `source="webcam"` this will record audio and video, for `source="upload"` this will retain the audio in an uploaded video by [@mandargogate](https://github.com/MandarGogate) in [PR 2721](https://github.com/gradio-app/gradio/pull/2721) + +### Contributors Shoutout: + +- [@andridns](https://github.com/andridns) made their first contribution in [PR 2722](https://github.com/gradio-app/gradio/pull/2722)! + +## 3.11.0 + +### New Features: + +###### Upload Button + +There is now a new component called the `UploadButton` which is a file upload component but in button form! You can also specify what file types it should accept in the form of a list (ex: `image`, `video`, `audio`, `text`, or generic `file`). Added by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2591](https://github.com/gradio-app/gradio/pull/2591). + +Example of how it can be used: + +```python +import gradio as gr + +def upload_file(files): + file_paths = [file.name for file in files] + return file_paths + +with gr.Blocks() as demo: + file_output = gr.File() + upload_button = gr.UploadButton("Click to Upload a File", file_types=["image", "video"], file_count="multiple") + upload_button.upload(upload_file, upload_button, file_output) + +demo.launch() +``` + +###### Revamped API documentation page + +New API Docs page with in-browser playground and updated aesthetics. [@gary149](https://github.com/gary149) in [PR 2652](https://github.com/gradio-app/gradio/pull/2652) + +###### Revamped Login page + +Previously our login page had its own CSS, had no dark mode, and had an ugly json message on the wrong credentials. Made the page more aesthetically consistent, added dark mode support, and a nicer error message. [@aliabid94](https://github.com/aliabid94) in [PR 2684](https://github.com/gradio-app/gradio/pull/2684) + +###### Accessing the Requests Object Directly + +You can now access the Request object directly in your Python function by [@abidlabs](https://github.com/abidlabs) in [PR 2641](https://github.com/gradio-app/gradio/pull/2641). This means that you can access request headers, the client IP address, and so on. In order to use it, add a parameter to your function and set its type hint to be `gr.Request`. Here's a simple example: + +```py +import gradio as gr + +def echo(name, request: gr.Request): + if request: + print("Request headers dictionary:", request.headers) + print("IP address:", request.client.host) + return name + +io = gr.Interface(echo, "textbox", "textbox").launch() +``` + +### Bug Fixes: + +- Fixed bug that limited files from being sent over websockets to 16MB. The new limit + is now 1GB by [@abidlabs](https://github.com/abidlabs) in [PR 2709](https://github.com/gradio-app/gradio/pull/2709) + +### Documentation Changes: + +- Updated documentation for embedding Gradio demos on Spaces as web components by + [@julien-c](https://github.com/julien-c) in [PR 2698](https://github.com/gradio-app/gradio/pull/2698) +- Updated IFrames in Guides to use the host URL instead of the Space name to be consistent with the new method for embedding Spaces, by + [@julien-c](https://github.com/julien-c) in [PR 2692](https://github.com/gradio-app/gradio/pull/2692) +- Colab buttons on every demo in the website! Just click open in colab, and run the demo there. + +https://user-images.githubusercontent.com/9021060/202878400-cb16ed47-f4dd-4cb0-b2f0-102a9ff64135.mov + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Better warnings and error messages for `gr.Interface.load()` by [@abidlabs](https://github.com/abidlabs) in [PR 2694](https://github.com/gradio-app/gradio/pull/2694) +- Add open in colab buttons to demos in docs and /demos by [@aliabd](https://github.com/aliabd) in [PR 2608](https://github.com/gradio-app/gradio/pull/2608) +- Apply different formatting for the types in component docstrings by [@aliabd](https://github.com/aliabd) in [PR 2707](https://github.com/gradio-app/gradio/pull/2707) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.10.1 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Passes kwargs into `gr.Interface.load()` by [@abidlabs](https://github.com/abidlabs) in [PR 2669](https://github.com/gradio-app/gradio/pull/2669) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Clean up printed statements in Embedded Colab Mode by [@aliabid94](https://github.com/aliabid94) in [PR 2612](https://github.com/gradio-app/gradio/pull/2612) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.10.0 + +- Add support for `'password'` and `'email'` types to `Textbox`. [@pngwn](https://github.com/pngwn) in [PR 2653](https://github.com/gradio-app/gradio/pull/2653) +- `gr.Textbox` component will now raise an exception if `type` is not "text", "email", or "password" [@pngwn](https://github.com/pngwn) in [PR 2653](https://github.com/gradio-app/gradio/pull/2653). This will cause demos using the deprecated `gr.Textbox(type="number")` to raise an exception. + +### Bug Fixes: + +- Updated the minimum FastApi used in tests to version 0.87 by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2647](https://github.com/gradio-app/gradio/pull/2647) +- Fixed bug where interfaces with examples could not be loaded with `gr.Interface.load` by [@freddyaboulton](https://github.com/freddyaboulton) [PR 2640](https://github.com/gradio-app/gradio/pull/2640) +- Fixed bug where the `interactive` property of a component could not be updated by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2639](https://github.com/gradio-app/gradio/pull/2639) +- Fixed bug where some URLs were not being recognized as valid URLs and thus were not + loading correctly in various components by [@abidlabs](https://github.com/abidlabs) in [PR 2659](https://github.com/gradio-app/gradio/pull/2659) + +### Documentation Changes: + +- Fix some typos in the embedded demo names in "05_using_blocks_like_functions.md" by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2656](https://github.com/gradio-app/gradio/pull/2656) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Add support for `'password'` and `'email'` types to `Textbox`. [@pngwn](https://github.com/pngwn) in [PR 2653](https://github.com/gradio-app/gradio/pull/2653) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.9.1 + +### New Features: + +No changes to highlight. + +### Bug Fixes: + +- Only set a min height on md and html when loading by [@pngwn](https://github.com/pngwn) in [PR 2623](https://github.com/gradio-app/gradio/pull/2623) + +### Documentation Changes: + +- See docs for the latest gradio commit to main as well the latest pip release: + +![main-vs-pip](https://user-images.githubusercontent.com/9021060/199607887-aab1ae4e-a070-4527-966d-024397abe15b.gif) + +- Modified the "Connecting To a Database Guide" to use `pd.read_sql` as opposed to low-level postgres connector by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2604](https://github.com/gradio-app/gradio/pull/2604) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Dropdown for seeing docs as latest or main by [@aliabd](https://github.com/aliabd) in [PR 2544](https://github.com/gradio-app/gradio/pull/2544) +- Allow `gr.Templates` to accept parameters to override the defaults by [@abidlabs](https://github.com/abidlabs) in [PR 2600](https://github.com/gradio-app/gradio/pull/2600) +- Components now throw a `ValueError()` if constructed with invalid parameters for `type` or `source` (for components that take those parameters) in [PR 2610](https://github.com/gradio-app/gradio/pull/2610) +- Allow auth with using queue by [@GLGDLY](https://github.com/GLGDLY) in [PR 2611](https://github.com/gradio-app/gradio/pull/2611) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.9 + +### New Features: + +- Gradio is now embedded directly in colab without requiring the share link by [@aliabid94](https://github.com/aliabid94) in [PR 2455](https://github.com/gradio-app/gradio/pull/2455) + +###### Calling functions by api_name in loaded apps + +When you load an upstream app with `gr.Blocks.load`, you can now specify which fn +to call with the `api_name` parameter. + +```python +import gradio as gr +english_translator = gr.Blocks.load(name="spaces/gradio/english-translator") +german = english_translator("My name is Freddy", api_name='translate-to-german') +``` + +The `api_name` parameter will take precedence over the `fn_index` parameter. + +### Bug Fixes: + +- Fixed bug where None could not be used for File,Model3D, and Audio examples by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2588](https://github.com/gradio-app/gradio/pull/2588) +- Fixed links in Plotly map guide + demo by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2578](https://github.com/gradio-app/gradio/pull/2578) +- `gr.Blocks.load()` now correctly loads example files from Spaces [@abidlabs](https://github.com/abidlabs) in [PR 2594](https://github.com/gradio-app/gradio/pull/2594) +- Fixed bug when image clear started upload dialog [@mezotaken](https://github.com/mezotaken) in [PR 2577](https://github.com/gradio-app/gradio/pull/2577) + +### Documentation Changes: + +- Added a Guide on how to configure the queue for maximum performance by [@abidlabs](https://github.com/abidlabs) in [PR 2558](https://github.com/gradio-app/gradio/pull/2558) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Add `api_name` to `Blocks.__call__` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2593](https://github.com/gradio-app/gradio/pull/2593) +- Update queue with using deque & update requirements by [@GLGDLY](https://github.com/GLGDLY) in [PR 2428](https://github.com/gradio-app/gradio/pull/2428) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.8.2 + +### Bug Fixes: + +- Ensure gradio apps embedded via spaces use the correct endpoint for predictions. [@pngwn](https://github.com/pngwn) in [PR 2567](https://github.com/gradio-app/gradio/pull/2567) +- Ensure gradio apps embedded via spaces use the correct websocket protocol. [@pngwn](https://github.com/pngwn) in [PR 2571](https://github.com/gradio-app/gradio/pull/2571) + +### New Features: + +###### Running Events Continuously + +Gradio now supports the ability to run an event continuously on a fixed schedule. To use this feature, +pass `every=# of seconds` to the event definition. This will run the event every given number of seconds! + +This can be used to: + +- Create live visualizations that show the most up to date data +- Refresh the state of the frontend automatically in response to changes in the backend + +Here is an example of a live plot that refreshes every half second: + +```python +import math +import gradio as gr +import plotly.express as px +import numpy as np + + +plot_end = 2 * math.pi + + +def get_plot(period=1): + global plot_end + x = np.arange(plot_end - 2 * math.pi, plot_end, 0.02) + y = np.sin(2*math.pi*period * x) + fig = px.line(x=x, y=y) + plot_end += 2 * math.pi + return fig + + +with gr.Blocks() as demo: + with gr.Row(): + with gr.Column(): + gr.Markdown("Change the value of the slider to automatically update the plot") + period = gr.Slider(label="Period of plot", value=1, minimum=0, maximum=10, step=1) + plot = gr.Plot(label="Plot (updates every half second)") + + dep = demo.load(get_plot, None, plot, every=0.5) + period.change(get_plot, period, plot, every=0.5, cancels=[dep]) + +demo.queue().launch() +``` + +![live_demo](https://user-images.githubusercontent.com/41651716/198357377-633ce460-4e31-47bd-8202-1440cdd6fe19.gif) + +### Bug Fixes: + +No changes to highlight. + +### Documentation Changes: + +- Explained how to set up `queue` and `auth` when working with reload mode by by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3089](https://github.com/gradio-app/gradio/pull/3089) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Allows loading private Spaces by passing an an `api_key` to `gr.Interface.load()` + by [@abidlabs](https://github.com/abidlabs) in [PR 2568](https://github.com/gradio-app/gradio/pull/2568) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.8 + +### New Features: + +- Allows event listeners to accept a single dictionary as its argument, where the keys are the components and the values are the component values. This is set by passing the input components in the event listener as a set instead of a list. [@aliabid94](https://github.com/aliabid94) in [PR 2550](https://github.com/gradio-app/gradio/pull/2550) + +### Bug Fixes: + +- Fix whitespace issue when using plotly. [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2548](https://github.com/gradio-app/gradio/pull/2548) +- Apply appropriate alt text to all gallery images. [@camenduru](https://github.com/camenduru) in [PR 2358](https://github.com/gradio-app/gradio/pull/2538) +- Removed erroneous tkinter import in gradio.blocks by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2555](https://github.com/gradio-app/gradio/pull/2555) + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Added the `every` keyword to event listeners that runs events on a fixed schedule by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2512](https://github.com/gradio-app/gradio/pull/2512) +- Fix whitespace issue when using plotly. [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2548](https://github.com/gradio-app/gradio/pull/2548) +- Apply appropriate alt text to all gallery images. [@camenduru](https://github.com/camenduru) in [PR 2358](https://github.com/gradio-app/gradio/pull/2538) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.7 + +### New Features: + +###### Batched Functions + +Gradio now supports the ability to pass _batched_ functions. Batched functions are just +functions which take in a list of inputs and return a list of predictions. + +For example, here is a batched function that takes in two lists of inputs (a list of +words and a list of ints), and returns a list of trimmed words as output: + +```py +import time + +def trim_words(words, lens): + trimmed_words = [] + time.sleep(5) + for w, l in zip(words, lens): + trimmed_words.append(w[:l]) + return [trimmed_words] +``` + +The advantage of using batched functions is that if you enable queuing, the Gradio +server can automatically _batch_ incoming requests and process them in parallel, +potentially speeding up your demo. Here's what the Gradio code looks like (notice +the `batch=True` and `max_batch_size=16` -- both of these parameters can be passed +into event triggers or into the `Interface` class) + +```py +import gradio as gr + +with gr.Blocks() as demo: + with gr.Row(): + word = gr.Textbox(label="word", value="abc") + leng = gr.Number(label="leng", precision=0, value=1) + output = gr.Textbox(label="Output") + with gr.Row(): + run = gr.Button() + + event = run.click(trim_words, [word, leng], output, batch=True, max_batch_size=16) + +demo.queue() +demo.launch() +``` + +In the example above, 16 requests could be processed in parallel (for a total inference +time of 5 seconds), instead of each request being processed separately (for a total +inference time of 80 seconds). + +###### Upload Event + +`Video`, `Audio`, `Image`, and `File` components now support a `upload()` event that is triggered when a user uploads a file into any of these components. + +Example usage: + +```py +import gradio as gr + +with gr.Blocks() as demo: + with gr.Row(): + input_video = gr.Video() + output_video = gr.Video() + + # Clears the output video when an input video is uploaded + input_video.upload(lambda : None, None, output_video) +``` + +### Bug Fixes: + +- Fixes issue where plotly animations, interactivity, titles, legends, were not working properly. [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2486](https://github.com/gradio-app/gradio/pull/2486) +- Prevent requests to the `/api` endpoint from skipping the queue if the queue is enabled for that event by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2493](https://github.com/gradio-app/gradio/pull/2493) +- Fixes a bug with `cancels` in event triggers so that it works properly if multiple + Blocks are rendered by [@abidlabs](https://github.com/abidlabs) in [PR 2530](https://github.com/gradio-app/gradio/pull/2530) +- Prevent invalid targets of events from crashing the whole application. [@pngwn](https://github.com/pngwn) in [PR 2534](https://github.com/gradio-app/gradio/pull/2534) +- Properly dequeue cancelled events when multiple apps are rendered by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2540](https://github.com/gradio-app/gradio/pull/2540) +- Fixes videos being cropped due to height/width params not being used [@hannahblair](https://github.com/hannahblair) in [PR 4946](https://github.com/gradio-app/gradio/pull/4946) + +### Documentation Changes: + +- Added an example interactive dashboard to the "Tabular & Plots" section of the Demos page by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2508](https://github.com/gradio-app/gradio/pull/2508) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Fixes the error message if a user builds Gradio locally and tries to use `share=True` by [@abidlabs](https://github.com/abidlabs) in [PR 2502](https://github.com/gradio-app/gradio/pull/2502) +- Allows the render() function to return self by [@Raul9595](https://github.com/Raul9595) in [PR 2514](https://github.com/gradio-app/gradio/pull/2514) +- Fixes issue where plotly animations, interactivity, titles, legends, were not working properly. [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2486](https://github.com/gradio-app/gradio/pull/2486) +- Gradio now supports batched functions by [@abidlabs](https://github.com/abidlabs) in [PR 2218](https://github.com/gradio-app/gradio/pull/2218) +- Add `upload` event for `Video`, `Audio`, `Image`, and `File` components [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2448](https://github.com/gradio-app/gradio/pull/2456) +- Changes websocket path for Spaces as it is no longer necessary to have a different URL for websocket connections on Spaces by [@abidlabs](https://github.com/abidlabs) in [PR 2528](https://github.com/gradio-app/gradio/pull/2528) +- Clearer error message when events are defined outside of a Blocks scope, and a warning if you + try to use `Series` or `Parallel` with `Blocks` by [@abidlabs](https://github.com/abidlabs) in [PR 2543](https://github.com/gradio-app/gradio/pull/2543) +- Adds support for audio samples that are in `float64`, `float16`, or `uint16` formats by [@abidlabs](https://github.com/abidlabs) in [PR 2545](https://github.com/gradio-app/gradio/pull/2545) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.6 + +### New Features: + +###### Cancelling Running Events + +Running events can be cancelled when other events are triggered! To test this feature, pass the `cancels` parameter to the event listener. +For this feature to work, the queue must be enabled. + +![cancel_on_change_rl](https://user-images.githubusercontent.com/41651716/195952623-61a606bd-e82b-4e1a-802e-223154cb8727.gif) + +Code: + +```python +import time +import gradio as gr + +def fake_diffusion(steps): + for i in range(steps): + time.sleep(1) + yield str(i) + +def long_prediction(*args, **kwargs): + time.sleep(10) + return 42 + + +with gr.Blocks() as demo: + with gr.Row(): + with gr.Column(): + n = gr.Slider(1, 10, value=9, step=1, label="Number Steps") + run = gr.Button() + output = gr.Textbox(label="Iterative Output") + stop = gr.Button(value="Stop Iterating") + with gr.Column(): + prediction = gr.Number(label="Expensive Calculation") + run_pred = gr.Button(value="Run Expensive Calculation") + with gr.Column(): + cancel_on_change = gr.Textbox(label="Cancel Iteration and Expensive Calculation on Change") + + click_event = run.click(fake_diffusion, n, output) + stop.click(fn=None, inputs=None, outputs=None, cancels=[click_event]) + pred_event = run_pred.click(fn=long_prediction, inputs=None, outputs=prediction) + + cancel_on_change.change(None, None, None, cancels=[click_event, pred_event]) + + +demo.queue(concurrency_count=1, max_size=20).launch() +``` + +For interfaces, a stop button will be added automatically if the function uses a `yield` statement. + +```python +import gradio as gr +import time + +def iteration(steps): + for i in range(steps): + time.sleep(0.5) + yield i + +gr.Interface(iteration, + inputs=gr.Slider(minimum=1, maximum=10, step=1, value=5), + outputs=gr.Number()).queue().launch() +``` + +![stop_interface_rl](https://user-images.githubusercontent.com/41651716/195952883-e7ca4235-aae3-4852-8f28-96d01d0c5822.gif) + +### Bug Fixes: + +- Add loading status tracker UI to HTML and Markdown components. [@pngwn](https://github.com/pngwn) in [PR 2474](https://github.com/gradio-app/gradio/pull/2474) +- Fixed videos being mirrored in the front-end if source is not webcam by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2475](https://github.com/gradio-app/gradio/pull/2475) +- Add clear button for timeseries component [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2487](https://github.com/gradio-app/gradio/pull/2487) +- Removes special characters from temporary filenames so that the files can be served by components [@abidlabs](https://github.com/abidlabs) in [PR 2480](https://github.com/gradio-app/gradio/pull/2480) +- Fixed infinite reload loop when mounting gradio as a sub application by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2477](https://github.com/gradio-app/gradio/pull/2477) + +### Documentation Changes: + +- Adds a demo to show how a sound alert can be played upon completion of a prediction by [@abidlabs](https://github.com/abidlabs) in [PR 2478](https://github.com/gradio-app/gradio/pull/2478) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Enable running events to be cancelled from other events by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2433](https://github.com/gradio-app/gradio/pull/2433) +- Small fix for version check before reuploading demos by [@aliabd](https://github.com/aliabd) in [PR 2469](https://github.com/gradio-app/gradio/pull/2469) +- Add loading status tracker UI to HTML and Markdown components. [@pngwn](https://github.com/pngwn) in [PR 2400](https://github.com/gradio-app/gradio/pull/2474) +- Add clear button for timeseries component [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2487](https://github.com/gradio-app/gradio/pull/2487) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.5 + +### Bug Fixes: + +- Ensure that Gradio does not take control of the HTML page title when embedding a gradio app as a web component, this behaviour flipped by adding `control_page_title="true"` to the webcomponent. [@pngwn](https://github.com/pngwn) in [PR 2400](https://github.com/gradio-app/gradio/pull/2400) +- Decreased latency in iterative-output demos by making the iteration asynchronous [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2409](https://github.com/gradio-app/gradio/pull/2409) +- Fixed queue getting stuck under very high load by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2374](https://github.com/gradio-app/gradio/pull/2374) +- Ensure that components always behave as if `interactive=True` were set when the following conditions are true: + + - no default value is provided, + - they are not set as the input or output of an event, + - `interactive` kwarg is not set. + + [@pngwn](https://github.com/pngwn) in [PR 2459](https://github.com/gradio-app/gradio/pull/2459) + +### New Features: + +- When an `Image` component is set to `source="upload"`, it is now possible to drag and drop and image to replace a previously uploaded image by [@pngwn](https://github.com/pngwn) in [PR 1711](https://github.com/gradio-app/gradio/issues/1711) +- The `gr.Dataset` component now accepts `HTML` and `Markdown` components by [@abidlabs](https://github.com/abidlabs) in [PR 2437](https://github.com/gradio-app/gradio/pull/2437) + +### Documentation Changes: + +- Improved documentation for the `gr.Dataset` component by [@abidlabs](https://github.com/abidlabs) in [PR 2437](https://github.com/gradio-app/gradio/pull/2437) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +- The `Carousel` component is officially deprecated. Since gradio 3.0, code containing the `Carousel` component would throw warnings. As of the next release, the `Carousel` component will raise an exception. + +### Full Changelog: + +- Speeds up Gallery component by using temporary files instead of base64 representation in the front-end by [@proxyphi](https://github.com/proxyphi), [@pngwn](https://github.com/pngwn), and [@abidlabs](https://github.com/abidlabs) in [PR 2265](https://github.com/gradio-app/gradio/pull/2265) +- Fixed some embedded demos in the guides by not loading the gradio web component in some guides by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2403](https://github.com/gradio-app/gradio/pull/2403) +- When an `Image` component is set to `source="upload"`, it is now possible to drag and drop and image to replace a previously uploaded image by [@pngwn](https://github.com/pngwn) in [PR 2400](https://github.com/gradio-app/gradio/pull/2410) +- Improve documentation of the `Blocks.load()` event by [@abidlabs](https://github.com/abidlabs) in [PR 2413](https://github.com/gradio-app/gradio/pull/2413) +- Decreased latency in iterative-output demos by making the iteration asynchronous [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2409](https://github.com/gradio-app/gradio/pull/2409) +- Updated share link message to reference new Spaces Hardware [@abidlabs](https://github.com/abidlabs) in [PR 2423](https://github.com/gradio-app/gradio/pull/2423) +- Automatically restart spaces if they're down by [@aliabd](https://github.com/aliabd) in [PR 2405](https://github.com/gradio-app/gradio/pull/2405) +- Carousel component is now deprecated by [@abidlabs](https://github.com/abidlabs) in [PR 2434](https://github.com/gradio-app/gradio/pull/2434) +- Build Gradio from source in ui tests by by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2440](https://github.com/gradio-app/gradio/pull/2440) +- Change "return ValueError" to "raise ValueError" by [@vzakharov](https://github.com/vzakharov) in [PR 2445](https://github.com/gradio-app/gradio/pull/2445) +- Add guide on creating a map demo using the `gr.Plot()` component [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2402](https://github.com/gradio-app/gradio/pull/2402) +- Add blur event for `Textbox` and `Number` components [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2448](https://github.com/gradio-app/gradio/pull/2448) +- Stops a gradio launch from hogging a port even after it's been killed [@aliabid94](https://github.com/aliabid94) in [PR 2453](https://github.com/gradio-app/gradio/pull/2453) +- Fix embedded interfaces on touch screen devices by [@aliabd](https://github.com/aliabd) in [PR 2457](https://github.com/gradio-app/gradio/pull/2457) +- Upload all demos to spaces by [@aliabd](https://github.com/aliabd) in [PR 2281](https://github.com/gradio-app/gradio/pull/2281) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.4.1 + +### New Features: + +###### 1. See Past and Upcoming Changes in the Release History 👀 + +You can now see gradio's release history directly on the website, and also keep track of upcoming changes. Just go [here](https://gradio.app/changelog/). + +![release-history](https://user-images.githubusercontent.com/9021060/193145458-3de699f7-7620-45de-aa73-a1c1b9b96257.gif) + +### Bug Fixes: + +1. Fix typo in guide image path by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2357](https://github.com/gradio-app/gradio/pull/2357) +2. Raise error if Blocks has duplicate component with same IDs by [@abidlabs](https://github.com/abidlabs) in [PR 2359](https://github.com/gradio-app/gradio/pull/2359) +3. Catch the permission exception on the audio component by [@Ian-GL](https://github.com/Ian-GL) in [PR 2330](https://github.com/gradio-app/gradio/pull/2330) +4. Fix image_classifier_interface_load demo by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2365](https://github.com/gradio-app/gradio/pull/2365) +5. Fix combining adjacent components without gaps by introducing `gr.Row(variant="compact")` by [@aliabid94](https://github.com/aliabid94) in [PR 2291](https://github.com/gradio-app/gradio/pull/2291) This comes with deprecation of the following arguments for `Component.style`: `round`, `margin`, `border`. +6. Fix audio streaming, which was previously choppy in [PR 2351](https://github.com/gradio-app/gradio/pull/2351). Big thanks to [@yannickfunk](https://github.com/yannickfunk) for the proposed solution. +7. Fix bug where new typeable slider doesn't respect the minimum and maximum values [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2380](https://github.com/gradio-app/gradio/pull/2380) + +### Documentation Changes: + +1. New Guide: Connecting to a Database 🗄️ + + A new guide by [@freddyaboulton](https://github.com/freddyaboulton) that explains how you can use Gradio to connect your app to a database. Read more [here](https://gradio.app/connecting_to_a_database/). + +2. New Guide: Running Background Tasks 🥷 + + A new guide by [@freddyaboulton](https://github.com/freddyaboulton) that explains how you can run background tasks from your gradio app. Read more [here](https://gradio.app/running_background_tasks/). + +3. Small fixes to docs for `Image` component by [@abidlabs](https://github.com/abidlabs) in [PR 2372](https://github.com/gradio-app/gradio/pull/2372) + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- Create a guide on how to connect an app to a database hosted on the cloud by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2341](https://github.com/gradio-app/gradio/pull/2341) +- Removes `analytics` dependency by [@abidlabs](https://github.com/abidlabs) in [PR 2347](https://github.com/gradio-app/gradio/pull/2347) +- Add guide on launching background tasks from your app by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2350](https://github.com/gradio-app/gradio/pull/2350) +- Fix typo in guide image path by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2357](https://github.com/gradio-app/gradio/pull/2357) +- Raise error if Blocks has duplicate component with same IDs by [@abidlabs](https://github.com/abidlabs) in [PR 2359](https://github.com/gradio-app/gradio/pull/2359) +- Hotfix: fix version back to 3.4 by [@abidlabs](https://github.com/abidlabs) in [PR 2361](https://github.com/gradio-app/gradio/pull/2361) +- Change version.txt to 3.4 instead of 3.4.0 by [@aliabd](https://github.com/aliabd) in [PR 2363](https://github.com/gradio-app/gradio/pull/2363) +- Catch the permission exception on the audio component by [@Ian-GL](https://github.com/Ian-GL) in [PR 2330](https://github.com/gradio-app/gradio/pull/2330) +- Fix image_classifier_interface_load demo by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2365](https://github.com/gradio-app/gradio/pull/2365) +- Small fixes to docs for `Image` component by [@abidlabs](https://github.com/abidlabs) in [PR 2372](https://github.com/gradio-app/gradio/pull/2372) +- Automated Release Notes by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2306](https://github.com/gradio-app/gradio/pull/2306) +- Fixed small typos in the docs [@julien-c](https://github.com/julien-c) in [PR 2373](https://github.com/gradio-app/gradio/pull/2373) +- Adds ability to disable pre/post-processing for examples [@abidlabs](https://github.com/abidlabs) in [PR 2383](https://github.com/gradio-app/gradio/pull/2383) +- Copy changelog file in website docker by [@aliabd](https://github.com/aliabd) in [PR 2384](https://github.com/gradio-app/gradio/pull/2384) +- Lets users provide a `gr.update()` dictionary even if post-processing is disabled [@abidlabs](https://github.com/abidlabs) in [PR 2385](https://github.com/gradio-app/gradio/pull/2385) +- Fix bug where errors would cause apps run in reload mode to hang forever by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2394](https://github.com/gradio-app/gradio/pull/2394) +- Fix bug where new typeable slider doesn't respect the minimum and maximum values [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2380](https://github.com/gradio-app/gradio/pull/2380) + +### Contributors Shoutout: + +No changes to highlight. + +## 3.4 + +### New Features: + +###### 1. Gallery Captions 🖼️ + +You can now pass captions to images in the Gallery component. To do so you need to pass a {List} of (image, {str} caption) tuples. This is optional and the component also accepts just a list of the images. + +Here's an example: + +```python +import gradio as gr + +images_with_captions = [ + ("https://images.unsplash.com/photo-1551969014-7d2c4cddf0b6", "Cheetah by David Groves"), + ("https://images.unsplash.com/photo-1546182990-dffeafbe841d", "Lion by Francesco"), + ("https://images.unsplash.com/photo-1561731216-c3a4d99437d5", "Tiger by Mike Marrah") + ] + +with gr.Blocks() as demo: + gr.Gallery(value=images_with_captions) + +demo.launch() +``` + +gallery_captions + +###### 2. Type Values into the Slider 🔢 + +You can now type values directly on the Slider component! Here's what it looks like: + +![type-slider](https://user-images.githubusercontent.com/9021060/192399877-76b662a1-fede-4417-a932-fc15f0da7360.gif) + +###### 3. Better Sketching and Inpainting 🎨 + +We've made a lot of changes to our Image component so that it can support better sketching and inpainting. + +Now supports: + +- A standalone black-and-white sketch + +```python +import gradio as gr +demo = gr.Interface(lambda x: x, gr.Sketchpad(), gr.Image()) +demo.launch() +``` + +![bw](https://user-images.githubusercontent.com/9021060/192410264-b08632b5-7b2a-4f86-afb0-5760e7b474cf.gif) + +- A standalone color sketch + +```python +import gradio as gr +demo = gr.Interface(lambda x: x, gr.Paint(), gr.Image()) +demo.launch() +``` + +![color-sketch](https://user-images.githubusercontent.com/9021060/192410500-3c8c3e64-a5fd-4df2-a991-f0a5cef93728.gif) + +- An uploadable image with black-and-white or color sketching + +```python +import gradio as gr +demo = gr.Interface(lambda x: x, gr.Image(source='upload', tool='color-sketch'), gr.Image()) # for black and white, tool = 'sketch' +demo.launch() +``` + +![sketch-new](https://user-images.githubusercontent.com/9021060/192402422-e53cb7b6-024e-448c-87eb-d6a35a63c476.gif) + +- Webcam with black-and-white or color sketching + +```python +import gradio as gr +demo = gr.Interface(lambda x: x, gr.Image(source='webcam', tool='color-sketch'), gr.Image()) # for black and white, tool = 'sketch' +demo.launch() +``` + +![webcam-sketch](https://user-images.githubusercontent.com/9021060/192410820-0ffaf324-776e-4e1f-9de6-0fdbbf4940fa.gif) + +As well as other fixes + +### Bug Fixes: + +1. Fix bug where max concurrency count is not respected in queue by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2286](https://github.com/gradio-app/gradio/pull/2286) +2. fix : queue could be blocked by [@SkyTNT](https://github.com/SkyTNT) in [PR 2288](https://github.com/gradio-app/gradio/pull/2288) +3. Supports `gr.update()` in example caching by [@abidlabs](https://github.com/abidlabs) in [PR 2309](https://github.com/gradio-app/gradio/pull/2309) +4. Clipboard fix for iframes by [@abidlabs](https://github.com/abidlabs) in [PR 2321](https://github.com/gradio-app/gradio/pull/2321) +5. Fix: Dataframe column headers are reset when you add a new column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2318](https://github.com/gradio-app/gradio/pull/2318) +6. Added support for URLs for Video, Audio, and Image by [@abidlabs](https://github.com/abidlabs) in [PR 2256](https://github.com/gradio-app/gradio/pull/2256) +7. Add documentation about how to create and use the Gradio FastAPI app by [@abidlabs](https://github.com/abidlabs) in [PR 2263](https://github.com/gradio-app/gradio/pull/2263) + +### Documentation Changes: + +1. Adding a Playground Tab to the Website by [@aliabd](https://github.com/aliabd) in [PR 1860](https://github.com/gradio-app/gradio/pull/1860) +2. Gradio for Tabular Data Science Workflows Guide by [@merveenoyan](https://github.com/merveenoyan) in [PR 2199](https://github.com/gradio-app/gradio/pull/2199) +3. Promotes `postprocess` and `preprocess` to documented parameters by [@abidlabs](https://github.com/abidlabs) in [PR 2293](https://github.com/gradio-app/gradio/pull/2293) +4. Update 2)key_features.md by [@voidxd](https://github.com/voidxd) in [PR 2326](https://github.com/gradio-app/gradio/pull/2326) +5. Add docs to blocks context postprocessing function by [@Ian-GL](https://github.com/Ian-GL) in [PR 2332](https://github.com/gradio-app/gradio/pull/2332) + +### Testing and Infrastructure Changes + +1. Website fixes and refactoring by [@aliabd](https://github.com/aliabd) in [PR 2280](https://github.com/gradio-app/gradio/pull/2280) +2. Don't deploy to spaces on release by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2313](https://github.com/gradio-app/gradio/pull/2313) + +### Full Changelog: + +- Website fixes and refactoring by [@aliabd](https://github.com/aliabd) in [PR 2280](https://github.com/gradio-app/gradio/pull/2280) +- Fix bug where max concurrency count is not respected in queue by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2286](https://github.com/gradio-app/gradio/pull/2286) +- Promotes `postprocess` and `preprocess` to documented parameters by [@abidlabs](https://github.com/abidlabs) in [PR 2293](https://github.com/gradio-app/gradio/pull/2293) +- Raise warning when trying to cache examples but not all inputs have examples by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2279](https://github.com/gradio-app/gradio/pull/2279) +- fix : queue could be blocked by [@SkyTNT](https://github.com/SkyTNT) in [PR 2288](https://github.com/gradio-app/gradio/pull/2288) +- Don't deploy to spaces on release by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2313](https://github.com/gradio-app/gradio/pull/2313) +- Supports `gr.update()` in example caching by [@abidlabs](https://github.com/abidlabs) in [PR 2309](https://github.com/gradio-app/gradio/pull/2309) +- Respect Upstream Queue when loading interfaces/blocks from Spaces by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2294](https://github.com/gradio-app/gradio/pull/2294) +- Clipboard fix for iframes by [@abidlabs](https://github.com/abidlabs) in [PR 2321](https://github.com/gradio-app/gradio/pull/2321) +- Sketching + Inpainting Capabilities to Gradio by [@abidlabs](https://github.com/abidlabs) in [PR 2144](https://github.com/gradio-app/gradio/pull/2144) +- Update 2)key_features.md by [@voidxd](https://github.com/voidxd) in [PR 2326](https://github.com/gradio-app/gradio/pull/2326) +- release 3.4b3 by [@abidlabs](https://github.com/abidlabs) in [PR 2328](https://github.com/gradio-app/gradio/pull/2328) +- Fix: Dataframe column headers are reset when you add a new column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2318](https://github.com/gradio-app/gradio/pull/2318) +- Start queue when gradio is a sub application by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2319](https://github.com/gradio-app/gradio/pull/2319) +- Fix Web Tracker Script by [@aliabd](https://github.com/aliabd) in [PR 2308](https://github.com/gradio-app/gradio/pull/2308) +- Add docs to blocks context postprocessing function by [@Ian-GL](https://github.com/Ian-GL) in [PR 2332](https://github.com/gradio-app/gradio/pull/2332) +- Fix typo in iterator variable name in run_predict function by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2340](https://github.com/gradio-app/gradio/pull/2340) +- Add captions to galleries by [@aliabid94](https://github.com/aliabid94) in [PR 2284](https://github.com/gradio-app/gradio/pull/2284) +- Typeable value on gradio.Slider by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2329](https://github.com/gradio-app/gradio/pull/2329) + +### Contributors Shoutout: + +- [@SkyTNT](https://github.com/SkyTNT) made their first contribution in [PR 2288](https://github.com/gradio-app/gradio/pull/2288) +- [@voidxd](https://github.com/voidxd) made their first contribution in [PR 2326](https://github.com/gradio-app/gradio/pull/2326) + +## 3.3 + +### New Features: + +###### 1. Iterative Outputs ⏳ + +You can now create an iterative output simply by having your function return a generator! + +Here's (part of) an example that was used to generate the interface below it. [See full code](https://colab.research.google.com/drive/1m9bWS6B82CT7bw-m4L6AJR8za7fEK7Ov?usp=sharing). + +```python +def predict(steps, seed): + generator = torch.manual_seed(seed) + for i in range(1,steps): + yield pipeline(generator=generator, num_inference_steps=i)["sample"][0] +``` + +![example](https://user-images.githubusercontent.com/9021060/189086273-f5e7087d-71fa-4158-90a9-08e84da0421c.mp4) + +###### 2. Accordion Layout 🆕 + +This version of Gradio introduces a new layout component to Blocks: the Accordion. Wrap your elements in a neat, expandable layout that allows users to toggle them as needed. + +Usage: ([Read the docs](https://gradio.app/docs/#accordion)) + +```python +with gr.Accordion("open up"): +# components here +``` + +![accordion](https://user-images.githubusercontent.com/9021060/189088465-f0ffd7f0-fc6a-42dc-9249-11c5e1e0529b.gif) + +###### 3. Skops Integration 📈 + +Our new integration with [skops](https://huggingface.co/blog/skops) allows you to load tabular classification and regression models directly from the [hub](https://huggingface.co/models). + +Here's a classification example showing how quick it is to set up an interface for a [model](https://huggingface.co/scikit-learn/tabular-playground). + +```python +import gradio as gr +gr.Interface.load("models/scikit-learn/tabular-playground").launch() +``` + +![187936493-5c90c01d-a6dd-400f-aa42-833a096156a1](https://user-images.githubusercontent.com/9021060/189090519-328fbcb4-120b-43c8-aa54-d6fccfa6b7e8.png) + +### Bug Fixes: + +No changes to highlight. + +### Documentation Changes: + +No changes to highlight. + +### Testing and Infrastructure Changes: + +No changes to highlight. + +### Breaking Changes: + +No changes to highlight. + +### Full Changelog: + +- safari fixes by [@pngwn](https://github.com/pngwn) in [PR 2138](https://github.com/gradio-app/gradio/pull/2138) +- Fix roundedness and form borders by [@aliabid94](https://github.com/aliabid94) in [PR 2147](https://github.com/gradio-app/gradio/pull/2147) +- Better processing of example data prior to creating dataset component by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2147](https://github.com/gradio-app/gradio/pull/2147) +- Show error on Connection drops by [@aliabid94](https://github.com/aliabid94) in [PR 2147](https://github.com/gradio-app/gradio/pull/2147) +- 3.2 release! by [@abidlabs](https://github.com/abidlabs) in [PR 2139](https://github.com/gradio-app/gradio/pull/2139) +- Fixed Named API Requests by [@abidlabs](https://github.com/abidlabs) in [PR 2151](https://github.com/gradio-app/gradio/pull/2151) +- Quick Fix: Cannot upload Model3D image after clearing it by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2168](https://github.com/gradio-app/gradio/pull/2168) +- Fixed misleading log when server_name is '0.0.0.0' by [@lamhoangtung](https://github.com/lamhoangtung) in [PR 2176](https://github.com/gradio-app/gradio/pull/2176) +- Keep embedded PngInfo metadata by [@cobryan05](https://github.com/cobryan05) in [PR 2170](https://github.com/gradio-app/gradio/pull/2170) +- Skops integration: Load tabular classification and regression models from the hub by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2126](https://github.com/gradio-app/gradio/pull/2126) +- Respect original filename when cached example files are downloaded by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2145](https://github.com/gradio-app/gradio/pull/2145) +- Add manual trigger to deploy to pypi by [@abidlabs](https://github.com/abidlabs) in [PR 2192](https://github.com/gradio-app/gradio/pull/2192) +- Fix bugs with gr.update by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2157](https://github.com/gradio-app/gradio/pull/2157) +- Make queue per app by [@aliabid94](https://github.com/aliabid94) in [PR 2193](https://github.com/gradio-app/gradio/pull/2193) +- Preserve Labels In Interpretation Components by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2166](https://github.com/gradio-app/gradio/pull/2166) +- Quick Fix: Multiple file download not working by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2169](https://github.com/gradio-app/gradio/pull/2169) +- use correct MIME type for js-script file by [@daspartho](https://github.com/daspartho) in [PR 2200](https://github.com/gradio-app/gradio/pull/2200) +- Add accordion component by [@aliabid94](https://github.com/aliabid94) in [PR 2208](https://github.com/gradio-app/gradio/pull/2208) + +### Contributors Shoutout: + +- [@lamhoangtung](https://github.com/lamhoangtung) made their first contribution in [PR 2176](https://github.com/gradio-app/gradio/pull/2176) +- [@cobryan05](https://github.com/cobryan05) made their first contribution in [PR 2170](https://github.com/gradio-app/gradio/pull/2170) +- [@daspartho](https://github.com/daspartho) made their first contribution in [PR 2200](https://github.com/gradio-app/gradio/pull/2200) + +## 3.2 + +### New Features: + +###### 1. Improvements to Queuing 🥇 + +We've implemented a brand new queuing system based on **web sockets** instead of HTTP long polling. Among other things, this allows us to manage queue sizes better on Hugging Face Spaces. There are also additional queue-related parameters you can add: + +- Now supports concurrent workers (parallelization) + +```python +demo = gr.Interface(...) +demo.queue(concurrency_count=3) +demo.launch() +``` + +- Configure a maximum queue size + +```python +demo = gr.Interface(...) +demo.queue(max_size=100) +demo.launch() +``` + +- If a user closes their tab / browser, they leave the queue, which means the demo will run faster for everyone else + +###### 2. Fixes to Examples + +- Dataframe examples will render properly, and look much clearer in the UI: (thanks to PR #2125) + +![Screen Shot 2022-08-30 at 8 29 58 PM](https://user-images.githubusercontent.com/9021060/187586561-d915bafb-f968-4966-b9a2-ef41119692b2.png) + +- Image and Video thumbnails are cropped to look neater and more uniform: (thanks to PR #2109) + +![Screen Shot 2022-08-30 at 8 32 15 PM](https://user-images.githubusercontent.com/9021060/187586890-56e1e4f0-1b84-42d9-a82f-911772c41030.png) + +- Other fixes in PR #2131 and #2064 make it easier to design and use Examples + +###### 3. Component Fixes 🧱 + +- Specify the width and height of an image in its style tag (thanks to PR #2133) + +```python +components.Image().style(height=260, width=300) +``` + +- Automatic conversion of videos so they are playable in the browser (thanks to PR #2003). Gradio will check if a video's format is playable in the browser and, if it isn't, will automatically convert it to a format that is (mp4). +- Pass in a json filepath to the Label component (thanks to PR #2083) +- Randomize the default value of a Slider (thanks to PR #1935) + +![slider-random](https://user-images.githubusercontent.com/9021060/187596230-3db9697f-9f4d-42f5-9387-d77573513448.gif) + +- Improvements to State in PR #2100 + +###### 4. Ability to Randomize Input Sliders and Reload Data whenever the Page Loads + +- In some cases, you want to be able to show a different set of input data to every user as they load the page app. For example, you might want to randomize the value of a "seed" `Slider` input. Or you might want to show a `Textbox` with the current date. We now supporting passing _functions_ as the default value in input components. When you pass in a function, it gets **re-evaluated** every time someone loads the demo, allowing you to reload / change data for different users. + +Here's an example loading the current date time into an input Textbox: + +```python +import gradio as gr +import datetime + +with gr.Blocks() as demo: + gr.Textbox(datetime.datetime.now) + +demo.launch() +``` + +Note that we don't evaluate the function -- `datetime.datetime.now()` -- we pass in the function itself to get this behavior -- `datetime.datetime.now` + +Because randomizing the initial value of `Slider` is a common use case, we've added a `randomize` keyword argument you can use to randomize its initial value: + +```python +import gradio as gr +demo = gr.Interface(lambda x:x, gr.Slider(0, 10, randomize=True), "number") +demo.launch() +``` + +###### 5. New Guide 🖊️ + +- [Gradio and W&B Integration](https://gradio.app/Gradio_and_Wandb_Integration/) + +### Full Changelog: + +- Reset components to original state by setting value to None by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2044](https://github.com/gradio-app/gradio/pull/2044) +- Cleaning up the way data is processed for components by [@abidlabs](https://github.com/abidlabs) in [PR 1967](https://github.com/gradio-app/gradio/pull/1967) +- version 3.1.8b by [@abidlabs](https://github.com/abidlabs) in [PR 2063](https://github.com/gradio-app/gradio/pull/2063) +- Wandb guide by [@AK391](https://github.com/AK391) in [PR 1898](https://github.com/gradio-app/gradio/pull/1898) +- Add a flagging callback to save json files to a hugging face dataset by [@chrisemezue](https://github.com/chrisemezue) in [PR 1821](https://github.com/gradio-app/gradio/pull/1821) +- Add data science demos to landing page by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2067](https://github.com/gradio-app/gradio/pull/2067) +- Hide time series + xgboost demos by default by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2079](https://github.com/gradio-app/gradio/pull/2079) +- Encourage people to keep trying when queue full by [@apolinario](https://github.com/apolinario) in [PR 2076](https://github.com/gradio-app/gradio/pull/2076) +- Updated our analytics on creation of Blocks/Interface by [@abidlabs](https://github.com/abidlabs) in [PR 2082](https://github.com/gradio-app/gradio/pull/2082) +- `Label` component now accepts file paths to `.json` files by [@abidlabs](https://github.com/abidlabs) in [PR 2083](https://github.com/gradio-app/gradio/pull/2083) +- Fix issues related to demos in Spaces by [@abidlabs](https://github.com/abidlabs) in [PR 2086](https://github.com/gradio-app/gradio/pull/2086) +- Fix TimeSeries examples not properly displayed in UI by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2064](https://github.com/gradio-app/gradio/pull/2064) +- Fix infinite requests when doing tab item select by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2070](https://github.com/gradio-app/gradio/pull/2070) +- Accept deprecated `file` route as well by [@abidlabs](https://github.com/abidlabs) in [PR 2099](https://github.com/gradio-app/gradio/pull/2099) +- Allow frontend method execution on Block.load event by [@codedealer](https://github.com/codedealer) in [PR 2108](https://github.com/gradio-app/gradio/pull/2108) +- Improvements to `State` by [@abidlabs](https://github.com/abidlabs) in [PR 2100](https://github.com/gradio-app/gradio/pull/2100) +- Catch IndexError, KeyError in video_is_playable by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2113](https://github.com/gradio-app/gradio/pull/2113) +- Fix: Download button does not respect the filepath returned by the function by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2073](https://github.com/gradio-app/gradio/pull/2073) +- Refactoring Layout: Adding column widths, forms, and more. by [@aliabid94](https://github.com/aliabid94) in [PR 2097](https://github.com/gradio-app/gradio/pull/2097) +- Update CONTRIBUTING.md by [@abidlabs](https://github.com/abidlabs) in [PR 2118](https://github.com/gradio-app/gradio/pull/2118) +- 2092 df ex by [@pngwn](https://github.com/pngwn) in [PR 2125](https://github.com/gradio-app/gradio/pull/2125) +- feat(samples table/gallery): Crop thumbs to square by [@ronvoluted](https://github.com/ronvoluted) in [PR 2109](https://github.com/gradio-app/gradio/pull/2109) +- Some enhancements to `gr.Examples` by [@abidlabs](https://github.com/abidlabs) in [PR 2131](https://github.com/gradio-app/gradio/pull/2131) +- Image size fix by [@aliabid94](https://github.com/aliabid94) in [PR 2133](https://github.com/gradio-app/gradio/pull/2133) + +### Contributors Shoutout: + +- [@chrisemezue](https://github.com/chrisemezue) made their first contribution in [PR 1821](https://github.com/gradio-app/gradio/pull/1821) +- [@apolinario](https://github.com/apolinario) made their first contribution in [PR 2076](https://github.com/gradio-app/gradio/pull/2076) +- [@codedealer](https://github.com/codedealer) made their first contribution in [PR 2108](https://github.com/gradio-app/gradio/pull/2108) + +## 3.1 + +### New Features: + +###### 1. Embedding Demos on Any Website 💻 + +With PR #1444, Gradio is now distributed as a web component. This means demos can be natively embedded on websites. You'll just need to add two lines: one to load the gradio javascript, and one to link to the demos backend. + +Here's a simple example that embeds the demo from a Hugging Face space: + +```html + + +``` + +But you can also embed demos that are running anywhere, you just need to link the demo to `src` instead of `space`. In fact, all the demos on the gradio website are embedded this way: + +Screen Shot 2022-07-14 at 2 41 44 PM + +Read more in the [Embedding Gradio Demos](https://gradio.app/embedding_gradio_demos) guide. + +###### 2. Reload Mode 👨‍💻 + +Reload mode helps developers create gradio demos faster by automatically reloading the demo whenever the code changes. It can support development on Python IDEs (VS Code, PyCharm, etc), the terminal, as well as Jupyter notebooks. + +If your demo code is in a script named `app.py`, instead of running `python app.py` you can now run `gradio app.py` and that will launch the demo in reload mode: + +```bash +Launching in reload mode on: http://127.0.0.1:7860 (Press CTRL+C to quit) +Watching... +WARNING: The --reload flag should not be used in production on Windows. +``` + +If you're working from a Jupyter or Colab Notebook, use these magic commands instead: `%load_ext gradio` when you import gradio, and `%%blocks` in the top of the cell with the demo code. Here's an example that shows how much faster the development becomes: + +![Blocks](https://user-images.githubusercontent.com/9021060/178986488-ed378cc8-5141-4330-ba41-672b676863d0.gif) + +###### 3. Inpainting Support on `gr.Image()` 🎨 + +We updated the Image component to add support for inpainting demos. It works by adding `tool="sketch"` as a parameter, that passes both an image and a sketchable mask to your prediction function. + +Here's an example from the [LAMA space](https://huggingface.co/spaces/akhaliq/lama): + +![FXApVlFVsAALSD-](https://user-images.githubusercontent.com/9021060/178989479-549867c8-7fb0-436a-a97d-1e91c9f5e611.jpeg) + +###### 4. Markdown and HTML support in Dataframes 🔢 + +We upgraded the Dataframe component in PR #1684 to support rendering Markdown and HTML inside the cells. + +This means you can build Dataframes that look like the following: + +![image (8)](https://user-images.githubusercontent.com/9021060/178991233-41cb07a5-e7a3-433e-89b8-319bc78eb9c2.png) + +###### 5. `gr.Examples()` for Blocks 🧱 + +We've added the `gr.Examples` component helper to allow you to add examples to any Blocks demo. This class is a wrapper over the `gr.Dataset` component. + +Screen Shot 2022-07-14 at 2 23 50 PM + +gr.Examples takes two required parameters: + +- `examples` which takes in a nested list +- `inputs` which takes in a component or list of components + +You can read more in the [Examples docs](https://gradio.app/docs/#examples) or the [Adding Examples to your Demos guide](https://gradio.app/adding_examples_to_your_app/). + +###### 6. Fixes to Audio Streaming + +With [PR 1828](https://github.com/gradio-app/gradio/pull/1828) we now hide the status loading animation, as well as remove the echo in streaming. Check out the [stream_audio](https://github.com/gradio-app/gradio/blob/main/demo/stream_audio/run.py) demo for more or read through our [Real Time Speech Recognition](https://gradio.app/real_time_speech_recognition/) guide. + +Screen Shot 2022-07-19 at 6 02 35 PM + +### Full Changelog: + +- File component: list multiple files and allow for download #1446 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1681](https://github.com/gradio-app/gradio/pull/1681) +- Add ColorPicker to docs by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1768](https://github.com/gradio-app/gradio/pull/1768) +- Mock out requests in TestRequest unit tests by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1794](https://github.com/gradio-app/gradio/pull/1794) +- Add requirements.txt and test_files to source dist by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1817](https://github.com/gradio-app/gradio/pull/1817) +- refactor: f-string for tunneling.py by [@nhankiet](https://github.com/nhankiet) in [PR 1819](https://github.com/gradio-app/gradio/pull/1819) +- Miscellaneous formatting improvements to website by [@aliabd](https://github.com/aliabd) in [PR 1754](https://github.com/gradio-app/gradio/pull/1754) +- `integrate()` method moved to `Blocks` by [@abidlabs](https://github.com/abidlabs) in [PR 1776](https://github.com/gradio-app/gradio/pull/1776) +- Add python-3.7 tests by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1818](https://github.com/gradio-app/gradio/pull/1818) +- Copy test dir in website dockers by [@aliabd](https://github.com/aliabd) in [PR 1827](https://github.com/gradio-app/gradio/pull/1827) +- Add info to docs on how to set default values for components by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1788](https://github.com/gradio-app/gradio/pull/1788) +- Embedding Components on Docs by [@aliabd](https://github.com/aliabd) in [PR 1726](https://github.com/gradio-app/gradio/pull/1726) +- Remove usage of deprecated gr.inputs and gr.outputs from website by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1796](https://github.com/gradio-app/gradio/pull/1796) +- Some cleanups to the docs page by [@abidlabs](https://github.com/abidlabs) in [PR 1822](https://github.com/gradio-app/gradio/pull/1822) + +### Contributors Shoutout: + +- [@nhankiet](https://github.com/nhankiet) made their first contribution in [PR 1819](https://github.com/gradio-app/gradio/pull/1819) + +## 3.0 + +###### 🔥 Gradio 3.0 is the biggest update to the library, ever. + +### New Features: + +###### 1. Blocks 🧱 + +Blocks is a new, low-level API that allows you to have full control over the data flows and layout of your application. It allows you to build very complex, multi-step applications. For example, you might want to: + +- Group together related demos as multiple tabs in one web app +- Change the layout of your demo instead of just having all of the inputs on the left and outputs on the right +- Have multi-step interfaces, in which the output of one model becomes the input to the next model, or have more flexible data flows in general +- Change a component's properties (for example, the choices in a Dropdown) or its visibility based on user input + +Here's a simple example that creates the demo below it: + +```python +import gradio as gr + +def update(name): + return f"Welcome to Gradio, {name}!" + +demo = gr.Blocks() + +with demo: + gr.Markdown( + """ + # Hello World! + Start typing below to see the output. + """) + inp = gr.Textbox(placeholder="What is your name?") + out = gr.Textbox() + + inp.change(fn=update, + inputs=inp, + outputs=out) + +demo.launch() +``` + +![hello-blocks](https://user-images.githubusercontent.com/9021060/168684108-78cbd24b-e6bd-4a04-a8d9-20d535203434.gif) + +Read our [Introduction to Blocks](http://gradio.app/introduction_to_blocks/) guide for more, and join the 🎈 [Gradio Blocks Party](https://huggingface.co/spaces/Gradio-Blocks/README)! + +###### 2. Our Revamped Design 🎨 + +We've upgraded our design across the entire library: from components, and layouts all the way to dark mode. + +![kitchen_sink](https://user-images.githubusercontent.com/9021060/168686333-7a6e3096-3e23-4309-abf2-5cd7736e0463.gif) + +###### 3. A New Website 💻 + +We've upgraded [gradio.app](https://gradio.app) to make it cleaner, faster and easier to use. Our docs now come with components and demos embedded directly on the page. So you can quickly get up to speed with what you're looking for. + +![website](https://user-images.githubusercontent.com/9021060/168687191-10d6a3bd-101f-423a-8193-48f47a5e077d.gif) + +###### 4. New Components: Model3D, Dataset, and More.. + +We've introduced a lot of new components in `3.0`, including `Model3D`, `Dataset`, `Markdown`, `Button` and `Gallery`. You can find all the components and play around with them [here](https://gradio.app/docs/#components). + +![Model3d](https://user-images.githubusercontent.com/9021060/168689062-6ad77151-8cc5-467d-916c-f7c78e52ec0c.gif) + +### Full Changelog: + +- Gradio dash fe by [@pngwn](https://github.com/pngwn) in [PR 807](https://github.com/gradio-app/gradio/pull/807) +- Blocks components by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 765](https://github.com/gradio-app/gradio/pull/765) +- Blocks components V2 by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 843](https://github.com/gradio-app/gradio/pull/843) +- Blocks-Backend-Events by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 844](https://github.com/gradio-app/gradio/pull/844) +- Interfaces from Blocks by [@aliabid94](https://github.com/aliabid94) in [PR 849](https://github.com/gradio-app/gradio/pull/849) +- Blocks dev by [@aliabid94](https://github.com/aliabid94) in [PR 853](https://github.com/gradio-app/gradio/pull/853) +- Started updating demos to use the new `gradio.components` syntax by [@abidlabs](https://github.com/abidlabs) in [PR 848](https://github.com/gradio-app/gradio/pull/848) +- add test infra + add browser tests to CI by [@pngwn](https://github.com/pngwn) in [PR 852](https://github.com/gradio-app/gradio/pull/852) +- 854 textbox by [@pngwn](https://github.com/pngwn) in [PR 859](https://github.com/gradio-app/gradio/pull/859) +- Getting old Python unit tests to pass on `blocks-dev` by [@abidlabs](https://github.com/abidlabs) in [PR 861](https://github.com/gradio-app/gradio/pull/861) +- initialise chatbot with empty array of messages by [@pngwn](https://github.com/pngwn) in [PR 867](https://github.com/gradio-app/gradio/pull/867) +- add test for output to input by [@pngwn](https://github.com/pngwn) in [PR 866](https://github.com/gradio-app/gradio/pull/866) +- More Interface -> Blocks features by [@aliabid94](https://github.com/aliabid94) in [PR 864](https://github.com/gradio-app/gradio/pull/864) +- Fixing external.py in blocks-dev to reflect the new HF Spaces paths by [@abidlabs](https://github.com/abidlabs) in [PR 879](https://github.com/gradio-app/gradio/pull/879) +- backend_default_value_refactoring by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 871](https://github.com/gradio-app/gradio/pull/871) +- fix default_value by [@pngwn](https://github.com/pngwn) in [PR 869](https://github.com/gradio-app/gradio/pull/869) +- fix buttons by [@aliabid94](https://github.com/aliabid94) in [PR 883](https://github.com/gradio-app/gradio/pull/883) +- Checking and updating more demos to use 3.0 syntax by [@abidlabs](https://github.com/abidlabs) in [PR 892](https://github.com/gradio-app/gradio/pull/892) +- Blocks Tests by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 902](https://github.com/gradio-app/gradio/pull/902) +- Interface fix by [@pngwn](https://github.com/pngwn) in [PR 901](https://github.com/gradio-app/gradio/pull/901) +- Quick fix: Issue 893 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 907](https://github.com/gradio-app/gradio/pull/907) +- 3d Image Component by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 775](https://github.com/gradio-app/gradio/pull/775) +- fix endpoint url in prod by [@pngwn](https://github.com/pngwn) in [PR 911](https://github.com/gradio-app/gradio/pull/911) +- rename Model3d to Image3D by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 912](https://github.com/gradio-app/gradio/pull/912) +- update pypi to 2.9.1 by [@abidlabs](https://github.com/abidlabs) in [PR 916](https://github.com/gradio-app/gradio/pull/916) +- blocks-with-fix by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 917](https://github.com/gradio-app/gradio/pull/917) +- Restore Interpretation, Live, Auth, Queueing by [@aliabid94](https://github.com/aliabid94) in [PR 915](https://github.com/gradio-app/gradio/pull/915) +- Allow `Blocks` instances to be used like a `Block` in other `Blocks` by [@abidlabs](https://github.com/abidlabs) in [PR 919](https://github.com/gradio-app/gradio/pull/919) +- Redesign 1 by [@pngwn](https://github.com/pngwn) in [PR 918](https://github.com/gradio-app/gradio/pull/918) +- blocks-components-tests by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 904](https://github.com/gradio-app/gradio/pull/904) +- fix unit + browser tests by [@pngwn](https://github.com/pngwn) in [PR 926](https://github.com/gradio-app/gradio/pull/926) +- blocks-move-test-data by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 927](https://github.com/gradio-app/gradio/pull/927) +- remove debounce from form inputs by [@pngwn](https://github.com/pngwn) in [PR 932](https://github.com/gradio-app/gradio/pull/932) +- reimplement webcam video by [@pngwn](https://github.com/pngwn) in [PR 928](https://github.com/gradio-app/gradio/pull/928) +- blocks-move-test-data by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 941](https://github.com/gradio-app/gradio/pull/941) +- allow audio components to take a string value by [@pngwn](https://github.com/pngwn) in [PR 930](https://github.com/gradio-app/gradio/pull/930) +- static mode for textbox by [@pngwn](https://github.com/pngwn) in [PR 929](https://github.com/gradio-app/gradio/pull/929) +- fix file upload text by [@pngwn](https://github.com/pngwn) in [PR 931](https://github.com/gradio-app/gradio/pull/931) +- tabbed-interface-rewritten by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 958](https://github.com/gradio-app/gradio/pull/958) +- Gan demo fix by [@abidlabs](https://github.com/abidlabs) in [PR 965](https://github.com/gradio-app/gradio/pull/965) +- Blocks analytics by [@abidlabs](https://github.com/abidlabs) in [PR 947](https://github.com/gradio-app/gradio/pull/947) +- Blocks page load by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 963](https://github.com/gradio-app/gradio/pull/963) +- add frontend for page load events by [@pngwn](https://github.com/pngwn) in [PR 967](https://github.com/gradio-app/gradio/pull/967) +- fix i18n and some tweaks by [@pngwn](https://github.com/pngwn) in [PR 966](https://github.com/gradio-app/gradio/pull/966) +- add jinja2 to reqs by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 969](https://github.com/gradio-app/gradio/pull/969) +- Cleaning up `Launchable()` by [@abidlabs](https://github.com/abidlabs) in [PR 968](https://github.com/gradio-app/gradio/pull/968) +- Fix #944 by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 971](https://github.com/gradio-app/gradio/pull/971) +- New Blocks Demo: neural instrument cloning by [@abidlabs](https://github.com/abidlabs) in [PR 975](https://github.com/gradio-app/gradio/pull/975) +- Add huggingface_hub client library by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 973](https://github.com/gradio-app/gradio/pull/973) +- State and variables by [@aliabid94](https://github.com/aliabid94) in [PR 977](https://github.com/gradio-app/gradio/pull/977) +- update-components by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 986](https://github.com/gradio-app/gradio/pull/986) +- ensure dataframe updates as expected by [@pngwn](https://github.com/pngwn) in [PR 981](https://github.com/gradio-app/gradio/pull/981) +- test-guideline by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 990](https://github.com/gradio-app/gradio/pull/990) +- Issue #785: add footer by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 972](https://github.com/gradio-app/gradio/pull/972) +- indentation fix by [@abidlabs](https://github.com/abidlabs) in [PR 993](https://github.com/gradio-app/gradio/pull/993) +- missing quote by [@aliabd](https://github.com/aliabd) in [PR 996](https://github.com/gradio-app/gradio/pull/996) +- added interactive parameter to components by [@abidlabs](https://github.com/abidlabs) in [PR 992](https://github.com/gradio-app/gradio/pull/992) +- custom-components by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 985](https://github.com/gradio-app/gradio/pull/985) +- Refactor component shortcuts by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 995](https://github.com/gradio-app/gradio/pull/995) +- Plot Component by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 805](https://github.com/gradio-app/gradio/pull/805) +- updated PyPi version to 2.9.2 by [@abidlabs](https://github.com/abidlabs) in [PR 1002](https://github.com/gradio-app/gradio/pull/1002) +- Release 2.9.3 by [@abidlabs](https://github.com/abidlabs) in [PR 1003](https://github.com/gradio-app/gradio/pull/1003) +- Image3D Examples Fix by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1001](https://github.com/gradio-app/gradio/pull/1001) +- release 2.9.4 by [@abidlabs](https://github.com/abidlabs) in [PR 1006](https://github.com/gradio-app/gradio/pull/1006) +- templates import hotfix by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1008](https://github.com/gradio-app/gradio/pull/1008) +- Progress indicator bar by [@aliabid94](https://github.com/aliabid94) in [PR 997](https://github.com/gradio-app/gradio/pull/997) +- Fixed image input for absolute path by [@JefferyChiang](https://github.com/JefferyChiang) in [PR 1004](https://github.com/gradio-app/gradio/pull/1004) +- Model3D + Plot Components by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1010](https://github.com/gradio-app/gradio/pull/1010) +- Gradio Guides: Creating CryptoPunks with GANs by [@NimaBoscarino](https://github.com/NimaBoscarino) in [PR 1000](https://github.com/gradio-app/gradio/pull/1000) +- [BIG PR] Gradio blocks & redesigned components by [@abidlabs](https://github.com/abidlabs) in [PR 880](https://github.com/gradio-app/gradio/pull/880) +- fixed failing test on main by [@abidlabs](https://github.com/abidlabs) in [PR 1023](https://github.com/gradio-app/gradio/pull/1023) +- Use smaller ASR model in external test by [@abidlabs](https://github.com/abidlabs) in [PR 1024](https://github.com/gradio-app/gradio/pull/1024) +- updated PyPi version to 2.9.0b by [@abidlabs](https://github.com/abidlabs) in [PR 1026](https://github.com/gradio-app/gradio/pull/1026) +- Fixing import issues so that the package successfully installs on colab notebooks by [@abidlabs](https://github.com/abidlabs) in [PR 1027](https://github.com/gradio-app/gradio/pull/1027) +- Update website tracker slackbot by [@aliabd](https://github.com/aliabd) in [PR 1037](https://github.com/gradio-app/gradio/pull/1037) +- textbox-autoheight by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1009](https://github.com/gradio-app/gradio/pull/1009) +- Model3D Examples fixes by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1035](https://github.com/gradio-app/gradio/pull/1035) +- GAN Gradio Guide: Adjustments to iframe heights by [@NimaBoscarino](https://github.com/NimaBoscarino) in [PR 1042](https://github.com/gradio-app/gradio/pull/1042) +- added better default labels to form components by [@abidlabs](https://github.com/abidlabs) in [PR 1040](https://github.com/gradio-app/gradio/pull/1040) +- Slackbot web tracker fix by [@aliabd](https://github.com/aliabd) in [PR 1043](https://github.com/gradio-app/gradio/pull/1043) +- Plot fixes by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1044](https://github.com/gradio-app/gradio/pull/1044) +- Small fixes to the demos by [@abidlabs](https://github.com/abidlabs) in [PR 1030](https://github.com/gradio-app/gradio/pull/1030) +- fixing demo issue with website by [@aliabd](https://github.com/aliabd) in [PR 1047](https://github.com/gradio-app/gradio/pull/1047) +- [hotfix] HighlightedText by [@aliabid94](https://github.com/aliabid94) in [PR 1046](https://github.com/gradio-app/gradio/pull/1046) +- Update text by [@ronvoluted](https://github.com/ronvoluted) in [PR 1050](https://github.com/gradio-app/gradio/pull/1050) +- Update CONTRIBUTING.md by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1052](https://github.com/gradio-app/gradio/pull/1052) +- fix(ui): Increase contrast for footer by [@ronvoluted](https://github.com/ronvoluted) in [PR 1048](https://github.com/gradio-app/gradio/pull/1048) +- UI design update by [@gary149](https://github.com/gary149) in [PR 1041](https://github.com/gradio-app/gradio/pull/1041) +- updated PyPi version to 2.9.0b8 by [@abidlabs](https://github.com/abidlabs) in [PR 1059](https://github.com/gradio-app/gradio/pull/1059) +- Running, testing, and fixing demos by [@abidlabs](https://github.com/abidlabs) in [PR 1060](https://github.com/gradio-app/gradio/pull/1060) +- Form layout by [@pngwn](https://github.com/pngwn) in [PR 1054](https://github.com/gradio-app/gradio/pull/1054) +- inputless-interfaces by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1038](https://github.com/gradio-app/gradio/pull/1038) +- Update PULL_REQUEST_TEMPLATE.md by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1068](https://github.com/gradio-app/gradio/pull/1068) +- Upgrading node memory to 4gb in website Docker by [@aliabd](https://github.com/aliabd) in [PR 1069](https://github.com/gradio-app/gradio/pull/1069) +- Website reload error by [@aliabd](https://github.com/aliabd) in [PR 1079](https://github.com/gradio-app/gradio/pull/1079) +- fixed favicon issue by [@abidlabs](https://github.com/abidlabs) in [PR 1064](https://github.com/gradio-app/gradio/pull/1064) +- remove-queue-from-events by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1056](https://github.com/gradio-app/gradio/pull/1056) +- Enable vertex colors for OBJs files by [@radames](https://github.com/radames) in [PR 1074](https://github.com/gradio-app/gradio/pull/1074) +- Dark text by [@ronvoluted](https://github.com/ronvoluted) in [PR 1049](https://github.com/gradio-app/gradio/pull/1049) +- Scroll to output by [@pngwn](https://github.com/pngwn) in [PR 1077](https://github.com/gradio-app/gradio/pull/1077) +- Explicitly list pnpm version 6 in contributing guide by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1085](https://github.com/gradio-app/gradio/pull/1085) +- hotfix for encrypt issue by [@abidlabs](https://github.com/abidlabs) in [PR 1096](https://github.com/gradio-app/gradio/pull/1096) +- Release 2.9b9 by [@abidlabs](https://github.com/abidlabs) in [PR 1098](https://github.com/gradio-app/gradio/pull/1098) +- tweak node circleci settings by [@pngwn](https://github.com/pngwn) in [PR 1091](https://github.com/gradio-app/gradio/pull/1091) +- Website Reload Error by [@aliabd](https://github.com/aliabd) in [PR 1099](https://github.com/gradio-app/gradio/pull/1099) +- Website Reload: README in demos docker by [@aliabd](https://github.com/aliabd) in [PR 1100](https://github.com/gradio-app/gradio/pull/1100) +- Flagging fixes by [@abidlabs](https://github.com/abidlabs) in [PR 1081](https://github.com/gradio-app/gradio/pull/1081) +- Backend for optional labels by [@abidlabs](https://github.com/abidlabs) in [PR 1080](https://github.com/gradio-app/gradio/pull/1080) +- Optional labels fe by [@pngwn](https://github.com/pngwn) in [PR 1105](https://github.com/gradio-app/gradio/pull/1105) +- clean-deprecated-parameters by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1090](https://github.com/gradio-app/gradio/pull/1090) +- Blocks rendering fix by [@abidlabs](https://github.com/abidlabs) in [PR 1102](https://github.com/gradio-app/gradio/pull/1102) +- Redos #1106 by [@abidlabs](https://github.com/abidlabs) in [PR 1112](https://github.com/gradio-app/gradio/pull/1112) +- Interface types: handle input-only, output-only, and unified interfaces by [@abidlabs](https://github.com/abidlabs) in [PR 1108](https://github.com/gradio-app/gradio/pull/1108) +- Hotfix + New pypi release 2.9b11 by [@abidlabs](https://github.com/abidlabs) in [PR 1118](https://github.com/gradio-app/gradio/pull/1118) +- issue-checkbox by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1122](https://github.com/gradio-app/gradio/pull/1122) +- issue-checkbox-hotfix by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1127](https://github.com/gradio-app/gradio/pull/1127) +- Fix demos in website by [@aliabd](https://github.com/aliabd) in [PR 1130](https://github.com/gradio-app/gradio/pull/1130) +- Guide for Gradio ONNX model zoo on Huggingface by [@AK391](https://github.com/AK391) in [PR 1073](https://github.com/gradio-app/gradio/pull/1073) +- ONNX guide fixes by [@aliabd](https://github.com/aliabd) in [PR 1131](https://github.com/gradio-app/gradio/pull/1131) +- Stacked form inputs css by [@gary149](https://github.com/gary149) in [PR 1134](https://github.com/gradio-app/gradio/pull/1134) +- made default value in textbox empty string by [@abidlabs](https://github.com/abidlabs) in [PR 1135](https://github.com/gradio-app/gradio/pull/1135) +- Examples UI by [@gary149](https://github.com/gary149) in [PR 1121](https://github.com/gradio-app/gradio/pull/1121) +- Chatbot custom color support by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1092](https://github.com/gradio-app/gradio/pull/1092) +- highlighted text colors by [@pngwn](https://github.com/pngwn) in [PR 1119](https://github.com/gradio-app/gradio/pull/1119) +- pin to pnpm 6 for now by [@pngwn](https://github.com/pngwn) in [PR 1147](https://github.com/gradio-app/gradio/pull/1147) +- Restore queue in Blocks by [@aliabid94](https://github.com/aliabid94) in [PR 1137](https://github.com/gradio-app/gradio/pull/1137) +- add select event for tabitems by [@pngwn](https://github.com/pngwn) in [PR 1154](https://github.com/gradio-app/gradio/pull/1154) +- max_lines + autoheight for textbox by [@pngwn](https://github.com/pngwn) in [PR 1153](https://github.com/gradio-app/gradio/pull/1153) +- use color palette for chatbot by [@pngwn](https://github.com/pngwn) in [PR 1152](https://github.com/gradio-app/gradio/pull/1152) +- Timeseries improvements by [@pngwn](https://github.com/pngwn) in [PR 1149](https://github.com/gradio-app/gradio/pull/1149) +- move styling for interface panels to frontend by [@pngwn](https://github.com/pngwn) in [PR 1146](https://github.com/gradio-app/gradio/pull/1146) +- html tweaks by [@pngwn](https://github.com/pngwn) in [PR 1145](https://github.com/gradio-app/gradio/pull/1145) +- Issue #768: Support passing none to resize and crop image by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1144](https://github.com/gradio-app/gradio/pull/1144) +- image gallery component + img css by [@aliabid94](https://github.com/aliabid94) in [PR 1140](https://github.com/gradio-app/gradio/pull/1140) +- networking tweak by [@abidlabs](https://github.com/abidlabs) in [PR 1143](https://github.com/gradio-app/gradio/pull/1143) +- Allow enabling queue per event listener by [@aliabid94](https://github.com/aliabid94) in [PR 1155](https://github.com/gradio-app/gradio/pull/1155) +- config hotfix and v. 2.9b23 by [@abidlabs](https://github.com/abidlabs) in [PR 1158](https://github.com/gradio-app/gradio/pull/1158) +- Custom JS calls by [@aliabid94](https://github.com/aliabid94) in [PR 1082](https://github.com/gradio-app/gradio/pull/1082) +- Small fixes: queue default fix, ffmpeg installation message by [@abidlabs](https://github.com/abidlabs) in [PR 1159](https://github.com/gradio-app/gradio/pull/1159) +- formatting by [@abidlabs](https://github.com/abidlabs) in [PR 1161](https://github.com/gradio-app/gradio/pull/1161) +- enable flex grow for gr-box by [@radames](https://github.com/radames) in [PR 1165](https://github.com/gradio-app/gradio/pull/1165) +- 1148 loading by [@pngwn](https://github.com/pngwn) in [PR 1164](https://github.com/gradio-app/gradio/pull/1164) +- Put enable_queue kwarg back in launch() by [@aliabid94](https://github.com/aliabid94) in [PR 1167](https://github.com/gradio-app/gradio/pull/1167) +- A few small fixes by [@abidlabs](https://github.com/abidlabs) in [PR 1171](https://github.com/gradio-app/gradio/pull/1171) +- Hotfix for dropdown component by [@abidlabs](https://github.com/abidlabs) in [PR 1172](https://github.com/gradio-app/gradio/pull/1172) +- use secondary buttons in interface by [@pngwn](https://github.com/pngwn) in [PR 1173](https://github.com/gradio-app/gradio/pull/1173) +- 1183 component height by [@pngwn](https://github.com/pngwn) in [PR 1185](https://github.com/gradio-app/gradio/pull/1185) +- 962 dataframe by [@pngwn](https://github.com/pngwn) in [PR 1186](https://github.com/gradio-app/gradio/pull/1186) +- update-contributing by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1188](https://github.com/gradio-app/gradio/pull/1188) +- Table tweaks by [@pngwn](https://github.com/pngwn) in [PR 1195](https://github.com/gradio-app/gradio/pull/1195) +- wrap tab content in column by [@pngwn](https://github.com/pngwn) in [PR 1200](https://github.com/gradio-app/gradio/pull/1200) +- WIP: Add dark mode support by [@gary149](https://github.com/gary149) in [PR 1187](https://github.com/gradio-app/gradio/pull/1187) +- Restored /api/predict/ endpoint for Interfaces by [@abidlabs](https://github.com/abidlabs) in [PR 1199](https://github.com/gradio-app/gradio/pull/1199) +- hltext-label by [@pngwn](https://github.com/pngwn) in [PR 1204](https://github.com/gradio-app/gradio/pull/1204) +- add copy functionality to json by [@pngwn](https://github.com/pngwn) in [PR 1205](https://github.com/gradio-app/gradio/pull/1205) +- Update component config by [@aliabid94](https://github.com/aliabid94) in [PR 1089](https://github.com/gradio-app/gradio/pull/1089) +- fix placeholder prompt by [@pngwn](https://github.com/pngwn) in [PR 1215](https://github.com/gradio-app/gradio/pull/1215) +- ensure webcam video value is propagated correctly by [@pngwn](https://github.com/pngwn) in [PR 1218](https://github.com/gradio-app/gradio/pull/1218) +- Automatic word-break in highlighted text, combine_adjacent support by [@aliabid94](https://github.com/aliabid94) in [PR 1209](https://github.com/gradio-app/gradio/pull/1209) +- async-function-support by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1190](https://github.com/gradio-app/gradio/pull/1190) +- Sharing fix for assets by [@aliabid94](https://github.com/aliabid94) in [PR 1208](https://github.com/gradio-app/gradio/pull/1208) +- Hotfixes for course demos by [@abidlabs](https://github.com/abidlabs) in [PR 1222](https://github.com/gradio-app/gradio/pull/1222) +- Allow Custom CSS by [@aliabid94](https://github.com/aliabid94) in [PR 1170](https://github.com/gradio-app/gradio/pull/1170) +- share-hotfix by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1226](https://github.com/gradio-app/gradio/pull/1226) +- tweaks by [@pngwn](https://github.com/pngwn) in [PR 1229](https://github.com/gradio-app/gradio/pull/1229) +- white space for class concatenation by [@radames](https://github.com/radames) in [PR 1228](https://github.com/gradio-app/gradio/pull/1228) +- Tweaks by [@pngwn](https://github.com/pngwn) in [PR 1230](https://github.com/gradio-app/gradio/pull/1230) +- css tweaks by [@pngwn](https://github.com/pngwn) in [PR 1235](https://github.com/gradio-app/gradio/pull/1235) +- ensure defaults height match for media inputs by [@pngwn](https://github.com/pngwn) in [PR 1236](https://github.com/gradio-app/gradio/pull/1236) +- Default Label label value by [@radames](https://github.com/radames) in [PR 1239](https://github.com/gradio-app/gradio/pull/1239) +- update-shortcut-syntax by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1234](https://github.com/gradio-app/gradio/pull/1234) +- Update version.txt by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1244](https://github.com/gradio-app/gradio/pull/1244) +- Layout bugs by [@pngwn](https://github.com/pngwn) in [PR 1246](https://github.com/gradio-app/gradio/pull/1246) +- Update demo by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1253](https://github.com/gradio-app/gradio/pull/1253) +- Button default name by [@FarukOzderim](https://github.com/FarukOzderim) in [PR 1243](https://github.com/gradio-app/gradio/pull/1243) +- Labels spacing by [@gary149](https://github.com/gary149) in [PR 1254](https://github.com/gradio-app/gradio/pull/1254) +- add global loader for gradio app by [@pngwn](https://github.com/pngwn) in [PR 1251](https://github.com/gradio-app/gradio/pull/1251) +- ui apis for dalle-mini by [@pngwn](https://github.com/pngwn) in [PR 1258](https://github.com/gradio-app/gradio/pull/1258) +- Add precision to Number, backend only by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 1125](https://github.com/gradio-app/gradio/pull/1125) +- Website Design Changes by [@abidlabs](https://github.com/abidlabs) in [PR 1015](https://github.com/gradio-app/gradio/pull/1015) +- Small fixes for multiple demos compatible with 3.0 by [@radames](https://github.com/radames) in [PR 1257](https://github.com/gradio-app/gradio/pull/1257) +- Issue #1160: Model 3D component not destroyed correctly by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 1219](https://github.com/gradio-app/gradio/pull/1219) +- Fixes to components by [@abidlabs](https://github.com/abidlabs) in [PR 1260](https://github.com/gradio-app/gradio/pull/1260) +- layout docs by [@abidlabs](https://github.com/abidlabs) in [PR 1263](https://github.com/gradio-app/gradio/pull/1263) +- Static forms by [@pngwn](https://github.com/pngwn) in [PR 1264](https://github.com/gradio-app/gradio/pull/1264) +- Cdn assets by [@pngwn](https://github.com/pngwn) in [PR 1265](https://github.com/gradio-app/gradio/pull/1265) +- update logo by [@gary149](https://github.com/gary149) in [PR 1266](https://github.com/gradio-app/gradio/pull/1266) +- fix slider by [@aliabid94](https://github.com/aliabid94) in [PR 1268](https://github.com/gradio-app/gradio/pull/1268) +- maybe fix auth in iframes by [@pngwn](https://github.com/pngwn) in [PR 1261](https://github.com/gradio-app/gradio/pull/1261) +- Improves "Getting Started" guide by [@abidlabs](https://github.com/abidlabs) in [PR 1269](https://github.com/gradio-app/gradio/pull/1269) +- Add embedded demos to website by [@aliabid94](https://github.com/aliabid94) in [PR 1270](https://github.com/gradio-app/gradio/pull/1270) +- Label hotfixes by [@abidlabs](https://github.com/abidlabs) in [PR 1281](https://github.com/gradio-app/gradio/pull/1281) +- General tweaks by [@pngwn](https://github.com/pngwn) in [PR 1276](https://github.com/gradio-app/gradio/pull/1276) +- only affect links within the document by [@pngwn](https://github.com/pngwn) in [PR 1282](https://github.com/gradio-app/gradio/pull/1282) +- release 3.0b9 by [@abidlabs](https://github.com/abidlabs) in [PR 1283](https://github.com/gradio-app/gradio/pull/1283) +- Dm by [@pngwn](https://github.com/pngwn) in [PR 1284](https://github.com/gradio-app/gradio/pull/1284) +- Website fixes by [@aliabd](https://github.com/aliabd) in [PR 1286](https://github.com/gradio-app/gradio/pull/1286) +- Create Streamables by [@aliabid94](https://github.com/aliabid94) in [PR 1279](https://github.com/gradio-app/gradio/pull/1279) +- ensure table works on mobile by [@pngwn](https://github.com/pngwn) in [PR 1277](https://github.com/gradio-app/gradio/pull/1277) +- changes by [@aliabid94](https://github.com/aliabid94) in [PR 1287](https://github.com/gradio-app/gradio/pull/1287) +- demo alignment on landing page by [@aliabd](https://github.com/aliabd) in [PR 1288](https://github.com/gradio-app/gradio/pull/1288) +- New meta img by [@aliabd](https://github.com/aliabd) in [PR 1289](https://github.com/gradio-app/gradio/pull/1289) +- updated PyPi version to 3.0 by [@abidlabs](https://github.com/abidlabs) in [PR 1290](https://github.com/gradio-app/gradio/pull/1290) +- Fix site by [@aliabid94](https://github.com/aliabid94) in [PR 1291](https://github.com/gradio-app/gradio/pull/1291) +- Mobile responsive guides by [@aliabd](https://github.com/aliabd) in [PR 1293](https://github.com/gradio-app/gradio/pull/1293) +- Update readme by [@abidlabs](https://github.com/abidlabs) in [PR 1292](https://github.com/gradio-app/gradio/pull/1292) +- gif by [@abidlabs](https://github.com/abidlabs) in [PR 1296](https://github.com/gradio-app/gradio/pull/1296) +- Allow decoding headerless b64 string [@1lint](https://github.com/1lint) in [PR 4031](https://github.com/gradio-app/gradio/pull/4031) + +### Contributors Shoutout: + +- [@JefferyChiang](https://github.com/JefferyChiang) made their first contribution in [PR 1004](https://github.com/gradio-app/gradio/pull/1004) +- [@NimaBoscarino](https://github.com/NimaBoscarino) made their first contribution in [PR 1000](https://github.com/gradio-app/gradio/pull/1000) +- [@ronvoluted](https://github.com/ronvoluted) made their first contribution in [PR 1050](https://github.com/gradio-app/gradio/pull/1050) +- [@radames](https://github.com/radames) made their first contribution in [PR 1074](https://github.com/gradio-app/gradio/pull/1074) +- [@freddyaboulton](https://github.com/freddyaboulton) made their first contribution in [PR 1085](https://github.com/gradio-app/gradio/pull/1085) +- [@liteli1987gmail](https://github.com/liteli1987gmail) & [@chenglu](https://github.com/chenglu) made their first contribution in [PR 4767](https://github.com/gradio-app/gradio/pull/4767) \ No newline at end of file diff --git a/gradio/__init__.py b/gradio/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0d7ca6fda9435832b2739dd67d184d2f1a76fe35 --- /dev/null +++ b/gradio/__init__.py @@ -0,0 +1,107 @@ +import pkgutil + +import gradio.components as components +import gradio.inputs as inputs +import gradio.outputs as outputs +import gradio.processing_utils +import gradio.templates +import gradio.themes as themes +from gradio.blocks import Blocks +from gradio.chat_interface import ChatInterface +from gradio.components import ( + HTML, + JSON, + AnnotatedImage, + Annotatedimage, + Audio, + BarPlot, + Button, + Carousel, + Chatbot, + Checkbox, + CheckboxGroup, + Checkboxgroup, + ClearButton, + Code, + ColorPicker, + DataFrame, + Dataframe, + Dataset, + Dropdown, + DuplicateButton, + File, + Gallery, + Highlight, + HighlightedText, + Highlightedtext, + Image, + Interpretation, + Json, + Label, + LinePlot, + Markdown, + Model3D, + Number, + Plot, + Radio, + ScatterPlot, + Slider, + State, + StatusTracker, + Text, + Textbox, + TimeSeries, + Timeseries, + UploadButton, + Variable, + Video, + component, +) +from gradio.deploy_space import deploy +from gradio.events import SelectData +from gradio.exceptions import Error +from gradio.external import load +from gradio.flagging import ( + CSVLogger, + FlaggingCallback, + HuggingFaceDatasetJSONSaver, + HuggingFaceDatasetSaver, + SimpleCSVLogger, +) +from gradio.helpers import ( + EventData, + Info, + Progress, + Warning, + make_waveform, + skip, + update, +) +from gradio.helpers import create_examples as Examples # noqa: N812 +from gradio.interface import Interface, TabbedInterface, close_all +from gradio.ipython_ext import load_ipython_extension +from gradio.layouts import Accordion, Box, Column, Group, Row, Tab, TabItem, Tabs +from gradio.mix import Parallel, Series +from gradio.routes import Request, mount_gradio_app +from gradio.templates import ( + Files, + ImageMask, + ImagePaint, + List, + Matrix, + Mic, + Microphone, + Numpy, + Paint, + Pil, + PlayableVideo, + Sketchpad, + TextArea, + Webcam, +) +from gradio.themes import Base as Theme + +current_pkg_version = ( + (pkgutil.get_data(__name__, "version.txt") or b"").decode("ascii").strip() +) +__version__ = current_pkg_version diff --git a/gradio/analytics.py b/gradio/analytics.py new file mode 100644 index 0000000000000000000000000000000000000000..067754dcea1ac02800b014776810e7150d4e330f --- /dev/null +++ b/gradio/analytics.py @@ -0,0 +1,188 @@ +""" Functions related to analytics and telemetry. """ +from __future__ import annotations + +import json +import os +import pkgutil +import threading +import warnings +from distutils.version import StrictVersion +from typing import Any + +import requests + +import gradio +from gradio.context import Context +from gradio.utils import GRADIO_VERSION + +ANALYTICS_URL = "https://api.gradio.app/" +PKG_VERSION_URL = "https://api.gradio.app/pkg-version" + + +def analytics_enabled() -> bool: + """ + Returns: True if analytics are enabled, False otherwise. + """ + return os.getenv("GRADIO_ANALYTICS_ENABLED", "True") == "True" + + +def _do_analytics_request(url: str, data: dict[str, Any]) -> None: + data["ip_address"] = get_local_ip_address() + try: + requests.post(url, data=data, timeout=5) + except (requests.ConnectionError, requests.exceptions.ReadTimeout): + pass # do not push analytics if no network + + +def version_check(): + try: + version_data = pkgutil.get_data(__name__, "version.txt") + if not version_data: + raise FileNotFoundError + current_pkg_version = version_data.decode("ascii").strip() + latest_pkg_version = requests.get(url=PKG_VERSION_URL, timeout=3).json()[ + "version" + ] + if StrictVersion(latest_pkg_version) > StrictVersion(current_pkg_version): + print( + f"IMPORTANT: You are using gradio version {current_pkg_version}, " + f"however version {latest_pkg_version} is available, please upgrade." + ) + print("--------") + except json.decoder.JSONDecodeError: + warnings.warn("unable to parse version details from package URL.") + except KeyError: + warnings.warn("package URL does not contain version info.") + except Exception: + pass + + +def get_local_ip_address() -> str: + """ + Gets the public IP address or returns the string "No internet connection" if unable + to obtain it or the string "Analytics disabled" if a user has disabled analytics. + Does not make a new request if the IP address has already been obtained in the + same Python session. + """ + if not analytics_enabled(): + return "Analytics disabled" + + if Context.ip_address is None: + try: + ip_address = requests.get( + "https://checkip.amazonaws.com/", timeout=3 + ).text.strip() + except (requests.ConnectionError, requests.exceptions.ReadTimeout): + ip_address = "No internet connection" + Context.ip_address = ip_address + else: + ip_address = Context.ip_address + return ip_address + + +def initiated_analytics(data: dict[str, Any]) -> None: + if not analytics_enabled(): + return + + threading.Thread( + target=_do_analytics_request, + kwargs={ + "url": f"{ANALYTICS_URL}gradio-initiated-analytics/", + "data": data, + }, + ).start() + + +def launched_analytics(blocks: gradio.Blocks, data: dict[str, Any]) -> None: + if not analytics_enabled(): + return + + blocks_telemetry, inputs_telemetry, outputs_telemetry, targets_telemetry = ( + [], + [], + [], + [], + ) + + from gradio.blocks import BlockContext + + for x in list(blocks.blocks.values()): + blocks_telemetry.append(x.get_block_name()) if isinstance( + x, BlockContext + ) else blocks_telemetry.append(str(x)) + + for x in blocks.dependencies: + targets_telemetry = targets_telemetry + [ + # Sometimes the target can be the Blocks object itself, so we need to check if its in blocks.blocks + str(blocks.blocks[y]) + for y in x["targets"] + if y in blocks.blocks + ] + inputs_telemetry = inputs_telemetry + [ + str(blocks.blocks[y]) for y in x["inputs"] if y in blocks.blocks + ] + outputs_telemetry = outputs_telemetry + [ + str(blocks.blocks[y]) for y in x["outputs"] if y in blocks.blocks + ] + additional_data = { + "version": GRADIO_VERSION, + "is_kaggle": blocks.is_kaggle, + "is_sagemaker": blocks.is_sagemaker, + "using_auth": blocks.auth is not None, + "dev_mode": blocks.dev_mode, + "show_api": blocks.show_api, + "show_error": blocks.show_error, + "title": blocks.title, + "inputs": blocks.input_components + if blocks.mode == "interface" + else inputs_telemetry, + "outputs": blocks.output_components + if blocks.mode == "interface" + else outputs_telemetry, + "targets": targets_telemetry, + "blocks": blocks_telemetry, + "events": [str(x["trigger"]) for x in blocks.dependencies], + } + + data.update(additional_data) + + threading.Thread( + target=_do_analytics_request, + kwargs={ + "url": f"{ANALYTICS_URL}gradio-launched-telemetry/", + "data": data, + }, + ).start() + + +def integration_analytics(data: dict[str, Any]) -> None: + if not analytics_enabled(): + return + + threading.Thread( + target=_do_analytics_request, + kwargs={ + "url": f"{ANALYTICS_URL}gradio-integration-analytics/", + "data": data, + }, + ).start() + + +def error_analytics(message: str) -> None: + """ + Send error analytics if there is network + Parameters: + message: Details about error + """ + if not analytics_enabled(): + return + + data = {"error": message} + + threading.Thread( + target=_do_analytics_request, + kwargs={ + "url": f"{ANALYTICS_URL}gradio-error-analytics/", + "data": data, + }, + ).start() diff --git a/gradio/blocks.py b/gradio/blocks.py new file mode 100644 index 0000000000000000000000000000000000000000..8386ecf21fd5c41652a85c0537587ab20320fc00 --- /dev/null +++ b/gradio/blocks.py @@ -0,0 +1,2178 @@ +from __future__ import annotations + +import copy +import inspect +import json +import os +import random +import secrets +import sys +import threading +import time +import warnings +import webbrowser +from abc import abstractmethod +from pathlib import Path +from types import ModuleType +from typing import TYPE_CHECKING, Any, AsyncIterator, Callable, Literal, cast + +import anyio +import requests +from anyio import CapacityLimiter +from gradio_client import serializing +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group +from packaging import version + +from gradio import ( + analytics, + components, + external, + networking, + queueing, + routes, + strings, + themes, + utils, + wasm_utils, +) +from gradio.context import Context +from gradio.deprecation import check_deprecated_parameters, warn_deprecation +from gradio.exceptions import ( + DuplicateBlockError, + InvalidApiNameError, + InvalidBlockError, +) +from gradio.helpers import EventData, create_tracker, skip, special_args +from gradio.themes import Default as DefaultTheme +from gradio.themes import ThemeClass as Theme +from gradio.tunneling import ( + BINARY_FILENAME, + BINARY_FOLDER, + BINARY_PATH, + BINARY_URL, + CURRENT_TUNNELS, +) +from gradio.utils import ( + GRADIO_VERSION, + TupleNoPrint, + check_function_inputs_match, + component_or_layout_class, + delete_none, + get_cancel_function, + get_continuous_fn, +) + +try: + import spaces # type: ignore +except Exception: + spaces = None + +set_documentation_group("blocks") + +if TYPE_CHECKING: # Only import for type checking (is False at runtime). + from fastapi.applications import FastAPI + + from gradio.components import Component + +BUILT_IN_THEMES: dict[str, Theme] = { + t.name: t + for t in [ + themes.Base(), + themes.Default(), + themes.Monochrome(), + themes.Soft(), + themes.Glass(), + ] +} + + +class Block: + def __init__( + self, + *, + render: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + visible: bool = True, + root_url: str | None = None, # URL that is prepended to all file paths + _skip_init_processing: bool = False, # Used for loading from Spaces + **kwargs, + ): + self._id = Context.id + Context.id += 1 + self.visible = visible + self.elem_id = elem_id + self.elem_classes = ( + [elem_classes] if isinstance(elem_classes, str) else elem_classes + ) + self.root_url = root_url + self.share_token = secrets.token_urlsafe(32) + self._skip_init_processing = _skip_init_processing + self.parent: BlockContext | None = None + self.is_rendered: bool = False + + if render: + self.render() + check_deprecated_parameters(self.__class__.__name__, kwargs=kwargs) + + def render(self): + """ + Adds self into appropriate BlockContext + """ + if Context.root_block is not None and self._id in Context.root_block.blocks: + raise DuplicateBlockError( + f"A block with id: {self._id} has already been rendered in the current Blocks." + ) + if Context.block is not None: + Context.block.add(self) + if Context.root_block is not None: + Context.root_block.blocks[self._id] = self + self.is_rendered = True + if isinstance(self, components.IOComponent): + Context.root_block.temp_file_sets.append(self.temp_files) + return self + + def unrender(self): + """ + Removes self from BlockContext if it has been rendered (otherwise does nothing). + Removes self from the layout and collection of blocks, but does not delete any event triggers. + """ + if Context.block is not None: + try: + Context.block.children.remove(self) + except ValueError: + pass + if Context.root_block is not None: + try: + del Context.root_block.blocks[self._id] + self.is_rendered = False + except KeyError: + pass + return self + + def get_block_name(self) -> str: + """ + Gets block's class name. + + If it is template component it gets the parent's class name. + + @return: class name + """ + return ( + self.__class__.__base__.__name__.lower() + if hasattr(self, "is_template") + else self.__class__.__name__.lower() + ) + + def get_expected_parent(self) -> type[BlockContext] | None: + return None + + def set_event_trigger( + self, + event_name: str, + fn: Callable | None, + inputs: Component | list[Component] | set[Component] | None, + outputs: Component | list[Component] | None, + preprocess: bool = True, + postprocess: bool = True, + scroll_to_output: bool = False, + show_progress: str = "full", + api_name: str | None | Literal[False] = None, + js: str | None = None, + no_target: bool = False, + queue: bool | None = None, + batch: bool = False, + max_batch_size: int = 4, + cancels: list[int] | None = None, + every: float | None = None, + collects_event_data: bool | None = None, + trigger_after: int | None = None, + trigger_only_on_success: bool = False, + ) -> tuple[dict[str, Any], int]: + """ + Adds an event to the component's dependencies. + Parameters: + event_name: event name + fn: Callable function + inputs: input list + outputs: output list + preprocess: whether to run the preprocess methods of components + postprocess: whether to run the postprocess methods of components + scroll_to_output: whether to scroll to output of dependency on trigger + show_progress: whether to show progress animation while running. + api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name. + js: Experimental parameter (API may change): Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components + no_target: if True, sets "targets" to [], used for Blocks "load" event + queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app. + batch: whether this function takes in a batch of inputs + max_batch_size: the maximum batch size to send to the function + cancels: a list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. + every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled. + collects_event_data: whether to collect event data for this event + trigger_after: if set, this event will be triggered after 'trigger_after' function index + trigger_only_on_success: if True, this event will only be triggered if the previous event was successful (only applies if `trigger_after` is set) + Returns: dependency information, dependency index + """ + # Support for singular parameter + if isinstance(inputs, set): + inputs_as_dict = True + inputs = sorted(inputs, key=lambda x: x._id) + else: + inputs_as_dict = False + if inputs is None: + inputs = [] + elif not isinstance(inputs, list): + inputs = [inputs] + + if isinstance(outputs, set): + outputs = sorted(outputs, key=lambda x: x._id) + else: + if outputs is None: + outputs = [] + elif not isinstance(outputs, list): + outputs = [outputs] + + if fn is not None and not cancels: + check_function_inputs_match(fn, inputs, inputs_as_dict) + + if Context.root_block is None: + raise AttributeError( + f"{event_name}() and other events can only be called within a Blocks context." + ) + if every is not None and every <= 0: + raise ValueError("Parameter every must be positive or None") + if every and batch: + raise ValueError( + f"Cannot run {event_name} event in a batch and every {every} seconds. " + "Either batch is True or every is non-zero but not both." + ) + + if every and fn: + fn = get_continuous_fn(fn, every) + elif every: + raise ValueError("Cannot set a value for `every` without a `fn`.") + + _, progress_index, event_data_index = ( + special_args(fn) if fn else (None, None, None) + ) + Context.root_block.fns.append( + BlockFunction( + fn, + inputs, + outputs, + preprocess, + postprocess, + inputs_as_dict, + progress_index is not None, + ) + ) + if api_name is not None and api_name is not False: + api_name_ = utils.append_unique_suffix( + api_name, [dep["api_name"] for dep in Context.root_block.dependencies] + ) + if api_name != api_name_: + warnings.warn(f"api_name {api_name} already exists, using {api_name_}") + api_name = api_name_ + + if collects_event_data is None: + collects_event_data = event_data_index is not None + + dependency = { + "targets": [self._id] if not no_target else [], + "trigger": event_name, + "inputs": [block._id for block in inputs], + "outputs": [block._id for block in outputs], + "backend_fn": fn is not None, + "js": js, + "queue": False if fn is None else queue, + "api_name": api_name, + "scroll_to_output": False if utils.get_space() else scroll_to_output, + "show_progress": show_progress, + "every": every, + "batch": batch, + "max_batch_size": max_batch_size, + "cancels": cancels or [], + "types": { + "continuous": bool(every), + "generator": inspect.isgeneratorfunction(fn) or bool(every), + }, + "collects_event_data": collects_event_data, + "trigger_after": trigger_after, + "trigger_only_on_success": trigger_only_on_success, + } + Context.root_block.dependencies.append(dependency) + return dependency, len(Context.root_block.dependencies) - 1 + + def get_config(self): + return { + "visible": self.visible, + "elem_id": self.elem_id, + "elem_classes": self.elem_classes, + "root_url": self.root_url, + } + + @staticmethod + @abstractmethod + def update(**kwargs) -> dict: + return {} + + @classmethod + def get_specific_update(cls, generic_update: dict[str, Any]) -> dict: + generic_update = generic_update.copy() + del generic_update["__type__"] + specific_update = cls.update(**generic_update) + return specific_update + + +class BlockContext(Block): + def __init__( + self, + visible: bool = True, + render: bool = True, + **kwargs, + ): + """ + Parameters: + visible: If False, this will be hidden but included in the Blocks config file (its visibility can later be updated). + render: If False, this will not be included in the Blocks config file at all. + """ + self.children: list[Block] = [] + Block.__init__(self, visible=visible, render=render, **kwargs) + + def add_child(self, child: Block): + self.children.append(child) + + def __enter__(self): + self.parent = Context.block + Context.block = self + return self + + def add(self, child: Block): + child.parent = self + self.children.append(child) + + def fill_expected_parents(self): + children = [] + pseudo_parent = None + for child in self.children: + expected_parent = child.get_expected_parent() + if not expected_parent or isinstance(self, expected_parent): + pseudo_parent = None + children.append(child) + else: + if pseudo_parent is not None and isinstance( + pseudo_parent, expected_parent + ): + pseudo_parent.add_child(child) + else: + pseudo_parent = expected_parent(render=False) + pseudo_parent.parent = self + children.append(pseudo_parent) + pseudo_parent.add_child(child) + if Context.root_block: + Context.root_block.blocks[pseudo_parent._id] = pseudo_parent + child.parent = pseudo_parent + self.children = children + + def __exit__(self, *args): + if getattr(self, "allow_expected_parents", True): + self.fill_expected_parents() + Context.block = self.parent + + def postprocess(self, y): + """ + Any postprocessing needed to be performed on a block context. + """ + return y + + +class BlockFunction: + def __init__( + self, + fn: Callable | None, + inputs: list[Component], + outputs: list[Component], + preprocess: bool, + postprocess: bool, + inputs_as_dict: bool, + tracks_progress: bool = False, + ): + self.fn = fn + self.inputs = inputs + self.outputs = outputs + self.preprocess = preprocess + self.postprocess = postprocess + self.tracks_progress = tracks_progress + self.total_runtime = 0 + self.total_runs = 0 + self.inputs_as_dict = inputs_as_dict + self.name = getattr(fn, "__name__", "fn") if fn is not None else None + self.spaces_auto_wrap() + + def spaces_auto_wrap(self): + if spaces is None: + return + if utils.get_space() is None: + return + self.fn = spaces.gradio_auto_wrap(self.fn) + + def __str__(self): + return str( + { + "fn": self.name, + "preprocess": self.preprocess, + "postprocess": self.postprocess, + } + ) + + def __repr__(self): + return str(self) + + +class class_or_instancemethod(classmethod): # noqa: N801 + def __get__(self, instance, type_): + descr_get = super().__get__ if instance is None else self.__func__.__get__ + return descr_get(instance, type_) + + +def postprocess_update_dict(block: Block, update_dict: dict, postprocess: bool = True): + """ + Converts a dictionary of updates into a format that can be sent to the frontend. + E.g. {"__type__": "generic_update", "value": "2", "interactive": False} + Into -> {"__type__": "update", "value": 2.0, "mode": "static"} + + Parameters: + block: The Block that is being updated with this update dictionary. + update_dict: The original update dictionary + postprocess: Whether to postprocess the "value" key of the update dictionary. + """ + if update_dict.get("__type__", "") == "generic_update": + update_dict = block.get_specific_update(update_dict) + if update_dict.get("value") is components._Keywords.NO_VALUE: + update_dict.pop("value") + interactive = update_dict.pop("interactive", None) + if interactive is not None: + update_dict["mode"] = "dynamic" if interactive else "static" + prediction_value = delete_none(update_dict, skip_value=True) + if "value" in prediction_value and postprocess: + assert isinstance( + block, components.IOComponent + ), f"Component {block.__class__} does not support value" + prediction_value["value"] = block.postprocess(prediction_value["value"]) + return prediction_value + + +def convert_component_dict_to_list( + outputs_ids: list[int], predictions: dict +) -> list | dict: + """ + Converts a dictionary of component updates into a list of updates in the order of + the outputs_ids and including every output component. Leaves other types of dictionaries unchanged. + E.g. {"textbox": "hello", "number": {"__type__": "generic_update", "value": "2"}} + Into -> ["hello", {"__type__": "generic_update"}, {"__type__": "generic_update", "value": "2"}] + """ + keys_are_blocks = [isinstance(key, Block) for key in predictions] + if all(keys_are_blocks): + reordered_predictions = [skip() for _ in outputs_ids] + for component, value in predictions.items(): + if component._id not in outputs_ids: + raise ValueError( + f"Returned component {component} not specified as output of function." + ) + output_index = outputs_ids.index(component._id) + reordered_predictions[output_index] = value + predictions = utils.resolve_singleton(reordered_predictions) + elif any(keys_are_blocks): + raise ValueError( + "Returned dictionary included some keys as Components. Either all keys must be Components to assign Component values, or return a List of values to assign output values in order." + ) + return predictions + + +def get_api_info(config: dict, serialize: bool = True): + """ + Gets the information needed to generate the API docs from a Blocks config. + Parameters: + config: a Blocks config dictionary + serialize: If True, returns the serialized version of the typed information. If False, returns the raw version. + """ + api_info = {"named_endpoints": {}, "unnamed_endpoints": {}} + mode = config.get("mode", None) + after_new_format = version.parse(config.get("version", "2.0")) > version.Version( + "3.28.3" + ) + + for d, dependency in enumerate(config["dependencies"]): + dependency_info = {"parameters": [], "returns": []} + skip_endpoint = False + + inputs = dependency["inputs"] + for i in inputs: + for component in config["components"]: + if component["id"] == i: + break + else: + skip_endpoint = True # if component not found, skip endpoint + break + type = component["type"] + if type in client_utils.SKIP_COMPONENTS: + continue + if ( + not component.get("serializer") + and type not in serializing.COMPONENT_MAPPING + ): + skip_endpoint = True # if component not serializable, skip endpoint + break + if type in client_utils.SKIP_COMPONENTS: + continue + label = component["props"].get("label", f"parameter_{i}") + # The config has the most specific API info (taking into account the parameters + # of the component), so we use that if it exists. Otherwise, we fallback to the + # Serializer's API info. + serializer = serializing.COMPONENT_MAPPING[type]() + if component.get("api_info") and after_new_format: + info = component["api_info"] + example = component["example_inputs"]["serialized"] + else: + assert isinstance(serializer, serializing.Serializable) + info = serializer.api_info() + example = serializer.example_inputs()["raw"] + python_info = info["info"] + if serialize and info["serialized_info"]: + python_info = serializer.serialized_info() + if ( + isinstance(serializer, serializing.FileSerializable) + and component["props"].get("file_count", "single") != "single" + ): + python_info = serializer._multiple_file_serialized_info() + + python_type = client_utils.json_schema_to_python_type(python_info) + serializer_name = serializing.COMPONENT_MAPPING[type].__name__ + dependency_info["parameters"].append( + { + "label": label, + "type": info["info"], + "python_type": { + "type": python_type, + "description": python_info.get("description", ""), + }, + "component": type.capitalize(), + "example_input": example, + "serializer": serializer_name, + } + ) + + outputs = dependency["outputs"] + for o in outputs: + for component in config["components"]: + if component["id"] == o: + break + else: + skip_endpoint = True # if component not found, skip endpoint + break + type = component["type"] + if type in client_utils.SKIP_COMPONENTS: + continue + if ( + not component.get("serializer") + and type not in serializing.COMPONENT_MAPPING + ): + skip_endpoint = True # if component not serializable, skip endpoint + break + label = component["props"].get("label", f"value_{o}") + serializer = serializing.COMPONENT_MAPPING[type]() + if component.get("api_info") and after_new_format: + info = component["api_info"] + example = component["example_inputs"]["serialized"] + else: + assert isinstance(serializer, serializing.Serializable) + info = serializer.api_info() + example = serializer.example_inputs()["raw"] + python_info = info["info"] + if serialize and info["serialized_info"]: + python_info = serializer.serialized_info() + if ( + isinstance(serializer, serializing.FileSerializable) + and component["props"].get("file_count", "single") != "single" + ): + python_info = serializer._multiple_file_serialized_info() + python_type = client_utils.json_schema_to_python_type(python_info) + serializer_name = serializing.COMPONENT_MAPPING[type].__name__ + dependency_info["returns"].append( + { + "label": label, + "type": info["info"], + "python_type": { + "type": python_type, + "description": python_info.get("description", ""), + }, + "component": type.capitalize(), + "serializer": serializer_name, + } + ) + + if not dependency["backend_fn"]: + skip_endpoint = True + + if skip_endpoint: + continue + if dependency["api_name"] is not None and dependency["api_name"] is not False: + api_info["named_endpoints"][f"/{dependency['api_name']}"] = dependency_info + elif ( + dependency["api_name"] is False + or mode == "interface" + or mode == "tabbed_interface" + ): + pass # Skip unnamed endpoints in interface mode + else: + api_info["unnamed_endpoints"][str(d)] = dependency_info + + return api_info + + +@document("launch", "queue", "integrate", "load") +class Blocks(BlockContext): + """ + Blocks is Gradio's low-level API that allows you to create more custom web + applications and demos than Interfaces (yet still entirely in Python). + + + Compared to the Interface class, Blocks offers more flexibility and control over: + (1) the layout of components (2) the events that + trigger the execution of functions (3) data flows (e.g. inputs can trigger outputs, + which can trigger the next level of outputs). Blocks also offers ways to group + together related demos such as with tabs. + + + The basic usage of Blocks is as follows: create a Blocks object, then use it as a + context (with the "with" statement), and then define layouts, components, or events + within the Blocks context. Finally, call the launch() method to launch the demo. + + Example: + import gradio as gr + def update(name): + return f"Welcome to Gradio, {name}!" + + with gr.Blocks() as demo: + gr.Markdown("Start typing below and then click **Run** to see the output.") + with gr.Row(): + inp = gr.Textbox(placeholder="What is your name?") + out = gr.Textbox() + btn = gr.Button("Run") + btn.click(fn=update, inputs=inp, outputs=out) + + demo.launch() + Demos: blocks_hello, blocks_flipper, blocks_speech_text_sentiment, generate_english_german, sound_alert + Guides: blocks-and-event-listeners, controlling-layout, state-in-blocks, custom-CSS-and-JS, custom-interpretations-with-blocks, using-blocks-like-functions + """ + + def __init__( + self, + theme: Theme | str | None = None, + analytics_enabled: bool | None = None, + mode: str = "blocks", + title: str = "Gradio", + css: str | None = None, + **kwargs, + ): + """ + Parameters: + theme: a Theme object or a string representing a theme. If a string, will look for a built-in theme with that name (e.g. "soft" or "default"), or will attempt to load a theme from the HF Hub (e.g. "gradio/monochrome"). If None, will use the Default theme. + analytics_enabled: whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True. + mode: a human-friendly name for the kind of Blocks or Interface being created. + title: The tab title to display when this is opened in a browser window. + css: custom css or path to custom css file to apply to entire Blocks + """ + self.limiter = None + if theme is None: + theme = DefaultTheme() + elif isinstance(theme, str): + if theme.lower() in BUILT_IN_THEMES: + theme = BUILT_IN_THEMES[theme.lower()] + else: + try: + theme = Theme.from_hub(theme) + except Exception as e: + warnings.warn(f"Cannot load {theme}. Caught Exception: {str(e)}") + theme = DefaultTheme() + if not isinstance(theme, Theme): + warnings.warn("Theme should be a class loaded from gradio.themes") + theme = DefaultTheme() + self.theme: Theme = theme + self.theme_css = theme._get_theme_css() + self.stylesheets = theme._stylesheets + self.encrypt = False + self.share = False + self.enable_queue = None + self.max_threads = 40 + self.show_error = True + if css is not None and os.path.exists(css): + with open(css) as css_file: + self.css = css_file.read() + else: + self.css = css + + # For analytics_enabled and allow_flagging: (1) first check for + # parameter, (2) check for env variable, (3) default to True/"manual" + self.analytics_enabled = ( + analytics_enabled + if analytics_enabled is not None + else analytics.analytics_enabled() + ) + if self.analytics_enabled: + t = threading.Thread(target=analytics.version_check) + t.start() + else: + os.environ["HF_HUB_DISABLE_TELEMETRY"] = "True" + super().__init__(render=False, **kwargs) + self.blocks: dict[int, Block] = {} + self.fns: list[BlockFunction] = [] + self.dependencies = [] + self.mode = mode + + self.is_running = False + self.local_url = None + self.share_url = None + self.width = None + self.height = None + self.api_open = True + + self.space_id = utils.get_space() + self.favicon_path = None + self.auth = None + self.dev_mode = True + self.app_id = random.getrandbits(64) + self.temp_file_sets = [] + self.title = title + self.show_api = True + + # Only used when an Interface is loaded from a config + self.predict = None + self.input_components = None + self.output_components = None + self.__name__ = None + self.api_mode = None + self.progress_tracking = None + self.ssl_verify = True + + self.allowed_paths = [] + self.blocked_paths = [] + self.root_path = "" + self.root_urls = set() + + if not wasm_utils.IS_WASM and self.analytics_enabled: + is_custom_theme = not any( + self.theme.to_dict() == built_in_theme.to_dict() + for built_in_theme in BUILT_IN_THEMES.values() + ) + data = { + "mode": self.mode, + "custom_css": self.css is not None, + "theme": self.theme.name, + "is_custom_theme": is_custom_theme, + "version": GRADIO_VERSION, + } + analytics.initiated_analytics(data) + + @classmethod + def from_config( + cls, + config: dict, + fns: list[Callable], + root_url: str, + ) -> Blocks: + """ + Factory method that creates a Blocks from a config and list of functions. Used + internally by the gradio.external.load() method. + + Parameters: + config: a dictionary containing the configuration of the Blocks. + fns: a list of functions that are used in the Blocks. Must be in the same order as the dependencies in the config. + root_url: an external url to use as a root URL when serving files for components in the Blocks. + """ + config = copy.deepcopy(config) + components_config = config["components"] + for component_config in components_config: + # for backwards compatibility, extract style into props + if "style" in component_config["props"]: + component_config["props"].update(component_config["props"]["style"]) + del component_config["props"]["style"] + theme = config.get("theme", "default") + original_mapping: dict[int, Block] = {} + root_urls = {root_url} + + def get_block_instance(id: int) -> Block: + for block_config in components_config: + if block_config["id"] == id: + break + else: + raise ValueError(f"Cannot find block with id {id}") + cls = component_or_layout_class(block_config["type"]) + block_config["props"].pop("type", None) + block_config["props"].pop("name", None) + # If a Gradio app B is loaded into a Gradio app A, and B itself loads a + # Gradio app C, then the root_urls of the components in A need to be the + # URL of C, not B. The else clause below handles this case. + if block_config["props"].get("root_url") is None: + block_config["props"]["root_url"] = f"{root_url}/" + else: + root_urls.add(block_config["props"]["root_url"]) + # Any component has already processed its initial value, so we skip that step here + block = cls(**block_config["props"], _skip_init_processing=True) + return block + + def iterate_over_children(children_list): + for child_config in children_list: + id = child_config["id"] + block = get_block_instance(id) + + original_mapping[id] = block + + children = child_config.get("children") + if children is not None: + assert isinstance( + block, BlockContext + ), f"Invalid config, Block with id {id} has children but is not a BlockContext." + with block: + iterate_over_children(children) + + derived_fields = ["types"] + + with Blocks(theme=theme) as blocks: + # ID 0 should be the root Blocks component + original_mapping[0] = Context.root_block or blocks + + iterate_over_children(config["layout"]["children"]) + + first_dependency = None + + # add the event triggers + for dependency, fn in zip(config["dependencies"], fns): + # We used to add a "fake_event" to the config to cache examples + # without removing it. This was causing bugs in calling gr.load + # We fixed the issue by removing "fake_event" from the config in examples.py + # but we still need to skip these events when loading the config to support + # older demos + if dependency["trigger"] == "fake_event": + continue + for field in derived_fields: + dependency.pop(field, None) + targets = dependency.pop("targets") + trigger = dependency.pop("trigger") + dependency.pop("backend_fn") + dependency.pop("documentation", None) + dependency["inputs"] = [ + original_mapping[i] for i in dependency["inputs"] + ] + dependency["outputs"] = [ + original_mapping[o] for o in dependency["outputs"] + ] + dependency.pop("status_tracker", None) + dependency["preprocess"] = False + dependency["postprocess"] = False + + for target in targets: + dependency = original_mapping[target].set_event_trigger( + event_name=trigger, fn=fn, **dependency + )[0] + if first_dependency is None: + first_dependency = dependency + + # Allows some use of Interface-specific methods with loaded Spaces + if first_dependency and Context.root_block: + blocks.predict = [fns[0]] + blocks.input_components = [ + Context.root_block.blocks[i] for i in first_dependency["inputs"] + ] + blocks.output_components = [ + Context.root_block.blocks[o] for o in first_dependency["outputs"] + ] + blocks.__name__ = "Interface" + blocks.api_mode = True + + blocks.root_urls = root_urls + return blocks + + def __str__(self): + return self.__repr__() + + def __repr__(self): + num_backend_fns = len([d for d in self.dependencies if d["backend_fn"]]) + repr = f"Gradio Blocks instance: {num_backend_fns} backend functions" + repr += f"\n{'-' * len(repr)}" + for d, dependency in enumerate(self.dependencies): + if dependency["backend_fn"]: + repr += f"\nfn_index={d}" + repr += "\n inputs:" + for input_id in dependency["inputs"]: + block = self.blocks[input_id] + repr += f"\n |-{block}" + repr += "\n outputs:" + for output_id in dependency["outputs"]: + block = self.blocks[output_id] + repr += f"\n |-{block}" + return repr + + def render(self): + if Context.root_block is not None: + if self._id in Context.root_block.blocks: + raise DuplicateBlockError( + f"A block with id: {self._id} has already been rendered in the current Blocks." + ) + overlapping_ids = set(Context.root_block.blocks).intersection(self.blocks) + for id in overlapping_ids: + # State components are allowed to be reused between Blocks + if not isinstance(self.blocks[id], components.State): + raise DuplicateBlockError( + "At least one block in this Blocks has already been rendered." + ) + + Context.root_block.blocks.update(self.blocks) + Context.root_block.fns.extend(self.fns) + dependency_offset = len(Context.root_block.dependencies) + for i, dependency in enumerate(self.dependencies): + api_name = dependency["api_name"] + if api_name is not None and api_name is not False: + api_name_ = utils.append_unique_suffix( + api_name, + [dep["api_name"] for dep in Context.root_block.dependencies], + ) + if api_name != api_name_: + warnings.warn( + f"api_name {api_name} already exists, using {api_name_}" + ) + dependency["api_name"] = api_name_ + dependency["cancels"] = [ + c + dependency_offset for c in dependency["cancels"] + ] + if dependency.get("trigger_after") is not None: + dependency["trigger_after"] += dependency_offset + # Recreate the cancel function so that it has the latest + # dependency fn indices. This is necessary to properly cancel + # events in the backend + if dependency["cancels"]: + updated_cancels = [ + Context.root_block.dependencies[i] + for i in dependency["cancels"] + ] + new_fn = BlockFunction( + get_cancel_function(updated_cancels)[0], + [], + [], + False, + True, + False, + ) + Context.root_block.fns[dependency_offset + i] = new_fn + Context.root_block.dependencies.append(dependency) + Context.root_block.temp_file_sets.extend(self.temp_file_sets) + Context.root_block.root_urls.update(self.root_urls) + + if Context.block is not None: + Context.block.children.extend(self.children) + return self + + def is_callable(self, fn_index: int = 0) -> bool: + """Checks if a particular Blocks function is callable (i.e. not stateful or a generator).""" + block_fn = self.fns[fn_index] + dependency = self.dependencies[fn_index] + + if inspect.isasyncgenfunction(block_fn.fn): + return False + if inspect.isgeneratorfunction(block_fn.fn): + return False + for input_id in dependency["inputs"]: + block = self.blocks[input_id] + if getattr(block, "stateful", False): + return False + for output_id in dependency["outputs"]: + block = self.blocks[output_id] + if getattr(block, "stateful", False): + return False + + return True + + def __call__(self, *inputs, fn_index: int = 0, api_name: str | None = None): + """ + Allows Blocks objects to be called as functions. Supply the parameters to the + function as positional arguments. To choose which function to call, use the + fn_index parameter, which must be a keyword argument. + + Parameters: + *inputs: the parameters to pass to the function + fn_index: the index of the function to call (defaults to 0, which for Interfaces, is the default prediction function) + api_name: The api_name of the dependency to call. Will take precedence over fn_index. + """ + if api_name is not None: + inferred_fn_index = next( + ( + i + for i, d in enumerate(self.dependencies) + if d.get("api_name") == api_name + ), + None, + ) + if inferred_fn_index is None: + raise InvalidApiNameError( + f"Cannot find a function with api_name {api_name}" + ) + fn_index = inferred_fn_index + if not (self.is_callable(fn_index)): + raise ValueError( + "This function is not callable because it is either stateful or is a generator. Please use the .launch() method instead to create an interactive user interface." + ) + + inputs = list(inputs) + processed_inputs = self.serialize_data(fn_index, inputs) + batch = self.dependencies[fn_index]["batch"] + if batch: + processed_inputs = [[inp] for inp in processed_inputs] + + outputs = client_utils.synchronize_async( + self.process_api, + fn_index=fn_index, + inputs=processed_inputs, + request=None, + state={}, + ) + outputs = outputs["data"] + + if batch: + outputs = [out[0] for out in outputs] + + processed_outputs = self.deserialize_data(fn_index, outputs) + processed_outputs = utils.resolve_singleton(processed_outputs) + + return processed_outputs + + async def call_function( + self, + fn_index: int, + processed_input: list[Any], + iterator: AsyncIterator[Any] | None = None, + requests: routes.Request | list[routes.Request] | None = None, + event_id: str | None = None, + event_data: EventData | None = None, + ): + """ + Calls function with given index and preprocessed input, and measures process time. + Parameters: + fn_index: index of function to call + processed_input: preprocessed input to pass to function + iterator: iterator to use if function is a generator + requests: requests to pass to function + event_id: id of event in queue + event_data: data associated with event trigger + """ + block_fn = self.fns[fn_index] + assert block_fn.fn, f"function with index {fn_index} not defined." + is_generating = False + + if block_fn.inputs_as_dict: + processed_input = [dict(zip(block_fn.inputs, processed_input))] + + request = requests[0] if isinstance(requests, list) else requests + processed_input, progress_index, _ = special_args( + block_fn.fn, processed_input, request, event_data + ) + progress_tracker = ( + processed_input[progress_index] if progress_index is not None else None + ) + + start = time.time() + + fn = utils.get_function_with_locals(block_fn.fn, self, event_id) + + if iterator is None: # If not a generator function that has already run + if progress_tracker is not None and progress_index is not None: + progress_tracker, fn = create_tracker( + self, event_id, fn, progress_tracker.track_tqdm + ) + processed_input[progress_index] = progress_tracker + + if inspect.iscoroutinefunction(fn): + prediction = await fn(*processed_input) + else: + prediction = await anyio.to_thread.run_sync( + fn, *processed_input, limiter=self.limiter + ) + else: + prediction = None + + if inspect.isgeneratorfunction(fn) or inspect.isasyncgenfunction(fn): + if not self.enable_queue: + raise ValueError("Need to enable queue to use generators.") + try: + if iterator is None: + iterator = cast(AsyncIterator[Any], prediction) + if inspect.isgenerator(iterator): + iterator = utils.SyncToAsyncIterator(iterator, self.limiter) + prediction = await utils.async_iteration(iterator) + is_generating = True + except StopAsyncIteration: + n_outputs = len(self.dependencies[fn_index].get("outputs")) + prediction = ( + components._Keywords.FINISHED_ITERATING + if n_outputs == 1 + else (components._Keywords.FINISHED_ITERATING,) * n_outputs + ) + iterator = None + + duration = time.time() - start + + return { + "prediction": prediction, + "duration": duration, + "is_generating": is_generating, + "iterator": iterator, + } + + def serialize_data(self, fn_index: int, inputs: list[Any]) -> list[Any]: + dependency = self.dependencies[fn_index] + processed_input = [] + + for i, input_id in enumerate(dependency["inputs"]): + try: + block = self.blocks[input_id] + except KeyError as e: + raise InvalidBlockError( + f"Input component with id {input_id} used in {dependency['trigger']}() event is not defined in this gr.Blocks context. You are allowed to nest gr.Blocks contexts, but there must be a gr.Blocks context that contains all components and events." + ) from e + assert isinstance( + block, components.IOComponent + ), f"{block.__class__} Component with id {input_id} not a valid input component." + serialized_input = block.serialize(inputs[i]) + processed_input.append(serialized_input) + + return processed_input + + def deserialize_data(self, fn_index: int, outputs: list[Any]) -> list[Any]: + dependency = self.dependencies[fn_index] + predictions = [] + + for o, output_id in enumerate(dependency["outputs"]): + try: + block = self.blocks[output_id] + except KeyError as e: + raise InvalidBlockError( + f"Output component with id {output_id} used in {dependency['trigger']}() event not found in this gr.Blocks context. You are allowed to nest gr.Blocks contexts, but there must be a gr.Blocks context that contains all components and events." + ) from e + assert isinstance( + block, components.IOComponent + ), f"{block.__class__} Component with id {output_id} not a valid output component." + deserialized = block.deserialize( + outputs[o], + save_dir=block.DEFAULT_TEMP_DIR, + root_url=block.root_url, + hf_token=Context.hf_token, + ) + predictions.append(deserialized) + + return predictions + + def validate_inputs(self, fn_index: int, inputs: list[Any]): + block_fn = self.fns[fn_index] + dependency = self.dependencies[fn_index] + + dep_inputs = dependency["inputs"] + + # This handles incorrect inputs when args are changed by a JS function + # Only check not enough args case, ignore extra arguments (for now) + # TODO: make this stricter? + if len(inputs) < len(dep_inputs): + name = ( + f" ({block_fn.name})" + if block_fn.name and block_fn.name != "" + else "" + ) + + wanted_args = [] + received_args = [] + for input_id in dep_inputs: + block = self.blocks[input_id] + wanted_args.append(str(block)) + for inp in inputs: + v = f'"{inp}"' if isinstance(inp, str) else str(inp) + received_args.append(v) + + wanted = ", ".join(wanted_args) + received = ", ".join(received_args) + + # JS func didn't pass enough arguments + raise ValueError( + f"""An event handler{name} didn't receive enough input values (needed: {len(dep_inputs)}, got: {len(inputs)}). +Check if the event handler calls a Javascript function, and make sure its return value is correct. +Wanted inputs: + [{wanted}] +Received inputs: + [{received}]""" + ) + + def preprocess_data(self, fn_index: int, inputs: list[Any], state: dict[int, Any]): + block_fn = self.fns[fn_index] + dependency = self.dependencies[fn_index] + + self.validate_inputs(fn_index, inputs) + + if block_fn.preprocess: + processed_input = [] + for i, input_id in enumerate(dependency["inputs"]): + try: + block = self.blocks[input_id] + except KeyError as e: + raise InvalidBlockError( + f"Input component with id {input_id} used in {dependency['trigger']}() event not found in this gr.Blocks context. You are allowed to nest gr.Blocks contexts, but there must be a gr.Blocks context that contains all components and events." + ) from e + assert isinstance( + block, components.Component + ), f"{block.__class__} Component with id {input_id} not a valid input component." + if getattr(block, "stateful", False): + processed_input.append(state.get(input_id)) + else: + processed_input.append(block.preprocess(inputs[i])) + else: + processed_input = inputs + return processed_input + + def validate_outputs(self, fn_index: int, predictions: Any | list[Any]): + block_fn = self.fns[fn_index] + dependency = self.dependencies[fn_index] + + dep_outputs = dependency["outputs"] + + if type(predictions) is not list and type(predictions) is not tuple: + predictions = [predictions] + + if len(predictions) < len(dep_outputs): + name = ( + f" ({block_fn.name})" + if block_fn.name and block_fn.name != "" + else "" + ) + + wanted_args = [] + received_args = [] + for output_id in dep_outputs: + block = self.blocks[output_id] + wanted_args.append(str(block)) + for pred in predictions: + v = f'"{pred}"' if isinstance(pred, str) else str(pred) + received_args.append(v) + + wanted = ", ".join(wanted_args) + received = ", ".join(received_args) + + raise ValueError( + f"""An event handler{name} didn't receive enough output values (needed: {len(dep_outputs)}, received: {len(predictions)}). +Wanted outputs: + [{wanted}] +Received outputs: + [{received}]""" + ) + + def postprocess_data( + self, fn_index: int, predictions: list | dict, state: dict[int, Any] + ): + block_fn = self.fns[fn_index] + dependency = self.dependencies[fn_index] + batch = dependency["batch"] + + if type(predictions) is dict and len(predictions) > 0: + predictions = convert_component_dict_to_list( + dependency["outputs"], predictions + ) + + if len(dependency["outputs"]) == 1 and not (batch): + predictions = [ + predictions, + ] + + self.validate_outputs(fn_index, predictions) # type: ignore + + output = [] + for i, output_id in enumerate(dependency["outputs"]): + try: + if predictions[i] is components._Keywords.FINISHED_ITERATING: + output.append(None) + continue + except (IndexError, KeyError) as err: + raise ValueError( + "Number of output components does not match number " + f"of values returned from from function {block_fn.name}" + ) from err + + try: + block = self.blocks[output_id] + except KeyError as e: + raise InvalidBlockError( + f"Output component with id {output_id} used in {dependency['trigger']}() event not found in this gr.Blocks context. You are allowed to nest gr.Blocks contexts, but there must be a gr.Blocks context that contains all components and events." + ) from e + + if getattr(block, "stateful", False): + if not utils.is_update(predictions[i]): + state[output_id] = predictions[i] + output.append(None) + else: + prediction_value = predictions[i] + if utils.is_update(prediction_value): + assert isinstance(prediction_value, dict) + prediction_value = postprocess_update_dict( + block=block, + update_dict=prediction_value, + postprocess=block_fn.postprocess, + ) + elif block_fn.postprocess: + assert isinstance( + block, components.Component + ), f"{block.__class__} Component with id {output_id} not a valid output component." + prediction_value = block.postprocess(prediction_value) + output.append(prediction_value) + + return output + + async def process_api( + self, + fn_index: int, + inputs: list[Any], + state: dict[int, Any], + request: routes.Request | list[routes.Request] | None = None, + iterators: dict[int, Any] | None = None, + event_id: str | None = None, + event_data: EventData | None = None, + ) -> dict[str, Any]: + """ + Processes API calls from the frontend. First preprocesses the data, + then runs the relevant function, then postprocesses the output. + Parameters: + fn_index: Index of function to run. + inputs: input data received from the frontend + state: data stored from stateful components for session (key is input block id) + request: the gr.Request object containing information about the network request (e.g. IP address, headers, query parameters, username) + iterators: the in-progress iterators for each generator function (key is function index) + event_id: id of event that triggered this API call + event_data: data associated with the event trigger itself + Returns: None + """ + block_fn = self.fns[fn_index] + batch = self.dependencies[fn_index]["batch"] + + if batch: + max_batch_size = self.dependencies[fn_index]["max_batch_size"] + batch_sizes = [len(inp) for inp in inputs] + batch_size = batch_sizes[0] + if inspect.isasyncgenfunction(block_fn.fn) or inspect.isgeneratorfunction( + block_fn.fn + ): + raise ValueError("Gradio does not support generators in batch mode.") + if not all(x == batch_size for x in batch_sizes): + raise ValueError( + f"All inputs to a batch function must have the same length but instead have sizes: {batch_sizes}." + ) + if batch_size > max_batch_size: + raise ValueError( + f"Batch size ({batch_size}) exceeds the max_batch_size for this function ({max_batch_size})" + ) + + inputs = [ + self.preprocess_data(fn_index, list(i), state) for i in zip(*inputs) + ] + result = await self.call_function( + fn_index, list(zip(*inputs)), None, request, event_id, event_data + ) + preds = result["prediction"] + data = [ + self.postprocess_data(fn_index, list(o), state) for o in zip(*preds) + ] + data = list(zip(*data)) + is_generating, iterator = None, None + else: + inputs = self.preprocess_data(fn_index, inputs, state) + iterator = iterators.get(fn_index, None) if iterators else None + result = await self.call_function( + fn_index, inputs, iterator, request, event_id, event_data + ) + data = self.postprocess_data(fn_index, result["prediction"], state) + is_generating, iterator = result["is_generating"], result["iterator"] + + block_fn.total_runtime += result["duration"] + block_fn.total_runs += 1 + return { + "data": data, + "is_generating": is_generating, + "iterator": iterator, + "duration": result["duration"], + "average_duration": block_fn.total_runtime / block_fn.total_runs, + } + + async def create_limiter(self): + self.limiter = ( + None + if self.max_threads == 40 + else CapacityLimiter(total_tokens=self.max_threads) + ) + + def get_config(self): + return {"type": "column"} + + def get_config_file(self): + config = { + "version": routes.VERSION, + "mode": self.mode, + "dev_mode": self.dev_mode, + "analytics_enabled": self.analytics_enabled, + "components": [], + "css": self.css, + "title": self.title or "Gradio", + "space_id": self.space_id, + "enable_queue": getattr(self, "enable_queue", False), # launch attributes + "show_error": getattr(self, "show_error", False), + "show_api": self.show_api, + "is_colab": utils.colab_check(), + "stylesheets": self.stylesheets, + "theme": self.theme.name, + } + + def get_layout(block): + if not isinstance(block, BlockContext): + return {"id": block._id} + children_layout = [] + for child in block.children: + children_layout.append(get_layout(child)) + return {"id": block._id, "children": children_layout} + + config["layout"] = get_layout(self) + + for _id, block in self.blocks.items(): + props = block.get_config() if hasattr(block, "get_config") else {} + block_config = { + "id": _id, + "type": block.get_block_name(), + "props": utils.delete_none(props), + } + serializer = utils.get_serializer_name(block) + if serializer: + assert isinstance(block, serializing.Serializable) + block_config["serializer"] = serializer + block_config["api_info"] = block.api_info() # type: ignore + block_config["example_inputs"] = block.example_inputs() # type: ignore + config["components"].append(block_config) + config["dependencies"] = self.dependencies + return config + + def __enter__(self): + if Context.block is None: + Context.root_block = self + self.parent = Context.block + Context.block = self + self.exited = False + return self + + def __exit__(self, *args): + super().fill_expected_parents() + Context.block = self.parent + # Configure the load events before root_block is reset + self.attach_load_events() + if self.parent is None: + Context.root_block = None + else: + self.parent.children.extend(self.children) + self.config = self.get_config_file() + self.app = routes.App.create_app(self) + self.progress_tracking = any(block_fn.tracks_progress for block_fn in self.fns) + self.exited = True + + @class_or_instancemethod + def load( + self_or_cls, # noqa: N805 + fn: Callable | None = None, + inputs: list[Component] | None = None, + outputs: list[Component] | None = None, + api_name: str | None | Literal[False] = None, + scroll_to_output: bool = False, + show_progress: str = "full", + queue=None, + batch: bool = False, + max_batch_size: int = 4, + preprocess: bool = True, + postprocess: bool = True, + every: float | None = None, + _js: str | None = None, + *, + name: str | None = None, + src: str | None = None, + api_key: str | None = None, + alias: str | None = None, + **kwargs, + ) -> Blocks | dict[str, Any] | None: + """ + For reverse compatibility reasons, this is both a class method and an instance + method, the two of which, confusingly, do two completely different things. + + + Class method: loads a demo from a Hugging Face Spaces repo and creates it locally and returns a block instance. Warning: this method will be deprecated. Use the equivalent `gradio.load()` instead. + + + Instance method: adds event that runs as soon as the demo loads in the browser. Example usage below. + Parameters: + name: Class Method - the name of the model (e.g. "gpt2" or "facebook/bart-base") or space (e.g. "flax-community/spanish-gpt2"), can include the `src` as prefix (e.g. "models/facebook/bart-base") + src: Class Method - the source of the model: `models` or `spaces` (or leave empty if source is provided as a prefix in `name`) + api_key: Class Method - optional access token for loading private Hugging Face Hub models or spaces. Find your token here: https://huggingface.co/settings/tokens. Warning: only provide this if you are loading a trusted private Space as it can be read by the Space you are loading. + alias: Class Method - optional string used as the name of the loaded model instead of the default name (only applies if loading a Space running Gradio 2.x) + fn: Instance Method - the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component. + inputs: Instance Method - List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list. + outputs: Instance Method - List of gradio.components to use as inputs. If the function returns no outputs, this should be an empty list. + api_name: Instance Method - Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name. + scroll_to_output: Instance Method - If True, will scroll to output component on completion + show_progress: Instance Method - If True, will show progress animation while pending + queue: Instance Method - If True, will place the request on the queue, if the queue exists + batch: Instance Method - If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component. + max_batch_size: Instance Method - Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True) + preprocess: Instance Method - If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component). + postprocess: Instance Method - If False, will not run postprocessing of component data before returning 'fn' output to the browser. + every: Instance Method - Run this event 'every' number of seconds. Interpreted in seconds. Queue must be enabled. + Example: + import gradio as gr + import datetime + with gr.Blocks() as demo: + def get_time(): + return datetime.datetime.now().time() + dt = gr.Textbox(label="Current time") + demo.load(get_time, inputs=None, outputs=dt) + demo.launch() + """ + if isinstance(self_or_cls, type): + warn_deprecation( + "gr.Blocks.load() will be deprecated. Use gr.load() instead." + ) + if name is None: + raise ValueError( + "Blocks.load() requires passing parameters as keyword arguments" + ) + return external.load( + name=name, src=src, hf_token=api_key, alias=alias, **kwargs + ) + else: + from gradio.events import Dependency + + dep, dep_index = self_or_cls.set_event_trigger( + event_name="load", + fn=fn, + inputs=inputs, + outputs=outputs, + api_name=api_name, + preprocess=preprocess, + postprocess=postprocess, + scroll_to_output=scroll_to_output, + show_progress=show_progress, + js=_js, + queue=queue, + batch=batch, + max_batch_size=max_batch_size, + every=every, + no_target=True, + ) + return Dependency(self_or_cls, dep, dep_index) + + def clear(self): + """Resets the layout of the Blocks object.""" + self.blocks = {} + self.fns = [] + self.dependencies = [] + self.children = [] + return self + + @document() + def queue( + self, + concurrency_count: int = 1, + status_update_rate: float | Literal["auto"] = "auto", + client_position_to_load_data: int | None = None, + default_enabled: bool | None = None, + api_open: bool = True, + max_size: int | None = None, + ): + """ + You can control the rate of processed requests by creating a queue. This will allow you to set the number of requests to be processed at one time, and will let users know their position in the queue. + Parameters: + concurrency_count: Number of worker threads that will be processing requests from the queue concurrently. Increasing this number will increase the rate at which requests are processed, but will also increase the memory usage of the queue. + status_update_rate: If "auto", Queue will send status estimations to all clients whenever a job is finished. Otherwise Queue will send status at regular intervals set by this parameter as the number of seconds. + client_position_to_load_data: DEPRECATED. This parameter is deprecated and has no effect. + default_enabled: Deprecated and has no effect. + api_open: If True, the REST routes of the backend will be open, allowing requests made directly to those endpoints to skip the queue. + max_size: The maximum number of events the queue will store at any given moment. If the queue is full, new events will not be added and a user will receive a message saying that the queue is full. If None, the queue size will be unlimited. + Example: (Blocks) + with gr.Blocks() as demo: + button = gr.Button(label="Generate Image") + button.click(fn=image_generator, inputs=gr.Textbox(), outputs=gr.Image()) + demo.queue(concurrency_count=3) + demo.launch() + Example: (Interface) + demo = gr.Interface(image_generator, gr.Textbox(), gr.Image()) + demo.queue(concurrency_count=3) + demo.launch() + """ + if default_enabled is not None: + warn_deprecation( + "The default_enabled parameter of queue has no effect and will be removed " + "in a future version of gradio." + ) + self.enable_queue = True + self.api_open = api_open + if client_position_to_load_data is not None: + warn_deprecation( + "The client_position_to_load_data parameter is deprecated." + ) + max_size_default = self.max_threads if utils.is_zero_gpu_space() else None + self._queue = queueing.Queue( + live_updates=status_update_rate == "auto", + concurrency_count=concurrency_count, + update_intervals=status_update_rate if status_update_rate != "auto" else 1, + max_size=max_size_default if max_size is None else max_size, + blocks_dependencies=self.dependencies, + ) + self.config = self.get_config_file() + self.app = routes.App.create_app(self) + return self + + def validate_queue_settings(self): + if not self.enable_queue and self.progress_tracking: + raise ValueError("Progress tracking requires queuing to be enabled.") + + for fn_index, dep in enumerate(self.dependencies): + if not self.enable_queue and self.queue_enabled_for_fn(fn_index): + raise ValueError( + f"The queue is enabled for event {dep['api_name'] if dep['api_name'] else fn_index} " + "but the queue has not been enabled for the app. Please call .queue() " + "on your app. Consult https://gradio.app/docs/#blocks-queue for information on how " + "to configure the queue." + ) + for i in dep["cancels"]: + if not self.queue_enabled_for_fn(i): + raise ValueError( + "Queue needs to be enabled! " + "You may get this error by either 1) passing a function that uses the yield keyword " + "into an interface without enabling the queue or 2) defining an event that cancels " + "another event without enabling the queue. Both can be solved by calling .queue() " + "before .launch()" + ) + if dep["batch"] and ( + dep["queue"] is False + or (dep["queue"] is None and not self.enable_queue) + ): + raise ValueError("In order to use batching, the queue must be enabled.") + + def launch( + self, + inline: bool | None = None, + inbrowser: bool = False, + share: bool | None = None, + debug: bool = False, + enable_queue: bool | None = None, + max_threads: int = 40, + auth: Callable | tuple[str, str] | list[tuple[str, str]] | None = None, + auth_message: str | None = None, + prevent_thread_lock: bool = False, + show_error: bool = False, + server_name: str | None = None, + server_port: int | None = None, + show_tips: bool = False, + height: int = 500, + width: int | str = "100%", + encrypt: bool | None = None, + favicon_path: str | None = None, + ssl_keyfile: str | None = None, + ssl_certfile: str | None = None, + ssl_keyfile_password: str | None = None, + ssl_verify: bool = True, + quiet: bool = False, + show_api: bool = True, + file_directories: list[str] | None = None, + allowed_paths: list[str] | None = None, + blocked_paths: list[str] | None = None, + root_path: str = "", + _frontend: bool = True, + app_kwargs: dict[str, Any] | None = None, + ) -> tuple[FastAPI, str, str]: + """ + Launches a simple web server that serves the demo. Can also be used to create a + public link used by anyone to access the demo from their browser by setting share=True. + + Parameters: + inline: whether to display in the interface inline in an iframe. Defaults to True in python notebooks; False otherwise. + inbrowser: whether to automatically launch the interface in a new tab on the default browser. + share: whether to create a publicly shareable link for the interface. Creates an SSH tunnel to make your UI accessible from anywhere. If not provided, it is set to False by default every time, except when running in Google Colab. When localhost is not accessible (e.g. Google Colab), setting share=False is not supported. + debug: if True, blocks the main thread from running. If running in Google Colab, this is needed to print the errors in the cell output. + auth: If provided, username and password (or list of username-password tuples) required to access interface. Can also provide function that takes username and password and returns True if valid login. + auth_message: If provided, HTML message provided on login page. + prevent_thread_lock: If True, the interface will block the main thread while the server is running. + show_error: If True, any errors in the interface will be displayed in an alert modal and printed in the browser console log + server_port: will start gradio app on this port (if available). Can be set by environment variable GRADIO_SERVER_PORT. If None, will search for an available port starting at 7860. + server_name: to make app accessible on local network, set this to "0.0.0.0". Can be set by environment variable GRADIO_SERVER_NAME. If None, will use "127.0.0.1". + show_tips: if True, will occasionally show tips about new Gradio features + enable_queue: DEPRECATED (use .queue() method instead.) if True, inference requests will be served through a queue instead of with parallel threads. Required for longer inference times (> 1min) to prevent timeout. The default option in HuggingFace Spaces is True. The default option elsewhere is False. + max_threads: the maximum number of total threads that the Gradio app can generate in parallel. The default is inherited from the starlette library (currently 40). Applies whether the queue is enabled or not. But if queuing is enabled, this parameter is increaseed to be at least the concurrency_count of the queue. + width: The width in pixels of the iframe element containing the interface (used if inline=True) + height: The height in pixels of the iframe element containing the interface (used if inline=True) + encrypt: DEPRECATED. Has no effect. + favicon_path: If a path to a file (.png, .gif, or .ico) is provided, it will be used as the favicon for the web page. + ssl_keyfile: If a path to a file is provided, will use this as the private key file to create a local server running on https. + ssl_certfile: If a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided. + ssl_keyfile_password: If a password is provided, will use this with the ssl certificate for https. + ssl_verify: If False, skips certificate validation which allows self-signed certificates to be used. + quiet: If True, suppresses most print statements. + show_api: If True, shows the api docs in the footer of the app. Default True. If the queue is enabled, then api_open parameter of .queue() will determine if the api docs are shown, independent of the value of show_api. + file_directories: This parameter has been renamed to `allowed_paths`. It will be removed in a future version. + allowed_paths: List of complete filepaths or parent directories that gradio is allowed to serve (in addition to the directory containing the gradio python file). Must be absolute paths. Warning: if you provide directories, any files in these directories or their subdirectories are accessible to all users of your app. + blocked_paths: List of complete filepaths or parent directories that gradio is not allowed to serve (i.e. users of your app are not allowed to access). Must be absolute paths. Warning: takes precedence over `allowed_paths` and all other directories exposed by Gradio by default. + root_path: The root path (or "mount point") of the application, if it's not served from the root ("/") of the domain. Often used when the application is behind a reverse proxy that forwards requests to the application. For example, if the application is served at "https://example.com/myapp", the `root_path` should be set to "/myapp". + app_kwargs: Additional keyword arguments to pass to the underlying FastAPI app as a dictionary of parameter keys and argument values. For example, `{"docs_url": "/docs"}` + Returns: + app: FastAPI app object that is running the demo + local_url: Locally accessible link to the demo + share_url: Publicly accessible link to the demo (if share=True, otherwise None) + Example: (Blocks) + import gradio as gr + def reverse(text): + return text[::-1] + with gr.Blocks() as demo: + button = gr.Button(value="Reverse") + button.click(reverse, gr.Textbox(), gr.Textbox()) + demo.launch(share=True, auth=("username", "password")) + Example: (Interface) + import gradio as gr + def reverse(text): + return text[::-1] + demo = gr.Interface(reverse, "text", "text") + demo.launch(share=True, auth=("username", "password")) + """ + if not self.exited: + self.__exit__() + + self.dev_mode = False + if ( + auth + and not callable(auth) + and not isinstance(auth[0], tuple) + and not isinstance(auth[0], list) + ): + self.auth = [auth] + else: + self.auth = auth + self.auth_message = auth_message + self.show_tips = show_tips + self.show_error = show_error + self.height = height + self.width = width + self.favicon_path = favicon_path + self.ssl_verify = ssl_verify + self.root_path = root_path + + if enable_queue is not None: + self.enable_queue = enable_queue + warn_deprecation( + "The `enable_queue` parameter has been deprecated. " + "Please use the `.queue()` method instead.", + ) + if encrypt is not None: + warn_deprecation( + "The `encrypt` parameter has been deprecated and has no effect.", + ) + + if self.space_id: + self.enable_queue = self.enable_queue is not False + else: + self.enable_queue = self.enable_queue is True + if self.enable_queue and not hasattr(self, "_queue"): + self.queue() + self.show_api = self.api_open if self.enable_queue else show_api + + if file_directories is not None: + warn_deprecation( + "The `file_directories` parameter has been renamed to `allowed_paths`. " + "Please use that instead.", + ) + if allowed_paths is None: + allowed_paths = file_directories + self.allowed_paths = allowed_paths or [] + self.blocked_paths = blocked_paths or [] + + if not isinstance(self.allowed_paths, list): + raise ValueError("`allowed_paths` must be a list of directories.") + if not isinstance(self.blocked_paths, list): + raise ValueError("`blocked_paths` must be a list of directories.") + + self.validate_queue_settings() + + self.config = self.get_config_file() + self.max_threads = max( + self._queue.max_thread_count if self.enable_queue else 0, max_threads + ) + + if self.is_running: + assert isinstance( + self.local_url, str + ), f"Invalid local_url: {self.local_url}" + if not (quiet): + print( + "Rerunning server... use `close()` to stop if you need to change `launch()` parameters.\n----" + ) + else: + if wasm_utils.IS_WASM: + server_name = "xxx" + server_port = 99999 + local_url = "" + server = None + + # In the Wasm environment, we only need the app object + # which the frontend app will directly communicate with through the Worker API, + # and we don't need to start a server. + # So we just create the app object and register it here, + # and avoid using `networking.start_server` that would start a server that don't work in the Wasm env. + from gradio.routes import App + + app = App.create_app(self, app_kwargs=app_kwargs) + wasm_utils.register_app(app) + else: + ( + server_name, + server_port, + local_url, + app, + server, + ) = networking.start_server( + self, + server_name, + server_port, + ssl_keyfile, + ssl_certfile, + ssl_keyfile_password, + app_kwargs=app_kwargs, + ) + self.server_name = server_name + self.local_url = local_url + self.server_port = server_port + self.server_app = app + self.server = server + self.is_running = True + self.is_colab = utils.colab_check() + self.is_kaggle = utils.kaggle_check() + + self.protocol = ( + "https" + if self.local_url.startswith("https") or self.is_colab + else "http" + ) + if not self.is_colab: + print( + strings.en["RUNNING_LOCALLY_SEPARATED"].format( + self.protocol, self.server_name, self.server_port + ) + ) + + if self.enable_queue: + self._queue.set_url(self.local_url) + + # Cannot run async functions in background other than app's scope. + # Workaround by triggering the app endpoint + if not wasm_utils.IS_WASM: + requests.get(f"{self.local_url}startup-events", verify=ssl_verify) + + if wasm_utils.IS_WASM: + return TupleNoPrint((self.server_app, self.local_url, self.share_url)) + + utils.launch_counter() + self.is_sagemaker = utils.sagemaker_check() + if share is None: + if self.is_colab and self.enable_queue: + if not quiet: + print( + "Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n" + ) + self.share = True + elif self.is_kaggle: + if not quiet: + print( + "Kaggle notebooks require sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n" + ) + self.share = True + elif self.is_sagemaker: + if not quiet: + print( + "Sagemaker notebooks may require sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n" + ) + self.share = True + else: + self.share = False + else: + self.share = share + + # If running in a colab or not able to access localhost, + # a shareable link must be created. + if _frontend and (not networking.url_ok(self.local_url)) and (not self.share): + raise ValueError( + "When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost." + ) + + if self.is_colab: + if not quiet: + if debug: + print(strings.en["COLAB_DEBUG_TRUE"]) + else: + print(strings.en["COLAB_DEBUG_FALSE"]) + if not self.share: + print(strings.en["COLAB_WARNING"].format(self.server_port)) + if self.enable_queue and not self.share: + raise ValueError( + "When using queueing in Colab, a shareable link must be created. Please set share=True." + ) + + if self.share: + if self.space_id: + raise RuntimeError("Share is not supported when you are in Spaces") + try: + if self.share_url is None: + self.share_url = networking.setup_tunnel( + self.server_name, self.server_port, self.share_token + ) + print(strings.en["SHARE_LINK_DISPLAY"].format(self.share_url)) + if not (quiet): + print(strings.en["SHARE_LINK_MESSAGE"]) + except (RuntimeError, requests.exceptions.ConnectionError): + if self.analytics_enabled: + analytics.error_analytics("Not able to set up tunnel") + self.share_url = None + self.share = False + if Path(BINARY_PATH).exists(): + print(strings.en["COULD_NOT_GET_SHARE_LINK"]) + else: + print( + strings.en["COULD_NOT_GET_SHARE_LINK_MISSING_FILE"].format( + BINARY_PATH, + BINARY_URL, + BINARY_FILENAME, + BINARY_FOLDER, + ) + ) + else: + if not (quiet): + print(strings.en["PUBLIC_SHARE_TRUE"]) + self.share_url = None + + if inbrowser: + link = self.share_url if self.share and self.share_url else self.local_url + webbrowser.open(link) + + # Check if running in a Python notebook in which case, display inline + if inline is None: + inline = utils.ipython_check() + if inline: + try: + from IPython.display import HTML, Javascript, display # type: ignore + + if self.share and self.share_url: + while not networking.url_ok(self.share_url): + time.sleep(0.25) + display( + HTML( + f'
' + ) + ) + elif self.is_colab: + # modified from /usr/local/lib/python3.7/dist-packages/google/colab/output/_util.py within Colab environment + code = """(async (port, path, width, height, cache, element) => { + if (!google.colab.kernel.accessAllowed && !cache) { + return; + } + element.appendChild(document.createTextNode('')); + const url = await google.colab.kernel.proxyPort(port, {cache}); + + const external_link = document.createElement('div'); + external_link.innerHTML = ` +
+ `; + element.appendChild(external_link); + + const iframe = document.createElement('iframe'); + iframe.src = new URL(path, url).toString(); + iframe.height = height; + iframe.allow = "autoplay; camera; microphone; clipboard-read; clipboard-write;" + iframe.width = width; + iframe.style.border = 0; + element.appendChild(iframe); + })""" + "({port}, {path}, {width}, {height}, {cache}, window.element)".format( + port=json.dumps(self.server_port), + path=json.dumps("/"), + width=json.dumps(self.width), + height=json.dumps(self.height), + cache=json.dumps(False), + ) + + display(Javascript(code)) + else: + display( + HTML( + f'
' + ) + ) + except ImportError: + pass + + if getattr(self, "analytics_enabled", False): + data = { + "launch_method": "browser" if inbrowser else "inline", + "is_google_colab": self.is_colab, + "is_sharing_on": self.share, + "share_url": self.share_url, + "enable_queue": self.enable_queue, + "show_tips": self.show_tips, + "server_name": server_name, + "server_port": server_port, + "is_space": self.space_id is not None, + "mode": self.mode, + } + analytics.launched_analytics(self, data) + + utils.show_tip(self) + + # Block main thread if debug==True + if debug or int(os.getenv("GRADIO_DEBUG", 0)) == 1: + self.block_thread() + # Block main thread if running in a script to stop script from exiting + is_in_interactive_mode = bool(getattr(sys, "ps1", sys.flags.interactive)) + + if not prevent_thread_lock and not is_in_interactive_mode: + self.block_thread() + + return TupleNoPrint((self.server_app, self.local_url, self.share_url)) + + def integrate( + self, + comet_ml=None, + wandb: ModuleType | None = None, + mlflow: ModuleType | None = None, + ) -> None: + """ + A catch-all method for integrating with other libraries. This method should be run after launch() + Parameters: + comet_ml: If a comet_ml Experiment object is provided, will integrate with the experiment and appear on Comet dashboard + wandb: If the wandb module is provided, will integrate with it and appear on WandB dashboard + mlflow: If the mlflow module is provided, will integrate with the experiment and appear on ML Flow dashboard + """ + analytics_integration = "" + if comet_ml is not None: + analytics_integration = "CometML" + comet_ml.log_other("Created from", "Gradio") + if self.share_url is not None: + comet_ml.log_text(f"gradio: {self.share_url}") + comet_ml.end() + elif self.local_url: + comet_ml.log_text(f"gradio: {self.local_url}") + comet_ml.end() + else: + raise ValueError("Please run `launch()` first.") + if wandb is not None: + analytics_integration = "WandB" + if self.share_url is not None: + wandb.log( + { + "Gradio panel": wandb.Html( + '' + ) + } + ) + else: + print( + "The WandB integration requires you to " + "`launch(share=True)` first." + ) + if mlflow is not None: + analytics_integration = "MLFlow" + if self.share_url is not None: + mlflow.log_param("Gradio Interface Share Link", self.share_url) + else: + mlflow.log_param("Gradio Interface Local Link", self.local_url) + if self.analytics_enabled and analytics_integration: + data = {"integration": analytics_integration} + analytics.integration_analytics(data) + + def close(self, verbose: bool = True) -> None: + """ + Closes the Interface that was launched and frees the port. + """ + try: + if self.enable_queue: + self._queue.close() + if self.server: + self.server.close() + self.is_running = False + # So that the startup events (starting the queue) + # happen the next time the app is launched + self.app.startup_events_triggered = False + if verbose: + print(f"Closing server running on port: {self.server_port}") + except (AttributeError, OSError): # can't close if not running + pass + + def block_thread( + self, + ) -> None: + """Block main thread until interrupted by user.""" + try: + while True: + time.sleep(0.1) + except (KeyboardInterrupt, OSError): + print("Keyboard interruption in main thread... closing server.") + if self.server: + self.server.close() + for tunnel in CURRENT_TUNNELS: + tunnel.kill() + + def attach_load_events(self): + """Add a load event for every component whose initial value should be randomized.""" + if Context.root_block: + for component in Context.root_block.blocks.values(): + if ( + isinstance(component, components.IOComponent) + and component.load_event_to_attach + ): + load_fn, every = component.load_event_to_attach + # Use set_event_trigger to avoid ambiguity between load class/instance method + dep = self.set_event_trigger( + "load", + load_fn, + None, + component, + no_target=True, + # If every is None, for sure skip the queue + # else, let the enable_queue parameter take precedence + # this will raise a nice error message is every is used + # without queue + queue=False if every is None else None, + every=every, + )[0] + component.load_event = dep + + def startup_events(self): + """Events that should be run when the app containing this block starts up.""" + + if self.enable_queue: + utils.run_coro_in_background(self._queue.start, self.ssl_verify) + # So that processing can resume in case the queue was stopped + self._queue.stopped = False + utils.run_coro_in_background(self.create_limiter) + + def queue_enabled_for_fn(self, fn_index: int): + if self.dependencies[fn_index]["queue"] is None: + return self.enable_queue + return self.dependencies[fn_index]["queue"] diff --git a/gradio/chat_interface.py b/gradio/chat_interface.py new file mode 100644 index 0000000000000000000000000000000000000000..aaee1c820e68e3c166b1f0f04bd233a4df259258 --- /dev/null +++ b/gradio/chat_interface.py @@ -0,0 +1,470 @@ +""" +This file defines a useful high-level abstraction to build Gradio chatbots: ChatInterface. +""" + + +from __future__ import annotations + +import inspect +from typing import Callable, Generator + +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group + +from gradio.blocks import Blocks +from gradio.components import ( + Button, + Chatbot, + IOComponent, + Markdown, + State, + Textbox, + get_component_instance, +) +from gradio.events import Dependency, EventListenerMethod +from gradio.helpers import create_examples as Examples # noqa: N812 +from gradio.layouts import Accordion, Column, Group, Row +from gradio.themes import ThemeClass as Theme + +set_documentation_group("chatinterface") + + +@document() +class ChatInterface(Blocks): + """ + ChatInterface is Gradio's high-level abstraction for creating chatbot UIs, and allows you to create + a web-based demo around a chatbot model in a few lines of code. Only one parameter is required: fn, which + takes a function that governs the response of the chatbot based on the user input and chat history. Additional + parameters can be used to control the appearance and behavior of the demo. + + Example: + import gradio as gr + + def echo(message, history): + return message + + demo = gr.ChatInterface(fn=echo, examples=["hello", "hola", "merhaba"], title="Echo Bot") + demo.launch() + Demos: chatinterface_random_response, chatinterface_streaming_echo + Guides: creating-a-chatbot-fast, sharing-your-app + """ + + def __init__( + self, + fn: Callable, + *, + chatbot: Chatbot | None = None, + textbox: Textbox | None = None, + additional_inputs: str | IOComponent | list[str | IOComponent] | None = None, + additional_inputs_accordion_name: str = "Additional Inputs", + examples: list[str] | None = None, + cache_examples: bool | None = None, + title: str | None = None, + description: str | None = None, + theme: Theme | str | None = None, + css: str | None = None, + analytics_enabled: bool | None = None, + submit_btn: str | None | Button = "Submit", + stop_btn: str | None | Button = "Stop", + retry_btn: str | None | Button = "🔄 Retry", + undo_btn: str | None | Button = "↩️ Undo", + clear_btn: str | None | Button = "🗑️ Clear", + autofocus: bool = True, + ): + """ + Parameters: + fn: the function to wrap the chat interface around. Should accept two parameters: a string input message and list of two-element lists of the form [[user_message, bot_message], ...] representing the chat history, and return a string response. See the Chatbot documentation for more information on the chat history format. + chatbot: an instance of the gr.Chatbot component to use for the chat interface, if you would like to customize the chatbot properties. If not provided, a default gr.Chatbot component will be created. + textbox: an instance of the gr.Textbox component to use for the chat interface, if you would like to customize the textbox properties. If not provided, a default gr.Textbox component will be created. + additional_inputs: an instance or list of instances of gradio components (or their string shortcuts) to use as additional inputs to the chatbot. If components are not already rendered in a surrounding Blocks, then the components will be displayed under the chatbot, in an accordion. + additional_inputs_accordion_name: the label of the accordion to use for additional inputs, only used if additional_inputs is provided. + examples: sample inputs for the function; if provided, appear below the chatbot and can be clicked to populate the chatbot input. + cache_examples: If True, caches examples in the server for fast runtime in examples. The default option in HuggingFace Spaces is True. The default option elsewhere is False. + title: a title for the interface; if provided, appears above chatbot in large font. Also used as the tab title when opened in a browser window. + description: a description for the interface; if provided, appears above the chatbot and beneath the title in regular font. Accepts Markdown and HTML content. + theme: Theme to use, loaded from gradio.themes. + css: custom css or path to custom css file to use with interface. + analytics_enabled: Whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable if defined, or default to True. + submit_btn: Text to display on the submit button. If None, no button will be displayed. If a Button object, that button will be used. + stop_btn: Text to display on the stop button, which replaces the submit_btn when the submit_btn or retry_btn is clicked and response is streaming. Clicking on the stop_btn will halt the chatbot response. If set to None, stop button functionality does not appear in the chatbot. If a Button object, that button will be used as the stop button. + retry_btn: Text to display on the retry button. If None, no button will be displayed. If a Button object, that button will be used. + undo_btn: Text to display on the delete last button. If None, no button will be displayed. If a Button object, that button will be used. + clear_btn: Text to display on the clear button. If None, no button will be displayed. If a Button object, that button will be used. + autofocus: If True, autofocuses to the textbox when the page loads. + """ + super().__init__( + analytics_enabled=analytics_enabled, + mode="chat_interface", + css=css, + title=title or "Gradio", + theme=theme, + ) + self.fn = fn + self.is_generator = inspect.isgeneratorfunction(self.fn) + self.examples = examples + if self.space_id and cache_examples is None: + self.cache_examples = True + else: + self.cache_examples = cache_examples or False + self.buttons: list[Button] = [] + + if additional_inputs: + if not isinstance(additional_inputs, list): + additional_inputs = [additional_inputs] + self.additional_inputs = [ + get_component_instance(i, render=False) for i in additional_inputs # type: ignore + ] + else: + self.additional_inputs = [] + self.additional_inputs_accordion_name = additional_inputs_accordion_name + + with self: + if title: + Markdown( + f"

{self.title}

" + ) + if description: + Markdown(description) + + with Column(variant="panel"): + if chatbot: + self.chatbot = chatbot.render() + else: + self.chatbot = Chatbot(label="Chatbot") + + with Group(): + with Row(): + if textbox: + textbox.container = False + textbox.show_label = False + self.textbox = textbox.render() + else: + self.textbox = Textbox( + container=False, + show_label=False, + label="Message", + placeholder="Type a message...", + scale=7, + autofocus=autofocus, + ) + if submit_btn: + if isinstance(submit_btn, Button): + submit_btn.render() + elif isinstance(submit_btn, str): + submit_btn = Button( + submit_btn, + variant="primary", + scale=1, + min_width=150, + ) + else: + raise ValueError( + f"The submit_btn parameter must be a gr.Button, string, or None, not {type(submit_btn)}" + ) + if stop_btn: + if isinstance(stop_btn, Button): + stop_btn.visible = False + stop_btn.render() + elif isinstance(stop_btn, str): + stop_btn = Button( + stop_btn, + variant="stop", + visible=False, + scale=1, + min_width=150, + ) + else: + raise ValueError( + f"The stop_btn parameter must be a gr.Button, string, or None, not {type(stop_btn)}" + ) + self.buttons.extend([submit_btn, stop_btn]) + + with Row(): + for btn in [retry_btn, undo_btn, clear_btn]: + if btn: + if isinstance(btn, Button): + btn.render() + elif isinstance(btn, str): + btn = Button(btn, variant="secondary") + else: + raise ValueError( + f"All the _btn parameters must be a gr.Button, string, or None, not {type(btn)}" + ) + self.buttons.append(btn) + + self.fake_api_btn = Button("Fake API", visible=False) + self.fake_response_textbox = Textbox( + label="Response", visible=False + ) + ( + self.submit_btn, + self.stop_btn, + self.retry_btn, + self.undo_btn, + self.clear_btn, + ) = self.buttons + + if examples: + if self.is_generator: + examples_fn = self._examples_stream_fn + else: + examples_fn = self._examples_fn + + self.examples_handler = Examples( + examples=examples, + inputs=[self.textbox] + self.additional_inputs, + outputs=self.chatbot, + fn=examples_fn, + ) + + any_unrendered_inputs = any( + not inp.is_rendered for inp in self.additional_inputs + ) + if self.additional_inputs and any_unrendered_inputs: + with Accordion(self.additional_inputs_accordion_name, open=False): + for input_component in self.additional_inputs: + if not input_component.is_rendered: + input_component.render() + + # The example caching must happen after the input components have rendered + if cache_examples: + client_utils.synchronize_async(self.examples_handler.cache) + + self.saved_input = State() + self.chatbot_state = State([]) + + self._setup_events() + self._setup_api() + + def _setup_events(self) -> None: + submit_fn = self._stream_fn if self.is_generator else self._submit_fn + submit_event = ( + self.textbox.submit( + self._clear_and_save_textbox, + [self.textbox], + [self.textbox, self.saved_input], + api_name=False, + queue=False, + ) + .then( + self._display_input, + [self.saved_input, self.chatbot_state], + [self.chatbot, self.chatbot_state], + api_name=False, + queue=False, + ) + .then( + submit_fn, + [self.saved_input, self.chatbot_state] + self.additional_inputs, + [self.chatbot, self.chatbot_state], + api_name=False, + ) + ) + self._setup_stop_events(self.textbox.submit, submit_event) + + if self.submit_btn: + click_event = ( + self.submit_btn.click( + self._clear_and_save_textbox, + [self.textbox], + [self.textbox, self.saved_input], + api_name=False, + queue=False, + ) + .then( + self._display_input, + [self.saved_input, self.chatbot_state], + [self.chatbot, self.chatbot_state], + api_name=False, + queue=False, + ) + .then( + submit_fn, + [self.saved_input, self.chatbot_state] + self.additional_inputs, + [self.chatbot, self.chatbot_state], + api_name=False, + ) + ) + self._setup_stop_events(self.submit_btn.click, click_event) + + if self.retry_btn: + retry_event = ( + self.retry_btn.click( + self._delete_prev_fn, + [self.chatbot_state], + [self.chatbot, self.saved_input, self.chatbot_state], + api_name=False, + queue=False, + ) + .then( + self._display_input, + [self.saved_input, self.chatbot_state], + [self.chatbot, self.chatbot_state], + api_name=False, + queue=False, + ) + .then( + submit_fn, + [self.saved_input, self.chatbot_state] + self.additional_inputs, + [self.chatbot, self.chatbot_state], + api_name=False, + ) + ) + self._setup_stop_events(self.retry_btn.click, retry_event) + + if self.undo_btn: + self.undo_btn.click( + self._delete_prev_fn, + [self.chatbot_state], + [self.chatbot, self.saved_input, self.chatbot_state], + api_name=False, + queue=False, + ).then( + lambda x: x, + [self.saved_input], + [self.textbox], + api_name=False, + queue=False, + ) + + if self.clear_btn: + self.clear_btn.click( + lambda: ([], [], None), + None, + [self.chatbot, self.chatbot_state, self.saved_input], + queue=False, + api_name=False, + ) + + def _setup_stop_events( + self, event_trigger: EventListenerMethod, event_to_cancel: Dependency + ) -> None: + if self.stop_btn and self.is_generator: + if self.submit_btn: + event_trigger( + lambda: (Button.update(visible=False), Button.update(visible=True)), + None, + [self.submit_btn, self.stop_btn], + api_name=False, + queue=False, + ) + event_to_cancel.then( + lambda: (Button.update(visible=True), Button.update(visible=False)), + None, + [self.submit_btn, self.stop_btn], + api_name=False, + queue=False, + ) + else: + event_trigger( + lambda: Button.update(visible=True), + None, + [self.stop_btn], + api_name=False, + queue=False, + ) + event_to_cancel.then( + lambda: Button.update(visible=False), + None, + [self.stop_btn], + api_name=False, + queue=False, + ) + self.stop_btn.click( + None, + None, + None, + cancels=event_to_cancel, + api_name=False, + ) + + def _setup_api(self) -> None: + api_fn = self._api_stream_fn if self.is_generator else self._api_submit_fn + + self.fake_api_btn.click( + api_fn, + [self.textbox, self.chatbot_state] + self.additional_inputs, + [self.textbox, self.chatbot_state], + api_name="chat", + ) + + def _clear_and_save_textbox(self, message: str) -> tuple[str, str]: + return "", message + + def _display_input( + self, message: str, history: list[list[str | None]] + ) -> tuple[list[list[str | None]], list[list[str | None]]]: + history.append([message, None]) + return history, history + + def _submit_fn( + self, + message: str, + history_with_input: list[list[str | None]], + *args, + **kwargs, + ) -> tuple[list[list[str | None]], list[list[str | None]]]: + history = history_with_input[:-1] + response = self.fn(message, history, *args, **kwargs) + history.append([message, response]) + return history, history + + def _stream_fn( + self, + message: str, + history_with_input: list[list[str | None]], + *args, + **kwargs, + ) -> Generator[tuple[list[list[str | None]], list[list[str | None]]], None, None]: + history = history_with_input[:-1] + generator = self.fn(message, history, *args, **kwargs) + try: + first_response = next(generator) + update = history + [[message, first_response]] + yield update, update + except StopIteration: + update = history + [[message, None]] + yield update, update + for response in generator: + update = history + [[message, response]] + yield update, update + + def _api_submit_fn( + self, message: str, history: list[list[str | None]], *args, **kwargs + ) -> tuple[str, list[list[str | None]]]: + response = self.fn(message, history) + history.append([message, response]) + return response, history + + def _api_stream_fn( + self, message: str, history: list[list[str | None]], *args, **kwargs + ) -> Generator[tuple[str | None, list[list[str | None]]], None, None]: + generator = self.fn(message, history, *args, **kwargs) + try: + first_response = next(generator) + yield first_response, history + [[message, first_response]] + except StopIteration: + yield None, history + [[message, None]] + for response in generator: + yield response, history + [[message, response]] + + def _examples_fn(self, message: str, *args, **kwargs) -> list[list[str | None]]: + return [[message, self.fn(message, [], *args, **kwargs)]] + + def _examples_stream_fn( + self, + message: str, + *args, + **kwargs, + ) -> Generator[list[list[str | None]], None, None]: + for response in self.fn(message, [], *args, **kwargs): + yield [[message, response]] + + def _delete_prev_fn( + self, history: list[list[str | None]] + ) -> tuple[list[list[str | None]], str, list[list[str | None]]]: + try: + message, _ = history.pop() + except IndexError: + message = "" + return history, message or "", history diff --git a/gradio/cli.py b/gradio/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..b521bbf0a3cb59ede6ca30f6b684335dd46215f8 --- /dev/null +++ b/gradio/cli.py @@ -0,0 +1,21 @@ +import sys + +from gradio_client.cli import deploy_discord # type: ignore + +import gradio.cli_env_info +import gradio.deploy_space +import gradio.reload + + +def cli(): + args = sys.argv[1:] + if len(args) == 0: + raise ValueError("No file specified.") + elif args[0] == "deploy": + gradio.deploy_space.deploy() + elif args[0] == "environment": + gradio.cli_env_info.print_environment_info() + elif args[0] == "deploy-discord": + deploy_discord.main() + else: + gradio.reload.main() diff --git a/gradio/cli_env_info.py b/gradio/cli_env_info.py new file mode 100644 index 0000000000000000000000000000000000000000..5d91718d78591446719f2c67ee837b8ed71f4324 --- /dev/null +++ b/gradio/cli_env_info.py @@ -0,0 +1,29 @@ +""" This file is the part of 'gradio/cli.py' for printing the environment info +for the cli command 'gradio environment' +""" +import platform + +import pkg_resources + + +def print_environment_info(): + print("Gradio Environment Information:") + + print("Operating System: ", platform.system()) + print("\n") + + for package_name in ["gradio", "gradio_client"]: + try: + package_dist = pkg_resources.get_distribution(package_name) + package_version = package_dist.version + print(f"{package_name} version: ", package_version) + + print(f"\n{package_name} Dependencies:") + for req in package_dist.requires(): + print( + f" {req.project_name}: {pkg_resources.get_distribution(req.project_name).version}" + ) + + print("\n") + except pkg_resources.DistributionNotFound: + print(f"{package_name} package is not installed.") diff --git a/gradio/components/__init__.py b/gradio/components/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..96a64dd9b2e1619052547eb220e9ab904eaf8fdd --- /dev/null +++ b/gradio/components/__init__.py @@ -0,0 +1,116 @@ +from gradio.components.annotated_image import AnnotatedImage +from gradio.components.audio import Audio +from gradio.components.bar_plot import BarPlot +from gradio.components.base import ( + Column, + Component, + Form, + FormComponent, + IOComponent, + Row, + _Keywords, + component, + get_component_instance, +) +from gradio.components.button import Button +from gradio.components.carousel import Carousel +from gradio.components.chatbot import Chatbot +from gradio.components.checkbox import Checkbox +from gradio.components.checkboxgroup import CheckboxGroup +from gradio.components.clear_button import ClearButton +from gradio.components.code import Code +from gradio.components.color_picker import ColorPicker +from gradio.components.dataframe import Dataframe +from gradio.components.dataset import Dataset +from gradio.components.dropdown import Dropdown +from gradio.components.duplicate_button import DuplicateButton +from gradio.components.file import File +from gradio.components.gallery import Gallery +from gradio.components.highlighted_text import HighlightedText +from gradio.components.html import HTML +from gradio.components.image import Image +from gradio.components.interpretation import Interpretation +from gradio.components.json_component import JSON +from gradio.components.label import Label +from gradio.components.line_plot import LinePlot +from gradio.components.markdown import Markdown +from gradio.components.model3d import Model3D +from gradio.components.number import Number +from gradio.components.plot import Plot +from gradio.components.radio import Radio +from gradio.components.scatter_plot import ScatterPlot +from gradio.components.slider import Slider +from gradio.components.state import State, Variable +from gradio.components.status_tracker import StatusTracker +from gradio.components.textbox import Textbox +from gradio.components.timeseries import Timeseries +from gradio.components.upload_button import UploadButton +from gradio.components.video import Video + +Text = Textbox +DataFrame = Dataframe +Highlightedtext = HighlightedText +Annotatedimage = AnnotatedImage +Highlight = HighlightedText +Checkboxgroup = CheckboxGroup +TimeSeries = Timeseries +Json = JSON + +__all__ = [ + "Audio", + "BarPlot", + "Button", + "Carousel", + "Chatbot", + "ClearButton", + "Component", + "component", + "get_component_instance", + "_Keywords", + "Checkbox", + "CheckboxGroup", + "Code", + "ColorPicker", + "Column", + "Dataframe", + "DataFrame", + "Dataset", + "DuplicateButton", + "Form", + "FormComponent", + "Gallery", + "HTML", + "Image", + "IOComponent", + "Interpretation", + "JSON", + "Json", + "Label", + "LinePlot", + "Markdown", + "Textbox", + "Dropdown", + "Model3D", + "File", + "HighlightedText", + "AnnotatedImage", + "CheckboxGroup", + "Timeseries", + "Text", + "Highlightedtext", + "Annotatedimage", + "Highlight", + "Checkboxgroup", + "TimeSeries", + "Number", + "Plot", + "Radio", + "Row", + "ScatterPlot", + "Slider", + "State", + "Variable", + "StatusTracker", + "UploadButton", + "Video", +] diff --git a/gradio/components/annotated_image.py b/gradio/components/annotated_image.py new file mode 100644 index 0000000000000000000000000000000000000000..acb137566dc054a7f6c7c6c9e2734f80960c7db5 --- /dev/null +++ b/gradio/components/annotated_image.py @@ -0,0 +1,243 @@ +"""gr.AnnotatedImage() component.""" + +from __future__ import annotations + +from typing import Literal + +import numpy as np +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import JSONSerializable +from PIL import Image as _Image # using _ to minimize namespace pollution + +from gradio import utils +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import ( + EventListenerMethod, + Selectable, +) + +set_documentation_group("component") + +_Image.init() # fixes https://github.com/gradio-app/gradio/issues/2843 + + +@document() +class AnnotatedImage(Selectable, IOComponent, JSONSerializable): + """ + Displays a base image and colored subsections on top of that image. Subsections can take the from of rectangles (e.g. object detection) or masks (e.g. image segmentation). + Preprocessing: this component does *not* accept input. + Postprocessing: expects a {Tuple[numpy.ndarray | PIL.Image | str, List[Tuple[numpy.ndarray | Tuple[int, int, int, int], str]]]} consisting of a base image and a list of subsections, that are either (x1, y1, x2, y2) tuples identifying object boundaries, or 0-1 confidence masks of the same shape as the image. A label is provided for each subsection. + + Demos: image_segmentation + """ + + def __init__( + self, + value: tuple[ + np.ndarray | _Image.Image | str, + list[tuple[np.ndarray | tuple[int, int, int, int], str]], + ] + | None = None, + *, + show_legend: bool = True, + height: int | None = None, + width: int | None = None, + color_map: dict[str, str] | None = None, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: Tuple of base image and list of (subsection, label) pairs. + show_legend: If True, will show a legend of the subsections. + height: Height of the displayed image. + width: Width of the displayed image. + color_map: A dictionary mapping labels to colors. The colors must be specified as hex codes. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.show_legend = show_legend + self.height = height + self.width = width + self.color_map = color_map + self.select: EventListenerMethod + """ + Event listener for when the user selects Image subsection. + Uses event data gradio.SelectData to carry `value` referring to selected subsection label, and `index` to refer to subsection index. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "show_legend": self.show_legend, + "value": self.value, + "height": self.height, + "width": self.width, + "color_map": self.color_map, + "selectable": self.selectable, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: tuple[ + np.ndarray | _Image.Image | str, + list[tuple[np.ndarray | tuple[int, int, int, int], str]], + ] + | Literal[_Keywords.NO_VALUE] = _Keywords.NO_VALUE, + show_legend: bool | None = None, + height: int | None = None, + width: int | None = None, + color_map: dict[str, str] | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + updated_config = { + "show_legend": show_legend, + "height": height, + "width": width, + "color_map": color_map, + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "__type__": "update", + } + return updated_config + + def postprocess( + self, + y: tuple[ + np.ndarray | _Image.Image | str, + list[tuple[np.ndarray | tuple[int, int, int, int], str]], + ], + ) -> tuple[dict, list[tuple[dict, str]]] | None: + """ + Parameters: + y: Tuple of base image and list of subsections, with each subsection a two-part tuple where the first element is a 4 element bounding box or a 0-1 confidence mask, and the second element is the label. + Returns: + Tuple of base image file and list of subsections, with each subsection a two-part tuple where the first element image path of the mask, and the second element is the label. + """ + if y is None: + return None + base_img = y[0] + if isinstance(base_img, str): + base_img_path = base_img + base_img = np.array(_Image.open(base_img)) + elif isinstance(base_img, np.ndarray): + base_file = self.img_array_to_temp_file(base_img, dir=self.DEFAULT_TEMP_DIR) + base_img_path = str(utils.abspath(base_file)) + elif isinstance(base_img, _Image.Image): + base_file = self.pil_to_temp_file(base_img, dir=self.DEFAULT_TEMP_DIR) + base_img_path = str(utils.abspath(base_file)) + base_img = np.array(base_img) + else: + raise ValueError( + "AnnotatedImage only accepts filepaths, PIL images or numpy arrays for the base image." + ) + self.temp_files.add(base_img_path) + + sections = [] + color_map = self.color_map or {} + + def hex_to_rgb(value): + value = value.lstrip("#") + lv = len(value) + return [int(value[i : i + lv // 3], 16) for i in range(0, lv, lv // 3)] + + for mask, label in y[1]: + mask_array = np.zeros((base_img.shape[0], base_img.shape[1])) + if isinstance(mask, np.ndarray): + mask_array = mask + else: + x1, y1, x2, y2 = mask + border_width = 3 + mask_array[y1:y2, x1:x2] = 0.5 + mask_array[y1:y2, x1 : x1 + border_width] = 1 + mask_array[y1:y2, x2 - border_width : x2] = 1 + mask_array[y1 : y1 + border_width, x1:x2] = 1 + mask_array[y2 - border_width : y2, x1:x2] = 1 + + if label in color_map: + rgb_color = hex_to_rgb(color_map[label]) + else: + rgb_color = [255, 0, 0] + colored_mask = np.zeros((base_img.shape[0], base_img.shape[1], 4)) + solid_mask = np.copy(mask_array) + solid_mask[solid_mask > 0] = 1 + + colored_mask[:, :, 0] = rgb_color[0] * solid_mask + colored_mask[:, :, 1] = rgb_color[1] * solid_mask + colored_mask[:, :, 2] = rgb_color[2] * solid_mask + colored_mask[:, :, 3] = mask_array * 255 + + colored_mask_img = _Image.fromarray((colored_mask).astype(np.uint8)) + + mask_file = self.pil_to_temp_file( + colored_mask_img, dir=self.DEFAULT_TEMP_DIR + ) + mask_file_path = str(utils.abspath(mask_file)) + self.temp_files.add(mask_file_path) + + sections.append( + ({"name": mask_file_path, "data": None, "is_file": True}, label) + ) + + return {"name": base_img_path, "data": None, "is_file": True}, sections + + def style( + self, + *, + height: int | None = None, + width: int | None = None, + color_map: dict[str, str] | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if height is not None: + self.height = height + if width is not None: + self.width = width + if color_map is not None: + self.color_map = color_map + return self diff --git a/gradio/components/audio.py b/gradio/components/audio.py new file mode 100644 index 0000000000000000000000000000000000000000..868a4837b35588ed9a326319a9deafd43fa922cd --- /dev/null +++ b/gradio/components/audio.py @@ -0,0 +1,350 @@ +"""gr.Audio() component.""" + +from __future__ import annotations + +import tempfile +from pathlib import Path +from typing import Any, Callable, Literal + +import numpy as np +from gradio_client import media_data +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import FileSerializable + +from gradio import processing_utils, utils +from gradio.components.base import IOComponent, _Keywords +from gradio.events import ( + Changeable, + Clearable, + Playable, + Recordable, + Streamable, + Uploadable, +) +from gradio.interpretation import TokenInterpretable + +set_documentation_group("component") + + +@document() +class Audio( + Changeable, + Clearable, + Playable, + Recordable, + Streamable, + Uploadable, + IOComponent, + FileSerializable, + TokenInterpretable, +): + """ + Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output). + Preprocessing: passes the uploaded audio as a {Tuple(int, numpy.array)} corresponding to (sample rate in Hz, audio data as a 16-bit int array whose values range from -32768 to 32767), or as a {str} filepath, depending on `type`. + Postprocessing: expects a {Tuple(int, numpy.array)} corresponding to (sample rate in Hz, audio data as a float or int numpy array) or as a {str} or {pathlib.Path} filepath or URL to an audio file, which gets displayed + Examples-format: a {str} filepath to a local file that contains audio. + Demos: main_note, generate_tone, reverse_audio + Guides: real-time-speech-recognition + """ + + def __init__( + self, + value: str | Path | tuple[int, np.ndarray] | Callable | None = None, + *, + source: Literal["upload", "microphone"] = "upload", + type: Literal["numpy", "filepath"] = "numpy", + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + streaming: bool = False, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + format: Literal["wav", "mp3"] = "wav", + autoplay: bool = False, + show_download_button=True, + show_share_button: bool | None = None, + **kwargs, + ): + """ + Parameters: + value: A path, URL, or [sample_rate, numpy array] tuple (sample rate in Hz, audio data as a float or int numpy array) for the default value that Audio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component. + source: Source of audio. "upload" creates a box where user can drop an audio file, "microphone" creates a microphone input. + type: The format the audio file is converted to before being passed into the prediction function. "numpy" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), "filepath" passes a str path to a temporary file containing the audio. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + streaming: If set to True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'microphone'. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + format: The file format to save audio files. Either 'wav' or 'mp3'. wav files are lossless but will tend to be larger files. mp3 files tend to be smaller. Default is wav. Applies both when this component is used as an input (when `type` is "format") and when this component is used as an output. + autoplay: Whether to automatically play the audio when the component is used as an output. Note: browsers will not autoplay audio files if the user has not interacted with the page yet. + show_download_button: If True, will show a download button in the corner of the component for saving audio. If False, icon does not appear. + show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise. + """ + valid_sources = ["upload", "microphone"] + if source not in valid_sources: + raise ValueError( + f"Invalid value for parameter `source`: {source}. Please choose from one of: {valid_sources}" + ) + self.source = source + valid_types = ["numpy", "filepath"] + if type not in valid_types: + raise ValueError( + f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}" + ) + self.type = type + self.streaming = streaming + if streaming and source != "microphone": + raise ValueError( + "Audio streaming only available if source is 'microphone'." + ) + self.format = format + self.autoplay = autoplay + self.show_download_button = show_download_button + self.show_share_button = ( + (utils.get_space() is not None) + if show_share_button is None + else show_share_button + ) + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + TokenInterpretable.__init__(self) + + def get_config(self): + return { + "source": self.source, + "value": self.value, + "streaming": self.streaming, + "autoplay": self.autoplay, + "show_download_button": self.show_download_button, + "show_share_button": self.show_share_button, + **IOComponent.get_config(self), + } + + def example_inputs(self) -> dict[str, Any]: + return { + "raw": {"is_file": False, "data": media_data.BASE64_AUDIO}, + "serialized": "https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav", + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + source: Literal["upload", "microphone"] | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + autoplay: bool | None = None, + show_download_button: bool | None = None, + show_share_button: bool | None = None, + ): + return { + "source": source, + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "autoplay": autoplay, + "show_download_button": show_download_button, + "show_share_button": show_share_button, + "__type__": "update", + } + + def preprocess( + self, x: dict[str, Any] | None + ) -> tuple[int, np.ndarray] | str | None: + """ + Parameters: + x: dictionary with keys "name", "data", "is_file", "crop_min", "crop_max". + Returns: + audio in requested format + """ + if x is None: + return x + file_name, file_data, is_file = ( + x["name"], + x["data"], + x.get("is_file", False), + ) + crop_min, crop_max = x.get("crop_min", 0), x.get("crop_max", 100) + if is_file: + if client_utils.is_http_url_like(file_name): + temp_file_path = self.download_temp_copy_if_needed(file_name) + else: + temp_file_path = self.make_temp_copy_if_needed(file_name) + else: + temp_file_path = self.base64_to_temp_file_if_needed(file_data, file_name) + + sample_rate, data = processing_utils.audio_from_file( + temp_file_path, crop_min=crop_min, crop_max=crop_max + ) + + # Need a unique name for the file to avoid re-using the same audio file if + # a user submits the same audio file twice, but with different crop min/max. + temp_file_path = Path(temp_file_path) + output_file_name = str( + temp_file_path.with_name( + f"{temp_file_path.stem}-{crop_min}-{crop_max}{temp_file_path.suffix}" + ) + ) + + if self.type == "numpy": + return sample_rate, data + elif self.type == "filepath": + output_file = str(Path(output_file_name).with_suffix(f".{self.format}")) + processing_utils.audio_to_file( + sample_rate, data, output_file, format=self.format + ) + return output_file + else: + raise ValueError( + "Unknown type: " + + str(self.type) + + ". Please choose from: 'numpy', 'filepath'." + ) + + def set_interpret_parameters(self, segments: int = 8): + """ + Calculates interpretation score of audio subsections by splitting the audio into subsections, then using a "leave one out" method to calculate the score of each subsection by removing the subsection and measuring the delta of the output value. + Parameters: + segments: Number of interpretation segments to split audio into. + """ + self.interpretation_segments = segments + return self + + def tokenize(self, x): + if x.get("is_file"): + sample_rate, data = processing_utils.audio_from_file(x["name"]) + else: + file_name = self.base64_to_temp_file_if_needed(x["data"]) + sample_rate, data = processing_utils.audio_from_file(file_name) + leave_one_out_sets = [] + tokens = [] + masks = [] + duration = data.shape[0] + boundaries = np.linspace(0, duration, self.interpretation_segments + 1).tolist() + boundaries = [round(boundary) for boundary in boundaries] + for index in range(len(boundaries) - 1): + start, stop = boundaries[index], boundaries[index + 1] + masks.append((start, stop)) + + # Handle the leave one outs + leave_one_out_data = np.copy(data) + leave_one_out_data[start:stop] = 0 + file = tempfile.NamedTemporaryFile( + delete=False, suffix=".wav", dir=self.DEFAULT_TEMP_DIR + ) + processing_utils.audio_to_file(sample_rate, leave_one_out_data, file.name) + out_data = client_utils.encode_file_to_base64(file.name) + leave_one_out_sets.append(out_data) + file.close() + Path(file.name).unlink() + + # Handle the tokens + token = np.copy(data) + token[0:start] = 0 + token[stop:] = 0 + file = tempfile.NamedTemporaryFile( + delete=False, suffix=".wav", dir=self.DEFAULT_TEMP_DIR + ) + processing_utils.audio_to_file(sample_rate, token, file.name) + token_data = client_utils.encode_file_to_base64(file.name) + file.close() + Path(file.name).unlink() + + tokens.append(token_data) + tokens = [{"name": "token.wav", "data": token} for token in tokens] + leave_one_out_sets = [ + {"name": "loo.wav", "data": loo_set} for loo_set in leave_one_out_sets + ] + return tokens, leave_one_out_sets, masks + + def get_masked_inputs(self, tokens, binary_mask_matrix): + # create a "zero input" vector and get sample rate + x = tokens[0]["data"] + file_name = self.base64_to_temp_file_if_needed(x) + sample_rate, data = processing_utils.audio_from_file(file_name) + zero_input = np.zeros_like(data, dtype="int16") + # decode all of the tokens + token_data = [] + for token in tokens: + file_name = self.base64_to_temp_file_if_needed(token["data"]) + _, data = processing_utils.audio_from_file(file_name) + token_data.append(data) + # construct the masked version + masked_inputs = [] + for binary_mask_vector in binary_mask_matrix: + masked_input = np.copy(zero_input) + for t, b in zip(token_data, binary_mask_vector): + masked_input = masked_input + t * int(b) + file = tempfile.NamedTemporaryFile(delete=False, dir=self.DEFAULT_TEMP_DIR) + processing_utils.audio_to_file(sample_rate, masked_input, file.name) + masked_data = client_utils.encode_file_to_base64(file.name) + file.close() + Path(file.name).unlink() + masked_inputs.append(masked_data) + return masked_inputs + + def postprocess( + self, y: tuple[int, np.ndarray] | str | Path | None + ) -> str | dict | None: + """ + Parameters: + y: audio data in either of the following formats: a tuple of (sample_rate, data), or a string filepath or URL to an audio file, or None. + Returns: + base64 url data + """ + if y is None: + return None + if isinstance(y, str) and client_utils.is_http_url_like(y): + return {"name": y, "data": None, "is_file": True} + if isinstance(y, tuple): + sample_rate, data = y + file_path = self.audio_to_temp_file( + data, sample_rate, dir=self.DEFAULT_TEMP_DIR, format=self.format + ) + self.temp_files.add(file_path) + else: + file_path = self.make_temp_copy_if_needed(y) + return {"name": file_path, "data": None, "is_file": True} + + def check_streamable(self): + if self.source != "microphone": + raise ValueError( + "Audio streaming only available if source is 'microphone'." + ) + + def as_example(self, input_data: str | None) -> str: + return Path(input_data).name if input_data else "" diff --git a/gradio/components/bar_plot.py b/gradio/components/bar_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..430b10f63b0647e163df5bdde5d065519e64ce04 --- /dev/null +++ b/gradio/components/bar_plot.py @@ -0,0 +1,376 @@ +"""gr.BarPlot() component.""" + +from __future__ import annotations + +from typing import Callable, Literal + +import altair as alt +import pandas as pd +from gradio_client.documentation import document, set_documentation_group + +from gradio.components.base import _Keywords +from gradio.components.plot import AltairPlot, Plot + +set_documentation_group("component") + + +@document() +class BarPlot(Plot): + """ + Create a bar plot. + + Preprocessing: this component does *not* accept input. + Postprocessing: expects a pandas dataframe with the data to plot. + + Demos: bar_plot, chicago-bikeshare-dashboard + """ + + def __init__( + self, + value: pd.DataFrame | Callable | None = None, + x: str | None = None, + y: str | None = None, + *, + color: str | None = None, + vertical: bool = True, + group: str | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + group_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + y_lim: list[int] | None = None, + caption: str | None = None, + interactive: bool | None = True, + label: str | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + every: float | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + ): + """ + Parameters: + value: The pandas dataframe containing the data to display in a scatter plot. + x: Column corresponding to the x axis. + y: Column corresponding to the y axis. + color: The column to determine the bar color. Must be categorical (discrete values). + vertical: If True, the bars will be displayed vertically. If False, the x and y axis will be switched, displaying the bars horizontally. Default is True. + group: The column with which to split the overall plot into smaller subplots. + title: The title to display on top of the chart. + tooltip: The column (or list of columns) to display on the tooltip when a user hovers over a bar. + x_title: The title given to the x axis. By default, uses the value of the x parameter. + y_title: The title given to the y axis. By default, uses the value of the y parameter. + color_legend_title: The title given to the color legend. By default, uses the value of color parameter. + group_title: The label displayed on top of the subplot columns (or rows if vertical=True). Use an empty string to omit. + color_legend_position: The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + height: The height of the plot in pixels. + width: The width of the plot in pixels. + y_lim: A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]. + caption: The (optional) caption to display below the plot. + interactive: Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad. + label: The (optional) label to display on the top left corner of the plot. + show_label: Whether the label should be displayed. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + visible: Whether the plot should be visible. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.x = x + self.y = y + self.color = color + self.vertical = vertical + self.group = group + self.group_title = group_title + self.tooltip = tooltip + self.title = title + self.x_title = x_title + self.y_title = y_title + self.color_legend_title = color_legend_title + self.group_title = group_title + self.color_legend_position = color_legend_position + self.y_lim = y_lim + self.caption = caption + self.interactive_chart = interactive + self.width = width + self.height = height + super().__init__( + value=value, + label=label, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + every=every, + ) + + def get_config(self): + config = super().get_config() + config["caption"] = self.caption + return config + + def get_block_name(self) -> str: + return "plot" + + @staticmethod + def update( + value: pd.DataFrame | dict | Literal[_Keywords.NO_VALUE] = _Keywords.NO_VALUE, + x: str | None = None, + y: str | None = None, + color: str | None = None, + vertical: bool = True, + group: str | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + group_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + y_lim: list[int] | None = None, + caption: str | None = None, + interactive: bool | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + """Update an existing BarPlot component. + + If updating any of the plot properties (color, size, etc) the value, x, and y parameters must be specified. + + Parameters: + value: The pandas dataframe containing the data to display in a scatter plot. + x: Column corresponding to the x axis. + y: Column corresponding to the y axis. + color: The column to determine the bar color. Must be categorical (discrete values). + vertical: If True, the bars will be displayed vertically. If False, the x and y axis will be switched, displaying the bars horizontally. Default is True. + group: The column with which to split the overall plot into smaller subplots. + title: The title to display on top of the chart. + tooltip: The column (or list of columns) to display on the tooltip when a user hovers over a bar. + x_title: The title given to the x axis. By default, uses the value of the x parameter. + y_title: The title given to the y axis. By default, uses the value of the y parameter. + color_legend_title: The title given to the color legend. By default, uses the value of color parameter. + group_title: The label displayed on top of the subplot columns (or rows if vertical=True). Use an empty string to omit. + color_legend_position: The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + height: The height of the plot in pixels. + width: The width of the plot in pixels. + y_lim: A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]. + caption: The (optional) caption to display below the plot. + interactive: Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad. + label: The (optional) label to display on the top left corner of the plot. + show_label: Whether the label should be displayed. + visible: Whether the plot should be visible. + """ + properties = [ + x, + y, + color, + vertical, + group, + title, + tooltip, + x_title, + y_title, + color_legend_title, + group_title, + color_legend_position, + height, + width, + y_lim, + interactive, + ] + if any(properties): + if not isinstance(value, pd.DataFrame): + raise ValueError( + "In order to update plot properties the value parameter " + "must be provided, and it must be a Dataframe. Please pass a value " + "parameter to gr.BarPlot.update." + ) + if x is None or y is None: + raise ValueError( + "In order to update plot properties, the x and y axis data " + "must be specified. Please pass valid values for x an y to " + "gr.BarPlot.update." + ) + chart = BarPlot.create_plot(value, *properties) + value = {"type": "altair", "plot": chart.to_json(), "chart": "bar"} + + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "caption": caption, + "__type__": "update", + } + return updated_config + + @staticmethod + def create_plot( + value: pd.DataFrame, + x: str, + y: str, + color: str | None = None, + vertical: bool = True, + group: str | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + group_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + y_lim: list[int] | None = None, + interactive: bool | None = True, + ): + """Helper for creating the bar plot.""" + interactive = True if interactive is None else interactive + orientation = ( + {"field": group, "title": group_title if group_title is not None else group} + if group + else {} + ) + + x_title = x_title or x + y_title = y_title or y + + # If horizontal, switch x and y + if not vertical: + y, x = x, y + x = f"sum({x}):Q" + y_title, x_title = x_title, y_title + orientation = {"row": alt.Row(**orientation)} if orientation else {} # type: ignore + x_lim = y_lim + y_lim = None + else: + y = f"sum({y}):Q" + x_lim = None + orientation = {"column": alt.Column(**orientation)} if orientation else {} # type: ignore + + encodings = dict( + x=alt.X( + x, # type: ignore + title=x_title, # type: ignore + scale=AltairPlot.create_scale(x_lim), # type: ignore + ), + y=alt.Y( + y, # type: ignore + title=y_title, # type: ignore + scale=AltairPlot.create_scale(y_lim), # type: ignore + ), + **orientation, + ) + properties = {} + if title: + properties["title"] = title + if height: + properties["height"] = height + if width: + properties["width"] = width + + if color: + domain = value[color].unique().tolist() + range_ = list(range(len(domain))) + encodings["color"] = { + "field": color, + "type": "nominal", + "scale": {"domain": domain, "range": range_}, + "legend": AltairPlot.create_legend( + position=color_legend_position, title=color_legend_title or color + ), + } + + if tooltip: + encodings["tooltip"] = tooltip + + chart = ( + alt.Chart(value) # type: ignore + .mark_bar() # type: ignore + .encode(**encodings) + .properties(background="transparent", **properties) + ) + if interactive: + chart = chart.interactive() + + return chart + + def postprocess(self, y: pd.DataFrame | dict | None) -> dict[str, str] | None: + # if None or update + if y is None or isinstance(y, dict): + return y + if self.x is None or self.y is None: + raise ValueError("No value provided for required parameters `x` and `y`.") + chart = self.create_plot( + value=y, + x=self.x, + y=self.y, + color=self.color, + vertical=self.vertical, + group=self.group, + title=self.title, + tooltip=self.tooltip, + x_title=self.x_title, + y_title=self.y_title, + color_legend_title=self.color_legend_title, + color_legend_position=self.color_legend_position, # type: ignore + group_title=self.group_title, + y_lim=self.y_lim, + interactive=self.interactive_chart, + height=self.height, + width=self.width, + ) + + return {"type": "altair", "plot": chart.to_json(), "chart": "bar"} diff --git a/gradio/components/base.py b/gradio/components/base.py new file mode 100644 index 0000000000000000000000000000000000000000..6cafdf3bf5bb202b4d10c0978d6ffa1a1da849ab --- /dev/null +++ b/gradio/components/base.py @@ -0,0 +1,407 @@ +"""Contains all of the components that can be used with Gradio Interface / Blocks. +Along with the docs for each component, you can find the names of example demos that use +each component. These demos are located in the `demo` directory.""" + +from __future__ import annotations + +import hashlib +import os +import secrets +import shutil +import tempfile +import urllib.request +from enum import Enum +from pathlib import Path +from typing import TYPE_CHECKING, Any, Callable + +import aiofiles +import numpy as np +import requests +from fastapi import UploadFile +from gradio_client import utils as client_utils +from gradio_client.documentation import set_documentation_group +from gradio_client.serializing import ( + Serializable, +) +from PIL import Image as _Image # using _ to minimize namespace pollution + +from gradio import processing_utils, utils +from gradio.blocks import Block, BlockContext +from gradio.deprecation import warn_deprecation, warn_style_method_deprecation +from gradio.events import ( + EventListener, +) +from gradio.layouts import Column, Form, Row + +if TYPE_CHECKING: + from typing import TypedDict + + class DataframeData(TypedDict): + headers: list[str] + data: list[list[str | int | bool]] + + +set_documentation_group("component") +_Image.init() # fixes https://github.com/gradio-app/gradio/issues/2843 + + +class _Keywords(Enum): + NO_VALUE = "NO_VALUE" # Used as a sentinel to determine if nothing is provided as a argument for `value` in `Component.update()` + FINISHED_ITERATING = "FINISHED_ITERATING" # Used to skip processing of a component's value (needed for generators + state) + + +class Component(Block, Serializable): + """ + A base class for defining the methods that all gradio components should have. + """ + + def __init__(self, *args, **kwargs): + Block.__init__(self, *args, **kwargs) + EventListener.__init__(self) + + def __str__(self): + return self.__repr__() + + def __repr__(self): + return f"{self.get_block_name()}" + + def get_config(self): + """ + :return: a dictionary with context variables for the javascript file associated with the context + """ + return { + "name": self.get_block_name(), + **super().get_config(), + } + + def preprocess(self, x: Any) -> Any: + """ + Any preprocessing needed to be performed on function input. + """ + return x + + def postprocess(self, y): + """ + Any postprocessing needed to be performed on function output. + """ + return y + + def style(self, *args, **kwargs): + """ + This method is deprecated. Please set these arguments in the Components constructor instead. + """ + warn_style_method_deprecation() + put_deprecated_params_in_box = False + if "rounded" in kwargs: + warn_deprecation( + "'rounded' styling is no longer supported. To round adjacent components together, place them in a Column(variant='box')." + ) + if isinstance(kwargs["rounded"], (list, tuple)): + put_deprecated_params_in_box = True + kwargs.pop("rounded") + if "margin" in kwargs: + warn_deprecation( + "'margin' styling is no longer supported. To place adjacent components together without margin, place them in a Column(variant='box')." + ) + if isinstance(kwargs["margin"], (list, tuple)): + put_deprecated_params_in_box = True + kwargs.pop("margin") + if "border" in kwargs: + warn_deprecation( + "'border' styling is no longer supported. To place adjacent components in a shared border, place them in a Column(variant='box')." + ) + kwargs.pop("border") + for key in kwargs: + warn_deprecation(f"Unknown style parameter: {key}") + if ( + put_deprecated_params_in_box + and isinstance(self.parent, (Row, Column)) + and self.parent.variant == "default" + ): + self.parent.variant = "compact" + return self + + +class IOComponent(Component): + """ + A base class for defining methods that all input/output components should have. + """ + + def __init__( + self, + *, + value: Any = None, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + load_fn: Callable | None = None, + every: float | None = None, + **kwargs, + ): + self.temp_files: set[str] = set() + self.DEFAULT_TEMP_DIR = os.environ.get("GRADIO_TEMP_DIR") or str( + Path(tempfile.gettempdir()) / "gradio" + ) + + Component.__init__( + self, elem_id=elem_id, elem_classes=elem_classes, visible=visible, **kwargs + ) + + self.label = label + self.info = info + if not container: + if show_label: + warn_deprecation("show_label has no effect when container is False.") + show_label = False + if show_label is None: + show_label = True + self.show_label = show_label + self.container = container + if scale is not None and scale != round(scale): + warn_deprecation( + f"'scale' value should be an integer. Using {scale} will cause issues." + ) + self.scale = scale + self.min_width = min_width + self.interactive = interactive + + # load_event is set in the Blocks.attach_load_events method + self.load_event: None | dict[str, Any] = None + self.load_event_to_attach = None + load_fn, initial_value = self.get_load_fn_and_initial_value(value) + self.value = ( + initial_value + if self._skip_init_processing + else self.postprocess(initial_value) + ) + if callable(load_fn): + self.attach_load_event(load_fn, every) + + @staticmethod + def hash_file(file_path: str | Path, chunk_num_blocks: int = 128) -> str: + sha1 = hashlib.sha1() + with open(file_path, "rb") as f: + for chunk in iter(lambda: f.read(chunk_num_blocks * sha1.block_size), b""): + sha1.update(chunk) + return sha1.hexdigest() + + @staticmethod + def hash_url(url: str, chunk_num_blocks: int = 128) -> str: + sha1 = hashlib.sha1() + remote = urllib.request.urlopen(url) + max_file_size = 100 * 1024 * 1024 # 100MB + total_read = 0 + while True: + data = remote.read(chunk_num_blocks * sha1.block_size) + total_read += chunk_num_blocks * sha1.block_size + if not data or total_read > max_file_size: + break + sha1.update(data) + return sha1.hexdigest() + + @staticmethod + def hash_bytes(bytes: bytes): + sha1 = hashlib.sha1() + sha1.update(bytes) + return sha1.hexdigest() + + @staticmethod + def hash_base64(base64_encoding: str, chunk_num_blocks: int = 128) -> str: + sha1 = hashlib.sha1() + for i in range(0, len(base64_encoding), chunk_num_blocks * sha1.block_size): + data = base64_encoding[i : i + chunk_num_blocks * sha1.block_size] + sha1.update(data.encode("utf-8")) + return sha1.hexdigest() + + def make_temp_copy_if_needed(self, file_path: str | Path) -> str: + """Returns a temporary file path for a copy of the given file path if it does + not already exist. Otherwise returns the path to the existing temp file.""" + temp_dir = self.hash_file(file_path) + temp_dir = Path(self.DEFAULT_TEMP_DIR) / temp_dir + temp_dir.mkdir(exist_ok=True, parents=True) + + name = client_utils.strip_invalid_filename_characters(Path(file_path).name) + full_temp_file_path = str(utils.abspath(temp_dir / name)) + + if not Path(full_temp_file_path).exists(): + shutil.copy2(file_path, full_temp_file_path) + + self.temp_files.add(full_temp_file_path) + return full_temp_file_path + + async def save_uploaded_file(self, file: UploadFile, upload_dir: str) -> str: + temp_dir = secrets.token_hex( + 20 + ) # Since the full file is being uploaded anyways, there is no benefit to hashing the file. + temp_dir = Path(upload_dir) / temp_dir + temp_dir.mkdir(exist_ok=True, parents=True) + + if file.filename: + file_name = Path(file.filename).name + name = client_utils.strip_invalid_filename_characters(file_name) + else: + name = f"tmp{secrets.token_hex(5)}" + + full_temp_file_path = str(utils.abspath(temp_dir / name)) + + async with aiofiles.open(full_temp_file_path, "wb") as output_file: + while True: + content = await file.read(100 * 1024 * 1024) + if not content: + break + await output_file.write(content) + + return full_temp_file_path + + def download_temp_copy_if_needed(self, url: str) -> str: + """Downloads a file and makes a temporary file path for a copy if does not already + exist. Otherwise returns the path to the existing temp file.""" + temp_dir = self.hash_url(url) + temp_dir = Path(self.DEFAULT_TEMP_DIR) / temp_dir + temp_dir.mkdir(exist_ok=True, parents=True) + + name = client_utils.strip_invalid_filename_characters(Path(url).name) + full_temp_file_path = str(utils.abspath(temp_dir / name)) + + if not Path(full_temp_file_path).exists(): + with requests.get(url, stream=True) as r, open( + full_temp_file_path, "wb" + ) as f: + shutil.copyfileobj(r.raw, f) + + self.temp_files.add(full_temp_file_path) + return full_temp_file_path + + def base64_to_temp_file_if_needed( + self, base64_encoding: str, file_name: str | None = None + ) -> str: + """Converts a base64 encoding to a file and returns the path to the file if + the file doesn't already exist. Otherwise returns the path to the existing file. + """ + temp_dir = self.hash_base64(base64_encoding) + temp_dir = Path(self.DEFAULT_TEMP_DIR) / temp_dir + temp_dir.mkdir(exist_ok=True, parents=True) + + guess_extension = client_utils.get_extension(base64_encoding) + if file_name: + file_name = client_utils.strip_invalid_filename_characters(file_name) + elif guess_extension: + file_name = f"file.{guess_extension}" + else: + file_name = "file" + + full_temp_file_path = str(utils.abspath(temp_dir / file_name)) # type: ignore + + if not Path(full_temp_file_path).exists(): + data, _ = client_utils.decode_base64_to_binary(base64_encoding) + with open(full_temp_file_path, "wb") as fb: + fb.write(data) + + self.temp_files.add(full_temp_file_path) + return full_temp_file_path + + def pil_to_temp_file(self, img: _Image.Image, dir: str, format="png") -> str: + bytes_data = processing_utils.encode_pil_to_bytes(img, format) + temp_dir = Path(dir) / self.hash_bytes(bytes_data) + temp_dir.mkdir(exist_ok=True, parents=True) + filename = str(temp_dir / f"image.{format}") + img.save(filename, pnginfo=processing_utils.get_pil_metadata(img)) + return filename + + def img_array_to_temp_file(self, arr: np.ndarray, dir: str) -> str: + pil_image = _Image.fromarray( + processing_utils._convert(arr, np.uint8, force_copy=False) + ) + return self.pil_to_temp_file(pil_image, dir, format="png") + + def audio_to_temp_file( + self, data: np.ndarray, sample_rate: int, dir: str, format: str + ): + temp_dir = Path(dir) / self.hash_bytes(data.tobytes()) + temp_dir.mkdir(exist_ok=True, parents=True) + filename = str(temp_dir / f"audio.{format}") + processing_utils.audio_to_file(sample_rate, data, filename, format=format) + return filename + + def file_bytes_to_file(self, data: bytes, dir: str, file_name: str): + path = Path(dir) / self.hash_bytes(data) + path.mkdir(exist_ok=True, parents=True) + path = path / Path(file_name).name + path.write_bytes(data) + return path + + def get_config(self): + config = { + "label": self.label, + "show_label": self.show_label, + "container": self.container, + "scale": self.scale, + "min_width": self.min_width, + "interactive": self.interactive, + **super().get_config(), + } + if self.info: + config["info"] = self.info + return config + + @staticmethod + def get_load_fn_and_initial_value(value): + if callable(value): + initial_value = value() + load_fn = value + else: + initial_value = value + load_fn = None + return load_fn, initial_value + + def attach_load_event(self, callable: Callable, every: float | None): + """Add a load event that runs `callable`, optionally every `every` seconds.""" + self.load_event_to_attach = (callable, every) + + def as_example(self, input_data): + """Return the input data in a way that can be displayed by the examples dataset component in the front-end.""" + return input_data + + +class FormComponent: + def get_expected_parent(self) -> type[Form] | None: + if getattr(self, "container", None) is False: + return None + return Form + + +def component(cls_name: str) -> Component: + obj = utils.component_or_layout_class(cls_name)() + if isinstance(obj, BlockContext): + raise ValueError(f"Invalid component: {obj.__class__}") + return obj + + +def get_component_instance(comp: str | dict | Component, render=True) -> Component: + if isinstance(comp, str): + component_obj = component(comp) + if not (render): + component_obj.unrender() + return component_obj + elif isinstance(comp, dict): + name = comp.pop("name") + component_cls = utils.component_or_layout_class(name) + component_obj = component_cls(**comp) + if isinstance(component_obj, BlockContext): + raise ValueError(f"Invalid component: {name}") + if not (render): + component_obj.unrender() + return component_obj + elif isinstance(comp, Component): + return comp + else: + raise ValueError( + f"Component must provided as a `str` or `dict` or `Component` but is {comp}" + ) diff --git a/gradio/components/button.py b/gradio/components/button.py new file mode 100644 index 0000000000000000000000000000000000000000..4d932c75becc1a324630fe6b1ad2442e229500b0 --- /dev/null +++ b/gradio/components/button.py @@ -0,0 +1,121 @@ +"""gr.Button() component.""" + +from __future__ import annotations + +from typing import Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio.components.base import Component, IOComponent, _Keywords +from gradio.deprecation import warn_deprecation, warn_style_method_deprecation +from gradio.events import Clickable + +set_documentation_group("component") + + +@document() +class Button(Clickable, IOComponent, StringSerializable): + """ + Used to create a button, that can be assigned arbitrary click() events. The label (value) of the button can be used as an input or set via the output of a function. + + Preprocessing: passes the button value as a {str} into the function + Postprocessing: expects a {str} to be returned from a function, which is set as the label of the button + Demos: blocks_inputs, blocks_kinematics + """ + + def __init__( + self, + value: str | Callable = "Run", + *, + variant: Literal["primary", "secondary", "stop"] = "secondary", + size: Literal["sm", "lg"] | None = None, + visible: bool = True, + interactive: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + scale: int | None = None, + min_width: int | None = None, + **kwargs, + ): + """ + Parameters: + value: Default text for the button to display. If callable, the function will be called whenever the app loads to set the initial value of the component. + variant: 'primary' for main call-to-action, 'secondary' for a more subdued style, 'stop' for a stop button. + size: Size of the button. Can be "sm" or "lg". + visible: If False, component will be hidden. + interactive: If False, the Button will be in a disabled state. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + """ + IOComponent.__init__( + self, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + interactive=interactive, + scale=scale, + min_width=min_width, + **kwargs, + ) + if variant == "plain": + warn_deprecation("'plain' variant deprecated, using 'secondary' instead.") + variant = "secondary" + self.variant = variant + self.size = size + + def get_config(self): + return { + "value": self.value, + "variant": self.variant, + "size": self.size, + "interactive": self.interactive, + "scale": self.scale, + "min_width": self.min_width, + **Component.get_config(self), + } + + @staticmethod + def update( + value: str | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + variant: Literal["primary", "secondary", "stop"] | None = None, + size: Literal["sm", "lg"] | None = None, + visible: bool | None = None, + interactive: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + ): + return { + "variant": variant, + "size": size, + "visible": visible, + "value": value, + "interactive": interactive, + "scale": scale, + "min_width": min_width, + "__type__": "update", + } + + def style( + self, + *, + full_width: bool | None = None, + size: Literal["sm", "lg"] | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if full_width is not None: + warn_deprecation( + "Use `scale` in place of full_width in the constructor. " + "scale=1 will make the button expand, whereas 0 will not." + ) + self.scale = 1 if full_width else None + if size is not None: + self.size = size + return self diff --git a/gradio/components/carousel.py b/gradio/components/carousel.py new file mode 100644 index 0000000000000000000000000000000000000000..00a064420f1361e7be8e69e3542dcfa7a04a2bc9 --- /dev/null +++ b/gradio/components/carousel.py @@ -0,0 +1,22 @@ +"""gr.Carousel() component.""" + +from gradio_client.serializing import SimpleSerializable + +from gradio.components.base import IOComponent +from gradio.events import Changeable + + +class Carousel(IOComponent, Changeable, SimpleSerializable): + """ + Deprecated Component + """ + + def __init__( + self, + *args, + **kwargs, + ): + raise DeprecationWarning( + "The Carousel component is deprecated. Please consider using the Gallery " + "component, which can be used to display images (and optional captions).", + ) diff --git a/gradio/components/chatbot.py b/gradio/components/chatbot.py new file mode 100644 index 0000000000000000000000000000000000000000..43ea670f80f0dda1e9cd6e053cd478c0671698c4 --- /dev/null +++ b/gradio/components/chatbot.py @@ -0,0 +1,247 @@ +"""gr.Chatbot() component.""" + +from __future__ import annotations + +import inspect +from pathlib import Path +from typing import Callable, Literal + +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import JSONSerializable + +from gradio import utils +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_deprecation, warn_style_method_deprecation +from gradio.events import ( + Changeable, + EventListenerMethod, + Selectable, +) + +set_documentation_group("component") + + +@document() +class Chatbot(Changeable, Selectable, IOComponent, JSONSerializable): + """ + Displays a chatbot output showing both user submitted messages and responses. Supports a subset of Markdown including bold, italics, code, tables. Also supports audio/video/image files, which are displayed in the Chatbot, and other kinds of files which are displayed as links. + Preprocessing: passes the messages in the Chatbot as a {List[List[str | None | Tuple]]}, i.e. a list of lists. The inner list has 2 elements: the user message and the response message. See `Postprocessing` for the format of these messages. + Postprocessing: expects function to return a {List[List[str | None | Tuple]]}, i.e. a list of lists. The inner list should have 2 elements: the user message and the response message. The individual messages can be (1) strings in valid Markdown, (2) tuples if sending files: (a filepath or URL to a file, [optional string alt text]) -- if the file is image/video/audio, it is displayed in the Chatbot, or (3) None, in which case the message is not displayed. + + Demos: chatbot_simple, chatbot_multimodal + Guides: creating-a-chatbot + """ + + def __init__( + self, + value: list[list[str | tuple[str] | tuple[str | Path, str] | None]] + | Callable + | None = None, + color_map: dict[str, str] | None = None, + *, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + height: int | None = None, + latex_delimiters: list[dict[str, str | bool]] | None = None, + rtl: bool = False, + show_share_button: bool | None = None, + **kwargs, + ): + """ + Parameters: + value: Default value to show in chatbot. If callable, the function will be called whenever the app loads to set the initial value of the component. + color_map: This parameter is deprecated. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + height: height of the component in pixels. + latex_delimiters: A list of dicts of the form {"left": open delimiter (str), "right": close delimiter (str), "display": whether to display in newline (bool)} that will be used to render LaTeX expressions. If not provided, `latex_delimiters` is set to `[{ "left": "$$", "right": "$$", "display": True }]`, so only expressions enclosed in $$ delimiters will be rendered as LaTeX, and in a new line. Pass in an empty list to disable LaTeX rendering. For more information, see the [KaTeX documentation](https://katex.org/docs/autorender.html). + rtl: If True, sets the direction of the rendered text to right-to-left. Default is False, which renders text left-to-right. + show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise. + """ + if color_map is not None: + warn_deprecation("The 'color_map' parameter has been deprecated.") + self.select: EventListenerMethod + """ + Event listener for when the user selects message from Chatbot. + Uses event data gradio.SelectData to carry `value` referring to text of selected message, and `index` tuple to refer to [message, participant] index. + See EventData documentation on how to use this event data. + """ + self.height = height + self.rtl = rtl + if latex_delimiters is None: + latex_delimiters = [{"left": "$$", "right": "$$", "display": True}] + self.latex_delimiters = latex_delimiters + self.show_share_button = ( + (utils.get_space() is not None) + if show_share_button is None + else show_share_button + ) + + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "value": self.value, + "latex_delimiters": self.latex_delimiters, + "selectable": self.selectable, + "height": self.height, + "show_share_button": self.show_share_button, + "rtl": self.rtl, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: list[list[str | tuple[str] | tuple[str, str] | None]] + | Literal[_Keywords.NO_VALUE] + | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + height: int | None = None, + rtl: bool | None = None, + show_share_button: bool | None = None, + ): + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "height": height, + "show_share_button": show_share_button, + "rtl": rtl, + "__type__": "update", + } + return updated_config + + def _preprocess_chat_messages( + self, chat_message: str | dict | None + ) -> str | tuple[str] | tuple[str, str] | None: + if chat_message is None: + return None + elif isinstance(chat_message, dict): + if chat_message["alt_text"] is not None: + return (chat_message["name"], chat_message["alt_text"]) + else: + return (chat_message["name"],) + else: # string + return chat_message + + def preprocess( + self, + y: list[list[str | dict | None] | tuple[str | dict | None, str | dict | None]], + ) -> list[list[str | tuple[str] | tuple[str, str] | None]]: + if y is None: + return y + processed_messages = [] + for message_pair in y: + assert isinstance( + message_pair, (tuple, list) + ), f"Expected a list of lists or list of tuples. Received: {message_pair}" + assert ( + len(message_pair) == 2 + ), f"Expected a list of lists of length 2 or list of tuples of length 2. Received: {message_pair}" + processed_messages.append( + [ + self._preprocess_chat_messages(message_pair[0]), + self._preprocess_chat_messages(message_pair[1]), + ] + ) + return processed_messages + + def _postprocess_chat_messages( + self, chat_message: str | tuple | list | None + ) -> str | dict | None: + if chat_message is None: + return None + elif isinstance(chat_message, (tuple, list)): + file_uri = str(chat_message[0]) + if utils.validate_url(file_uri): + filepath = file_uri + else: + filepath = self.make_temp_copy_if_needed(file_uri) + + mime_type = client_utils.get_mimetype(filepath) + return { + "name": filepath, + "mime_type": mime_type, + "alt_text": chat_message[1] if len(chat_message) > 1 else None, + "data": None, # These last two fields are filled in by the frontend + "is_file": True, + } + elif isinstance(chat_message, str): + chat_message = inspect.cleandoc(chat_message) + return chat_message + else: + raise ValueError(f"Invalid message for Chatbot component: {chat_message}") + + def postprocess( + self, + y: list[list[str | tuple[str] | tuple[str, str] | None] | tuple], + ) -> list[list[str | dict | None]]: + """ + Parameters: + y: List of lists representing the message and response pairs. Each message and response should be a string, which may be in Markdown format. It can also be a tuple whose first element is a string or pathlib.Path filepath or URL to an image/video/audio, and second (optional) element is the alt text, in which case the media file is displayed. It can also be None, in which case that message is not displayed. + Returns: + List of lists representing the message and response. Each message and response will be a string of HTML, or a dictionary with media information. Or None if the message is not to be displayed. + """ + if y is None: + return [] + processed_messages = [] + for message_pair in y: + assert isinstance( + message_pair, (tuple, list) + ), f"Expected a list of lists or list of tuples. Received: {message_pair}" + assert ( + len(message_pair) == 2 + ), f"Expected a list of lists of length 2 or list of tuples of length 2. Received: {message_pair}" + processed_messages.append( + [ + self._postprocess_chat_messages(message_pair[0]), + self._postprocess_chat_messages(message_pair[1]), + ] + ) + return processed_messages + + def style(self, height: int | None = None, **kwargs): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if height is not None: + self.height = height + return self diff --git a/gradio/components/checkbox.py b/gradio/components/checkbox.py new file mode 100644 index 0000000000000000000000000000000000000000..08b6478f4b1809cd3de77a174e4bd9534912f090 --- /dev/null +++ b/gradio/components/checkbox.py @@ -0,0 +1,134 @@ +"""gr.Checkbox() component.""" + +from __future__ import annotations + +from typing import Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import BooleanSerializable + +from gradio.components.base import FormComponent, IOComponent, _Keywords +from gradio.events import Changeable, EventListenerMethod, Inputable, Selectable +from gradio.interpretation import NeighborInterpretable + +set_documentation_group("component") + + +@document() +class Checkbox( + FormComponent, + Changeable, + Inputable, + Selectable, + IOComponent, + BooleanSerializable, + NeighborInterpretable, +): + """ + Creates a checkbox that can be set to `True` or `False`. + + Preprocessing: passes the status of the checkbox as a {bool} into the function. + Postprocessing: expects a {bool} returned from the function and, if it is True, checks the checkbox. + Examples-format: a {bool} representing whether the box is checked. + Demos: sentence_builder, titanic_survival + """ + + def __init__( + self, + value: bool | Callable = False, + *, + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: if True, checked by default. If callable, the function will be called whenever the app loads to set the initial value of the component. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, this checkbox can be checked; if False, checking will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.select: EventListenerMethod + """ + Event listener for when the user selects or deselects Checkbox. + Uses event data gradio.SelectData to carry `value` referring to label of checkbox, and `selected` to refer to state of checkbox. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + NeighborInterpretable.__init__(self) + + def get_config(self): + return { + "value": self.value, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: bool | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "__type__": "update", + } + + def get_interpretation_neighbors(self, x): + return [not x], {} + + def get_interpretation_scores(self, x, neighbors, scores, **kwargs): + """ + Returns: + The first value represents the interpretation score if the input is False, and the second if the input is True. + """ + if x: + return scores[0], None + else: + return None, scores[0] diff --git a/gradio/components/checkboxgroup.py b/gradio/components/checkboxgroup.py new file mode 100644 index 0000000000000000000000000000000000000000..3e67090ac8afcd62b938878ae65c02c2be25149a --- /dev/null +++ b/gradio/components/checkboxgroup.py @@ -0,0 +1,213 @@ +"""gr.CheckboxGroup() component""" + +from __future__ import annotations + +from typing import Any, Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import ListStringSerializable + +from gradio.components.base import FormComponent, IOComponent, _Keywords +from gradio.deprecation import warn_deprecation, warn_style_method_deprecation +from gradio.events import Changeable, EventListenerMethod, Inputable, Selectable +from gradio.interpretation import NeighborInterpretable + +set_documentation_group("component") + + +@document() +class CheckboxGroup( + FormComponent, + Changeable, + Inputable, + Selectable, + IOComponent, + ListStringSerializable, + NeighborInterpretable, +): + """ + Creates a set of checkboxes of which a subset can be checked. + Preprocessing: passes the list of checked checkboxes as a {List[str]} or their indices as a {List[int]} into the function, depending on `type`. + Postprocessing: expects a {List[str]}, each element of which becomes a checked checkbox. + Examples-format: a {List[str]} representing the values to be checked. + Demos: sentence_builder, titanic_survival + """ + + def __init__( + self, + choices: list[str] | None = None, + *, + value: list[str] | str | Callable | None = None, + type: Literal["value", "index"] = "value", + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + choices: list of options to select from. + value: default selected list of options. If callable, the function will be called whenever the app loads to set the initial value of the component. + type: Type of value to be returned by component. "value" returns the list of strings of the choices selected, "index" returns the list of indices of the choices selected. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, choices in this checkbox group will be checkable; if False, checking will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.choices = choices or [] + valid_types = ["value", "index"] + if type not in valid_types: + raise ValueError( + f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}" + ) + self.type = type + self.select: EventListenerMethod + """ + Event listener for when the user selects or deselects within CheckboxGroup. + Uses event data gradio.SelectData to carry `value` referring to label of selected checkbox, `index` to refer to index, and `selected` to refer to state of checkbox. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + NeighborInterpretable.__init__(self) + + def get_config(self): + return { + "choices": self.choices, + "value": self.value, + **IOComponent.get_config(self), + } + + def example_inputs(self) -> dict[str, Any]: + return { + "raw": self.choices[0] if self.choices else None, + "serialized": self.choices[0] if self.choices else None, + } + + @staticmethod + def update( + value: list[str] + | str + | Literal[_Keywords.NO_VALUE] + | None = _Keywords.NO_VALUE, + choices: list[str] | None = None, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "choices": choices, + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "__type__": "update", + } + + def preprocess(self, x: list[str]) -> list[str] | list[int]: + """ + Parameters: + x: list of selected choices + Returns: + list of selected choices as strings or indices within choice list + """ + if self.type == "value": + return x + elif self.type == "index": + return [self.choices.index(choice) for choice in x] + else: + raise ValueError( + f"Unknown type: {self.type}. Please choose from: 'value', 'index'." + ) + + def postprocess(self, y: list[str] | str | None) -> list[str]: + """ + Any postprocessing needed to be performed on function output. + Parameters: + y: List of selected choices. If a single choice is selected, it can be passed in as a string + Returns: + List of selected choices + """ + if y is None: + return [] + if not isinstance(y, list): + y = [y] + return y + + def get_interpretation_neighbors(self, x): + leave_one_out_sets = [] + for choice in self.choices: + leave_one_out_set = list(x) + if choice in leave_one_out_set: + leave_one_out_set.remove(choice) + else: + leave_one_out_set.append(choice) + leave_one_out_sets.append(leave_one_out_set) + return leave_one_out_sets, {} + + def get_interpretation_scores(self, x, neighbors, scores, **kwargs): + """ + Returns: + For each tuple in the list, the first value represents the interpretation score if the input is False, and the second if the input is True. + """ + final_scores = [] + for choice, score in zip(self.choices, scores): + score_set = [score, None] if choice in x else [None, score] + final_scores.append(score_set) + return final_scores + + def style( + self, + *, + item_container: bool | None = None, + container: bool | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if item_container is not None: + warn_deprecation("The `item_container` parameter is deprecated.") + if container is not None: + self.container = container + return self diff --git a/gradio/components/clear_button.py b/gradio/components/clear_button.py new file mode 100644 index 0000000000000000000000000000000000000000..56652e731ae430e16ea3e7da432d06d6bd5e2a91 --- /dev/null +++ b/gradio/components/clear_button.py @@ -0,0 +1,70 @@ +""" Predefined buttons with bound events that can be included in a gr.Blocks for convenience. """ + +from __future__ import annotations + +import json +from typing import Literal + +from gradio_client.documentation import document, set_documentation_group + +from gradio.components import Button, Component + +set_documentation_group("component") + + +@document("add") +class ClearButton(Button): + """ + Button that clears the value of a component or a list of components when clicked. It is instantiated with the list of components to clear. + Preprocessing: passes the button value as a {str} into the function + Postprocessing: expects a {str} to be returned from a function, which is set as the label of the button + """ + + is_template = True + + def __init__( + self, + components: None | list[Component] | Component = None, + *, + value: str = "Clear", + variant: Literal["primary", "secondary", "stop"] = "secondary", + size: Literal["sm", "lg"] | None = None, + visible: bool = True, + interactive: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + scale: int | None = None, + min_width: int | None = None, + **kwargs, + ): + super().__init__( + value, + variant=variant, + size=size, + visible=visible, + interactive=interactive, + elem_id=elem_id, + elem_classes=elem_classes, + scale=scale, + min_width=min_width, + **kwargs, + ) + self.add(components) + + def add(self, components: None | Component | list[Component]) -> ClearButton: + """ + Adds a component or list of components to the list of components that will be cleared when the button is clicked. + """ + if not components: + # This needs to be here because when the ClearButton is created in an gr.Interface, we don't + # want to create dependencies for it before we have created the dependencies for the submit function. + # We generally assume that the submit function dependency is the first thing created in an gr.Interface. + return self + + if isinstance(components, Component): + components = [components] + clear_values = json.dumps( + [component.postprocess(None) for component in components] + ) + self.click(None, [], components, _js=f"() => {clear_values}") + return self diff --git a/gradio/components/code.py b/gradio/components/code.py new file mode 100644 index 0000000000000000000000000000000000000000..134877a4036db4c07fa4427c29694ebc680f65aa --- /dev/null +++ b/gradio/components/code.py @@ -0,0 +1,157 @@ +"""gr.Code() component""" + +from __future__ import annotations + +from typing import Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio.components.base import IOComponent, _Keywords +from gradio.events import Changeable, Inputable + +set_documentation_group("component") + + +@document("languages") +class Code(Changeable, Inputable, IOComponent, StringSerializable): + """ + Creates a Code editor for entering, editing or viewing code. + Preprocessing: passes a {str} of code into the function. + Postprocessing: expects the function to return a {str} of code or a single-elment {tuple}: (string filepath,) + """ + + languages = [ + "python", + "markdown", + "json", + "html", + "css", + "javascript", + "typescript", + "yaml", + "dockerfile", + "shell", + "r", + None, + ] + + def __init__( + self, + value: str | tuple[str] | None = None, + language: Literal[ + "python", + "markdown", + "json", + "html", + "css", + "javascript", + "typescript", + "yaml", + "dockerfile", + "shell", + "r", + ] + | None = None, + *, + lines: int = 5, + label: str | None = None, + interactive: bool | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: Default value to show in the code editor. If callable, the function will be called whenever the app loads to set the initial value of the component. + language: The language to display the code as. Supported languages listed in `gr.Code.languages`. + label: component name in interface. + interactive: Whether user should be able to enter code or only view it. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + assert language in Code.languages, f"Language {language} not supported." + self.language = language + self.lines = lines + IOComponent.__init__( + self, + label=label, + interactive=interactive, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "value": self.value, + "language": self.language, + "lines": self.lines, + **IOComponent.get_config(self), + } + + def postprocess(self, y): + if y is None: + return None + elif isinstance(y, tuple): + with open(y[0]) as file_data: + return file_data.read() + else: + return y.strip() + + @staticmethod + def update( + value: str + | tuple[str] + | None + | Literal[_Keywords.NO_VALUE] = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + language: Literal[ + "python", + "markdown", + "json", + "html", + "css", + "javascript", + "typescript", + "yaml", + "dockerfile", + "shell", + "r", + ] + | None = None, + interactive: bool | None = None, + ): + return { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "language": language, + "interactive": interactive, + "__type__": "update", + } diff --git a/gradio/components/color_picker.py b/gradio/components/color_picker.py new file mode 100644 index 0000000000000000000000000000000000000000..49881866187e229d2abdaf819a7c14c02e44c635 --- /dev/null +++ b/gradio/components/color_picker.py @@ -0,0 +1,143 @@ +"""gr.ColorPicker() component.""" + +from __future__ import annotations + +from typing import Any, Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio.components.base import IOComponent, _Keywords +from gradio.events import ( + Blurrable, + Changeable, + Inputable, + Submittable, +) + +set_documentation_group("component") + + +@document() +class ColorPicker( + Changeable, Inputable, Submittable, Blurrable, IOComponent, StringSerializable +): + """ + Creates a color picker for user to select a color as string input. + Preprocessing: passes selected color value as a {str} into the function. + Postprocessing: expects a {str} returned from function and sets color picker value to it. + Examples-format: a {str} with a hexadecimal representation of a color, e.g. "#ff0000" for red. + Demos: color_picker, color_generator + """ + + def __init__( + self, + value: str | Callable | None = None, + *, + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: default text to provide in color picker. If callable, the function will be called whenever the app loads to set the initial value of the component. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will be rendered as an editable color picker; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def example_inputs(self) -> dict[str, Any]: + return { + "raw": "#000000", + "serialized": "#000000", + } + + def get_config(self): + return { + "value": self.value, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: str | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + interactive: bool | None = None, + ): + return { + "value": value, + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "interactive": interactive, + "__type__": "update", + } + + def preprocess(self, x: str | None) -> str | None: + """ + Any preprocessing needed to be performed on function input. + Parameters: + x: text + Returns: + text + """ + if x is None: + return None + else: + return str(x) + + def postprocess(self, y: str | None) -> str | None: + """ + Any postprocessing needed to be performed on function output. + Parameters: + y: text + Returns: + text + """ + if y is None: + return None + else: + return str(y) diff --git a/gradio/components/dataframe.py b/gradio/components/dataframe.py new file mode 100644 index 0000000000000000000000000000000000000000..8c8c78a3d9c653d4fb5c5c50a0de8eb2ffbccab6 --- /dev/null +++ b/gradio/components/dataframe.py @@ -0,0 +1,304 @@ +"""gr.Dataframe() component""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Callable, Literal + +import numpy as np +import pandas as pd +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import JSONSerializable + +from gradio import utils +from gradio.components.base import IOComponent, _Keywords +from gradio.events import ( + Changeable, + EventListenerMethod, + Inputable, + Selectable, +) + +if TYPE_CHECKING: + from typing import TypedDict + + class DataframeData(TypedDict): + headers: list[str] + data: list[list[str | int | bool]] + + +set_documentation_group("component") + + +@document() +class Dataframe(Changeable, Inputable, Selectable, IOComponent, JSONSerializable): + """ + Accepts or displays 2D input through a spreadsheet-like component for dataframes. + Preprocessing: passes the uploaded spreadsheet data as a {pandas.DataFrame}, {numpy.array}, {List[List]}, or {List} depending on `type` + Postprocessing: expects a {pandas.DataFrame}, {numpy.array}, {List[List]}, {List}, a {Dict} with keys `data` (and optionally `headers`), or {str} path to a csv, which is rendered in the spreadsheet. + Examples-format: a {str} filepath to a csv with data, a pandas dataframe, or a list of lists (excluding headers) where each sublist is a row of data. + Demos: filter_records, matrix_transpose, tax_calculator + """ + + markdown_parser = None + + def __init__( + self, + value: list[list[Any]] | Callable | None = None, + *, + headers: list[str] | None = None, + row_count: int | tuple[int, str] = (1, "dynamic"), + col_count: int | tuple[int, str] | None = None, + datatype: str | list[str] = "str", + type: Literal["pandas", "numpy", "array"] = "pandas", + max_rows: int | None = 20, + max_cols: int | None = None, + overflow_row_behaviour: Literal["paginate", "show_ends"] = "paginate", + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + wrap: bool = False, + **kwargs, + ): + """ + Parameters: + value: Default value as a 2-dimensional list of values. If callable, the function will be called whenever the app loads to set the initial value of the component. + headers: List of str header names. If None, no headers are shown. + row_count: Limit number of rows for input and decide whether user can create new rows. The first element of the tuple is an `int`, the row count; the second should be 'fixed' or 'dynamic', the new row behaviour. If an `int` is passed the rows default to 'dynamic' + col_count: Limit number of columns for input and decide whether user can create new columns. The first element of the tuple is an `int`, the number of columns; the second should be 'fixed' or 'dynamic', the new column behaviour. If an `int` is passed the columns default to 'dynamic' + datatype: Datatype of values in sheet. Can be provided per column as a list of strings, or for the entire sheet as a single string. Valid datatypes are "str", "number", "bool", "date", and "markdown". + type: Type of value to be returned by component. "pandas" for pandas dataframe, "numpy" for numpy array, or "array" for a Python array. + label: component name in interface. + max_rows: Maximum number of rows to display at once. Set to None for infinite. + max_cols: Maximum number of columns to display at once. Set to None for infinite. + overflow_row_behaviour: If set to "paginate", will create pages for overflow rows. If set to "show_ends", will show initial and final rows and truncate middle rows. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will allow users to edit the dataframe; if False, can only be used to display data. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + wrap: if True text in table cells will wrap when appropriate, if False the table will scroll horizontally. Defaults to False. + """ + + self.wrap = wrap + self.row_count = self.__process_counts(row_count) + self.col_count = self.__process_counts( + col_count, len(headers) if headers else 3 + ) + + self.__validate_headers(headers, self.col_count[0]) + + self.headers = ( + headers if headers is not None else list(range(1, self.col_count[0] + 1)) + ) + self.datatype = ( + datatype if isinstance(datatype, list) else [datatype] * self.col_count[0] + ) + valid_types = ["pandas", "numpy", "array"] + if type not in valid_types: + raise ValueError( + f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}" + ) + self.type = type + values = { + "str": "", + "number": 0, + "bool": False, + "date": "01/01/1970", + "markdown": "", + "html": "", + } + column_dtypes = ( + [datatype] * self.col_count[0] if isinstance(datatype, str) else datatype + ) + self.empty_input = [ + [values[c] for c in column_dtypes] for _ in range(self.row_count[0]) + ] + + self.max_rows = max_rows + self.max_cols = max_cols + self.overflow_row_behaviour = overflow_row_behaviour + self.select: EventListenerMethod + """ + Event listener for when the user selects cell within Dataframe. + Uses event data gradio.SelectData to carry `value` referring to value of selected cell, and `index` tuple to refer to index row and column. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "headers": self.headers, + "datatype": self.datatype, + "row_count": self.row_count, + "col_count": self.col_count, + "value": self.value, + "max_rows": self.max_rows, + "max_cols": self.max_cols, + "overflow_row_behaviour": self.overflow_row_behaviour, + "wrap": self.wrap, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + max_rows: int | None = None, + max_cols: str | None = None, + label: str | None = None, + show_label: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "max_rows": max_rows, + "max_cols": max_cols, + "label": label, + "show_label": show_label, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "__type__": "update", + } + + def preprocess(self, x: DataframeData): + """ + Parameters: + x: 2D array of str, numeric, or bool data + Returns: + Dataframe in requested format + """ + if self.type == "pandas": + if x.get("headers") is not None: + return pd.DataFrame(x["data"], columns=x.get("headers")) + else: + return pd.DataFrame(x["data"]) + if self.type == "numpy": + return np.array(x["data"]) + elif self.type == "array": + return x["data"] + else: + raise ValueError( + "Unknown type: " + + str(self.type) + + ". Please choose from: 'pandas', 'numpy', 'array'." + ) + + def postprocess( + self, y: str | pd.DataFrame | np.ndarray | list[list[str | float]] | dict + ) -> dict: + """ + Parameters: + y: dataframe in given format + Returns: + JSON object with key 'headers' for list of header names, 'data' for 2D array of string or numeric data + """ + if y is None: + return self.postprocess(self.empty_input) + if isinstance(y, dict): + return y + if isinstance(y, str): + dataframe = pd.read_csv(y) + return { + "headers": list(dataframe.columns), + "data": Dataframe.__process_markdown( + dataframe.to_dict(orient="split")["data"], self.datatype + ), + } + if isinstance(y, pd.DataFrame): + return { + "headers": list(y.columns), # type: ignore + "data": Dataframe.__process_markdown( + y.to_dict(orient="split")["data"], self.datatype # type: ignore + ), + } + if isinstance(y, (np.ndarray, list)): + if len(y) == 0: + return self.postprocess([[]]) + if isinstance(y, np.ndarray): + y = y.tolist() + assert isinstance(y, list), "output cannot be converted to list" + + _headers = self.headers + + if len(self.headers) < len(y[0]): + _headers = [ + *self.headers, + *list(range(len(self.headers) + 1, len(y[0]) + 1)), + ] + elif len(self.headers) > len(y[0]): + _headers = self.headers[: len(y[0])] + + return { + "headers": _headers, + "data": Dataframe.__process_markdown(y, self.datatype), + } + raise ValueError("Cannot process value as a Dataframe") + + @staticmethod + def __process_counts(count, default=3) -> tuple[int, str]: + if count is None: + return (default, "dynamic") + if type(count) == int or type(count) == float: + return (int(count), "dynamic") + else: + return count + + @staticmethod + def __validate_headers(headers: list[str] | None, col_count: int): + if headers is not None and len(headers) != col_count: + raise ValueError( + f"The length of the headers list must be equal to the col_count int.\n" + f"The column count is set to {col_count} but `headers` has {len(headers)} items. " + f"Check the values passed to `col_count` and `headers`." + ) + + @classmethod + def __process_markdown(cls, data: list[list[Any]], datatype: list[str]): + if "markdown" not in datatype: + return data + + if cls.markdown_parser is None: + cls.markdown_parser = utils.get_markdown_parser() + + for i in range(len(data)): + for j in range(len(data[i])): + if datatype[j] == "markdown": + data[i][j] = cls.markdown_parser.render(data[i][j]) + + return data + + def as_example(self, input_data: pd.DataFrame | np.ndarray | str | None): + if input_data is None: + return "" + elif isinstance(input_data, pd.DataFrame): + return input_data.head(n=5).to_dict(orient="split")["data"] # type: ignore + elif isinstance(input_data, np.ndarray): + return input_data.tolist() + return input_data diff --git a/gradio/components/dataset.py b/gradio/components/dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..af7a7c8bb7e5198e019d02191ff1ac647084773d --- /dev/null +++ b/gradio/components/dataset.py @@ -0,0 +1,137 @@ +"""gr.Dataset() component.""" + +from __future__ import annotations + +from typing import Any, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio.components.base import ( + Component, + IOComponent, + _Keywords, + get_component_instance, +) +from gradio.events import Clickable, Selectable + +set_documentation_group("component") + + +@document() +class Dataset(Clickable, Selectable, Component, StringSerializable): + """ + Used to create an output widget for showing datasets. Used to render the examples + box. + Preprocessing: passes the selected sample either as a {list} of data (if type="value") or as an {int} index (if type="index") + Postprocessing: expects a {list} of {lists} corresponding to the dataset data. + """ + + def __init__( + self, + *, + label: str | None = None, + components: list[IOComponent] | list[str], + samples: list[list[Any]] | None = None, + headers: list[str] | None = None, + type: Literal["values", "index"] = "values", + samples_per_page: int = 10, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + **kwargs, + ): + """ + Parameters: + components: Which component types to show in this dataset widget, can be passed in as a list of string names or Components instances. The following components are supported in a Dataset: Audio, Checkbox, CheckboxGroup, ColorPicker, Dataframe, Dropdown, File, HTML, Image, Markdown, Model3D, Number, Radio, Slider, Textbox, TimeSeries, Video + samples: a nested list of samples. Each sublist within the outer list represents a data sample, and each element within the sublist represents an value for each component + headers: Column headers in the Dataset widget, should be the same len as components. If not provided, inferred from component labels + type: 'values' if clicking on a sample should pass the value of the sample, or "index" if it should pass the index of the sample + samples_per_page: how many examples to show per page. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + """ + Component.__init__( + self, visible=visible, elem_id=elem_id, elem_classes=elem_classes, **kwargs + ) + self.container = container + self.scale = scale + self.min_width = min_width + self.components = [get_component_instance(c, render=False) for c in components] + + # Narrow type to IOComponent + assert all( + isinstance(c, IOComponent) for c in self.components + ), "All components in a `Dataset` must be subclasses of `IOComponent`" + self.components = [c for c in self.components if isinstance(c, IOComponent)] + for component in self.components: + component.root_url = self.root_url + + self.samples = [[]] if samples is None else samples + for example in self.samples: + for i, (component, ex) in enumerate(zip(self.components, example)): + example[i] = component.as_example(ex) + self.type = type + self.label = label + if headers is not None: + self.headers = headers + elif all(c.label is None for c in self.components): + self.headers = [] + else: + self.headers = [c.label or "" for c in self.components] + self.samples_per_page = samples_per_page + + def get_config(self): + return { + "components": [component.get_block_name() for component in self.components], + "headers": self.headers, + "samples": self.samples, + "type": self.type, + "label": self.label, + "samples_per_page": self.samples_per_page, + "container": self.container, + "scale": self.scale, + "min_width": self.min_width, + **Component.get_config(self), + } + + @staticmethod + def update( + samples: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + visible: bool | None = None, + label: str | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + ): + return { + "samples": samples, + "visible": visible, + "label": label, + "container": container, + "scale": scale, + "min_width": min_width, + "__type__": "update", + } + + def preprocess(self, x: Any) -> Any: + """ + Any preprocessing needed to be performed on function input. + """ + if self.type == "index": + return x + elif self.type == "values": + return self.samples[x] + + def postprocess(self, samples: list[list[Any]]) -> dict: + return { + "samples": samples, + "__type__": "update", + } diff --git a/gradio/components/dropdown.py b/gradio/components/dropdown.py new file mode 100644 index 0000000000000000000000000000000000000000..473e105268e80bbec2b76eb6eda463410c0114d3 --- /dev/null +++ b/gradio/components/dropdown.py @@ -0,0 +1,243 @@ +"""gr.Dropdown() component.""" + +from __future__ import annotations + +import warnings +from typing import Any, Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import SimpleSerializable + +from gradio.components.base import FormComponent, IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import ( + Blurrable, + Changeable, + EventListenerMethod, + Inputable, + Selectable, +) + +set_documentation_group("component") + + +@document() +class Dropdown( + FormComponent, + Changeable, + Inputable, + Selectable, + Blurrable, + IOComponent, + SimpleSerializable, +): + """ + Creates a dropdown of choices from which entries can be selected. + Preprocessing: passes the value of the selected dropdown entry as a {str} or its index as an {int} into the function, depending on `type`. + Postprocessing: expects a {str} corresponding to the value of the dropdown entry to be selected. + Examples-format: a {str} representing the drop down value to select. + Demos: sentence_builder, titanic_survival + """ + + def __init__( + self, + choices: list[str] | None = None, + *, + value: str | list[str] | Callable | None = None, + type: Literal["value", "index"] = "value", + multiselect: bool | None = None, + max_choices: int | None = None, + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + allow_custom_value: bool = False, + **kwargs, + ): + """ + Parameters: + choices: list of options to select from. + value: default value(s) selected in dropdown. If None, no value is selected by default. If callable, the function will be called whenever the app loads to set the initial value of the component. + type: Type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected. + multiselect: if True, multiple choices can be selected. + max_choices: maximum number of choices that can be selected. If None, no limit is enforced. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, choices in this dropdown will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + allow_custom_value: If True, allows user to enter a custom value that is not in the list of choices. + """ + self.choices = [str(choice) for choice in choices] if choices else [] + valid_types = ["value", "index"] + if type not in valid_types: + raise ValueError( + f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}" + ) + self.type = type + self.multiselect = multiselect + if multiselect and isinstance(value, str): + value = [value] + if not multiselect and max_choices is not None: + warnings.warn( + "The `max_choices` parameter is ignored when `multiselect` is False." + ) + self.max_choices = max_choices + self.allow_custom_value = allow_custom_value + if multiselect and allow_custom_value: + raise ValueError( + "Custom values are not supported when `multiselect` is True." + ) + self.interpret_by_tokens = False + self.select: EventListenerMethod + """ + Event listener for when the user selects Dropdown option. + Uses event data gradio.SelectData to carry `value` referring to label of selected option, and `index` to refer to index. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def api_info(self) -> dict[str, dict | bool]: + if self.multiselect: + type = { + "type": "array", + "items": {"type": "string"}, + "description": f"List of options from: {self.choices}", + } + else: + type = {"type": "string", "description": f"Option from: {self.choices}"} + return {"info": type, "serialized_info": False} + + def example_inputs(self) -> dict[str, Any]: + if self.multiselect: + return { + "raw": [self.choices[0]] if self.choices else [], + "serialized": [self.choices[0]] if self.choices else [], + } + else: + return { + "raw": self.choices[0] if self.choices else None, + "serialized": self.choices[0] if self.choices else None, + } + + def get_config(self): + return { + "choices": self.choices, + "value": self.value, + "multiselect": self.multiselect, + "max_choices": self.max_choices, + "allow_custom_value": self.allow_custom_value, + "container": self.container, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + choices: str | list[str] | None = None, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + placeholder: str | None = None, + visible: bool | None = None, + ): + return { + "choices": choices, + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "interactive": interactive, + "placeholder": placeholder, + "__type__": "update", + } + + def preprocess( + self, x: str | list[str] + ) -> str | int | list[str] | list[int] | None: + """ + Parameters: + x: selected choice(s) + Returns: + selected choice(s) as string or index within choice list or list of string or indices + """ + if self.type == "value": + return x + elif self.type == "index": + if x is None: + return None + elif self.multiselect: + return [self.choices.index(c) for c in x] + else: + if isinstance(x, str): + return self.choices.index(x) if x in self.choices else None + else: + raise ValueError( + f"Unknown type: {self.type}. Please choose from: 'value', 'index'." + ) + + def set_interpret_parameters(self): + """ + Calculates interpretation score of each choice by comparing the output against each of the outputs when alternative choices are selected. + """ + return self + + def get_interpretation_neighbors(self, x): + choices = list(self.choices) + choices.remove(x) + return choices, {} + + def get_interpretation_scores( + self, x, neighbors, scores: list[float | None], **kwargs + ) -> list: + """ + Returns: + Each value represents the interpretation score corresponding to each choice. + """ + scores.insert(self.choices.index(x), None) + return scores + + def style(self, *, container: bool | None = None, **kwargs): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if container is not None: + self.container = container + return self diff --git a/gradio/components/duplicate_button.py b/gradio/components/duplicate_button.py new file mode 100644 index 0000000000000000000000000000000000000000..e4ecc25c9b3d1f405dcd8cbbaa96c6b536e96d80 --- /dev/null +++ b/gradio/components/duplicate_button.py @@ -0,0 +1,61 @@ +""" Predefined buttons with bound events that can be included in a gr.Blocks for convenience. """ + +from __future__ import annotations + +from typing import Literal + +from gradio_client.documentation import document, set_documentation_group + +from gradio.components import Button +from gradio.utils import get_space + +set_documentation_group("component") + + +@document() +class DuplicateButton(Button): + """ + Button that triggers a Spaces Duplication, when the demo is on Hugging Face Spaces. Does nothing locally. + Preprocessing: passes the button value as a {str} into the function + Postprocessing: expects a {str} to be returned from a function, which is set as the label of the button + """ + + is_template = True + + def __init__( + self, + *, + value: str = "Duplicate Space", + variant: Literal["primary", "secondary", "stop"] = "secondary", + size: Literal["sm", "lg"] | None = "sm", + visible: bool = True, + interactive: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + scale: int | None = 0, + min_width: int | None = None, + _activate: bool = True, + **kwargs, + ): + super().__init__( + value, + variant=variant, + size=size, + visible=visible, + interactive=interactive, + elem_id=elem_id, + elem_classes=elem_classes, + scale=scale, + min_width=min_width, + **kwargs, + ) + if _activate: + self.activate() + + def activate(self): + space_name = get_space() + if space_name is not None: + self.click( + fn=None, + _js=f"() => {{ window.open(`https://huggingface.co/spaces/{space_name}?duplicate=true`, '_blank') }}", + ) diff --git a/gradio/components/file.py b/gradio/components/file.py new file mode 100644 index 0000000000000000000000000000000000000000..79426473d605eef21fa8bd793b2fe9f17d5ba660 --- /dev/null +++ b/gradio/components/file.py @@ -0,0 +1,281 @@ +"""gr.File() component""" + +from __future__ import annotations + +import tempfile +import warnings +from pathlib import Path +from typing import Any, Callable, Literal + +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import FileSerializable + +from gradio import utils +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_deprecation +from gradio.events import ( + Changeable, + Clearable, + EventListenerMethod, + Selectable, + Uploadable, +) + +set_documentation_group("component") + + +@document() +class File( + Changeable, + Selectable, + Clearable, + Uploadable, + IOComponent, + FileSerializable, +): + """ + Creates a file component that allows uploading generic file (when used as an input) and or displaying generic files (output). + Preprocessing: passes the uploaded file as a {tempfile._TemporaryFileWrapper} or {List[tempfile._TemporaryFileWrapper]} depending on `file_count` (or a {bytes}/{List{bytes}} depending on `type`) + Postprocessing: expects function to return a {str} path to a file, or {List[str]} consisting of paths to files. + Examples-format: a {str} path to a local file that populates the component. + Demos: zip_to_json, zip_files + """ + + def __init__( + self, + value: str | list[str] | Callable | None = None, + *, + file_count: Literal["single", "multiple", "directory"] = "single", + file_types: list[str] | None = None, + type: Literal["file", "binary"] = "file", + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: Default file to display, given as str file path. If callable, the function will be called whenever the app loads to set the initial value of the component. + file_count: if single, allows user to upload one file. If "multiple", user uploads multiple files. If "directory", user uploads all files in selected directory. Return type will be list for each file in case of "multiple" or "directory". + file_types: List of file extensions or types of files to be uploaded (e.g. ['image', '.json', '.mp4']). "file" allows any file to be uploaded, "image" allows only image files to be uploaded, "audio" allows only audio files to be uploaded, "video" allows only video files to be uploaded, "text" allows only text files to be uploaded. + type: Type of value to be returned by component. "file" returns a temporary file object with the same base name as the uploaded file, whose full path can be retrieved by file_obj.name, "binary" returns an bytes object. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will allow users to upload a file; if False, can only be used to display files. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.file_count = file_count + self.file_types = file_types + if file_types is not None and not isinstance(file_types, list): + raise ValueError( + f"Parameter file_types must be a list. Received {file_types.__class__.__name__}" + ) + valid_types = [ + "file", + "binary", + "bytes", + ] # "bytes" is included for backwards compatibility + if type not in valid_types: + raise ValueError( + f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}" + ) + if type == "bytes": + warn_deprecation( + "The `bytes` type is deprecated and may not work as expected. Please use `binary` instead." + ) + if file_count == "directory" and file_types is not None: + warnings.warn( + "The `file_types` parameter is ignored when `file_count` is 'directory'." + ) + self.type = type + self.select: EventListenerMethod + """ + Event listener for when the user selects file from list. + Uses event data gradio.SelectData to carry `value` referring to name of selected file, and `index` to refer to index. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "file_count": self.file_count, + "file_types": self.file_types, + "value": self.value, + "selectable": self.selectable, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "__type__": "update", + } + + def preprocess( + self, x: list[dict[str, Any]] | None + ) -> ( + bytes + | tempfile._TemporaryFileWrapper + | list[bytes | tempfile._TemporaryFileWrapper] + | None + ): + """ + Parameters: + x: List of JSON objects with filename as 'name' property and base64 data as 'data' property + Returns: + File objects in requested format + """ + if x is None: + return None + + def process_single_file(f) -> bytes | tempfile._TemporaryFileWrapper: + file_name, data, is_file = ( + f["name"], + f["data"], + f.get("is_file", False), + ) + if self.type == "file": + if is_file: + path = self.make_temp_copy_if_needed(file_name) + else: + data, _ = client_utils.decode_base64_to_binary(data) + path = self.file_bytes_to_file( + data, dir=self.DEFAULT_TEMP_DIR, file_name=file_name + ) + path = str(utils.abspath(path)) + self.temp_files.add(path) + + # Creation of tempfiles here + file = tempfile.NamedTemporaryFile( + delete=False, dir=self.DEFAULT_TEMP_DIR + ) + file.name = path + file.orig_name = file_name # type: ignore + return file + elif ( + self.type == "binary" or self.type == "bytes" + ): # "bytes" is included for backwards compatibility + if is_file: + with open(file_name, "rb") as file_data: + return file_data.read() + return client_utils.decode_base64_to_binary(data)[0] + else: + raise ValueError( + "Unknown type: " + + str(self.type) + + ". Please choose from: 'file', 'bytes'." + ) + + if self.file_count == "single": + if isinstance(x, list): + return process_single_file(x[0]) + else: + return process_single_file(x) + else: + if isinstance(x, list): + return [process_single_file(f) for f in x] + else: + return process_single_file(x) + + def postprocess( + self, y: str | list[str] | None + ) -> dict[str, Any] | list[dict[str, Any]] | None: + """ + Parameters: + y: file path + Returns: + JSON object with key 'name' for filename, 'data' for base64 url, and 'size' for filesize in bytes + """ + if y is None: + return None + if isinstance(y, list): + return [ + { + "orig_name": Path(file).name, + "name": self.make_temp_copy_if_needed(file), + "size": Path(file).stat().st_size, + "data": None, + "is_file": True, + } + for file in y + ] + else: + d = { + "orig_name": Path(y).name, + "name": self.make_temp_copy_if_needed(y), + "size": Path(y).stat().st_size, + "data": None, + "is_file": True, + } + return d + + def as_example(self, input_data: str | list | None) -> str: + if input_data is None: + return "" + elif isinstance(input_data, list): + return ", ".join([Path(file).name for file in input_data]) + else: + return Path(input_data).name + + def api_info(self) -> dict[str, dict | bool]: + if self.file_count == "single": + return self._single_file_api_info() + else: + return self._multiple_file_api_info() + + def serialized_info(self): + if self.file_count == "single": + return self._single_file_serialized_info() + else: + return self._multiple_file_serialized_info() + + def example_inputs(self) -> dict[str, Any]: + if self.file_count == "single": + return self._single_file_example_inputs() + else: + return self._multiple_file_example_inputs() diff --git a/gradio/components/gallery.py b/gradio/components/gallery.py new file mode 100644 index 0000000000000000000000000000000000000000..7e4278a1d0b5a00752053b155dfd946d1ba616ab --- /dev/null +++ b/gradio/components/gallery.py @@ -0,0 +1,238 @@ +"""gr.Gallery() component.""" + +from __future__ import annotations + +from pathlib import Path +from typing import Any, Callable, Literal + +import numpy as np +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import GallerySerializable +from PIL import Image as _Image # using _ to minimize namespace pollution + +from gradio import utils +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_deprecation, warn_style_method_deprecation +from gradio.events import ( + EventListenerMethod, + Selectable, +) + +set_documentation_group("component") + + +@document() +class Gallery(IOComponent, GallerySerializable, Selectable): + """ + Used to display a list of images as a gallery that can be scrolled through. + Preprocessing: this component does *not* accept input. + Postprocessing: expects a list of images in any format, {List[numpy.array | PIL.Image | str | pathlib.Path]}, or a {List} of (image, {str} caption) tuples and displays them. + + Demos: fake_gan + """ + + def __init__( + self, + value: list[np.ndarray | _Image.Image | str | Path | tuple] + | Callable + | None = None, + *, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + columns: int | tuple | None = 2, + rows: int | tuple | None = None, + height: str | None = None, + preview: bool | None = None, + object_fit: Literal["contain", "cover", "fill", "none", "scale-down"] + | None = None, + allow_preview: bool = True, + show_share_button: bool | None = None, + **kwargs, + ): + """ + Parameters: + value: List of images to display in the gallery by default. If callable, the function will be called whenever the app loads to set the initial value of the component. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + columns: Represents the number of images that should be shown in one row, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). if fewer that 6 are given then the last will be used for all subsequent breakpoints + rows: Represents the number of rows in the image grid, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). if fewer that 6 are given then the last will be used for all subsequent breakpoints + height: Height of the gallery. + preview: If True, will display the Gallery in preview mode, which shows all of the images as thumbnails and allows the user to click on them to view them in full size. + object_fit: CSS object-fit property for the thumbnail images in the gallery. Can be "contain", "cover", "fill", "none", or "scale-down". + allow_preview: If True, images in the gallery will be enlarged when they are clicked. Default is True. + show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise. + """ + self.grid_cols = columns + self.grid_rows = rows + self.height = height + self.preview = preview + self.object_fit = object_fit + self.allow_preview = allow_preview + self.select: EventListenerMethod + """ + Event listener for when the user selects image within Gallery. + Uses event data gradio.SelectData to carry `value` referring to caption of selected image, and `index` to refer to index. + See EventData documentation on how to use this event data. + """ + self.show_share_button = ( + (utils.get_space() is not None) + if show_share_button is None + else show_share_button + ) + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + columns: int | tuple | None = None, + rows: int | tuple | None = None, + height: str | None = None, + preview: bool | None = None, + object_fit: Literal["contain", "cover", "fill", "none", "scale-down"] + | None = None, + allow_preview: bool | None = None, + show_share_button: bool | None = None, + ): + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "grid_cols": columns, + "grid_rows": rows, + "height": height, + "preview": preview, + "object_fit": object_fit, + "allow_preview": allow_preview, + "show_share_button": show_share_button, + "__type__": "update", + } + return updated_config + + def get_config(self): + return { + "value": self.value, + "grid_cols": self.grid_cols, + "grid_rows": self.grid_rows, + "height": self.height, + "preview": self.preview, + "object_fit": self.object_fit, + "allow_preview": self.allow_preview, + "show_share_button": self.show_share_button, + **IOComponent.get_config(self), + } + + def postprocess( + self, + y: list[np.ndarray | _Image.Image | str] + | list[tuple[np.ndarray | _Image.Image | str, str]] + | None, + ) -> list[str]: + """ + Parameters: + y: list of images, or list of (image, caption) tuples + Returns: + list of string file paths to images in temp directory + """ + if y is None: + return [] + output = [] + for img in y: + caption = None + if isinstance(img, (tuple, list)): + img, caption = img + if isinstance(img, np.ndarray): + file = self.img_array_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR) + file_path = str(utils.abspath(file)) + self.temp_files.add(file_path) + elif isinstance(img, _Image.Image): + file = self.pil_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR) + file_path = str(utils.abspath(file)) + self.temp_files.add(file_path) + elif isinstance(img, (str, Path)): + if utils.validate_url(img): + file_path = img + else: + file_path = self.make_temp_copy_if_needed(img) + else: + raise ValueError(f"Cannot process type as image: {type(img)}") + + if caption is not None: + output.append( + [{"name": file_path, "data": None, "is_file": True}, caption] + ) + else: + output.append({"name": file_path, "data": None, "is_file": True}) + + return output + + def style( + self, + *, + grid: int | tuple | None = None, + columns: int | tuple | None = None, + rows: int | tuple | None = None, + height: str | None = None, + container: bool | None = None, + preview: bool | None = None, + object_fit: str | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if grid is not None: + warn_deprecation( + "The 'grid' parameter will be deprecated. Please use 'grid_cols' in the constructor instead.", + ) + self.grid_cols = grid + if columns is not None: + self.grid_cols = columns + if rows is not None: + self.grid_rows = rows + if height is not None: + self.height = height + if preview is not None: + self.preview = preview + if object_fit is not None: + self.object_fit = object_fit + if container is not None: + self.container = container + return self diff --git a/gradio/components/highlighted_text.py b/gradio/components/highlighted_text.py new file mode 100644 index 0000000000000000000000000000000000000000..8d8c9b0d0b34e290f5f86052372587b9a6b7cc4f --- /dev/null +++ b/gradio/components/highlighted_text.py @@ -0,0 +1,205 @@ +"""gr.HighlightedText() component.""" + +from __future__ import annotations + +from typing import Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import ( + JSONSerializable, +) + +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import ( + Changeable, + EventListenerMethod, + Selectable, +) + +set_documentation_group("component") + + +@document() +class HighlightedText(Changeable, Selectable, IOComponent, JSONSerializable): + """ + Displays text that contains spans that are highlighted by category or numerical value. + Preprocessing: this component does *not* accept input. + Postprocessing: expects a {List[Tuple[str, float | str]]]} consisting of spans of text and their associated labels, or a {Dict} with two keys: (1) "text" whose value is the complete text, and "entities", which is a list of dictionaries, each of which have the keys: "entity" (consisting of the entity label), "start" (the character index where the label starts), and "end" (the character index where the label ends). Entities should not overlap. + + Demos: diff_texts, text_analysis + Guides: named-entity-recognition + """ + + def __init__( + self, + value: list[tuple[str, str | float | None]] | dict | Callable | None = None, + *, + color_map: dict[str, str] + | None = None, # Parameter moved to HighlightedText.style() + show_legend: bool = False, + combine_adjacent: bool = False, + adjacent_separator: str = "", + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: Default value to show. If callable, the function will be called whenever the app loads to set the initial value of the component. + show_legend: whether to show span categories in a separate legend or inline. + combine_adjacent: If True, will merge the labels of adjacent tokens belonging to the same category. + adjacent_separator: Specifies the separator to be used between tokens if combine_adjacent is True. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.color_map = color_map + self.show_legend = show_legend + self.combine_adjacent = combine_adjacent + self.adjacent_separator = adjacent_separator + self.select: EventListenerMethod + """ + Event listener for when the user selects Highlighted text span. + Uses event data gradio.SelectData to carry `value` referring to selected [text, label] tuple, and `index` to refer to span index. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "color_map": self.color_map, + "show_legend": self.show_legend, + "value": self.value, + "selectable": self.selectable, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: list[tuple[str, str | float | None]] + | dict + | Literal[_Keywords.NO_VALUE] + | None = _Keywords.NO_VALUE, + color_map: dict[str, str] | None = None, + show_legend: bool | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + updated_config = { + "color_map": color_map, + "show_legend": show_legend, + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "__type__": "update", + } + return updated_config + + def postprocess( + self, y: list[tuple[str, str | float | None]] | dict | None + ) -> list[tuple[str, str | float | None]] | None: + """ + Parameters: + y: List of (word, category) tuples + Returns: + List of (word, category) tuples + """ + if y is None: + return None + if isinstance(y, dict): + try: + text = y["text"] + entities = y["entities"] + except KeyError as ke: + raise ValueError( + "Expected a dictionary with keys 'text' and 'entities' " + "for the value of the HighlightedText component." + ) from ke + if len(entities) == 0: + y = [(text, None)] + else: + list_format = [] + index = 0 + entities = sorted(entities, key=lambda x: x["start"]) + for entity in entities: + list_format.append((text[index : entity["start"]], None)) + list_format.append( + (text[entity["start"] : entity["end"]], entity["entity"]) + ) + index = entity["end"] + list_format.append((text[index:], None)) + y = list_format + if self.combine_adjacent: + output = [] + running_text, running_category = None, None + for text, category in y: + if running_text is None: + running_text = text + running_category = category + elif category == running_category: + running_text += self.adjacent_separator + text + elif not text: + # Skip fully empty item, these get added in processing + # of dictionaries. + pass + else: + output.append((running_text, running_category)) + running_text = text + running_category = category + if running_text is not None: + output.append((running_text, running_category)) + return output + else: + return y + + def style( + self, + *, + color_map: dict[str, str] | None = None, + container: bool | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if container is not None: + self.container = container + if color_map is not None: + self.color_map = color_map + return self diff --git a/gradio/components/html.py b/gradio/components/html.py new file mode 100644 index 0000000000000000000000000000000000000000..4fd58cf95261f3bfceb305cfb94963ecc7fb23e6 --- /dev/null +++ b/gradio/components/html.py @@ -0,0 +1,81 @@ +"""gr.HTML() component.""" + +from __future__ import annotations + +from typing import Any, Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio.components.base import IOComponent, _Keywords +from gradio.events import Changeable + +set_documentation_group("component") + + +@document() +class HTML(Changeable, IOComponent, StringSerializable): + """ + Used to display arbitrary HTML output. + Preprocessing: this component does *not* accept input. + Postprocessing: expects a valid HTML {str}. + + Demos: text_analysis + Guides: key-features + """ + + def __init__( + self, + value: str | Callable = "", + *, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: Default value. If callable, the function will be called whenever the app loads to set the initial value of the component. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "value": self.value, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + visible: bool | None = None, + ): + updated_config = { + "label": label, + "show_label": show_label, + "visible": visible, + "value": value, + "__type__": "update", + } + return updated_config diff --git a/gradio/components/image.py b/gradio/components/image.py new file mode 100644 index 0000000000000000000000000000000000000000..96481d5c156ea376a87a4633d40a28c252cfdb16 --- /dev/null +++ b/gradio/components/image.py @@ -0,0 +1,442 @@ +"""gr.Image() component.""" + +from __future__ import annotations + +import warnings +from pathlib import Path +from typing import Any, Literal + +import numpy as np +import PIL +import PIL.ImageOps +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import ImgSerializable +from PIL import Image as _Image # using _ to minimize namespace pollution + +from gradio import processing_utils, utils +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import ( + Changeable, + Clearable, + Editable, + EventListenerMethod, + Selectable, + Streamable, + Uploadable, +) +from gradio.interpretation import TokenInterpretable + +set_documentation_group("component") +_Image.init() # fixes https://github.com/gradio-app/gradio/issues/2843 + + +@document() +class Image( + Editable, + Clearable, + Changeable, + Streamable, + Selectable, + Uploadable, + IOComponent, + ImgSerializable, + TokenInterpretable, +): + """ + Creates an image component that can be used to upload/draw images (as an input) or display images (as an output). + Preprocessing: passes the uploaded image as a {numpy.array}, {PIL.Image} or {str} filepath depending on `type` -- unless `tool` is `sketch` AND source is one of `upload` or `webcam`. In these cases, a {dict} with keys `image` and `mask` is passed, and the format of the corresponding values depends on `type`. + Postprocessing: expects a {numpy.array}, {PIL.Image} or {str} or {pathlib.Path} filepath to an image and displays the image. + Examples-format: a {str} filepath to a local file that contains the image. + Demos: image_mod, image_mod_default_image + Guides: image-classification-in-pytorch, image-classification-in-tensorflow, image-classification-with-vision-transformers, building-a-pictionary_app, create-your-own-friends-with-a-gan + """ + + def __init__( + self, + value: str | _Image.Image | np.ndarray | None = None, + *, + shape: tuple[int, int] | None = None, + height: int | None = None, + width: int | None = None, + image_mode: Literal[ + "1", "L", "P", "RGB", "RGBA", "CMYK", "YCbCr", "LAB", "HSV", "I", "F" + ] = "RGB", + invert_colors: bool = False, + source: Literal["upload", "webcam", "canvas"] = "upload", + tool: Literal["editor", "select", "sketch", "color-sketch"] | None = None, + type: Literal["numpy", "pil", "filepath"] = "numpy", + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + show_download_button: bool = True, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + streaming: bool = False, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + mirror_webcam: bool = True, + brush_radius: float | None = None, + brush_color: str = "#000000", + mask_opacity: float = 0.7, + show_share_button: bool | None = None, + **kwargs, + ): + """ + Parameters: + value: A PIL Image, numpy array, path or URL for the default value that Image component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component. + shape: (width, height) shape to crop and resize image when passed to function. If None, matches input image size. Pass None for either width or height to only crop and resize the other. + height: Height of the displayed image in pixels. + width: Width of the displayed image in pixels. + image_mode: "RGB" if color, or "L" if black and white. See https://pillow.readthedocs.io/en/stable/handbook/concepts.html for other supported image modes and their meaning. + invert_colors: whether to invert the image as a preprocessing step. + source: Source of image. "upload" creates a box where user can drop an image file, "webcam" allows user to take snapshot from their webcam, "canvas" defaults to a white image that can be edited and drawn upon with tools. + tool: Tools used for editing. "editor" allows a full screen editor (and is the default if source is "upload" or "webcam"), "select" provides a cropping and zoom tool, "sketch" allows you to create a binary sketch (and is the default if source="canvas"), and "color-sketch" allows you to created a sketch in different colors. "color-sketch" can be used with source="upload" or "webcam" to allow sketching on an image. "sketch" can also be used with "upload" or "webcam" to create a mask over an image and in that case both the image and mask are passed into the function as a dictionary with keys "image" and "mask" respectively. + type: The format the image is converted to before being passed into the prediction function. "numpy" converts the image to a numpy array with shape (height, width, 3) and values from 0 to 255, "pil" converts the image to a PIL image object, "filepath" passes a str path to a temporary file containing the image. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + show_download_button: If True, will display button to download image. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + streaming: If True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'webcam'. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + mirror_webcam: If True webcam will be mirrored. Default is True. + brush_radius: Size of the brush for Sketch. Default is None which chooses a sensible default + brush_color: Color of the brush for Sketch as hex string. Default is "#000000". + mask_opacity: Opacity of mask drawn on image, as a value between 0 and 1. + show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise. + """ + self.brush_radius = brush_radius + self.brush_color = brush_color + self.mask_opacity = mask_opacity + self.mirror_webcam = mirror_webcam + valid_types = ["numpy", "pil", "filepath"] + if type not in valid_types: + raise ValueError( + f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}" + ) + self.type = type + self.shape = shape + self.height = height + self.width = width + self.image_mode = image_mode + valid_sources = ["upload", "webcam", "canvas"] + if source not in valid_sources: + raise ValueError( + f"Invalid value for parameter `source`: {source}. Please choose from one of: {valid_sources}" + ) + self.source = source + if tool is None: + self.tool = "sketch" if source == "canvas" else "editor" + else: + self.tool = tool + self.invert_colors = invert_colors + self.streaming = streaming + self.show_download_button = show_download_button + if streaming and source != "webcam": + raise ValueError("Image streaming only available if source is 'webcam'.") + self.select: EventListenerMethod + """ + Event listener for when the user clicks on a pixel within the image. + Uses event data gradio.SelectData to carry `index` to refer to the [x, y] coordinates of the clicked pixel. + See EventData documentation on how to use this event data. + """ + self.show_share_button = ( + (utils.get_space() is not None) + if show_share_button is None + else show_share_button + ) + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + TokenInterpretable.__init__(self) + + def get_config(self): + return { + "image_mode": self.image_mode, + "shape": self.shape, + "height": self.height, + "width": self.width, + "source": self.source, + "tool": self.tool, + "value": self.value, + "streaming": self.streaming, + "mirror_webcam": self.mirror_webcam, + "brush_radius": self.brush_radius, + "brush_color": self.brush_color, + "mask_opacity": self.mask_opacity, + "selectable": self.selectable, + "show_share_button": self.show_share_button, + "show_download_button": self.show_download_button, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + height: int | None = None, + width: int | None = None, + label: str | None = None, + show_label: bool | None = None, + show_download_button: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + brush_radius: float | None = None, + brush_color: str | None = None, + mask_opacity: float | None = None, + show_share_button: bool | None = None, + ): + return { + "height": height, + "width": width, + "label": label, + "show_label": show_label, + "show_download_button": show_download_button, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "brush_radius": brush_radius, + "brush_color": brush_color, + "mask_opacity": mask_opacity, + "show_share_button": show_share_button, + "__type__": "update", + } + + def _format_image( + self, im: _Image.Image | None + ) -> np.ndarray | _Image.Image | str | None: + """Helper method to format an image based on self.type""" + if im is None: + return im + fmt = im.format + if self.type == "pil": + return im + elif self.type == "numpy": + return np.array(im) + elif self.type == "filepath": + path = self.pil_to_temp_file( + im, dir=self.DEFAULT_TEMP_DIR, format=fmt or "png" + ) + self.temp_files.add(path) + return path + else: + raise ValueError( + "Unknown type: " + + str(self.type) + + ". Please choose from: 'numpy', 'pil', 'filepath'." + ) + + def preprocess( + self, x: str | dict[str, str] + ) -> np.ndarray | _Image.Image | str | dict | None: + """ + Parameters: + x: base64 url data, or (if tool == "sketch") a dict of image and mask base64 url data + Returns: + image in requested format, or (if tool == "sketch") a dict of image and mask in requested format + """ + if x is None: + return x + + mask = "" + if self.tool == "sketch" and self.source in ["upload", "webcam"]: + assert isinstance(x, dict) + x, mask = x["image"], x["mask"] + + assert isinstance(x, str) + im = processing_utils.decode_base64_to_image(x) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + im = im.convert(self.image_mode) + if self.shape is not None: + im = processing_utils.resize_and_crop(im, self.shape) + if self.invert_colors: + im = PIL.ImageOps.invert(im) + if ( + self.source == "webcam" + and self.mirror_webcam is True + and self.tool != "color-sketch" + ): + im = PIL.ImageOps.mirror(im) + + if self.tool == "sketch" and self.source in ["upload", "webcam"]: + mask_im = processing_utils.decode_base64_to_image(mask) + + if mask_im.mode == "RGBA": # whiten any opaque pixels in the mask + alpha_data = mask_im.getchannel("A").convert("L") + mask_im = _Image.merge("RGB", [alpha_data, alpha_data, alpha_data]) + return { + "image": self._format_image(im), + "mask": self._format_image(mask_im), + } + + return self._format_image(im) + + def postprocess( + self, y: np.ndarray | _Image.Image | str | Path | None + ) -> str | None: + """ + Parameters: + y: image as a numpy array, PIL Image, string/Path filepath, or string URL + Returns: + base64 url data + """ + if y is None: + return None + if isinstance(y, np.ndarray): + return processing_utils.encode_array_to_base64(y) + elif isinstance(y, _Image.Image): + return processing_utils.encode_pil_to_base64(y) + elif isinstance(y, (str, Path)): + return client_utils.encode_url_or_file_to_base64(y) + else: + raise ValueError("Cannot process this value as an Image") + + def set_interpret_parameters(self, segments: int = 16): + """ + Calculates interpretation score of image subsections by splitting the image into subsections, then using a "leave one out" method to calculate the score of each subsection by whiting out the subsection and measuring the delta of the output value. + Parameters: + segments: Number of interpretation segments to split image into. + """ + self.interpretation_segments = segments + return self + + def _segment_by_slic(self, x): + """ + Helper method that segments an image into superpixels using slic. + Parameters: + x: base64 representation of an image + """ + x = processing_utils.decode_base64_to_image(x) + if self.shape is not None: + x = processing_utils.resize_and_crop(x, self.shape) + resized_and_cropped_image = np.array(x) + try: + from skimage.segmentation import slic + except (ImportError, ModuleNotFoundError) as err: + raise ValueError( + "Error: running this interpretation for images requires scikit-image, please install it first." + ) from err + try: + segments_slic = slic( + resized_and_cropped_image, + self.interpretation_segments, + compactness=10, + sigma=1, + start_label=1, + ) + except TypeError: # For skimage 0.16 and older + segments_slic = slic( + resized_and_cropped_image, + self.interpretation_segments, + compactness=10, + sigma=1, + ) + return segments_slic, resized_and_cropped_image + + def tokenize(self, x): + """ + Segments image into tokens, masks, and leave-one-out-tokens + Parameters: + x: base64 representation of an image + Returns: + tokens: list of tokens, used by the get_masked_input() method + leave_one_out_tokens: list of left-out tokens, used by the get_interpretation_neighbors() method + masks: list of masks, used by the get_interpretation_neighbors() method + """ + segments_slic, resized_and_cropped_image = self._segment_by_slic(x) + tokens, masks, leave_one_out_tokens = [], [], [] + replace_color = np.mean(resized_and_cropped_image, axis=(0, 1)) + for segment_value in np.unique(segments_slic): + mask = segments_slic == segment_value + image_screen = np.copy(resized_and_cropped_image) + image_screen[segments_slic == segment_value] = replace_color + leave_one_out_tokens.append( + processing_utils.encode_array_to_base64(image_screen) + ) + token = np.copy(resized_and_cropped_image) + token[segments_slic != segment_value] = 0 + tokens.append(token) + masks.append(mask) + return tokens, leave_one_out_tokens, masks + + def get_masked_inputs(self, tokens, binary_mask_matrix): + masked_inputs = [] + for binary_mask_vector in binary_mask_matrix: + masked_input = np.zeros_like(tokens[0], dtype=int) + for token, b in zip(tokens, binary_mask_vector): + masked_input = masked_input + token * int(b) + masked_inputs.append(processing_utils.encode_array_to_base64(masked_input)) + return masked_inputs + + def get_interpretation_scores( + self, x, neighbors, scores, masks, tokens=None, **kwargs + ) -> list[list[float]]: + """ + Returns: + A 2D array representing the interpretation score of each pixel of the image. + """ + x = processing_utils.decode_base64_to_image(x) + if self.shape is not None: + x = processing_utils.resize_and_crop(x, self.shape) + x = np.array(x) + output_scores = np.zeros((x.shape[0], x.shape[1])) + + for score, mask in zip(scores, masks): + output_scores += score * mask + + max_val, min_val = np.max(output_scores), np.min(output_scores) + if max_val > 0: + output_scores = (output_scores - min_val) / (max_val - min_val) + return output_scores.tolist() + + def style(self, *, height: int | None = None, width: int | None = None, **kwargs): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if height is not None: + self.height = height + if width is not None: + self.width = width + return self + + def check_streamable(self): + if self.source != "webcam": + raise ValueError("Image streaming only available if source is 'webcam'.") + + def as_example(self, input_data: str | None) -> str: + if input_data is None: + return "" + elif ( + self.root_url + ): # If an externally hosted image, don't convert to absolute path + return input_data + return str(utils.abspath(input_data)) diff --git a/gradio/components/interpretation.py b/gradio/components/interpretation.py new file mode 100644 index 0000000000000000000000000000000000000000..fc476d99b813cd3ce1933112c7f002433ee36ebe --- /dev/null +++ b/gradio/components/interpretation.py @@ -0,0 +1,61 @@ +"""gr.Interpretation() component""" + +from __future__ import annotations + +from typing import Any, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import SimpleSerializable + +from gradio.components.base import Component, _Keywords + +set_documentation_group("component") + + +@document() +class Interpretation(Component, SimpleSerializable): + """ + Used to create an interpretation widget for a component. + Preprocessing: this component does *not* accept input. + Postprocessing: expects a {dict} with keys "original" and "interpretation". + + Guides: custom-interpretations-with-blocks + """ + + def __init__( + self, + component: Component, + *, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + component: Which component to show in the interpretation widget. + visible: Whether or not the interpretation is visible. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + Component.__init__( + self, visible=visible, elem_id=elem_id, elem_classes=elem_classes, **kwargs + ) + self.component = component + + def get_config(self): + return { + "component": self.component.get_block_name(), + "component_props": self.component.get_config(), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + visible: bool | None = None, + ): + return { + "visible": visible, + "value": value, + "__type__": "update", + } diff --git a/gradio/components/json_component.py b/gradio/components/json_component.py new file mode 100644 index 0000000000000000000000000000000000000000..bdd32c51febf8a7aaaa0fbab65d55c387e7c9576 --- /dev/null +++ b/gradio/components/json_component.py @@ -0,0 +1,122 @@ +"""gr.JSON() component.""" + +from __future__ import annotations + +import json +from typing import Any, Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import JSONSerializable + +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import ( + Changeable, +) + +set_documentation_group("component") + + +@document() +class JSON(Changeable, IOComponent, JSONSerializable): + """ + Used to display arbitrary JSON output prettily. + Preprocessing: this component does *not* accept input. + Postprocessing: expects a {str} filepath to a file containing valid JSON -- or a {list} or {dict} that is valid JSON + + Demos: zip_to_json, blocks_xray + """ + + def __init__( + self, + value: str | dict | list | Callable | None = None, + *, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: Default value. If callable, the function will be called whenever the app loads to set the initial value of the component. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "value": self.value, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "__type__": "update", + } + return updated_config + + def postprocess(self, y: dict | list | str | None) -> dict | list | None: + """ + Parameters: + y: either a string filepath to a JSON file, or a Python list or dict that can be converted to JSON + Returns: + JSON output in Python list or dict format + """ + if y is None: + return None + if isinstance(y, str): + return json.loads(y) + else: + return y + + def style(self, *, container: bool | None = None, **kwargs): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if container is not None: + self.container = container + return self diff --git a/gradio/components/label.py b/gradio/components/label.py new file mode 100644 index 0000000000000000000000000000000000000000..5a2c40fd387b7250cd75d3dfd7ade49ab5343b51 --- /dev/null +++ b/gradio/components/label.py @@ -0,0 +1,182 @@ +"""gr.Label() component.""" + +from __future__ import annotations + +import operator +from pathlib import Path +from typing import Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import ( + JSONSerializable, +) + +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import ( + Changeable, + EventListenerMethod, + Selectable, +) + +set_documentation_group("component") + + +@document() +class Label(Changeable, Selectable, IOComponent, JSONSerializable): + """ + Displays a classification label, along with confidence scores of top categories, if provided. + Preprocessing: this component does *not* accept input. + Postprocessing: expects a {Dict[str, float]} of classes and confidences, or {str} with just the class or an {int}/{float} for regression outputs, or a {str} path to a .json file containing a json dictionary in the structure produced by Label.postprocess(). + + Demos: main_note, titanic_survival + Guides: image-classification-in-pytorch, image-classification-in-tensorflow, image-classification-with-vision-transformers, building-a-pictionary-app + """ + + CONFIDENCES_KEY = "confidences" + + def __init__( + self, + value: dict[str, float] | str | float | Callable | None = None, + *, + num_top_classes: int | None = None, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + color: str | None = None, + **kwargs, + ): + """ + Parameters: + value: Default value to show in the component. If a str or number is provided, simply displays the string or number. If a {Dict[str, float]} of classes and confidences is provided, displays the top class on top and the `num_top_classes` below, along with their confidence bars. If callable, the function will be called whenever the app loads to set the initial value of the component. + num_top_classes: number of most confident classes to show. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + color: The background color of the label (either a valid css color name or hexadecimal string). + """ + self.num_top_classes = num_top_classes + self.color = color + self.select: EventListenerMethod + """ + Event listener for when the user selects a category from Label. + Uses event data gradio.SelectData to carry `value` referring to name of selected category, and `index` to refer to index. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "num_top_classes": self.num_top_classes, + "value": self.value, + "color": self.color, + "selectable": self.selectable, + **IOComponent.get_config(self), + } + + def postprocess(self, y: dict[str, float] | str | float | None) -> dict | None: + """ + Parameters: + y: a dictionary mapping labels to confidence value, or just a string/numerical label by itself + Returns: + Object with key 'label' representing primary label, and key 'confidences' representing a list of label-confidence pairs + """ + if y is None or y == {}: + return {} + if isinstance(y, str) and y.endswith(".json") and Path(y).exists(): + return self.serialize(y) + if isinstance(y, (str, float, int)): + return {"label": str(y)} + if isinstance(y, dict): + if "confidences" in y and isinstance(y["confidences"], dict): + y = y["confidences"] + y = {c["label"]: c["confidence"] for c in y} + sorted_pred = sorted(y.items(), key=operator.itemgetter(1), reverse=True) + if self.num_top_classes is not None: + sorted_pred = sorted_pred[: self.num_top_classes] + return { + "label": sorted_pred[0][0], + "confidences": [ + {"label": pred[0], "confidence": pred[1]} for pred in sorted_pred + ], + } + raise ValueError( + "The `Label` output interface expects one of: a string label, or an int label, a " + "float label, or a dictionary whose keys are labels and values are confidences. " + f"Instead, got a {type(y)}" + ) + + @staticmethod + def update( + value: dict[str, float] + | str + | float + | Literal[_Keywords.NO_VALUE] + | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + color: str | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + ): + # If color is not specified (NO_VALUE) map it to None so that + # it gets filtered out in postprocess. This will mean the color + # will not be updated in the front-end + if color is _Keywords.NO_VALUE: + color = None + # If the color was specified by the developer as None + # Map is so that the color is updated to be transparent, + # e.g. no background default state. + elif color is None: + color = "transparent" + return { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "color": color, + "__type__": "update", + } + + def style( + self, + *, + container: bool | None = None, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if container is not None: + self.container = container + return self diff --git a/gradio/components/line_plot.py b/gradio/components/line_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..fcf6d8d49b7e8df39f2b571f7099de89b994fb57 --- /dev/null +++ b/gradio/components/line_plot.py @@ -0,0 +1,430 @@ +"""gr.LinePlot() component""" + +from __future__ import annotations + +from typing import Callable, Literal + +import altair as alt +import pandas as pd +from gradio_client.documentation import document, set_documentation_group + +from gradio.components.base import _Keywords +from gradio.components.plot import AltairPlot, Plot + +set_documentation_group("component") + + +@document() +class LinePlot(Plot): + """ + Create a line plot. + + Preprocessing: this component does *not* accept input. + Postprocessing: expects a pandas dataframe with the data to plot. + + Demos: line_plot, live_dashboard + """ + + def __init__( + self, + value: pd.DataFrame | Callable | None = None, + x: str | None = None, + y: str | None = None, + *, + color: str | None = None, + stroke_dash: str | None = None, + overlay_point: bool | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + stroke_dash_legend_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + stroke_dash_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + x_lim: list[int] | None = None, + y_lim: list[int] | None = None, + caption: str | None = None, + interactive: bool | None = True, + label: str | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + every: float | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + ): + """ + Parameters: + value: The pandas dataframe containing the data to display in a scatter plot. + x: Column corresponding to the x axis. + y: Column corresponding to the y axis. + color: The column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values. + stroke_dash: The column to determine the symbol used to draw the line, e.g. dashed lines, dashed lines with points. + overlay_point: Whether to draw a point on the line for each (x, y) coordinate pair. + title: The title to display on top of the chart. + tooltip: The column (or list of columns) to display on the tooltip when a user hovers a point on the plot. + x_title: The title given to the x axis. By default, uses the value of the x parameter. + y_title: The title given to the y axis. By default, uses the value of the y parameter. + color_legend_title: The title given to the color legend. By default, uses the value of color parameter. + stroke_dash_legend_title: The title given to the stroke_dash legend. By default, uses the value of the stroke_dash parameter. + color_legend_position: The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + stroke_dash_legend_position: The position of the stoke_dash legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + height: The height of the plot in pixels. + width: The width of the plot in pixels. + x_lim: A tuple or list containing the limits for the x-axis, specified as [x_min, x_max]. + y_lim: A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]. + caption: The (optional) caption to display below the plot. + interactive: Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad. + label: The (optional) label to display on the top left corner of the plot. + show_label: Whether the label should be displayed. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + visible: Whether the plot should be visible. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.x = x + self.y = y + self.color = color + self.stroke_dash = stroke_dash + self.tooltip = tooltip + self.title = title + self.x_title = x_title + self.y_title = y_title + self.color_legend_title = color_legend_title + self.stroke_dash_legend_title = stroke_dash_legend_title + self.color_legend_position = color_legend_position + self.stroke_dash_legend_position = stroke_dash_legend_position + self.overlay_point = overlay_point + self.x_lim = x_lim + self.y_lim = y_lim + self.caption = caption + self.interactive_chart = interactive + self.width = width + self.height = height + super().__init__( + value=value, + label=label, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + every=every, + ) + + def get_config(self): + config = super().get_config() + config["caption"] = self.caption + return config + + def get_block_name(self) -> str: + return "plot" + + @staticmethod + def update( + value: pd.DataFrame | dict | Literal[_Keywords.NO_VALUE] = _Keywords.NO_VALUE, + x: str | None = None, + y: str | None = None, + color: str | None = None, + stroke_dash: str | None = None, + overlay_point: bool | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + stroke_dash_legend_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + stroke_dash_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + x_lim: list[int] | None = None, + y_lim: list[int] | None = None, + interactive: bool | None = None, + caption: str | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + """Update an existing plot component. + + If updating any of the plot properties (color, size, etc) the value, x, and y parameters must be specified. + + Parameters: + value: The pandas dataframe containing the data to display in a scatter plot. + x: Column corresponding to the x axis. + y: Column corresponding to the y axis. + color: The column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values. + stroke_dash: The column to determine the symbol used to draw the line, e.g. dashed lines, dashed lines with points. + overlay_point: Whether to draw a point on the line for each (x, y) coordinate pair. + title: The title to display on top of the chart. + tooltip: The column (or list of columns) to display on the tooltip when a user hovers a point on the plot. + x_title: The title given to the x axis. By default, uses the value of the x parameter. + y_title: The title given to the y axis. By default, uses the value of the y parameter. + color_legend_title: The title given to the color legend. By default, uses the value of color parameter. + stroke_dash_legend_title: The title given to the stroke legend. By default, uses the value of stroke parameter. + color_legend_position: The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation + stroke_dash_legend_position: The position of the stoke_dash legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation + height: The height of the plot in pixels. + width: The width of the plot in pixels. + x_lim: A tuple or list containing the limits for the x-axis, specified as [x_min, x_max]. + y_lim: A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]. + caption: The (optional) caption to display below the plot. + interactive: Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad. + label: The (optional) label to display in the top left corner of the plot. + show_label: Whether the label should be displayed. + visible: Whether the plot should be visible. + """ + properties = [ + x, + y, + color, + stroke_dash, + overlay_point, + title, + tooltip, + x_title, + y_title, + color_legend_title, + stroke_dash_legend_title, + color_legend_position, + stroke_dash_legend_position, + height, + width, + x_lim, + y_lim, + interactive, + ] + if any(properties): + if not isinstance(value, pd.DataFrame): + raise ValueError( + "In order to update plot properties the value parameter " + "must be provided, and it must be a Dataframe. Please pass a value " + "parameter to gr.LinePlot.update." + ) + if x is None or y is None: + raise ValueError( + "In order to update plot properties, the x and y axis data " + "must be specified. Please pass valid values for x an y to " + "gr.LinePlot.update." + ) + chart = LinePlot.create_plot(value, *properties) + value = {"type": "altair", "plot": chart.to_json(), "chart": "line"} + + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "caption": caption, + "__type__": "update", + } + return updated_config + + @staticmethod + def create_plot( + value: pd.DataFrame, + x: str, + y: str, + color: str | None = None, + stroke_dash: str | None = None, + overlay_point: bool | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + stroke_dash_legend_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + stroke_dash_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + x_lim: list[int] | None = None, + y_lim: list[int] | None = None, + interactive: bool | None = None, + ): + """Helper for creating the scatter plot.""" + interactive = True if interactive is None else interactive + encodings = { + "x": alt.X( + x, # type: ignore + title=x_title or x, # type: ignore + scale=AltairPlot.create_scale(x_lim), # type: ignore + ), + "y": alt.Y( + y, # type: ignore + title=y_title or y, # type: ignore + scale=AltairPlot.create_scale(y_lim), # type: ignore + ), + } + properties = {} + if title: + properties["title"] = title + if height: + properties["height"] = height + if width: + properties["width"] = width + + if color: + domain = value[color].unique().tolist() + range_ = list(range(len(domain))) + encodings["color"] = { + "field": color, + "type": "nominal", + "scale": {"domain": domain, "range": range_}, + "legend": AltairPlot.create_legend( + position=color_legend_position, title=color_legend_title or color + ), + } + + highlight = None + if interactive and any([color, stroke_dash]): + highlight = alt.selection( + type="single", # type: ignore + on="mouseover", + fields=[c for c in [color, stroke_dash] if c], + nearest=True, + ) + + if stroke_dash: + stroke_dash = { + "field": stroke_dash, # type: ignore + "legend": AltairPlot.create_legend( # type: ignore + position=stroke_dash_legend_position, # type: ignore + title=stroke_dash_legend_title or stroke_dash, # type: ignore + ), # type: ignore + } # type: ignore + else: + stroke_dash = alt.value(alt.Undefined) # type: ignore + + if tooltip: + encodings["tooltip"] = tooltip + + chart = alt.Chart(value).encode(**encodings) # type: ignore + + points = chart.mark_point(clip=True).encode( + opacity=alt.value(alt.Undefined) if overlay_point else alt.value(0), + ) + lines = chart.mark_line(clip=True).encode(strokeDash=stroke_dash) + + if highlight: + points = points.add_selection(highlight) + + lines = lines.encode( + size=alt.condition(highlight, alt.value(4), alt.value(1)), + ) + + chart = (lines + points).properties(background="transparent", **properties) + if interactive: + chart = chart.interactive() + + return chart + + def postprocess(self, y: pd.DataFrame | dict | None) -> dict[str, str] | None: + # if None or update + if y is None or isinstance(y, dict): + return y + if self.x is None or self.y is None: + raise ValueError("No value provided for required parameters `x` and `y`.") + chart = self.create_plot( + value=y, + x=self.x, + y=self.y, + color=self.color, + overlay_point=self.overlay_point, + title=self.title, + tooltip=self.tooltip, + x_title=self.x_title, + y_title=self.y_title, + color_legend_title=self.color_legend_title, # type: ignore + color_legend_position=self.color_legend_position, # type: ignore + stroke_dash_legend_title=self.stroke_dash_legend_title, + stroke_dash_legend_position=self.stroke_dash_legend_position, # type: ignore + x_lim=self.x_lim, + y_lim=self.y_lim, + stroke_dash=self.stroke_dash, + interactive=self.interactive_chart, + height=self.height, + width=self.width, + ) + + return {"type": "altair", "plot": chart.to_json(), "chart": "line"} diff --git a/gradio/components/markdown.py b/gradio/components/markdown.py new file mode 100644 index 0000000000000000000000000000000000000000..3ef36b1884bfbbb642d14f6851989bd47621cb35 --- /dev/null +++ b/gradio/components/markdown.py @@ -0,0 +1,95 @@ +"""gr.Markdown() component.""" + +from __future__ import annotations + +import inspect +from typing import Any, Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio import utils +from gradio.components.base import Component, IOComponent, _Keywords +from gradio.events import ( + Changeable, +) + +set_documentation_group("component") + + +@document() +class Markdown(IOComponent, Changeable, StringSerializable): + """ + Used to render arbitrary Markdown output. Can also render latex enclosed by dollar signs. + Preprocessing: this component does *not* accept input. + Postprocessing: expects a valid {str} that can be rendered as Markdown. + + Demos: blocks_hello, blocks_kinematics + Guides: key-features + """ + + def __init__( + self, + value: str | Callable = "", + *, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + rtl: bool = False, + **kwargs, + ): + """ + Parameters: + value: Value to show in Markdown component. If callable, the function will be called whenever the app loads to set the initial value of the component. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + rtl: If True, sets the direction of the rendered text to right-to-left. Default is False, which renders text left-to-right. + """ + self.md = utils.get_markdown_parser() + self.rtl = rtl + IOComponent.__init__( + self, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def postprocess(self, y: str | None) -> str | None: + """ + Parameters: + y: markdown representation + Returns: + HTML rendering of markdown + """ + if y is None: + return None + unindented_y = inspect.cleandoc(y) + return self.md.render(unindented_y) + + def get_config(self): + return { + "value": self.value, + "rtl": self.rtl, + **Component.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + visible: bool | None = None, + rtl: bool | None = None, + ): + updated_config = { + "visible": visible, + "value": value, + "rtl": rtl, + "__type__": "update", + } + return updated_config + + def as_example(self, input_data: str | None) -> str: + postprocessed = self.postprocess(input_data) + return postprocessed if postprocessed else "" diff --git a/gradio/components/model3d.py b/gradio/components/model3d.py new file mode 100644 index 0000000000000000000000000000000000000000..aed05a215df88747e60450bbe8e16b38dce60598 --- /dev/null +++ b/gradio/components/model3d.py @@ -0,0 +1,155 @@ +"""gr.Model3D() component.""" + +from __future__ import annotations + +from pathlib import Path +from typing import Any, Callable, Literal + +from gradio_client import media_data +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import FileSerializable + +from gradio.components.base import IOComponent, _Keywords +from gradio.events import ( + Changeable, + Clearable, + Editable, + Uploadable, +) + +set_documentation_group("component") + + +@document() +class Model3D( + Changeable, Uploadable, Editable, Clearable, IOComponent, FileSerializable +): + """ + Component allows users to upload or view 3D Model files (.obj, .glb, or .gltf). + Preprocessing: This component passes the uploaded file as a {str}filepath. + Postprocessing: expects function to return a {str} or {pathlib.Path} filepath of type (.obj, glb, or .gltf) + + Demos: model3D + Guides: how-to-use-3D-model-component + """ + + def __init__( + self, + value: str | Callable | None = None, + *, + clear_color: list[float] | None = None, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: path to (.obj, glb, or .gltf) file to show in model3D viewer. If callable, the function will be called whenever the app loads to set the initial value of the component. + clear_color: background color of scene + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.clear_color = clear_color or [0, 0, 0, 0] + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "clearColor": self.clear_color, + "value": self.value, + **IOComponent.get_config(self), + } + + def example_inputs(self) -> dict[str, Any]: + return { + "raw": {"is_file": False, "data": media_data.BASE64_MODEL3D}, + "serialized": "https://github.com/gradio-app/gradio/raw/main/test/test_files/Box.gltf", + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "__type__": "update", + } + return updated_config + + def preprocess(self, x: dict[str, str] | None) -> str | None: + """ + Parameters: + x: JSON object with filename as 'name' property and base64 data as 'data' property + Returns: + string file path to temporary file with the 3D image model + """ + if x is None: + return x + file_name, file_data, is_file = ( + x["name"], + x["data"], + x.get("is_file", False), + ) + if is_file: + temp_file_path = self.make_temp_copy_if_needed(file_name) + else: + temp_file_path = self.base64_to_temp_file_if_needed(file_data, file_name) + + return temp_file_path + + def postprocess(self, y: str | Path | None) -> dict[str, str] | None: + """ + Parameters: + y: path to the model + Returns: + file name mapped to base64 url data + """ + if y is None: + return y + data = { + "name": self.make_temp_copy_if_needed(y), + "data": None, + "is_file": True, + } + return data + + def as_example(self, input_data: str | None) -> str: + return Path(input_data).name if input_data else "" diff --git a/gradio/components/number.py b/gradio/components/number.py new file mode 100644 index 0000000000000000000000000000000000000000..1b2029a7042ca9566b288add69a3a8232b31387c --- /dev/null +++ b/gradio/components/number.py @@ -0,0 +1,238 @@ +"""gr.Number() component.""" + +from __future__ import annotations + +import math +from typing import Callable, Literal + +import numpy as np +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import NumberSerializable + +from gradio.components.base import FormComponent, IOComponent, _Keywords +from gradio.events import ( + Blurrable, + Changeable, + Inputable, + Submittable, +) +from gradio.exceptions import Error +from gradio.interpretation import NeighborInterpretable + +set_documentation_group("component") + + +@document() +class Number( + FormComponent, + Changeable, + Inputable, + Submittable, + Blurrable, + IOComponent, + NumberSerializable, + NeighborInterpretable, +): + """ + Creates a numeric field for user to enter numbers as input or display numeric output. + Preprocessing: passes field value as a {float} or {int} into the function, depending on `precision`. + Postprocessing: expects an {int} or {float} returned from the function and sets field value to it. + Examples-format: a {float} or {int} representing the number's value. + + Demos: tax_calculator, titanic_survival, blocks_simple_squares + """ + + def __init__( + self, + value: float | Callable | None = None, + *, + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + precision: int | None = None, + minimum: float | None = None, + maximum: float | None = None, + **kwargs, + ): + """ + Parameters: + value: default value. If callable, the function will be called whenever the app loads to set the initial value of the component. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will be editable; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + precision: Precision to round input/output to. If set to 0, will round to nearest integer and convert type to int. If None, no rounding happens. + minimum: Minimum value. Only applied when component is used as an input. If a user provides a smaller value, a gr.Error exception is raised by the backend. + maximum: Maximum value. Only applied when component is used as an input. If a user provides a larger value, a gr.Error exception is raised by the backend. + """ + self.precision = precision + self.minimum = minimum + self.maximum = maximum + + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + NeighborInterpretable.__init__(self) + + @staticmethod + def _round_to_precision(num: float | int, precision: int | None) -> float | int: + """ + Round to a given precision. + + If precision is None, no rounding happens. If 0, num is converted to int. + + Parameters: + num: Number to round. + precision: Precision to round to. + Returns: + rounded number + """ + if precision is None: + return float(num) + elif precision == 0: + return int(round(num, precision)) + else: + return round(num, precision) + + def get_config(self): + return { + "value": self.value, + "minimum": self.minimum, + "maximum": self.maximum, + "container": self.container, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: float | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + minimum: float | None = None, + maximum: float | None = None, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "minimum": minimum, + "maximum": maximum, + "interactive": interactive, + "__type__": "update", + } + + def preprocess(self, x: float | None) -> float | None: + """ + Parameters: + x: numeric input + Returns: + number representing function input + """ + if x is None: + return None + elif self.minimum is not None and x < self.minimum: + raise Error(f"Value {x} is less than minimum value {self.minimum}.") + elif self.maximum is not None and x > self.maximum: + raise Error(f"Value {x} is greater than maximum value {self.maximum}.") + return self._round_to_precision(x, self.precision) + + def postprocess(self, y: float | None) -> float | None: + """ + Any postprocessing needed to be performed on function output. + + Parameters: + y: numeric output + Returns: + number representing function output + """ + if y is None: + return None + return self._round_to_precision(y, self.precision) + + def set_interpret_parameters( + self, steps: int = 3, delta: float = 1, delta_type: str = "percent" + ): + """ + Calculates interpretation scores of numeric values close to the input number. + Parameters: + steps: Number of nearby values to measure in each direction (above and below the input number). + delta: Size of step in each direction between nearby values. + delta_type: "percent" if delta step between nearby values should be a calculated as a percent, or "absolute" if delta should be a constant step change. + """ + self.interpretation_steps = steps + self.interpretation_delta = delta + self.interpretation_delta_type = delta_type + return self + + def get_interpretation_neighbors(self, x: float | int) -> tuple[list[float], dict]: + x = self._round_to_precision(x, self.precision) + if self.interpretation_delta_type == "percent": + delta = 1.0 * self.interpretation_delta * x / 100 + elif self.interpretation_delta_type == "absolute": + delta = self.interpretation_delta + else: + delta = self.interpretation_delta + if self.precision == 0 and math.floor(delta) != delta: + raise ValueError( + f"Delta value {delta} is not an integer and precision=0. Cannot generate valid set of neighbors. " + "If delta_type='percent', pick a value of delta such that x * delta is an integer. " + "If delta_type='absolute', pick a value of delta that is an integer." + ) + # run_interpretation will preprocess the neighbors so no need to convert to int here + negatives = ( + np.array(x) + np.arange(-self.interpretation_steps, 0) * delta + ).tolist() + positives = ( + np.array(x) + np.arange(1, self.interpretation_steps + 1) * delta + ).tolist() + return negatives + positives, {} + + def get_interpretation_scores( + self, x: float, neighbors: list[float], scores: list[float | None], **kwargs + ) -> list[tuple[float, float | None]]: + """ + Returns: + Each tuple set represents a numeric value near the input and its corresponding interpretation score. + """ + interpretation = list(zip(neighbors, scores)) + interpretation.insert(int(len(interpretation) / 2), (x, None)) + return interpretation diff --git a/gradio/components/plot.py b/gradio/components/plot.py new file mode 100644 index 0000000000000000000000000000000000000000..54927b8b89885485ce1422daac54bbb99c46cd7b --- /dev/null +++ b/gradio/components/plot.py @@ -0,0 +1,159 @@ +"""gr.Plot() component.""" + +from __future__ import annotations + +import json +from types import ModuleType +from typing import Any, Callable, Literal + +import altair as alt +import pandas as pd +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import JSONSerializable + +from gradio import processing_utils +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import Changeable, Clearable + +set_documentation_group("component") + + +@document() +class Plot(Changeable, Clearable, IOComponent, JSONSerializable): + """ + Used to display various kinds of plots (matplotlib, plotly, or bokeh are supported) + Preprocessing: this component does *not* accept input. + Postprocessing: expects either a {matplotlib.figure.Figure}, a {plotly.graph_objects._figure.Figure}, or a {dict} corresponding to a bokeh plot (json_item format) + + Demos: altair_plot, outbreak_forecast, blocks_kinematics, stock_forecast, map_airbnb + Guides: plot-component-for-maps + """ + + def __init__( + self, + value: Callable | None | pd.DataFrame = None, + *, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: Optionally, supply a default plot object to display, must be a matplotlib, plotly, altair, or bokeh figure, or a callable. If callable, the function will be called whenever the app loads to set the initial value of the component. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + try: + import bokeh # type: ignore + + bokeh_version = bokeh.__version__ + except ImportError: + bokeh_version = None + return { + "value": self.value, + "bokeh_version": bokeh_version, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "__type__": "update", + } + return updated_config + + def postprocess(self, y) -> dict[str, str] | None: + """ + Parameters: + y: plot data + Returns: + plot type mapped to plot base64 data + """ + import matplotlib.figure + + if y is None: + return None + if isinstance(y, (ModuleType, matplotlib.figure.Figure)): # type: ignore + dtype = "matplotlib" + out_y = processing_utils.encode_plot_to_base64(y) + elif "bokeh" in y.__module__: + dtype = "bokeh" + from bokeh.embed import json_item # type: ignore + + out_y = json.dumps(json_item(y)) + else: + is_altair = "altair" in y.__module__ + dtype = "altair" if is_altair else "plotly" + out_y = y.to_json() + return {"type": dtype, "plot": out_y} + + def style(self, container: bool | None = None): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if container is not None: + self.container = container + return self + + +class AltairPlot: + @staticmethod + def create_legend(position, title): + if position == "none": + legend = None + else: + position = {"orient": position} if position else {} + legend = {"title": title, **position} + + return legend + + @staticmethod + def create_scale(limit): + return alt.Scale(domain=limit) if limit else alt.Undefined diff --git a/gradio/components/radio.py b/gradio/components/radio.py new file mode 100644 index 0000000000000000000000000000000000000000..a8846a84a621c298a41922c0457dd38dba7a3b21 --- /dev/null +++ b/gradio/components/radio.py @@ -0,0 +1,193 @@ +"""gr.Radio() component.""" + +from __future__ import annotations + +from typing import Any, Callable, Literal + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio.components.base import FormComponent, IOComponent, _Keywords +from gradio.deprecation import warn_deprecation, warn_style_method_deprecation +from gradio.events import Changeable, EventListenerMethod, Inputable, Selectable +from gradio.interpretation import NeighborInterpretable + +set_documentation_group("component") + + +@document() +class Radio( + FormComponent, + Selectable, + Changeable, + Inputable, + IOComponent, + StringSerializable, + NeighborInterpretable, +): + """ + Creates a set of radio buttons of which only one can be selected. + Preprocessing: passes the value of the selected radio button as a {str} or its index as an {int} into the function, depending on `type`. + Postprocessing: expects a {str} corresponding to the value of the radio button to be selected. + Examples-format: a {str} representing the radio option to select. + + Demos: sentence_builder, titanic_survival, blocks_essay + """ + + def __init__( + self, + choices: list[str] | None = None, + *, + value: str | Callable | None = None, + type: str = "value", + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + choices: list of options to select from. + value: the button selected by default. If None, no button is selected by default. If callable, the function will be called whenever the app loads to set the initial value of the component. + type: Type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, choices in this radio group will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.choices = choices or [] + valid_types = ["value", "index"] + if type not in valid_types: + raise ValueError( + f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}" + ) + self.type = type + self.select: EventListenerMethod + """ + Event listener for when the user selects Radio option. + Uses event data gradio.SelectData to carry `value` referring to label of selected option, and `index` to refer to index. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + NeighborInterpretable.__init__(self) + + def get_config(self): + return { + "choices": self.choices, + "value": self.value, + **IOComponent.get_config(self), + } + + def example_inputs(self) -> dict[str, Any]: + return { + "raw": self.choices[0] if self.choices else None, + "serialized": self.choices[0] if self.choices else None, + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + choices: list[str] | None = None, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "choices": choices, + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "__type__": "update", + } + + def preprocess(self, x: str | None) -> str | int | None: + """ + Parameters: + x: selected choice + Returns: + selected choice as string or index within choice list + """ + if self.type == "value": + return x + elif self.type == "index": + if x is None: + return None + else: + return self.choices.index(x) + else: + raise ValueError( + f"Unknown type: {self.type}. Please choose from: 'value', 'index'." + ) + + def get_interpretation_neighbors(self, x): + choices = list(self.choices) + choices.remove(x) + return choices, {} + + def get_interpretation_scores( + self, x, neighbors, scores: list[float | None], **kwargs + ) -> list: + """ + Returns: + Each value represents the interpretation score corresponding to each choice. + """ + scores.insert(self.choices.index(x), None) + return scores + + def style( + self, + *, + item_container: bool | None = None, + container: bool | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if item_container is not None: + warn_deprecation("The `item_container` parameter is deprecated.") + if container is not None: + self.container = container + return self diff --git a/gradio/components/scatter_plot.py b/gradio/components/scatter_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..38db509fdd4d6018ce562591a09c21d49f836691 --- /dev/null +++ b/gradio/components/scatter_plot.py @@ -0,0 +1,472 @@ +"""gr.ScatterPlot() component.""" + +from __future__ import annotations + +from typing import Callable, Literal + +import altair as alt +import pandas as pd +from gradio_client.documentation import document, set_documentation_group +from pandas.api.types import is_numeric_dtype + +from gradio.components.base import _Keywords +from gradio.components.plot import AltairPlot, Plot + +set_documentation_group("component") + + +@document() +class ScatterPlot(Plot): + """ + Create a scatter plot. + + Preprocessing: this component does *not* accept input. + Postprocessing: expects a pandas dataframe with the data to plot. + + Demos: scatter_plot + Guides: creating-a-dashboard-from-bigquery-data + """ + + def __init__( + self, + value: pd.DataFrame | Callable | None = None, + x: str | None = None, + y: str | None = None, + *, + color: str | None = None, + size: str | None = None, + shape: str | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + size_legend_title: str | None = None, + shape_legend_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + size_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + shape_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + x_lim: list[int | float] | None = None, + y_lim: list[int | float] | None = None, + caption: str | None = None, + interactive: bool | None = True, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + ): + """ + Parameters: + value: The pandas dataframe containing the data to display in a scatter plot, or a callable. If callable, the function will be called whenever the app loads to set the initial value of the component. + x: Column corresponding to the x axis. + y: Column corresponding to the y axis. + color: The column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values. + size: The column used to determine the point size. Should contain numeric data so that gradio can map the data to the point size. + shape: The column used to determine the point shape. Should contain categorical data. Gradio will map each unique value to a different shape. + title: The title to display on top of the chart. + tooltip: The column (or list of columns) to display on the tooltip when a user hovers a point on the plot. + x_title: The title given to the x axis. By default, uses the value of the x parameter. + y_title: The title given to the y axis. By default, uses the value of the y parameter. + color_legend_title: The title given to the color legend. By default, uses the value of color parameter. + size_legend_title: The title given to the size legend. By default, uses the value of the size parameter. + shape_legend_title: The title given to the shape legend. By default, uses the value of the shape parameter. + color_legend_position: The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + size_legend_position: The position of the size legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + shape_legend_position: The position of the shape legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + height: The height of the plot in pixels. + width: The width of the plot in pixels. + x_lim: A tuple or list containing the limits for the x-axis, specified as [x_min, x_max]. + y_lim: A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]. + caption: The (optional) caption to display below the plot. + interactive: Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad. + label: The (optional) label to display on the top left corner of the plot. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: Whether the label should be displayed. + visible: Whether the plot should be visible. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.x = x + self.y = y + self.color = color + self.size = size + self.shape = shape + self.tooltip = tooltip + self.title = title + self.x_title = x_title + self.y_title = y_title + self.color_legend_title = color_legend_title + self.color_legend_position = color_legend_position + self.size_legend_title = size_legend_title + self.size_legend_position = size_legend_position + self.shape_legend_title = shape_legend_title + self.shape_legend_position = shape_legend_position + self.caption = caption + self.interactive_chart = interactive + self.width = width + self.height = height + self.x_lim = x_lim + self.y_lim = y_lim + super().__init__( + value=value, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + ) + + def get_config(self): + config = super().get_config() + config["caption"] = self.caption + return config + + def get_block_name(self) -> str: + return "plot" + + @staticmethod + def update( + value: pd.DataFrame | dict | Literal[_Keywords.NO_VALUE] = _Keywords.NO_VALUE, + x: str | None = None, + y: str | None = None, + color: str | None = None, + size: str | None = None, + shape: str | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + size_legend_title: str | None = None, + shape_legend_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + size_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + shape_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + x_lim: list[int | float] | None = None, + y_lim: list[int | float] | None = None, + interactive: bool | None = None, + caption: str | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + ): + """Update an existing plot component. + + If updating any of the plot properties (color, size, etc) the value, x, and y parameters must be specified. + + Parameters: + value: The pandas dataframe containing the data to display in a scatter plot. + x: Column corresponding to the x axis. + y: Column corresponding to the y axis. + color: The column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values. + size: The column used to determine the point size. Should contain numeric data so that gradio can map the data to the point size. + shape: The column used to determine the point shape. Should contain categorical data. Gradio will map each unique value to a different shape. + title: The title to display on top of the chart. + tooltip: The column (or list of columns) to display on the tooltip when a user hovers a point on the plot. + x_title: The title given to the x axis. By default, uses the value of the x parameter. + y_title: The title given to the y axis. By default, uses the value of the y parameter. + color_legend_title: The title given to the color legend. By default, uses the value of color parameter. + size_legend_title: The title given to the size legend. By default, uses the value of the size parameter. + shape_legend_title: The title given to the shape legend. By default, uses the value of the shape parameter. + color_legend_position: The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + size_legend_position: The position of the size legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + shape_legend_position: The position of the shape legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation. + height: The height of the plot in pixels. + width: The width of the plot in pixels. + x_lim: A tuple or list containing the limits for the x-axis, specified as [x_min, x_max]. + y_lim: A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]. + interactive: Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad. + caption: The (optional) caption to display below the plot. + label: The (optional) label to display in the top left corner of the plot. + show_label: Whether the label should be displayed. + visible: Whether the plot should be visible. + """ + properties = [ + x, + y, + color, + size, + shape, + title, + tooltip, + x_title, + y_title, + color_legend_title, + size_legend_title, + shape_legend_title, + color_legend_position, + size_legend_position, + shape_legend_position, + height, + width, + x_lim, + y_lim, + interactive, + ] + if any(properties): + if not isinstance(value, pd.DataFrame): + raise ValueError( + "In order to update plot properties the value parameter " + "must be provided, and it must be a Dataframe. Please pass a value " + "parameter to gr.ScatterPlot.update." + ) + if x is None or y is None: + raise ValueError( + "In order to update plot properties, the x and y axis data " + "must be specified. Please pass valid values for x an y to " + "gr.ScatterPlot.update." + ) + chart = ScatterPlot.create_plot(value, *properties) + value = {"type": "altair", "plot": chart.to_json(), "chart": "scatter"} + + updated_config = { + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "caption": caption, + "__type__": "update", + } + return updated_config + + @staticmethod + def create_plot( + value: pd.DataFrame, + x: str, + y: str, + color: str | None = None, + size: str | None = None, + shape: str | None = None, + title: str | None = None, + tooltip: list[str] | str | None = None, + x_title: str | None = None, + y_title: str | None = None, + color_legend_title: str | None = None, + size_legend_title: str | None = None, + shape_legend_title: str | None = None, + color_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + size_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + shape_legend_position: Literal[ + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + "none", + ] + | None = None, + height: int | None = None, + width: int | None = None, + x_lim: list[int | float] | None = None, + y_lim: list[int | float] | None = None, + interactive: bool | None = True, + ): + """Helper for creating the scatter plot.""" + interactive = True if interactive is None else interactive + encodings = { + "x": alt.X( + x, # type: ignore + title=x_title or x, # type: ignore + scale=AltairPlot.create_scale(x_lim), # type: ignore + ), # ignore: type + "y": alt.Y( + y, # type: ignore + title=y_title or y, # type: ignore + scale=AltairPlot.create_scale(y_lim), # type: ignore + ), + } + properties = {} + if title: + properties["title"] = title + if height: + properties["height"] = height + if width: + properties["width"] = width + if color: + if is_numeric_dtype(value[color]): + domain = [value[color].min(), value[color].max()] + range_ = [0, 1] + type_ = "quantitative" + else: + domain = value[color].unique().tolist() + range_ = list(range(len(domain))) + type_ = "nominal" + + encodings["color"] = { + "field": color, + "type": type_, + "legend": AltairPlot.create_legend( + position=color_legend_position, title=color_legend_title or color + ), + "scale": {"domain": domain, "range": range_}, + } + if tooltip: + encodings["tooltip"] = tooltip + if size: + encodings["size"] = { + "field": size, + "type": "quantitative" if is_numeric_dtype(value[size]) else "nominal", + "legend": AltairPlot.create_legend( + position=size_legend_position, title=size_legend_title or size + ), + } + if shape: + encodings["shape"] = { + "field": shape, + "type": "quantitative" if is_numeric_dtype(value[shape]) else "nominal", + "legend": AltairPlot.create_legend( + position=shape_legend_position, title=shape_legend_title or shape + ), + } + chart = ( + alt.Chart(value) # type: ignore + .mark_point(clip=True) # type: ignore + .encode(**encodings) + .properties(background="transparent", **properties) + ) + if interactive: + chart = chart.interactive() + + return chart + + def postprocess(self, y: pd.DataFrame | dict | None) -> dict[str, str] | None: + # if None or update + if y is None or isinstance(y, dict): + return y + if self.x is None or self.y is None: + raise ValueError("No value provided for required parameters `x` and `y`.") + chart = self.create_plot( + value=y, + x=self.x, + y=self.y, + color=self.color, + size=self.size, + shape=self.shape, + title=self.title, + tooltip=self.tooltip, + x_title=self.x_title, + y_title=self.y_title, + color_legend_title=self.color_legend_title, + size_legend_title=self.size_legend_title, + shape_legend_title=self.size_legend_title, + color_legend_position=self.color_legend_position, # type: ignore + size_legend_position=self.size_legend_position, # type: ignore + shape_legend_position=self.shape_legend_position, # type: ignore + interactive=self.interactive_chart, + height=self.height, + width=self.width, + x_lim=self.x_lim, + y_lim=self.y_lim, + ) + + return {"type": "altair", "plot": chart.to_json(), "chart": "scatter"} diff --git a/gradio/components/slider.py b/gradio/components/slider.py new file mode 100644 index 0000000000000000000000000000000000000000..c589eb675d09dc0521c100488799aa96af8b06ca --- /dev/null +++ b/gradio/components/slider.py @@ -0,0 +1,210 @@ +"""gr.Slider() component.""" + +from __future__ import annotations + +import math +import random +from typing import Any, Callable, Literal + +import numpy as np +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import NumberSerializable + +from gradio.components.base import FormComponent, IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import Changeable, Inputable, Releaseable +from gradio.interpretation import NeighborInterpretable + +set_documentation_group("component") + + +@document() +class Slider( + FormComponent, + Changeable, + Inputable, + Releaseable, + IOComponent, + NumberSerializable, + NeighborInterpretable, +): + """ + Creates a slider that ranges from `minimum` to `maximum` with a step size of `step`. + Preprocessing: passes slider value as a {float} into the function. + Postprocessing: expects an {int} or {float} returned from function and sets slider value to it as long as it is within range. + Examples-format: A {float} or {int} representing the slider's value. + + Demos: sentence_builder, slider_release, generate_tone, titanic_survival, interface_random_slider, blocks_random_slider + Guides: create-your-own-friends-with-a-gan + """ + + def __init__( + self, + minimum: float = 0, + maximum: float = 100, + value: float | Callable | None = None, + *, + step: float | None = None, + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + randomize: bool = False, + **kwargs, + ): + """ + Parameters: + minimum: minimum value for slider. + maximum: maximum value for slider. + value: default value. If callable, the function will be called whenever the app loads to set the initial value of the component. Ignored if randomized=True. + step: increment between slider values. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, slider will be adjustable; if False, adjusting will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + randomize: If True, the value of the slider when the app loads is taken uniformly at random from the range given by the minimum and maximum. + """ + self.minimum = minimum + self.maximum = maximum + if step is None: + difference = maximum - minimum + power = math.floor(math.log10(difference) - 2) + self.step = 10**power + else: + self.step = step + if randomize: + value = self.get_random_value + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + NeighborInterpretable.__init__(self) + + def api_info(self) -> dict[str, dict | bool]: + return { + "info": { + "type": "number", + "description": f"numeric value between {self.minimum} and {self.maximum}", + }, + "serialized_info": False, + } + + def example_inputs(self) -> dict[str, Any]: + return { + "raw": self.minimum, + "serialized": self.minimum, + } + + def get_config(self): + return { + "minimum": self.minimum, + "maximum": self.maximum, + "step": self.step, + "value": self.value, + **IOComponent.get_config(self), + } + + def get_random_value(self): + n_steps = int((self.maximum - self.minimum) / self.step) + step = random.randint(0, n_steps) + value = self.minimum + step * self.step + # Round to number of decimals in step so that UI doesn't display long decimals + n_decimals = max(str(self.step)[::-1].find("."), 0) + if n_decimals: + value = round(value, n_decimals) + return value + + @staticmethod + def update( + value: float | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + minimum: float | None = None, + maximum: float | None = None, + step: float | None = None, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "minimum": minimum, + "maximum": maximum, + "step": step, + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "__type__": "update", + } + + def postprocess(self, y: float | None) -> float | None: + """ + Any postprocessing needed to be performed on function output. + Parameters: + y: numeric output + Returns: + numeric output or minimum number if None + """ + return self.minimum if y is None else y + + def set_interpret_parameters(self, steps: int = 8) -> Slider: + """ + Calculates interpretation scores of numeric values ranging between the minimum and maximum values of the slider. + Parameters: + steps: Number of neighboring values to measure between the minimum and maximum values of the slider range. + """ + self.interpretation_steps = steps + return self + + def get_interpretation_neighbors(self, x) -> tuple[object, dict]: + return ( + np.linspace(self.minimum, self.maximum, self.interpretation_steps).tolist(), + {}, + ) + + def style( + self, + *, + container: bool | None = None, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if container is not None: + self.container = container + return self diff --git a/gradio/components/state.py b/gradio/components/state.py new file mode 100644 index 0000000000000000000000000000000000000000..9722fa31e5240b8975af313d58bbcd83bb235fcd --- /dev/null +++ b/gradio/components/state.py @@ -0,0 +1,50 @@ +"""gr.State() component.""" + +from __future__ import annotations + +from copy import deepcopy +from typing import Any + +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import SimpleSerializable + +from gradio.components.base import IOComponent + +set_documentation_group("component") + + +@document() +class State(IOComponent, SimpleSerializable): + """ + Special hidden component that stores session state across runs of the demo by the + same user. The value of the State variable is cleared when the user refreshes the page. + + Preprocessing: No preprocessing is performed + Postprocessing: No postprocessing is performed + Demos: blocks_simple_squares + Guides: real-time-speech-recognition + """ + + allow_string_shortcut = False + + def __init__( + self, + value: Any = None, + **kwargs, + ): + """ + Parameters: + value: the initial value (of arbitrary type) of the state. The provided argument is deepcopied. If a callable is provided, the function will be called whenever the app loads to set the initial value of the state. + """ + self.stateful = True + IOComponent.__init__(self, value=deepcopy(value), **kwargs) + + +class Variable(State): + """Variable was renamed to State. This class is kept for backwards compatibility.""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def get_block_name(self): + return "state" diff --git a/gradio/components/status_tracker.py b/gradio/components/status_tracker.py new file mode 100644 index 0000000000000000000000000000000000000000..a9abec2969d93846fc81d3572942bef6afc8f3f9 --- /dev/null +++ b/gradio/components/status_tracker.py @@ -0,0 +1,13 @@ +"""gr.StatusTracker() component.""" +from gradio_client.serializing import SimpleSerializable + +from gradio.components.base import Component +from gradio.deprecation import warn_deprecation + + +class StatusTracker(Component, SimpleSerializable): + def __init__( + self, + **kwargs, + ): + warn_deprecation("The StatusTracker component is deprecated.") diff --git a/gradio/components/textbox.py b/gradio/components/textbox.py new file mode 100644 index 0000000000000000000000000000000000000000..156a6d35611e6ca92657ad62841bb3a8bad7b0ff --- /dev/null +++ b/gradio/components/textbox.py @@ -0,0 +1,284 @@ +"""gr.Textbox() component.""" + +from __future__ import annotations + +from typing import Callable, Literal + +import numpy as np +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import StringSerializable + +from gradio.components.base import ( + FormComponent, + IOComponent, + _Keywords, +) +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import ( + Blurrable, + Changeable, + EventListenerMethod, + Inputable, + Selectable, + Submittable, +) +from gradio.interpretation import TokenInterpretable + +set_documentation_group("component") + + +@document() +class Textbox( + FormComponent, + Changeable, + Inputable, + Selectable, + Submittable, + Blurrable, + IOComponent, + StringSerializable, + TokenInterpretable, +): + """ + Creates a textarea for user to enter string input or display string output. + Preprocessing: passes textarea value as a {str} into the function. + Postprocessing: expects a {str} returned from function and sets textarea value to it. + Examples-format: a {str} representing the textbox input. + + Demos: hello_world, diff_texts, sentence_builder + Guides: creating-a-chatbot, real-time-speech-recognition + """ + + def __init__( + self, + value: str | Callable | None = "", + *, + lines: int = 1, + max_lines: int = 20, + placeholder: str | None = None, + label: str | None = None, + info: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + autofocus: bool = False, + elem_classes: list[str] | str | None = None, + type: Literal["text", "password", "email"] = "text", + text_align: Literal["left", "right"] | None = None, + rtl: bool = False, + show_copy_button: bool = False, + **kwargs, + ): + """ + Parameters: + value: default text to provide in textarea. If callable, the function will be called whenever the app loads to set the initial value of the component. + lines: minimum number of line rows to provide in textarea. + max_lines: maximum number of line rows to provide in textarea. + placeholder: placeholder hint to provide behind textarea. + label: component name in interface. + info: additional component description. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + autofocus: If True, will focus on the textbox when the page loads. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + type: The type of textbox. One of: 'text', 'password', 'email', Default is 'text'. + text_align: How to align the text in the textbox, can be: "left", "right", or None (default). If None, the alignment is left if `rtl` is False, or right if `rtl` is True. Can only be changed if `type` is "text". + rtl: If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right. + show_copy_button: If True, includes a copy button to copy the text in the textbox. Only applies if show_label is True. + """ + if type not in ["text", "password", "email"]: + raise ValueError('`type` must be one of "text", "password", or "email".') + + self.lines = lines + if type == "text": + self.max_lines = max(lines, max_lines) + else: + self.max_lines = 1 + self.placeholder = placeholder + self.show_copy_button = show_copy_button + self.autofocus = autofocus + self.select: EventListenerMethod + """ + Event listener for when the user selects text in the Textbox. + Uses event data gradio.SelectData to carry `value` referring to selected substring, and `index` tuple referring to selected range endpoints. + See EventData documentation on how to use this event data. + """ + IOComponent.__init__( + self, + label=label, + info=info, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + TokenInterpretable.__init__(self) + self.type = type + self.rtl = rtl + self.text_align = text_align + + def get_config(self): + return { + "lines": self.lines, + "max_lines": self.max_lines, + "placeholder": self.placeholder, + "value": self.value, + "type": self.type, + "autofocus": self.autofocus, + "show_copy_button": self.show_copy_button, + "container": self.container, + "text_align": self.text_align, + "rtl": self.rtl, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: str | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + lines: int | None = None, + max_lines: int | None = None, + placeholder: str | None = None, + label: str | None = None, + info: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + visible: bool | None = None, + interactive: bool | None = None, + type: Literal["text", "password", "email"] | None = None, + text_align: Literal["left", "right"] | None = None, + rtl: bool | None = None, + show_copy_button: bool | None = None, + autofocus: bool | None = None, + ): + return { + "lines": lines, + "max_lines": max_lines, + "placeholder": placeholder, + "label": label, + "info": info, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "visible": visible, + "value": value, + "type": type, + "interactive": interactive, + "show_copy_button": show_copy_button, + "autofocus": autofocus, + "text_align": text_align, + "rtl": rtl, + "__type__": "update", + } + + def preprocess(self, x: str | None) -> str | None: + """ + Preprocesses input (converts it to a string) before passing it to the function. + Parameters: + x: text + Returns: + text + """ + return None if x is None else str(x) + + def postprocess(self, y: str | None) -> str | None: + """ + Postproccess the function output y by converting it to a str before passing it to the frontend. + Parameters: + y: function output to postprocess. + Returns: + text + """ + return None if y is None else str(y) + + def set_interpret_parameters( + self, separator: str = " ", replacement: str | None = None + ): + """ + Calculates interpretation score of characters in input by splitting input into tokens, then using a "leave one out" method to calculate the score of each token by removing each token and measuring the delta of the output value. + Parameters: + separator: Separator to use to split input into tokens. + replacement: In the "leave one out" step, the text that the token should be replaced with. If None, the token is removed altogether. + """ + self.interpretation_separator = separator + self.interpretation_replacement = replacement + return self + + def tokenize(self, x: str) -> tuple[list[str], list[str], None]: + """ + Tokenizes an input string by dividing into "words" delimited by self.interpretation_separator + """ + tokens = x.split(self.interpretation_separator) + leave_one_out_strings = [] + for index in range(len(tokens)): + leave_one_out_set = list(tokens) + if self.interpretation_replacement is None: + leave_one_out_set.pop(index) + else: + leave_one_out_set[index] = self.interpretation_replacement + leave_one_out_strings.append( + self.interpretation_separator.join(leave_one_out_set) + ) + return tokens, leave_one_out_strings, None + + def get_masked_inputs( + self, tokens: list[str], binary_mask_matrix: list[list[int]] + ) -> list[str]: + """ + Constructs partially-masked sentences for SHAP interpretation + """ + masked_inputs = [] + for binary_mask_vector in binary_mask_matrix: + masked_input = np.array(tokens)[np.array(binary_mask_vector, dtype=bool)] + masked_inputs.append(self.interpretation_separator.join(masked_input)) + return masked_inputs + + def get_interpretation_scores( + self, x, neighbors, scores: list[float], tokens: list[str], masks=None, **kwargs + ) -> list[tuple[str, float]]: + """ + Returns: + Each tuple set represents a set of characters and their corresponding interpretation score. + """ + result = [] + for token, score in zip(tokens, scores): + result.append((token, score)) + result.append((self.interpretation_separator, 0)) + return result + + def style( + self, + *, + show_copy_button: bool | None = None, + container: bool | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if show_copy_button is not None: + self.show_copy_button = show_copy_button + if container is not None: + self.container = container + return self diff --git a/gradio/components/timeseries.py b/gradio/components/timeseries.py new file mode 100644 index 0000000000000000000000000000000000000000..92d9086108bda61fa37fe1c65c546242f7937ee9 --- /dev/null +++ b/gradio/components/timeseries.py @@ -0,0 +1,157 @@ +"""gr.Timeseries() component.""" + +from __future__ import annotations + +from pathlib import Path +from typing import Any, Callable, Literal + +import pandas as pd +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import JSONSerializable + +from gradio.components.base import IOComponent, _Keywords +from gradio.events import Changeable + +set_documentation_group("component") + + +@document() +class Timeseries(Changeable, IOComponent, JSONSerializable): + """ + Creates a component that can be used to upload/preview timeseries csv files or display a dataframe consisting of a time series graphically. + Preprocessing: passes the uploaded timeseries data as a {pandas.DataFrame} into the function + Postprocessing: expects a {pandas.DataFrame} or {str} path to a csv to be returned, which is then displayed as a timeseries graph + Examples-format: a {str} filepath of csv data with time series data. + Demos: fraud_detector + """ + + def __init__( + self, + value: str | Callable | None = None, + *, + x: str | None = None, + y: str | list[str] | None = None, + colors: list[str] | None = None, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + **kwargs, + ): + """ + Parameters: + value: File path for the timeseries csv file. If callable, the function will be called whenever the app loads to set the initial value of the component. + x: Column name of x (time) series. None if csv has no headers, in which case first column is x series. + y: Column name of y series, or list of column names if multiple series. None if csv has no headers, in which case every column after first is a y series. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + colors: an ordered list of colors to use for each line plot + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will allow users to upload a timeseries csv; if False, can only be used to display timeseries data. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.x = x + if isinstance(y, str): + y = [y] + self.y = y + self.colors = colors + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "x": self.x, + "y": self.y, + "value": self.value, + "colors": self.colors, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: Any | Literal[_Keywords.NO_VALUE] | None = _Keywords.NO_VALUE, + colors: list[str] | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + ): + return { + "colors": colors, + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "__type__": "update", + } + + def preprocess(self, x: dict | None) -> pd.DataFrame | None: + """ + Parameters: + x: Dict with keys 'data': 2D array of str, numeric, or bool data, 'headers': list of strings for header names, 'range': optional two element list designating start of end of subrange. + Returns: + Dataframe of timeseries data + """ + if x is None: + return x + elif x.get("is_file"): + dataframe = pd.read_csv(x["name"]) + else: + dataframe = pd.DataFrame(data=x["data"], columns=x["headers"]) + if x.get("range") is not None: + dataframe = dataframe.loc[dataframe[self.x or 0] >= x["range"][0]] + dataframe = dataframe.loc[dataframe[self.x or 0] <= x["range"][1]] + return dataframe + + def postprocess(self, y: str | pd.DataFrame | None) -> dict | None: + """ + Parameters: + y: csv or dataframe with timeseries data + Returns: + JSON object with key 'headers' for list of header names, 'data' for 2D array of string or numeric data + """ + if y is None: + return None + if isinstance(y, str): + dataframe = pd.read_csv(y) + return { + "headers": dataframe.columns.values.tolist(), + "data": dataframe.values.tolist(), + } + if isinstance(y, pd.DataFrame): + return {"headers": y.columns.values.tolist(), "data": y.values.tolist()} + raise ValueError("Cannot process value as Timeseries data") + + def as_example(self, input_data: str | None) -> str: + return Path(input_data).name if input_data else "" diff --git a/gradio/components/upload_button.py b/gradio/components/upload_button.py new file mode 100644 index 0000000000000000000000000000000000000000..fb75d5a3723fa5247ae864114a355b60c9fb870d --- /dev/null +++ b/gradio/components/upload_button.py @@ -0,0 +1,211 @@ +"""gr.UploadButton() component.""" + +from __future__ import annotations + +import tempfile +import warnings +from typing import Any, Callable, Literal + +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import FileSerializable + +from gradio import utils +from gradio.components.base import Component, IOComponent, _Keywords +from gradio.deprecation import warn_deprecation, warn_style_method_deprecation +from gradio.events import Clickable, Uploadable + +set_documentation_group("component") + + +@document() +class UploadButton(Clickable, Uploadable, IOComponent, FileSerializable): + """ + Used to create an upload button, when cicked allows a user to upload files that satisfy the specified file type or generic files (if file_type not set). + Preprocessing: passes the uploaded file as a {file-object} or {List[file-object]} depending on `file_count` (or a {bytes}/{List{bytes}} depending on `type`) + Postprocessing: expects function to return a {str} path to a file, or {List[str]} consisting of paths to files. + Examples-format: a {str} path to a local file that populates the component. + Demos: upload_button + """ + + def __init__( + self, + label: str = "Upload a File", + value: str | list[str] | Callable | None = None, + *, + variant: Literal["primary", "secondary", "stop"] = "secondary", + visible: bool = True, + size: Literal["sm", "lg"] | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + type: Literal["file", "bytes"] = "file", + file_count: Literal["single", "multiple", "directory"] = "single", + file_types: list[str] | None = None, + **kwargs, + ): + """ + Parameters: + label: Text to display on the button. Defaults to "Upload a File". + value: File or list of files to upload by default. + variant: 'primary' for main call-to-action, 'secondary' for a more subdued style, 'stop' for a stop button. + visible: If False, component will be hidden. + size: Size of the button. Can be "sm" or "lg". + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: If False, the UploadButton will be in a disabled state. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + type: Type of value to be returned by component. "file" returns a temporary file object with the same base name as the uploaded file, whose full path can be retrieved by file_obj.name, "binary" returns an bytes object. + file_count: if single, allows user to upload one file. If "multiple", user uploads multiple files. If "directory", user uploads all files in selected directory. Return type will be list for each file in case of "multiple" or "directory". + file_types: List of type of files to be uploaded. "file" allows any file to be uploaded, "image" allows only image files to be uploaded, "audio" allows only audio files to be uploaded, "video" allows only video files to be uploaded, "text" allows only text files to be uploaded. + """ + self.type = type + self.file_count = file_count + if file_count == "directory" and file_types is not None: + warnings.warn( + "The `file_types` parameter is ignored when `file_count` is 'directory'." + ) + if file_types is not None and not isinstance(file_types, list): + raise ValueError( + f"Parameter file_types must be a list. Received {file_types.__class__.__name__}" + ) + self.size = size + self.file_types = file_types + self.label = label + self.variant = variant + IOComponent.__init__( + self, + label=label, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + scale=scale, + min_width=min_width, + interactive=interactive, + **kwargs, + ) + + def get_config(self): + return { + "label": self.label, + "value": self.value, + "size": self.size, + "file_count": self.file_count, + "file_types": self.file_types, + "scale": self.scale, + "min_width": self.min_width, + "variant": self.variant, + "interactive": self.interactive, + **Component.get_config(self), + } + + @staticmethod + def update( + value: str + | list[str] + | Literal[_Keywords.NO_VALUE] + | None = _Keywords.NO_VALUE, + size: Literal["sm", "lg"] | None = None, + variant: Literal["primary", "secondary", "stop"] | None = None, + interactive: bool | None = None, + visible: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + ): + return { + "variant": variant, + "interactive": interactive, + "size": size, + "visible": visible, + "value": value, + "scale": scale, + "min_width": min_width, + "__type__": "update", + } + + def preprocess( + self, x: list[dict[str, Any]] | None + ) -> ( + bytes + | tempfile._TemporaryFileWrapper + | list[bytes | tempfile._TemporaryFileWrapper] + | None + ): + """ + Parameters: + x: List of JSON objects with filename as 'name' property and base64 data as 'data' property + Returns: + File objects in requested format + """ + if x is None: + return None + + def process_single_file(f) -> bytes | tempfile._TemporaryFileWrapper: + file_name, data, is_file = ( + f["name"], + f["data"], + f.get("is_file", False), + ) + if self.type == "file": + if is_file: + path = self.make_temp_copy_if_needed(file_name) + else: + data, _ = client_utils.decode_base64_to_binary(data) + path = self.file_bytes_to_file( + data, dir=self.DEFAULT_TEMP_DIR, file_name=file_name + ) + path = str(utils.abspath(path)) + self.temp_files.add(path) + file = tempfile.NamedTemporaryFile( + delete=False, dir=self.DEFAULT_TEMP_DIR + ) + file.name = path + file.orig_name = file_name # type: ignore + return file + elif self.type == "bytes": + if is_file: + with open(file_name, "rb") as file_data: + return file_data.read() + return client_utils.decode_base64_to_binary(data)[0] + else: + raise ValueError( + "Unknown type: " + + str(self.type) + + ". Please choose from: 'file', 'bytes'." + ) + + if self.file_count == "single": + if isinstance(x, list): + return process_single_file(x[0]) + else: + return process_single_file(x) + else: + if isinstance(x, list): + return [process_single_file(f) for f in x] + else: + return process_single_file(x) + + def style( + self, + *, + full_width: bool | None = None, + size: Literal["sm", "lg"] | None = None, + **kwargs, + ): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if full_width is not None: + warn_deprecation( + "Use `scale` in place of full_width in the constructor. " + "scale=1 will make the button expand, whereas 0 will not." + ) + self.scale = 1 if full_width else None + if size is not None: + self.size = size + return self diff --git a/gradio/components/video.py b/gradio/components/video.py new file mode 100644 index 0000000000000000000000000000000000000000..80c216f8a4d0aae2e79c776296adde66e379f864 --- /dev/null +++ b/gradio/components/video.py @@ -0,0 +1,418 @@ +"""gr.Video() component.""" + +from __future__ import annotations + +import tempfile +import warnings +from pathlib import Path +from typing import Callable, Literal + +from gradio_client import utils as client_utils +from gradio_client.data_classes import FileData +from gradio_client.documentation import document, set_documentation_group +from gradio_client.serializing import VideoSerializable + +from gradio import processing_utils, utils, wasm_utils +from gradio.components.base import IOComponent, _Keywords +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import Changeable, Clearable, Playable, Recordable, Uploadable + +if not wasm_utils.IS_WASM: + # TODO: Support ffmpeg on Wasm + from ffmpy import FFmpeg + +set_documentation_group("component") + + +@document() +class Video( + Changeable, + Clearable, + Playable, + Recordable, + Uploadable, + IOComponent, + VideoSerializable, +): + """ + Creates a video component that can be used to upload/record videos (as an input) or display videos (as an output). + For the video to be playable in the browser it must have a compatible container and codec combination. Allowed + combinations are .mp4 with h264 codec, .ogg with theora codec, and .webm with vp9 codec. If the component detects + that the output video would not be playable in the browser it will attempt to convert it to a playable mp4 video. + If the conversion fails, the original video is returned. + Preprocessing: passes the uploaded video as a {str} filepath or URL whose extension can be modified by `format`. + Postprocessing: expects a {str} or {pathlib.Path} filepath to a video which is displayed, or a {Tuple[str | pathlib.Path, str | pathlib.Path | None]} where the first element is a filepath to a video and the second element is an optional filepath to a subtitle file. + Examples-format: a {str} filepath to a local file that contains the video, or a {Tuple[str, str]} where the first element is a filepath to a video file and the second element is a filepath to a subtitle file. + Demos: video_identity, video_subtitle + """ + + def __init__( + self, + value: str + | Path + | tuple[str | Path, str | Path | None] + | Callable + | None = None, + *, + format: str | None = None, + source: Literal["upload", "webcam"] = "upload", + height: int | None = None, + width: int | None = None, + label: str | None = None, + every: float | None = None, + show_label: bool | None = None, + container: bool = True, + scale: int | None = None, + min_width: int = 160, + interactive: bool | None = None, + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + mirror_webcam: bool = True, + include_audio: bool | None = None, + autoplay: bool = False, + show_share_button: bool | None = None, + **kwargs, + ): + """ + Parameters: + value: A path or URL for the default value that Video component is going to take. Can also be a tuple consisting of (video filepath, subtitle filepath). If a subtitle file is provided, it should be of type .srt or .vtt. Or can be callable, in which case the function will be called whenever the app loads to set the initial value of the component. + format: Format of video format to be returned by component, such as 'avi' or 'mp4'. Use 'mp4' to ensure browser playability. If set to None, video will keep uploaded format. + source: Source of video. "upload" creates a box where user can drop an video file, "webcam" allows user to record a video from their webcam. + height: Height of the displayed video in pixels. + width: Width of the displayed video in pixels. + label: component name in interface. + every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute. + show_label: if True, will display label. + container: If True, will place the component in a container - providing some extra padding around the border. + scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer. + min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first. + interactive: if True, will allow users to upload a video; if False, can only be used to display videos. If not provided, this is inferred based on whether the component is used as an input or output. + visible: If False, component will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles. + mirror_webcam: If True webcam will be mirrored. Default is True. + include_audio: Whether the component should record/retain the audio track for a video. By default, audio is excluded for webcam videos and included for uploaded videos. + autoplay: Whether to automatically play the video when the component is used as an output. Note: browsers will not autoplay video files if the user has not interacted with the page yet. + show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise. + """ + self.format = format + self.autoplay = autoplay + valid_sources = ["upload", "webcam"] + if source not in valid_sources: + raise ValueError( + f"Invalid value for parameter `source`: {source}. Please choose from one of: {valid_sources}" + ) + self.source = source + self.height = height + self.width = width + self.mirror_webcam = mirror_webcam + self.include_audio = ( + include_audio if include_audio is not None else source == "upload" + ) + self.show_share_button = ( + (utils.get_space() is not None) + if show_share_button is None + else show_share_button + ) + IOComponent.__init__( + self, + label=label, + every=every, + show_label=show_label, + container=container, + scale=scale, + min_width=min_width, + interactive=interactive, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + value=value, + **kwargs, + ) + + def get_config(self): + return { + "source": self.source, + "value": self.value, + "height": self.height, + "width": self.width, + "mirror_webcam": self.mirror_webcam, + "include_audio": self.include_audio, + "autoplay": self.autoplay, + "show_share_button": self.show_share_button, + **IOComponent.get_config(self), + } + + @staticmethod + def update( + value: str + | tuple[str, str | None] + | Literal[_Keywords.NO_VALUE] + | None = _Keywords.NO_VALUE, + source: Literal["upload", "webcam"] | None = None, + height: int | None = None, + width: int | None = None, + label: str | None = None, + show_label: bool | None = None, + container: bool | None = None, + scale: int | None = None, + min_width: int | None = None, + interactive: bool | None = None, + visible: bool | None = None, + autoplay: bool | None = None, + show_share_button: bool | None = None, + ): + return { + "source": source, + "height": height, + "width": width, + "label": label, + "show_label": show_label, + "container": container, + "scale": scale, + "min_width": min_width, + "interactive": interactive, + "visible": visible, + "value": value, + "autoplay": autoplay, + "show_share_button": show_share_button, + "__type__": "update", + } + + def preprocess( + self, x: tuple[FileData, FileData | None] | FileData | None + ) -> str | None: + """ + Parameters: + x: A tuple of (video file data, subtitle file data) or just video file data. + Returns: + A string file path or URL to the preprocessed video. Subtitle file data is ignored. + """ + if x is None: + return None + elif isinstance(x, dict): + video = x + else: + video = x[0] + + file_name, file_data, is_file = ( + video.get("name"), + video["data"], + video.get("is_file", False), + ) + + if is_file: + assert file_name is not None, "Received file data without a file name." + if client_utils.is_http_url_like(file_name): + fn = self.download_temp_copy_if_needed + else: + fn = self.make_temp_copy_if_needed + file_name = Path(fn(file_name)) + else: + assert file_data is not None, "Received empty file data." + file_name = Path(self.base64_to_temp_file_if_needed(file_data, file_name)) + + uploaded_format = file_name.suffix.replace(".", "") + needs_formatting = self.format is not None and uploaded_format != self.format + flip = self.source == "webcam" and self.mirror_webcam + + if needs_formatting or flip: + format = f".{self.format if needs_formatting else uploaded_format}" + output_options = ["-vf", "hflip", "-c:a", "copy"] if flip else [] + output_options += ["-an"] if not self.include_audio else [] + flip_suffix = "_flip" if flip else "" + output_file_name = str( + file_name.with_name(f"{file_name.stem}{flip_suffix}{format}") + ) + if Path(output_file_name).exists(): + return output_file_name + if wasm_utils.IS_WASM: + raise wasm_utils.WasmUnsupportedError( + "Video formatting is not supported in the Wasm mode." + ) + ff = FFmpeg( + inputs={str(file_name): None}, + outputs={output_file_name: output_options}, + ) + ff.run() + return output_file_name + elif not self.include_audio: + output_file_name = str(file_name.with_name(f"muted_{file_name.name}")) + if wasm_utils.IS_WASM: + raise wasm_utils.WasmUnsupportedError( + "include_audio=False is not supported in the Wasm mode." + ) + ff = FFmpeg( + inputs={str(file_name): None}, + outputs={output_file_name: ["-an"]}, + ) + ff.run() + return output_file_name + else: + return str(file_name) + + def postprocess( + self, y: str | Path | tuple[str | Path, str | Path | None] | None + ) -> tuple[FileData | None, FileData | None] | None: + """ + Processes a video to ensure that it is in the correct format before returning it to the front end. + Parameters: + y: video data in either of the following formats: a tuple of (video filepath, optional subtitle filepath), or just a filepath or URL to an video file, or None. + Returns: + a tuple with the two dictionary, reresent to video and (optional) subtitle, which following formats: + - The first dictionary represents the video file and contains the following keys: + - 'name': a file path to a temporary copy of the processed video. + - 'data': None + - 'is_file': True + - The second dictionary represents the subtitle file and contains the following keys: + - 'name': None + - 'data': Base64 encode the processed subtitle data. + - 'is_file': False + - If subtitle is None, returns (video, None). + - If both video and subtitle are None, returns None. + """ + + if y is None or y == [None, None] or y == (None, None): + return None + if isinstance(y, (str, Path)): + processed_files = (self._format_video(y), None) + elif isinstance(y, (tuple, list)): + assert ( + len(y) == 2 + ), f"Expected lists of length 2 or tuples of length 2. Received: {y}" + assert isinstance(y[0], (str, Path)) and isinstance( + y[1], (str, Path) + ), f"If a tuple is provided, both elements must be strings or Path objects. Received: {y}" + video = y[0] + subtitle = y[1] + processed_files = ( + self._format_video(video), + self._format_subtitle(subtitle), + ) + else: + raise Exception(f"Cannot process type as video: {type(y)}") + + return processed_files + + def _format_video(self, video: str | Path | None) -> FileData | None: + """ + Processes a video to ensure that it is in the correct format. + Parameters: + video: video data in either of the following formats: a string filepath or URL to an video file, or None. + Returns: + a dictionary with the following keys: + + - 'name': a file path to a temporary copy of the processed video. + - 'data': None + - 'is_file': True + """ + if video is None: + return None + video = str(video) + returned_format = video.split(".")[-1].lower() + if self.format is None or returned_format == self.format: + conversion_needed = False + else: + conversion_needed = True + + is_url = client_utils.is_http_url_like(video) + + # For cases where the video is a URL and does not need to be converted to another format, we can just return the URL + if is_url and not (conversion_needed): + return {"name": video, "data": None, "is_file": True} + + # For cases where the video needs to be converted to another format + if is_url: + video = self.download_temp_copy_if_needed(video) + if ( + processing_utils.ffmpeg_installed() + and not processing_utils.video_is_playable(video) + ): + warnings.warn( + "Video does not have browser-compatible container or codec. Converting to mp4" + ) + video = processing_utils.convert_video_to_playable_mp4(video) + # Recalculate the format in case convert_video_to_playable_mp4 already made it the + # selected format + returned_format = video.split(".")[-1].lower() + if self.format is not None and returned_format != self.format: + if wasm_utils.IS_WASM: + raise wasm_utils.WasmUnsupportedError( + "Returning a video in a different format is not supported in the Wasm mode." + ) + output_file_name = video[0 : video.rindex(".") + 1] + self.format + ff = FFmpeg( + inputs={video: None}, + outputs={output_file_name: None}, + global_options="-y", + ) + ff.run() + video = output_file_name + + video = self.make_temp_copy_if_needed(video) + + return { + "name": video, + "data": None, + "is_file": True, + "orig_name": Path(video).name, + } + + def _format_subtitle(self, subtitle: str | Path | None) -> FileData | None: + """ + Convert subtitle format to VTT and process the video to ensure it meets the HTML5 requirements. + Parameters: + subtitle: subtitle path in either of the VTT and SRT format. + Returns: + a dictionary with the following keys: + - 'name': None + - 'data': base64-encoded subtitle data. + - 'is_file': False + """ + + def srt_to_vtt(srt_file_path, vtt_file_path): + """Convert an SRT subtitle file to a VTT subtitle file""" + with open(srt_file_path, encoding="utf-8") as srt_file, open( + vtt_file_path, "w", encoding="utf-8" + ) as vtt_file: + vtt_file.write("WEBVTT\n\n") + for subtitle_block in srt_file.read().strip().split("\n\n"): + subtitle_lines = subtitle_block.split("\n") + subtitle_timing = subtitle_lines[1].replace(",", ".") + subtitle_text = "\n".join(subtitle_lines[2:]) + vtt_file.write(f"{subtitle_timing} --> {subtitle_timing}\n") + vtt_file.write(f"{subtitle_text}\n\n") + + if subtitle is None: + return None + + valid_extensions = (".srt", ".vtt") + + if Path(subtitle).suffix not in valid_extensions: + raise ValueError( + f"Invalid value for parameter `subtitle`: {subtitle}. Please choose a file with one of these extensions: {valid_extensions}" + ) + + # HTML5 only support vtt format + if Path(subtitle).suffix == ".srt": + temp_file = tempfile.NamedTemporaryFile( + delete=False, suffix=".vtt", dir=self.DEFAULT_TEMP_DIR + ) + + srt_to_vtt(subtitle, temp_file.name) + subtitle = temp_file.name + + subtitle_data = client_utils.encode_url_or_file_to_base64(subtitle) + return {"name": None, "data": subtitle_data, "is_file": False} + + def style(self, *, height: int | None = None, width: int | None = None, **kwargs): + """ + This method is deprecated. Please set these arguments in the constructor instead. + """ + warn_style_method_deprecation() + if height is not None: + self.height = height + if width is not None: + self.width = width + return self diff --git a/gradio/context.py b/gradio/context.py new file mode 100644 index 0000000000000000000000000000000000000000..393e563a42af1557927a2eb8a51e6e231d48a29a --- /dev/null +++ b/gradio/context.py @@ -0,0 +1,20 @@ +# Defines the Context class, which is used to store the state of all Blocks that are being rendered. + +from __future__ import annotations + +import threading +from typing import TYPE_CHECKING + +if TYPE_CHECKING: # Only import for type checking (is False at runtime). + from gradio.blocks import BlockContext, Blocks + + +class Context: + root_block: Blocks | None = None # The current root block that holds all blocks. + block: BlockContext | None = None # The current block that children are added to. + id: int = 0 # Running id to uniquely refer to any block that gets defined + ip_address: str | None = None # The IP address of the user. + hf_token: str | None = None # The token provided when loading private HF repos + + +thread_data = threading.local() diff --git a/gradio/data_classes.py b/gradio/data_classes.py new file mode 100644 index 0000000000000000000000000000000000000000..5ebb0c2bded20f1ddbbc73ffc79fac18c7af92db --- /dev/null +++ b/gradio/data_classes.py @@ -0,0 +1,62 @@ +"""Pydantic data models and other dataclasses. This is the only file that uses Optional[] +typing syntax instead of | None syntax to work with pydantic""" +from enum import Enum, auto +from typing import Any, Dict, List, Optional, Union + +from pydantic import BaseModel +from typing_extensions import Literal + + +class PredictBody(BaseModel): + session_hash: Optional[str] = None + event_id: Optional[str] = None + data: List[Any] + event_data: Optional[Any] = None + fn_index: Optional[int] = None + batched: Optional[ + bool + ] = False # Whether the data is a batch of samples (i.e. called from the queue if batch=True) or a single sample (i.e. called from the UI) + request: Optional[ + Union[Dict, List[Dict]] + ] = None # dictionary of request headers, query parameters, url, etc. (used to to pass in request for queuing) + + +class ResetBody(BaseModel): + session_hash: str + fn_index: int + + +class InterfaceTypes(Enum): + STANDARD = auto() + INPUT_ONLY = auto() + OUTPUT_ONLY = auto() + UNIFIED = auto() + + +class Estimation(BaseModel): + msg: Optional[str] = "estimation" + rank: Optional[int] = None + queue_size: int + avg_event_process_time: Optional[float] = None + avg_event_concurrent_process_time: Optional[float] = None + rank_eta: Optional[float] = None + queue_eta: float + + +class ProgressUnit(BaseModel): + index: Optional[int] = None + length: Optional[int] = None + unit: Optional[str] = None + progress: Optional[float] = None + desc: Optional[str] = None + + +class Progress(BaseModel): + msg: str = "progress" + progress_data: List[ProgressUnit] = [] + + +class LogMessage(BaseModel): + msg: str = "log" + log: str + level: Literal["info", "warning"] diff --git a/gradio/deploy_space.py b/gradio/deploy_space.py new file mode 100644 index 0000000000000000000000000000000000000000..9014b4e24ea2987d05dcf6ad58a6f0ee437646de --- /dev/null +++ b/gradio/deploy_space.py @@ -0,0 +1,175 @@ +from __future__ import annotations + +import argparse +import os +import re + +import huggingface_hub + +import gradio as gr + +repo_directory = os.getcwd() +readme_file = os.path.join(repo_directory, "README.md") +github_action_template = os.path.join( + os.path.dirname(__file__), "deploy_space_action.yaml" +) + + +def add_configuration_to_readme( + title: str | None, + app_file: str | None, +) -> dict: + configuration = {} + + dir_name = os.path.basename(repo_directory) + if title is None: + title = input(f"Enter Spaces app title [{dir_name}]: ") or dir_name + formatted_title = format_title(title) + if formatted_title != title: + print(f"Formatted to {formatted_title}. ") + configuration["title"] = formatted_title + + if app_file is None: + for file in os.listdir(repo_directory): + file_path = os.path.join(repo_directory, file) + if not os.path.isfile(file_path) or not file.endswith(".py"): + continue + + with open(file_path, encoding="utf-8", errors="ignore") as f: + content = f.read() + if "import gradio" in content: + app_file = file + break + + app_file = ( + input(f"Enter Gradio app file {f'[{app_file}]' if app_file else ''}: ") + or app_file + ) + if not app_file or not os.path.exists(app_file): + raise FileNotFoundError("Failed to find Gradio app file.") + configuration["app_file"] = app_file + + configuration["sdk"] = "gradio" + configuration["sdk_version"] = gr.__version__ + huggingface_hub.metadata_save(readme_file, configuration) + + configuration["hardware"] = ( + input( + f"Enter Spaces hardware ({', '.join(hardware.value for hardware in huggingface_hub.SpaceHardware)}) [cpu-basic]: " + ) + or "cpu-basic" + ) + + secrets = {} + if input("Any Spaces secrets (y/n) [n]: ") == "y": + while True: + secret_name = input("Enter secret name (leave blank to end): ") + if not secret_name: + break + secret_value = input(f"Enter secret value for {secret_name}: ") + secrets[secret_name] = secret_value + configuration["secrets"] = secrets + + requirements_file = os.path.join(repo_directory, "requirements.txt") + if ( + not os.path.exists(requirements_file) + and input("Create requirements.txt file? (y/n) [n]: ").lower() == "y" + ): + while True: + requirement = input("Enter a dependency (leave blank to end): ") + if not requirement: + break + with open(requirements_file, "a") as f: + f.write(requirement + "\n") + + if ( + input( + "Create Github Action to automatically update Space on 'git push'? [n]: " + ).lower() + == "y" + ): + track_branch = input("Enter branch to track [main]: ") or "main" + github_action_file = os.path.join( + repo_directory, ".github/workflows/update_space.yml" + ) + os.makedirs(os.path.dirname(github_action_file), exist_ok=True) + with open(github_action_template) as f: + github_action_content = f.read() + github_action_content = github_action_content.replace("$branch", track_branch) + with open(github_action_file, "w") as f: + f.write(github_action_content) + + print( + "Github Action created. Add your Hugging Face write token (from https://huggingface.co/settings/tokens) as an Actions Secret named 'hf_token' to your GitHub repository. This can be set in your repository's settings page." + ) + + return configuration + + +def format_title(title: str): + title = title.replace(" ", "_") + title = re.sub(r"[^a-zA-Z0-9\-._]", "", title) + title = re.sub("-+", "-", title) + while title.startswith("."): + title = title[1:] + return title + + +def deploy(): + if ( + os.getenv("SYSTEM") == "spaces" + ): # in case a repo with this function is uploaded to spaces + return + parser = argparse.ArgumentParser(description="Deploy to Spaces") + parser.add_argument("deploy") + parser.add_argument("--title", type=str, help="Spaces app title") + parser.add_argument("--app-file", type=str, help="File containing the Gradio app") + + args = parser.parse_args() + + hf_api = huggingface_hub.HfApi() + whoami = None + login = False + try: + whoami = hf_api.whoami() + if whoami["auth"]["accessToken"]["role"] != "write": + login = True + except OSError: + login = True + if login: + print("Need 'write' access token to create a Spaces repo.") + huggingface_hub.login(add_to_git_credential=False) + whoami = hf_api.whoami() + + configuration: None | dict = None + if os.path.exists(readme_file): + try: + configuration = huggingface_hub.metadata_load(readme_file) + except ValueError: + pass + + if configuration is None: + print( + f"Creating new Spaces Repo in '{repo_directory}'. Collecting metadata, press Enter to accept default value." + ) + configuration = add_configuration_to_readme( + args.title, + args.app_file, + ) + + space_id = huggingface_hub.create_repo( + configuration["title"], + space_sdk="gradio", + repo_type="space", + exist_ok=True, + space_hardware=configuration.get("hardware"), + ).repo_id + hf_api.upload_folder( + repo_id=space_id, + repo_type="space", + folder_path=repo_directory, + ) + if configuration.get("secrets"): + for secret_name, secret_value in configuration["secrets"].items(): + huggingface_hub.add_space_secret(space_id, secret_name, secret_value) + print(f"Space available at https://huggingface.co/spaces/{space_id}") diff --git a/gradio/deploy_space_action.yaml b/gradio/deploy_space_action.yaml new file mode 100644 index 0000000000000000000000000000000000000000..74f4cbdbde13728e57729531ca5de692b8521b69 --- /dev/null +++ b/gradio/deploy_space_action.yaml @@ -0,0 +1,28 @@ +name: Run Python script + +on: + push: + branches: + - $branch + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + + - name: Install Gradio + run: python -m pip install gradio + + - name: Log in to Hugging Face + run: python -c 'import huggingface_hub; huggingface_hub.login(token="${{ secrets.hf_token }}")' + + - name: Deploy to Spaces + run: gradio deploy diff --git a/gradio/deprecation.py b/gradio/deprecation.py new file mode 100644 index 0000000000000000000000000000000000000000..d14f88ffcda40a78a8072c48c378f95b874ff8fa --- /dev/null +++ b/gradio/deprecation.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +import warnings + +from gradio import utils + + +class GradioDeprecationWarning(UserWarning): + # This does not subclass DeprecationWarning + # because we want to show the warning by default. + pass + + +class GradioUnusedKwargWarning(UserWarning): + pass + + +def simple_deprecated_notice(term: str) -> str: + return f"`{term}` parameter is deprecated, and it has no effect" + + +def use_in_launch(term: str) -> str: + return f"`{term}` is deprecated in `Interface()`, please use it within `launch()` instead." + + +DEPRECATION_MESSAGE = { + "optional": simple_deprecated_notice("optional"), + "keep_filename": simple_deprecated_notice("keep_filename"), + "numeric": simple_deprecated_notice("numeric"), + "verbose": simple_deprecated_notice("verbose"), + "allow_screenshot": simple_deprecated_notice("allow_screenshot"), + "layout": simple_deprecated_notice("layout"), + "show_input": simple_deprecated_notice("show_input"), + "show_output": simple_deprecated_notice("show_output"), + "capture_session": simple_deprecated_notice("capture_session"), + "api_mode": simple_deprecated_notice("api_mode"), + "show_tips": use_in_launch("show_tips"), + "encrypt": simple_deprecated_notice("encrypt"), + "enable_queue": use_in_launch("enable_queue"), + "server_name": use_in_launch("server_name"), + "server_port": use_in_launch("server_port"), + "width": use_in_launch("width"), + "height": use_in_launch("height"), + "plot": "The 'plot' parameter has been deprecated. Use the new Plot component instead", +} + + +def check_deprecated_parameters( + cls: str, *, stacklevel: int | None = None, kwargs +) -> None: + if stacklevel is None: + stacklevel = utils.find_user_stack_level() + + for key, value in DEPRECATION_MESSAGE.items(): + if key in kwargs: + if key == "plot" and cls != "Image": + continue + kwargs.pop(key) + warnings.warn(value, GradioDeprecationWarning, stacklevel=stacklevel) + + if kwargs: + warnings.warn( + f"You have unused kwarg parameters in {cls}, please remove them: {kwargs}", + GradioUnusedKwargWarning, + stacklevel=stacklevel, + ) + + +def warn_deprecation(text: str) -> None: + warnings.warn( + text, + GradioDeprecationWarning, + stacklevel=utils.find_user_stack_level(), + ) + + +def warn_style_method_deprecation() -> None: + warn_deprecation( + "The `style` method is deprecated. Please set these arguments in the constructor instead." + ) diff --git a/gradio/events.py b/gradio/events.py new file mode 100644 index 0000000000000000000000000000000000000000..c5c4622d7e83135fe8761a87522189cdaac9df51 --- /dev/null +++ b/gradio/events.py @@ -0,0 +1,347 @@ +"""Contains all of the events that can be triggered in a gr.Blocks() app, with the exception +of the on-page-load event, which is defined in gr.Blocks().load().""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Callable, Literal, Sequence + +from gradio_client.documentation import document, set_documentation_group + +from gradio.blocks import Block +from gradio.deprecation import warn_deprecation +from gradio.helpers import EventData +from gradio.utils import get_cancel_function + +if TYPE_CHECKING: # Only import for type checking (is False at runtime). + from gradio.components import Component + +set_documentation_group("events") + + +def set_cancel_events( + block: Block, event_name: str, cancels: None | dict[str, Any] | list[dict[str, Any]] +): + if cancels: + if not isinstance(cancels, list): + cancels = [cancels] + cancel_fn, fn_indices_to_cancel = get_cancel_function(cancels) + block.set_event_trigger( + event_name, + cancel_fn, + inputs=None, + outputs=None, + queue=False, + preprocess=False, + cancels=fn_indices_to_cancel, + ) + + +class EventListener(Block): + def __init__(self: Any): + for event_listener_class in EventListener.__subclasses__(): + if isinstance(self, event_listener_class): + event_listener_class.__init__(self) + + +class Dependency(dict): + def __init__(self, trigger, key_vals, dep_index): + super().__init__(key_vals) + self.trigger = trigger + self.then = EventListenerMethod( + self.trigger, + "then", + trigger_after=dep_index, + trigger_only_on_success=False, + ) + """ + Triggered after directly preceding event is completed, regardless of success or failure. + """ + self.success = EventListenerMethod( + self.trigger, + "success", + trigger_after=dep_index, + trigger_only_on_success=True, + ) + """ + Triggered after directly preceding event is completed, if it was successful. + """ + + +class EventListenerMethod: + """ + Triggered on an event deployment. + """ + + def __init__( + self, + trigger: Block, + event_name: str, + show_progress: Literal["full", "minimal", "hidden"] = "full", + callback: Callable | None = None, + trigger_after: int | None = None, + trigger_only_on_success: bool = False, + ): + self.trigger = trigger + self.event_name = event_name + self.show_progress = show_progress + self.callback = callback + self.trigger_after = trigger_after + self.trigger_only_on_success = trigger_only_on_success + + def __call__( + self, + fn: Callable | None, + inputs: Component | Sequence[Component] | set[Component] | None = None, + outputs: Component | Sequence[Component] | None = None, + api_name: str | None | Literal[False] = None, + status_tracker: None = None, + scroll_to_output: bool = False, + show_progress: Literal["full", "minimal", "hidden"] = "full", + queue: bool | None = None, + batch: bool = False, + max_batch_size: int = 4, + preprocess: bool = True, + postprocess: bool = True, + cancels: dict[str, Any] | list[dict[str, Any]] | None = None, + every: float | None = None, + _js: str | None = None, + ) -> Dependency: + """ + Parameters: + fn: the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component. + inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list. + outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list. + api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name. + scroll_to_output: If True, will scroll to output component on completion + show_progress: If True, will show progress animation while pending + queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app. + batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component. + max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True) + preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component). + postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser. + cancels: A list of other events to cancel when This listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish. + every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled. + """ + if status_tracker: + warn_deprecation( + "The 'status_tracker' parameter has been deprecated and has no effect." + ) + if self.event_name == "stop": + warn_deprecation( + "The `stop` event on Video and Audio has been deprecated and will be remove in a future version. Use `ended` instead." + ) + + if isinstance(self, Streamable): + self.check_streamable() + if isinstance(show_progress, bool): + show_progress = "full" if show_progress else "hidden" + + dep, dep_index = self.trigger.set_event_trigger( + self.event_name, + fn, + inputs, + outputs, + preprocess=preprocess, + postprocess=postprocess, + scroll_to_output=scroll_to_output, + show_progress=show_progress + if show_progress is not None + else self.show_progress, + api_name=api_name, + js=_js, + queue=queue, + batch=batch, + max_batch_size=max_batch_size, + every=every, + trigger_after=self.trigger_after, + trigger_only_on_success=self.trigger_only_on_success, + ) + set_cancel_events(self.trigger, self.event_name, cancels) + if self.callback: + self.callback() + return Dependency(self.trigger, dep, dep_index) + + +@document("*change", inherit=True) +class Changeable(EventListener): + def __init__(self): + self.change = EventListenerMethod(self, "change") + """ + This listener is triggered when the component's value changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). + See `.input()` for a listener that is only triggered by user input. + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*input", inherit=True) +class Inputable(EventListener): + def __init__(self): + self.input = EventListenerMethod(self, "input") + """ + This listener is triggered when the user changes the value of the component. + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*click", inherit=True) +class Clickable(EventListener): + def __init__(self): + self.click = EventListenerMethod(self, "click") + """ + This listener is triggered when the component (e.g. a button) is clicked. + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*submit", inherit=True) +class Submittable(EventListener): + def __init__(self): + self.submit = EventListenerMethod(self, "submit") + """ + This listener is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused. + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*edit", inherit=True) +class Editable(EventListener): + def __init__(self): + self.edit = EventListenerMethod(self, "edit") + """ + This listener is triggered when the user edits the component (e.g. image) using the + built-in editor. This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*clear", inherit=True) +class Clearable(EventListener): + def __init__(self): + self.clear = EventListenerMethod(self, "clear") + """ + This listener is triggered when the user clears the component (e.g. image or audio) + using the X button for the component. This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*play", "*pause", "*stop", "*end", inherit=True) +class Playable(EventListener): + def __init__(self): + self.play = EventListenerMethod(self, "play") + """ + This listener is triggered when the user plays the component (e.g. audio or video). + This method can be used when this component is in a Gradio Blocks. + """ + + self.pause = EventListenerMethod(self, "pause") + """ + This listener is triggered when the media stops playing for any reason (e.g. audio or video). + This method can be used when this component is in a Gradio Blocks. + """ + + self.stop = EventListenerMethod(self, "stop") + """ + This listener is triggered when the user reaches the end of the media track (e.g. audio or video). + This method can be used when this component is in a Gradio Blocks. + """ + + self.end = EventListenerMethod(self, "end") + """ + This listener is triggered when the user reaches the end of the media track (e.g. audio or video). + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*stream", inherit=True) +class Streamable(EventListener): + def __init__(self): + self.streaming: bool + self.stream = EventListenerMethod( + self, + "stream", + show_progress="hidden", + callback=lambda: setattr(self, "streaming", True), + ) + """ + This listener is triggered when the user streams the component (e.g. a live webcam + component). This method can be used when this component is in a Gradio Blocks. + """ + + def check_streamable(self): + pass + + +@document("*start_recording", "*stop_recording", inherit=True) +class Recordable(EventListener): + def __init__(self): + self.start_recording = EventListenerMethod(self, "start_recording") + """ + This listener is triggered when the user starts recording with the component (e.g. audio or video). + This method can be used when this component is in a Gradio Blocks. + """ + + self.stop_recording = EventListenerMethod(self, "stop_recording") + """ + This listener is triggered when the user stops recording with the component (e.g. audio or video). + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*blur", inherit=True) +class Blurrable(EventListener): + def __init__(self): + self.blur = EventListenerMethod(self, "blur") + """ + This listener is triggered when the component's is unfocused/blurred (e.g. when the user clicks outside of a textbox). + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*upload", inherit=True) +class Uploadable(EventListener): + def __init__(self): + self.upload = EventListenerMethod(self, "upload") + """ + This listener is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*release", inherit=True) +class Releaseable(EventListener): + def __init__(self): + self.release = EventListenerMethod(self, "release") + """ + This listener is triggered when the user releases the mouse on this component (e.g. when the user releases the slider). + This method can be used when this component is in a Gradio Blocks. + """ + + +@document("*select", inherit=True) +class Selectable(EventListener): + def __init__(self): + self.selectable: bool = False + self.select = EventListenerMethod( + self, "select", callback=lambda: setattr(self, "selectable", True) + ) + """ + This listener is triggered when the user selects from within the Component. + This event has EventData of type gradio.SelectData that carries information, accessible through SelectData.index and SelectData.value. + See EventData documentation on how to use this event data. + """ + + +class SelectData(EventData): + def __init__(self, target: Block | None, data: Any): + super().__init__(target, data) + self.index: int | tuple[int, int] = data["index"] + """ + The index of the selected item. Is a tuple if the component is two dimensional or selection is a range. + """ + self.value: Any = data["value"] + """ + The value of the selected item. + """ + self.selected: bool = data.get("selected", True) + """ + True if the item was selected, False if deselected. + """ diff --git a/gradio/exceptions.py b/gradio/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..678ca7d5926798d1bd27363a019851717eee6e35 --- /dev/null +++ b/gradio/exceptions.py @@ -0,0 +1,52 @@ +from gradio_client.documentation import document, set_documentation_group + +set_documentation_group("helpers") + + +class DuplicateBlockError(ValueError): + """Raised when a Blocks contains more than one Block with the same id""" + + pass + + +class TooManyRequestsError(Exception): + """Raised when the Hugging Face API returns a 429 status code.""" + + pass + + +class InvalidApiNameError(ValueError): + pass + + +class ServerFailedToStartError(Exception): + pass + + +class InvalidBlockError(ValueError): + """Raised when an event in a Blocks contains a reference to a Block that is not in the original Blocks""" + + pass + + +InvalidApiName = InvalidApiNameError # backwards compatibility + + +@document() +class Error(Exception): + """ + This class allows you to pass custom error messages to the user. You can do so by raising a gr.Error("custom message") anywhere in the code, and when that line is executed the custom message will appear in a modal on the demo. + + Demos: calculator + """ + + def __init__(self, message: str = "Error raised."): + """ + Parameters: + message: The error message to be displayed to the user. + """ + self.message = message + super().__init__(self.message) + + def __str__(self): + return repr(self.message) diff --git a/gradio/external.py b/gradio/external.py new file mode 100644 index 0000000000000000000000000000000000000000..29ad28384cbe1b0f36a31b4c73efe7866dbcedae --- /dev/null +++ b/gradio/external.py @@ -0,0 +1,540 @@ +"""This module should not be used directly as its API is subject to change. Instead, +use the `gr.Blocks.load()` or `gr.load()` functions.""" + +from __future__ import annotations + +import json +import re +import warnings +from typing import TYPE_CHECKING, Callable + +import requests +from gradio_client import Client +from gradio_client.documentation import document, set_documentation_group + +import gradio +from gradio import components, utils +from gradio.context import Context +from gradio.deprecation import warn_deprecation +from gradio.exceptions import Error, TooManyRequestsError +from gradio.external_utils import ( + cols_to_rows, + encode_to_base64, + get_tabular_examples, + postprocess_label, + rows_to_cols, + streamline_spaces_interface, +) +from gradio.processing_utils import extract_base64_data, to_binary + +if TYPE_CHECKING: + from gradio.blocks import Blocks + from gradio.interface import Interface + + +set_documentation_group("helpers") + + +@document() +def load( + name: str, + src: str | None = None, + api_key: str | None = None, + hf_token: str | None = None, + alias: str | None = None, + **kwargs, +) -> Blocks: + """ + Method that constructs a Blocks from a Hugging Face repo. Can accept + model repos (if src is "models") or Space repos (if src is "spaces"). The input + and output components are automatically loaded from the repo. + Parameters: + name: the name of the model (e.g. "gpt2" or "facebook/bart-base") or space (e.g. "flax-community/spanish-gpt2"), can include the `src` as prefix (e.g. "models/facebook/bart-base") + src: the source of the model: `models` or `spaces` (or leave empty if source is provided as a prefix in `name`) + api_key: Deprecated. Please use the `hf_token` parameter instead. + hf_token: optional access token for loading private Hugging Face Hub models or spaces. Find your token here: https://huggingface.co/settings/tokens. Warning: only provide this if you are loading a trusted private Space as it can be read by the Space you are loading. + alias: optional string used as the name of the loaded model instead of the default name (only applies if loading a Space running Gradio 2.x) + Returns: + a Gradio Blocks object for the given model + Example: + import gradio as gr + demo = gr.load("gradio/question-answering", src="spaces") + demo.launch() + """ + if hf_token is None and api_key: + warn_deprecation( + "The `api_key` parameter will be deprecated. " + "Please use the `hf_token` parameter going forward." + ) + hf_token = api_key + return load_blocks_from_repo( + name=name, src=src, hf_token=hf_token, alias=alias, **kwargs + ) + + +def load_blocks_from_repo( + name: str, + src: str | None = None, + hf_token: str | None = None, + alias: str | None = None, + **kwargs, +) -> Blocks: + """Creates and returns a Blocks instance from a Hugging Face model or Space repo.""" + if src is None: + # Separate the repo type (e.g. "model") from repo name (e.g. "google/vit-base-patch16-224") + tokens = name.split("/") + assert ( + len(tokens) > 1 + ), "Either `src` parameter must be provided, or `name` must be formatted as {src}/{repo name}" + src = tokens[0] + name = "/".join(tokens[1:]) + + factory_methods: dict[str, Callable] = { + # for each repo type, we have a method that returns the Interface given the model name & optionally an api_key + "huggingface": from_model, + "models": from_model, + "spaces": from_spaces, + } + assert ( + src.lower() in factory_methods + ), f"parameter: src must be one of {factory_methods.keys()}" + + if hf_token is not None: + if Context.hf_token is not None and Context.hf_token != hf_token: + warnings.warn( + """You are loading a model/Space with a different access token than the one you used to load a previous model/Space. This is not recommended, as it may cause unexpected behavior.""" + ) + Context.hf_token = hf_token + + blocks: gradio.Blocks = factory_methods[src](name, hf_token, alias, **kwargs) + return blocks + + +def chatbot_preprocess(text, state): + payload = { + "inputs": {"generated_responses": None, "past_user_inputs": None, "text": text} + } + if state is not None: + payload["inputs"]["generated_responses"] = state["conversation"][ + "generated_responses" + ] + payload["inputs"]["past_user_inputs"] = state["conversation"][ + "past_user_inputs" + ] + + return payload + + +def chatbot_postprocess(response): + response_json = response.json() + chatbot_value = list( + zip( + response_json["conversation"]["past_user_inputs"], + response_json["conversation"]["generated_responses"], + ) + ) + return chatbot_value, response_json + + +def from_model(model_name: str, hf_token: str | None, alias: str | None, **kwargs): + model_url = f"https://huggingface.co/{model_name}" + api_url = f"https://api-inference.huggingface.co/models/{model_name}" + print(f"Fetching model from: {model_url}") + + headers = {"Authorization": f"Bearer {hf_token}"} if hf_token is not None else {} + + # Checking if model exists, and if so, it gets the pipeline + response = requests.request("GET", api_url, headers=headers) + assert ( + response.status_code == 200 + ), f"Could not find model: {model_name}. If it is a private or gated model, please provide your Hugging Face access token (https://huggingface.co/settings/tokens) as the argument for the `api_key` parameter." + p = response.json().get("pipeline_tag") + pipelines = { + "audio-classification": { + # example model: ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition + "inputs": components.Audio(source="upload", type="filepath", label="Input"), + "outputs": components.Label(label="Class"), + "preprocess": lambda i: to_binary, + "postprocess": lambda r: postprocess_label( + {i["label"].split(", ")[0]: i["score"] for i in r.json()} + ), + }, + "audio-to-audio": { + # example model: facebook/xm_transformer_sm_all-en + "inputs": components.Audio(source="upload", type="filepath", label="Input"), + "outputs": components.Audio(label="Output"), + "preprocess": to_binary, + "postprocess": encode_to_base64, + }, + "automatic-speech-recognition": { + # example model: facebook/wav2vec2-base-960h + "inputs": components.Audio(source="upload", type="filepath", label="Input"), + "outputs": components.Textbox(label="Output"), + "preprocess": to_binary, + "postprocess": lambda r: r.json()["text"], + }, + "conversational": { + "inputs": [components.Textbox(), components.State()], # type: ignore + "outputs": [components.Chatbot(), components.State()], # type: ignore + "preprocess": chatbot_preprocess, + "postprocess": chatbot_postprocess, + }, + "feature-extraction": { + # example model: julien-c/distilbert-feature-extraction + "inputs": components.Textbox(label="Input"), + "outputs": components.Dataframe(label="Output"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r.json()[0], + }, + "fill-mask": { + "inputs": components.Textbox(label="Input"), + "outputs": components.Label(label="Classification"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: postprocess_label( + {i["token_str"]: i["score"] for i in r.json()} + ), + }, + "image-classification": { + # Example: google/vit-base-patch16-224 + "inputs": components.Image(type="filepath", label="Input Image"), + "outputs": components.Label(label="Classification"), + "preprocess": to_binary, + "postprocess": lambda r: postprocess_label( + {i["label"].split(", ")[0]: i["score"] for i in r.json()} + ), + }, + "question-answering": { + # Example: deepset/xlm-roberta-base-squad2 + "inputs": [ + components.Textbox(lines=7, label="Context"), + components.Textbox(label="Question"), + ], + "outputs": [ + components.Textbox(label="Answer"), + components.Label(label="Score"), + ], + "preprocess": lambda c, q: {"inputs": {"context": c, "question": q}}, + "postprocess": lambda r: (r.json()["answer"], {"label": r.json()["score"]}), + }, + "summarization": { + # Example: facebook/bart-large-cnn + "inputs": components.Textbox(label="Input"), + "outputs": components.Textbox(label="Summary"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r.json()[0]["summary_text"], + }, + "text-classification": { + # Example: distilbert-base-uncased-finetuned-sst-2-english + "inputs": components.Textbox(label="Input"), + "outputs": components.Label(label="Classification"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: postprocess_label( + {i["label"].split(", ")[0]: i["score"] for i in r.json()[0]} + ), + }, + "text-generation": { + # Example: gpt2 + "inputs": components.Textbox(label="Input"), + "outputs": components.Textbox(label="Output"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r.json()[0]["generated_text"], + }, + "text2text-generation": { + # Example: valhalla/t5-small-qa-qg-hl + "inputs": components.Textbox(label="Input"), + "outputs": components.Textbox(label="Generated Text"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r.json()[0]["generated_text"], + }, + "translation": { + "inputs": components.Textbox(label="Input"), + "outputs": components.Textbox(label="Translation"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r.json()[0]["translation_text"], + }, + "zero-shot-classification": { + # Example: facebook/bart-large-mnli + "inputs": [ + components.Textbox(label="Input"), + components.Textbox(label="Possible class names (" "comma-separated)"), + components.Checkbox(label="Allow multiple true classes"), + ], + "outputs": components.Label(label="Classification"), + "preprocess": lambda i, c, m: { + "inputs": i, + "parameters": {"candidate_labels": c, "multi_class": m}, + }, + "postprocess": lambda r: postprocess_label( + { + r.json()["labels"][i]: r.json()["scores"][i] + for i in range(len(r.json()["labels"])) + } + ), + }, + "sentence-similarity": { + # Example: sentence-transformers/distilbert-base-nli-stsb-mean-tokens + "inputs": [ + components.Textbox( + value="That is a happy person", label="Source Sentence" + ), + components.Textbox( + lines=7, + placeholder="Separate each sentence by a newline", + label="Sentences to compare to", + ), + ], + "outputs": components.Label(label="Classification"), + "preprocess": lambda src, sentences: { + "inputs": { + "source_sentence": src, + "sentences": [s for s in sentences.splitlines() if s != ""], + } + }, + "postprocess": lambda r: postprocess_label( + {f"sentence {i}": v for i, v in enumerate(r.json())} + ), + }, + "text-to-speech": { + # Example: julien-c/ljspeech_tts_train_tacotron2_raw_phn_tacotron_g2p_en_no_space_train + "inputs": components.Textbox(label="Input"), + "outputs": components.Audio(label="Audio"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": encode_to_base64, + }, + "text-to-image": { + # example model: osanseviero/BigGAN-deep-128 + "inputs": components.Textbox(label="Input"), + "outputs": components.Image(label="Output"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": encode_to_base64, + }, + "token-classification": { + # example model: huggingface-course/bert-finetuned-ner + "inputs": components.Textbox(label="Input"), + "outputs": components.HighlightedText(label="Output"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r, # Handled as a special case in query_huggingface_api() + }, + "document-question-answering": { + # example model: impira/layoutlm-document-qa + "inputs": [ + components.Image(type="filepath", label="Input Document"), + components.Textbox(label="Question"), + ], + "outputs": components.Label(label="Label"), + "preprocess": lambda img, q: { + "inputs": { + "image": extract_base64_data(img), # Extract base64 data + "question": q, + } + }, + "postprocess": lambda r: postprocess_label( + {i["answer"]: i["score"] for i in r.json()} + ), + }, + "visual-question-answering": { + # example model: dandelin/vilt-b32-finetuned-vqa + "inputs": [ + components.Image(type="filepath", label="Input Image"), + components.Textbox(label="Question"), + ], + "outputs": components.Label(label="Label"), + "preprocess": lambda img, q: { + "inputs": { + "image": extract_base64_data(img), + "question": q, + } + }, + "postprocess": lambda r: postprocess_label( + {i["answer"]: i["score"] for i in r.json()} + ), + }, + "image-to-text": { + # example model: Salesforce/blip-image-captioning-base + "inputs": components.Image(type="filepath", label="Input Image"), + "outputs": components.Textbox(label="Generated Text"), + "preprocess": to_binary, + "postprocess": lambda r: r.json()[0]["generated_text"], + }, + } + + if p in ["tabular-classification", "tabular-regression"]: + example_data = get_tabular_examples(model_name) + col_names, example_data = cols_to_rows(example_data) + example_data = [[example_data]] if example_data else None + + pipelines[p] = { + "inputs": components.Dataframe( + label="Input Rows", + type="pandas", + headers=col_names, + col_count=(len(col_names), "fixed"), + ), + "outputs": components.Dataframe( + label="Predictions", type="array", headers=["prediction"] + ), + "preprocess": rows_to_cols, + "postprocess": lambda r: { + "headers": ["prediction"], + "data": [[pred] for pred in json.loads(r.text)], + }, + "examples": example_data, + } + + if p is None or p not in pipelines: + raise ValueError(f"Unsupported pipeline type: {p}") + + pipeline = pipelines[p] + + def query_huggingface_api(*params): + # Convert to a list of input components + data = pipeline["preprocess"](*params) + if isinstance( + data, dict + ): # HF doesn't allow additional parameters for binary files (e.g. images or audio files) + data.update({"options": {"wait_for_model": True}}) + data = json.dumps(data) + response = requests.request("POST", api_url, headers=headers, data=data) + if response.status_code != 200: + errors_json = response.json() + errors, warns = "", "" + if errors_json.get("error"): + errors = f", Error: {errors_json.get('error')}" + if errors_json.get("warnings"): + warns = f", Warnings: {errors_json.get('warnings')}" + raise Error( + f"Could not complete request to HuggingFace API, Status Code: {response.status_code}" + + errors + + warns + ) + if ( + p == "token-classification" + ): # Handle as a special case since HF API only returns the named entities and we need the input as well + ner_groups = response.json() + input_string = params[0] + response = utils.format_ner_list(input_string, ner_groups) + output = pipeline["postprocess"](response) + return output + + if alias is None: + query_huggingface_api.__name__ = model_name + else: + query_huggingface_api.__name__ = alias + + interface_info = { + "fn": query_huggingface_api, + "inputs": pipeline["inputs"], + "outputs": pipeline["outputs"], + "title": model_name, + "examples": pipeline.get("examples"), + } + + kwargs = dict(interface_info, **kwargs) + + # So interface doesn't run pre/postprocess + # except for conversational interfaces which + # are stateful + kwargs["_api_mode"] = p != "conversational" + + interface = gradio.Interface(**kwargs) + return interface + + +def from_spaces( + space_name: str, hf_token: str | None, alias: str | None, **kwargs +) -> Blocks: + space_url = f"https://huggingface.co/spaces/{space_name}" + + print(f"Fetching Space from: {space_url}") + + headers = {} + if hf_token is not None: + headers["Authorization"] = f"Bearer {hf_token}" + + iframe_url = ( + requests.get( + f"https://huggingface.co/api/spaces/{space_name}/host", headers=headers + ) + .json() + .get("host") + ) + + if iframe_url is None: + raise ValueError( + f"Could not find Space: {space_name}. If it is a private or gated Space, please provide your Hugging Face access token (https://huggingface.co/settings/tokens) as the argument for the `api_key` parameter." + ) + + r = requests.get(iframe_url, headers=headers) + + result = re.search( + r"window.gradio_config = (.*?);[\s]*", r.text + ) # some basic regex to extract the config + try: + config = json.loads(result.group(1)) # type: ignore + except AttributeError as ae: + raise ValueError(f"Could not load the Space: {space_name}") from ae + if "allow_flagging" in config: # Create an Interface for Gradio 2.x Spaces + return from_spaces_interface( + space_name, config, alias, hf_token, iframe_url, **kwargs + ) + else: # Create a Blocks for Gradio 3.x Spaces + if kwargs: + warnings.warn( + "You cannot override parameters for this Space by passing in kwargs. " + "Instead, please load the Space as a function and use it to create a " + "Blocks or Interface locally. You may find this Guide helpful: " + "https://gradio.app/using_blocks_like_functions/" + ) + return from_spaces_blocks(space=space_name, hf_token=hf_token) + + +def from_spaces_blocks(space: str, hf_token: str | None) -> Blocks: + client = Client(space, hf_token=hf_token) + predict_fns = [endpoint._predict_resolve for endpoint in client.endpoints] + return gradio.Blocks.from_config(client.config, predict_fns, client.src) + + +def from_spaces_interface( + model_name: str, + config: dict, + alias: str | None, + hf_token: str | None, + iframe_url: str, + **kwargs, +) -> Interface: + config = streamline_spaces_interface(config) + api_url = f"{iframe_url}/api/predict/" + headers = {"Content-Type": "application/json"} + if hf_token is not None: + headers["Authorization"] = f"Bearer {hf_token}" + + # The function should call the API with preprocessed data + def fn(*data): + data = json.dumps({"data": data}) + response = requests.post(api_url, headers=headers, data=data) + result = json.loads(response.content.decode("utf-8")) + if "error" in result and "429" in result["error"]: + raise TooManyRequestsError("Too many requests to the Hugging Face API") + try: + output = result["data"] + except KeyError as ke: + raise KeyError( + f"Could not find 'data' key in response from external Space. Response received: {result}" + ) from ke + if ( + len(config["outputs"]) == 1 + ): # if the fn is supposed to return a single value, pop it + output = output[0] + if len(config["outputs"]) == 1 and isinstance( + output, list + ): # Needed to support Output.Image() returning bounding boxes as well (TODO: handle different versions of gradio since they have slightly different APIs) + output = output[0] + return output + + fn.__name__ = alias if (alias is not None) else model_name + config["fn"] = fn + + kwargs = dict(config, **kwargs) + kwargs["_api_mode"] = True + interface = gradio.Interface(**kwargs) + return interface diff --git a/gradio/external_utils.py b/gradio/external_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..9a6064bd25da68c51ee9b09f3551e2a31fdb253b --- /dev/null +++ b/gradio/external_utils.py @@ -0,0 +1,140 @@ +"""Utility function for gradio/external.py""" + +import base64 +import math +import operator +import re +import warnings +from typing import Dict, List, Tuple + +import requests +import yaml + +from gradio import components + +################## +# Helper functions for processing tabular data +################## + + +def get_tabular_examples(model_name: str) -> Dict[str, List[float]]: + readme = requests.get(f"https://huggingface.co/{model_name}/resolve/main/README.md") + if readme.status_code != 200: + warnings.warn(f"Cannot load examples from README for {model_name}", UserWarning) + example_data = {} + else: + yaml_regex = re.search( + "(?:^|[\r\n])---[\n\r]+([\\S\\s]*?)[\n\r]+---([\n\r]|$)", readme.text + ) + if yaml_regex is None: + example_data = {} + else: + example_yaml = next( + yaml.safe_load_all(readme.text[: yaml_regex.span()[-1]]) + ) + example_data = example_yaml.get("widget", {}).get("structuredData", {}) + if not example_data: + raise ValueError( + f"No example data found in README.md of {model_name} - Cannot build gradio demo. " + "See the README.md here: https://huggingface.co/scikit-learn/tabular-playground/blob/main/README.md " + "for a reference on how to provide example data to your model." + ) + # replace nan with string NaN for inference API + for data in example_data.values(): + for i, val in enumerate(data): + if isinstance(val, float) and math.isnan(val): + data[i] = "NaN" + return example_data + + +def cols_to_rows( + example_data: Dict[str, List[float]] +) -> Tuple[List[str], List[List[float]]]: + headers = list(example_data.keys()) + n_rows = max(len(example_data[header] or []) for header in headers) + data = [] + for row_index in range(n_rows): + row_data = [] + for header in headers: + col = example_data[header] or [] + if row_index >= len(col): + row_data.append("NaN") + else: + row_data.append(col[row_index]) + data.append(row_data) + return headers, data + + +def rows_to_cols(incoming_data: Dict) -> Dict[str, Dict[str, Dict[str, List[str]]]]: + data_column_wise = {} + for i, header in enumerate(incoming_data["headers"]): + data_column_wise[header] = [str(row[i]) for row in incoming_data["data"]] + return {"inputs": {"data": data_column_wise}} + + +################## +# Helper functions for processing other kinds of data +################## + + +def postprocess_label(scores: Dict) -> Dict: + sorted_pred = sorted(scores.items(), key=operator.itemgetter(1), reverse=True) + return { + "label": sorted_pred[0][0], + "confidences": [ + {"label": pred[0], "confidence": pred[1]} for pred in sorted_pred + ], + } + + +def encode_to_base64(r: requests.Response) -> str: + # Handles the different ways HF API returns the prediction + base64_repr = base64.b64encode(r.content).decode("utf-8") + data_prefix = ";base64," + # Case 1: base64 representation already includes data prefix + if data_prefix in base64_repr: + return base64_repr + else: + content_type = r.headers.get("content-type") + # Case 2: the data prefix is a key in the response + if content_type == "application/json": + try: + data = r.json()[0] + content_type = data["content-type"] + base64_repr = data["blob"] + except KeyError as ke: + raise ValueError( + "Cannot determine content type returned by external API." + ) from ke + # Case 3: the data prefix is included in the response headers + else: + pass + new_base64 = f"data:{content_type};base64,{base64_repr}" + return new_base64 + + +################## +# Helper function for cleaning up an Interface loaded from HF Spaces +################## + + +def streamline_spaces_interface(config: Dict) -> Dict: + """Streamlines the interface config dictionary to remove unnecessary keys.""" + config["inputs"] = [ + components.get_component_instance(component) + for component in config["input_components"] + ] + config["outputs"] = [ + components.get_component_instance(component) + for component in config["output_components"] + ] + parameters = { + "article", + "description", + "flagging_options", + "inputs", + "outputs", + "title", + } + config = {k: config[k] for k in parameters} + return config diff --git a/gradio/flagging.py b/gradio/flagging.py new file mode 100644 index 0000000000000000000000000000000000000000..c98828825e74e8146bb4c4075e107c0f928de2b0 --- /dev/null +++ b/gradio/flagging.py @@ -0,0 +1,518 @@ +from __future__ import annotations + +import csv +import datetime +import json +import os +import time +import uuid +from abc import ABC, abstractmethod +from collections import OrderedDict +from distutils.version import StrictVersion +from pathlib import Path +from typing import TYPE_CHECKING, Any + +import filelock +import huggingface_hub +import pkg_resources +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group + +import gradio as gr +from gradio import utils +from gradio.deprecation import warn_deprecation + +if TYPE_CHECKING: + from gradio.components import IOComponent + +set_documentation_group("flagging") + + +class FlaggingCallback(ABC): + """ + An abstract class for defining the methods that any FlaggingCallback should have. + """ + + @abstractmethod + def setup(self, components: list[IOComponent], flagging_dir: str): + """ + This method should be overridden and ensure that everything is set up correctly for flag(). + This method gets called once at the beginning of the Interface.launch() method. + Parameters: + components: Set of components that will provide flagged data. + flagging_dir: A string, typically containing the path to the directory where the flagging file should be storied (provided as an argument to Interface.__init__()). + """ + pass + + @abstractmethod + def flag( + self, + flag_data: list[Any], + flag_option: str = "", + username: str | None = None, + ) -> int: + """ + This method should be overridden by the FlaggingCallback subclass and may contain optional additional arguments. + This gets called every time the button is pressed. + Parameters: + interface: The Interface object that is being used to launch the flagging interface. + flag_data: The data to be flagged. + flag_option (optional): In the case that flagging_options are provided, the flag option that is being used. + username (optional): The username of the user that is flagging the data, if logged in. + Returns: + (int) The total number of samples that have been flagged. + """ + pass + + +@document() +class SimpleCSVLogger(FlaggingCallback): + """ + A simplified implementation of the FlaggingCallback abstract class + provided for illustrative purposes. Each flagged sample (both the input and output data) + is logged to a CSV file on the machine running the gradio app. + Example: + import gradio as gr + def image_classifier(inp): + return {'cat': 0.3, 'dog': 0.7} + demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label", + flagging_callback=SimpleCSVLogger()) + """ + + def __init__(self): + pass + + def setup(self, components: list[IOComponent], flagging_dir: str | Path): + self.components = components + self.flagging_dir = flagging_dir + os.makedirs(flagging_dir, exist_ok=True) + + def flag( + self, + flag_data: list[Any], + flag_option: str = "", + username: str | None = None, + ) -> int: + flagging_dir = self.flagging_dir + log_filepath = Path(flagging_dir) / "log.csv" + + csv_data = [] + for component, sample in zip(self.components, flag_data): + save_dir = Path( + flagging_dir + ) / client_utils.strip_invalid_filename_characters(component.label or "") + csv_data.append( + component.deserialize( + sample, + save_dir, + None, + ) + ) + + with open(log_filepath, "a", newline="") as csvfile: + writer = csv.writer(csvfile) + writer.writerow(utils.sanitize_list_for_csv(csv_data)) + + with open(log_filepath) as csvfile: + line_count = len(list(csv.reader(csvfile))) - 1 + return line_count + + +@document() +class CSVLogger(FlaggingCallback): + """ + The default implementation of the FlaggingCallback abstract class. Each flagged + sample (both the input and output data) is logged to a CSV file with headers on the machine running the gradio app. + Example: + import gradio as gr + def image_classifier(inp): + return {'cat': 0.3, 'dog': 0.7} + demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label", + flagging_callback=CSVLogger()) + Guides: using-flagging + """ + + def __init__(self): + pass + + def setup( + self, + components: list[IOComponent], + flagging_dir: str | Path, + ): + self.components = components + self.flagging_dir = flagging_dir + os.makedirs(flagging_dir, exist_ok=True) + + def flag( + self, + flag_data: list[Any], + flag_option: str = "", + username: str | None = None, + ) -> int: + flagging_dir = self.flagging_dir + log_filepath = Path(flagging_dir) / "log.csv" + is_new = not Path(log_filepath).exists() + headers = [ + getattr(component, "label", None) or f"component {idx}" + for idx, component in enumerate(self.components) + ] + [ + "flag", + "username", + "timestamp", + ] + + csv_data = [] + for idx, (component, sample) in enumerate(zip(self.components, flag_data)): + save_dir = Path( + flagging_dir + ) / client_utils.strip_invalid_filename_characters( + getattr(component, "label", None) or f"component {idx}" + ) + if utils.is_update(sample): + csv_data.append(str(sample)) + else: + csv_data.append( + component.deserialize(sample, save_dir=save_dir) + if sample is not None + else "" + ) + csv_data.append(flag_option) + csv_data.append(username if username is not None else "") + csv_data.append(str(datetime.datetime.now())) + + with open(log_filepath, "a", newline="", encoding="utf-8") as csvfile: + writer = csv.writer(csvfile) + if is_new: + writer.writerow(utils.sanitize_list_for_csv(headers)) + writer.writerow(utils.sanitize_list_for_csv(csv_data)) + + with open(log_filepath, encoding="utf-8") as csvfile: + line_count = len(list(csv.reader(csvfile))) - 1 + return line_count + + +@document() +class HuggingFaceDatasetSaver(FlaggingCallback): + """ + A callback that saves each flagged sample (both the input and output data) to a HuggingFace dataset. + + Example: + import gradio as gr + hf_writer = gr.HuggingFaceDatasetSaver(HF_API_TOKEN, "image-classification-mistakes") + def image_classifier(inp): + return {'cat': 0.3, 'dog': 0.7} + demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label", + allow_flagging="manual", flagging_callback=hf_writer) + Guides: using-flagging + """ + + def __init__( + self, + hf_token: str, + dataset_name: str, + organization: str | None = None, + private: bool = False, + info_filename: str = "dataset_info.json", + separate_dirs: bool = False, + verbose: bool = True, # silently ignored. TODO: remove it? + ): + """ + Parameters: + hf_token: The HuggingFace token to use to create (and write the flagged sample to) the HuggingFace dataset (defaults to the registered one). + dataset_name: The repo_id of the dataset to save the data to, e.g. "image-classifier-1" or "username/image-classifier-1". + organization: Deprecated argument. Please pass a full dataset id (e.g. 'username/dataset_name') to `dataset_name` instead. + private: Whether the dataset should be private (defaults to False). + info_filename: The name of the file to save the dataset info (defaults to "dataset_infos.json"). + separate_dirs: If True, each flagged item will be saved in a separate directory. This makes the flagging more robust to concurrent editing, but may be less convenient to use. + """ + if organization is not None: + warn_deprecation( + "Parameter `organization` is not used anymore. Please pass a full dataset id (e.g. 'username/dataset_name') to `dataset_name` instead." + ) + self.hf_token = hf_token + self.dataset_id = dataset_name # TODO: rename parameter (but ensure backward compatibility somehow) + self.dataset_private = private + self.info_filename = info_filename + self.separate_dirs = separate_dirs + + def setup(self, components: list[IOComponent], flagging_dir: str): + """ + Params: + flagging_dir (str): local directory where the dataset is cloned, + updated, and pushed from. + """ + hh_version = pkg_resources.get_distribution("huggingface_hub").version + try: + if StrictVersion(hh_version) < StrictVersion("0.12.0"): + raise ImportError( + "The `huggingface_hub` package must be version 0.12.0 or higher" + "for HuggingFaceDatasetSaver. Try 'pip install huggingface_hub --upgrade'." + ) + except ValueError: + pass + + # Setup dataset on the Hub + self.dataset_id = huggingface_hub.create_repo( + repo_id=self.dataset_id, + token=self.hf_token, + private=self.dataset_private, + repo_type="dataset", + exist_ok=True, + ).repo_id + + # Setup flagging dir + self.components = components + self.dataset_dir = ( + Path(flagging_dir).absolute() / self.dataset_id.split("/")[-1] + ) + self.dataset_dir.mkdir(parents=True, exist_ok=True) + self.infos_file = self.dataset_dir / self.info_filename + + # Download remote files to local + remote_files = [self.info_filename] + if not self.separate_dirs: + # No separate dirs => means all data is in the same CSV file => download it to get its current content + remote_files.append("data.csv") + + for filename in remote_files: + try: + huggingface_hub.hf_hub_download( + repo_id=self.dataset_id, + repo_type="dataset", + filename=filename, + local_dir=self.dataset_dir, + token=self.hf_token, + ) + except huggingface_hub.utils.EntryNotFoundError: + pass + + def flag( + self, + flag_data: list[Any], + flag_option: str = "", + username: str | None = None, + ) -> int: + if self.separate_dirs: + # JSONL files to support dataset preview on the Hub + unique_id = str(uuid.uuid4()) + components_dir = self.dataset_dir / str(uuid.uuid4()) + data_file = components_dir / "metadata.jsonl" + path_in_repo = unique_id # upload in sub folder (safer for concurrency) + else: + # Unique CSV file + components_dir = self.dataset_dir + data_file = components_dir / "data.csv" + path_in_repo = None # upload at root level + + return self._flag_in_dir( + data_file=data_file, + components_dir=components_dir, + path_in_repo=path_in_repo, + flag_data=flag_data, + flag_option=flag_option, + username=username or "", + ) + + def _flag_in_dir( + self, + data_file: Path, + components_dir: Path, + path_in_repo: str | None, + flag_data: list[Any], + flag_option: str = "", + username: str = "", + ) -> int: + # Deserialize components (write images/audio to files) + features, row = self._deserialize_components( + components_dir, flag_data, flag_option, username + ) + + # Write generic info to dataset_infos.json + upload + with filelock.FileLock(str(self.infos_file) + ".lock"): + if not self.infos_file.exists(): + self.infos_file.write_text( + json.dumps({"flagged": {"features": features}}) + ) + + huggingface_hub.upload_file( + repo_id=self.dataset_id, + repo_type="dataset", + token=self.hf_token, + path_in_repo=self.infos_file.name, + path_or_fileobj=self.infos_file, + ) + + headers = list(features.keys()) + + if not self.separate_dirs: + with filelock.FileLock(components_dir / ".lock"): + sample_nb = self._save_as_csv(data_file, headers=headers, row=row) + sample_name = str(sample_nb) + huggingface_hub.upload_folder( + repo_id=self.dataset_id, + repo_type="dataset", + commit_message=f"Flagged sample #{sample_name}", + path_in_repo=path_in_repo, + ignore_patterns="*.lock", + folder_path=components_dir, + token=self.hf_token, + ) + else: + sample_name = self._save_as_jsonl(data_file, headers=headers, row=row) + sample_nb = len( + [path for path in self.dataset_dir.iterdir() if path.is_dir()] + ) + huggingface_hub.upload_folder( + repo_id=self.dataset_id, + repo_type="dataset", + commit_message=f"Flagged sample #{sample_name}", + path_in_repo=path_in_repo, + ignore_patterns="*.lock", + folder_path=components_dir, + token=self.hf_token, + ) + + return sample_nb + + @staticmethod + def _save_as_csv(data_file: Path, headers: list[str], row: list[Any]) -> int: + """Save data as CSV and return the sample name (row number).""" + is_new = not data_file.exists() + + with data_file.open("a", newline="", encoding="utf-8") as csvfile: + writer = csv.writer(csvfile) + + # Write CSV headers if new file + if is_new: + writer.writerow(utils.sanitize_list_for_csv(headers)) + + # Write CSV row for flagged sample + writer.writerow(utils.sanitize_list_for_csv(row)) + + with data_file.open(encoding="utf-8") as csvfile: + return sum(1 for _ in csv.reader(csvfile)) - 1 + + @staticmethod + def _save_as_jsonl(data_file: Path, headers: list[str], row: list[Any]) -> str: + """Save data as JSONL and return the sample name (uuid).""" + Path.mkdir(data_file.parent, parents=True, exist_ok=True) + with open(data_file, "w") as f: + json.dump(dict(zip(headers, row)), f) + return data_file.parent.name + + def _deserialize_components( + self, + data_dir: Path, + flag_data: list[Any], + flag_option: str = "", + username: str = "", + ) -> tuple[dict[Any, Any], list[Any]]: + """Deserialize components and return the corresponding row for the flagged sample. + + Images/audio are saved to disk as individual files. + """ + # Components that can have a preview on dataset repos + file_preview_types = {gr.Audio: "Audio", gr.Image: "Image"} + + # Generate the row corresponding to the flagged sample + features = OrderedDict() + row = [] + for component, sample in zip(self.components, flag_data): + # Get deserialized object (will save sample to disk if applicable -file, audio, image,...-) + label = component.label or "" + save_dir = data_dir / client_utils.strip_invalid_filename_characters(label) + deserialized = component.deserialize(sample, save_dir, None) + + # Add deserialized object to row + features[label] = {"dtype": "string", "_type": "Value"} + try: + assert Path(deserialized).exists() + row.append(Path(deserialized).name) + except (AssertionError, TypeError, ValueError): + row.append(str(deserialized)) + + # If component is eligible for a preview, add the URL of the file + if isinstance(component, tuple(file_preview_types)): # type: ignore + for _component, _type in file_preview_types.items(): + if isinstance(component, _component): + features[label + " file"] = {"_type": _type} + break + path_in_repo = str( # returned filepath is absolute, we want it relative to compute URL + Path(deserialized).relative_to(self.dataset_dir) + ).replace( + "\\", "/" + ) + row.append( + huggingface_hub.hf_hub_url( + repo_id=self.dataset_id, + filename=path_in_repo, + repo_type="dataset", + ) + ) + features["flag"] = {"dtype": "string", "_type": "Value"} + features["username"] = {"dtype": "string", "_type": "Value"} + row.append(flag_option) + row.append(username) + return features, row + + +class HuggingFaceDatasetJSONSaver(HuggingFaceDatasetSaver): + def __init__( + self, + hf_token: str, + dataset_name: str, + organization: str | None = None, + private: bool = False, + info_filename: str = "dataset_info.json", + verbose: bool = True, # silently ignored. TODO: remove it? + ): + warn_deprecation( + "Callback `HuggingFaceDatasetJSONSaver` is deprecated in favor of using" + " `HuggingFaceDatasetSaver` and passing `separate_dirs=True` as parameter." + ) + super().__init__( + hf_token=hf_token, + dataset_name=dataset_name, + organization=organization, + private=private, + info_filename=info_filename, + separate_dirs=True, + ) + + +class FlagMethod: + """ + Helper class that contains the flagging options and calls the flagging method. Also + provides visual feedback to the user when flag is clicked. + """ + + def __init__( + self, + flagging_callback: FlaggingCallback, + label: str, + value: str, + visual_feedback: bool = True, + ): + self.flagging_callback = flagging_callback + self.label = label + self.value = value + self.__name__ = "Flag" + self.visual_feedback = visual_feedback + + def __call__(self, request: gr.Request, *flag_data): + try: + self.flagging_callback.flag( + list(flag_data), flag_option=self.value, username=request.username + ) + except Exception as e: + print(f"Error while flagging: {e}") + if self.visual_feedback: + return "Error!" + if not self.visual_feedback: + return + time.sleep(0.8) # to provide enough time for the user to observe button change + return self.reset() + + def reset(self): + return gr.Button.update(value=self.label, interactive=True) diff --git a/gradio/helpers.py b/gradio/helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..188bd6059b0c48960a749ba6ec6275ecdb806187 --- /dev/null +++ b/gradio/helpers.py @@ -0,0 +1,1065 @@ +""" +Defines helper methods useful for loading and caching Interface examples. +""" +from __future__ import annotations + +import ast +import csv +import inspect +import os +import shutil +import subprocess +import tempfile +import threading +import warnings +from pathlib import Path +from typing import TYPE_CHECKING, Any, Callable, Iterable, Literal + +import matplotlib.pyplot as plt +import numpy as np +import PIL +import PIL.Image +from gradio_client import utils as client_utils +from gradio_client.documentation import document, set_documentation_group +from matplotlib import animation + +from gradio import components, processing_utils, routes, utils +from gradio.context import Context +from gradio.flagging import CSVLogger + +if TYPE_CHECKING: # Only import for type checking (to avoid circular imports). + from gradio.blocks import Block + from gradio.components import IOComponent + +CACHED_FOLDER = "gradio_cached_examples" +LOG_FILE = "log.csv" + +set_documentation_group("helpers") + + +def create_examples( + examples: list[Any] | list[list[Any]] | str, + inputs: IOComponent | list[IOComponent], + outputs: IOComponent | list[IOComponent] | None = None, + fn: Callable | None = None, + cache_examples: bool = False, + examples_per_page: int = 10, + _api_mode: bool = False, + label: str | None = None, + elem_id: str | None = None, + run_on_click: bool = False, + preprocess: bool = True, + postprocess: bool = True, + api_name: str | None | Literal[False] = False, + batch: bool = False, +): + """Top-level synchronous function that creates Examples. Provided for backwards compatibility, i.e. so that gr.Examples(...) can be used to create the Examples component.""" + examples_obj = Examples( + examples=examples, + inputs=inputs, + outputs=outputs, + fn=fn, + cache_examples=cache_examples, + examples_per_page=examples_per_page, + _api_mode=_api_mode, + label=label, + elem_id=elem_id, + run_on_click=run_on_click, + preprocess=preprocess, + postprocess=postprocess, + api_name=api_name, + batch=batch, + _initiated_directly=False, + ) + client_utils.synchronize_async(examples_obj.create) + return examples_obj + + +@document() +class Examples: + """ + This class is a wrapper over the Dataset component and can be used to create Examples + for Blocks / Interfaces. Populates the Dataset component with examples and + assigns event listener so that clicking on an example populates the input/output + components. Optionally handles example caching for fast inference. + + Demos: blocks_inputs, fake_gan + Guides: more-on-examples-and-flagging, using-hugging-face-integrations, image-classification-in-pytorch, image-classification-in-tensorflow, image-classification-with-vision-transformers, create-your-own-friends-with-a-gan + """ + + def __init__( + self, + examples: list[Any] | list[list[Any]] | str, + inputs: IOComponent | list[IOComponent], + outputs: IOComponent | list[IOComponent] | None = None, + fn: Callable | None = None, + cache_examples: bool = False, + examples_per_page: int = 10, + _api_mode: bool = False, + label: str | None = "Examples", + elem_id: str | None = None, + run_on_click: bool = False, + preprocess: bool = True, + postprocess: bool = True, + api_name: str | None | Literal[False] = False, + batch: bool = False, + _initiated_directly: bool = True, + ): + """ + Parameters: + examples: example inputs that can be clicked to populate specific components. Should be nested list, in which the outer list consists of samples and each inner list consists of an input corresponding to each input component. A string path to a directory of examples can also be provided but it should be within the directory with the python file running the gradio app. If there are multiple input components and a directory is provided, a log.csv file must be present in the directory to link corresponding inputs. + inputs: the component or list of components corresponding to the examples + outputs: optionally, provide the component or list of components corresponding to the output of the examples. Required if `cache` is True. + fn: optionally, provide the function to run to generate the outputs corresponding to the examples. Required if `cache` is True. + cache_examples: if True, caches examples for fast runtime. If True, then `fn` and `outputs` must be provided. If `fn` is a generator function, then the last yielded value will be used as the output. + examples_per_page: how many examples to show per page. + label: the label to use for the examples component (by default, "Examples") + elem_id: an optional string that is assigned as the id of this component in the HTML DOM. + run_on_click: if cache_examples is False, clicking on an example does not run the function when an example is clicked. Set this to True to run the function when an example is clicked. Has no effect if cache_examples is True. + preprocess: if True, preprocesses the example input before running the prediction function and caching the output. Only applies if cache_examples is True. + postprocess: if True, postprocesses the example output after running the prediction function and before caching. Only applies if cache_examples is True. + api_name: Defines how the event associated with clicking on the examples appears in the API docs. Can be a string, None, or False. If False (default), the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name. + batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. Used only if cache_examples is True. + """ + if _initiated_directly: + warnings.warn( + "Please use gr.Examples(...) instead of gr.examples.Examples(...) to create the Examples.", + ) + + if cache_examples and (fn is None or outputs is None): + raise ValueError("If caching examples, `fn` and `outputs` must be provided") + + if not isinstance(inputs, list): + inputs = [inputs] + if outputs and not isinstance(outputs, list): + outputs = [outputs] + + working_directory = Path().absolute() + + if examples is None: + raise ValueError("The parameter `examples` cannot be None") + elif isinstance(examples, list) and ( + len(examples) == 0 or isinstance(examples[0], list) + ): + pass + elif ( + isinstance(examples, list) and len(inputs) == 1 + ): # If there is only one input component, examples can be provided as a regular list instead of a list of lists + examples = [[e] for e in examples] + elif isinstance(examples, str): + if not Path(examples).exists(): + raise FileNotFoundError( + f"Could not find examples directory: {examples}" + ) + working_directory = examples + if not (Path(examples) / LOG_FILE).exists(): + if len(inputs) == 1: + examples = [[e] for e in os.listdir(examples)] + else: + raise FileNotFoundError( + "Could not find log file (required for multiple inputs): " + + LOG_FILE + ) + else: + with open(Path(examples) / LOG_FILE) as logs: + examples = list(csv.reader(logs)) + examples = [ + examples[i][: len(inputs)] for i in range(1, len(examples)) + ] # remove header and unnecessary columns + + else: + raise ValueError( + "The parameter `examples` must either be a string directory or a list" + "(if there is only 1 input component) or (more generally), a nested " + "list, where each sublist represents a set of inputs." + ) + + input_has_examples = [False] * len(inputs) + for example in examples: + for idx, example_for_input in enumerate(example): + if example_for_input is not None: + try: + input_has_examples[idx] = True + except IndexError: + pass # If there are more example components than inputs, ignore. This can sometimes be intentional (e.g. loading from a log file where outputs and timestamps are also logged) + + inputs_with_examples = [ + inp for (inp, keep) in zip(inputs, input_has_examples) if keep + ] + non_none_examples = [ + [ex for (ex, keep) in zip(example, input_has_examples) if keep] + for example in examples + ] + + self.examples = examples + self.non_none_examples = non_none_examples + self.inputs = inputs + self.inputs_with_examples = inputs_with_examples + self.outputs = outputs or [] + self.fn = fn + self.cache_examples = cache_examples + self._api_mode = _api_mode + self.preprocess = preprocess + self.postprocess = postprocess + self.api_name = api_name + self.batch = batch + + with utils.set_directory(working_directory): + self.processed_examples = [ + [ + component.postprocess(sample) + for component, sample in zip(inputs, example) + ] + for example in examples + ] + self.non_none_processed_examples = [ + [ex for (ex, keep) in zip(example, input_has_examples) if keep] + for example in self.processed_examples + ] + if cache_examples: + for example in self.examples: + if len([ex for ex in example if ex is not None]) != len(self.inputs): + warnings.warn( + "Examples are being cached but not all input components have " + "example values. This may result in an exception being thrown by " + "your function. If you do get an error while caching examples, make " + "sure all of your inputs have example values for all of your examples " + "or you provide default values for those particular parameters in your function." + ) + break + + from gradio import components + + with utils.set_directory(working_directory): + self.dataset = components.Dataset( + components=inputs_with_examples, + samples=non_none_examples, + type="index", + label=label, + samples_per_page=examples_per_page, + elem_id=elem_id, + ) + + self.cached_folder = Path(CACHED_FOLDER) / str(self.dataset._id) + self.cached_file = Path(self.cached_folder) / "log.csv" + self.cache_examples = cache_examples + self.run_on_click = run_on_click + + async def create(self) -> None: + """Caches the examples if self.cache_examples is True and creates the Dataset + component to hold the examples""" + + async def load_example(example_id): + processed_example = self.non_none_processed_examples[example_id] + return utils.resolve_singleton(processed_example) + + if Context.root_block: + self.load_input_event = self.dataset.click( + load_example, + inputs=[self.dataset], + outputs=self.inputs_with_examples, # type: ignore + show_progress="hidden", + postprocess=False, + queue=False, + api_name=self.api_name, # type: ignore + ) + if self.run_on_click and not self.cache_examples: + if self.fn is None: + raise ValueError("Cannot run_on_click if no function is provided") + self.load_input_event.then( + self.fn, + inputs=self.inputs, # type: ignore + outputs=self.outputs, # type: ignore + ) + + if self.cache_examples: + await self.cache() + + async def cache(self) -> None: + """ + Caches all of the examples so that their predictions can be shown immediately. + """ + if Path(self.cached_file).exists(): + print( + f"Using cache from '{utils.abspath(self.cached_folder)}' directory. If method or examples have changed since last caching, delete this folder to clear cache.\n" + ) + else: + if Context.root_block is None: + raise ValueError("Cannot cache examples if not in a Blocks context") + + print(f"Caching examples at: '{utils.abspath(self.cached_folder)}'") + cache_logger = CSVLogger() + + if inspect.isgeneratorfunction(self.fn): + + def get_final_item(*args): # type: ignore + x = None + for x in self.fn(*args): # noqa: B007 # type: ignore + pass + return x + + fn = get_final_item + elif inspect.isasyncgenfunction(self.fn): + + async def get_final_item(*args): + x = None + async for x in self.fn(*args): # noqa: B007 # type: ignore + pass + return x + + fn = get_final_item + else: + fn = self.fn + # create a fake dependency to process the examples and get the predictions + dependency, fn_index = Context.root_block.set_event_trigger( + event_name="fake_event", + fn=fn, + inputs=self.inputs_with_examples, # type: ignore + outputs=self.outputs, # type: ignore + preprocess=self.preprocess and not self._api_mode, + postprocess=self.postprocess and not self._api_mode, + batch=self.batch, + ) + + assert self.outputs is not None + cache_logger.setup(self.outputs, self.cached_folder) + for example_id, _ in enumerate(self.examples): + print(f"Caching example {example_id + 1}/{len(self.examples)}") + processed_input = self.processed_examples[example_id] + if self.batch: + processed_input = [[value] for value in processed_input] + with utils.MatplotlibBackendMananger(): + prediction = await Context.root_block.process_api( + fn_index=fn_index, + inputs=processed_input, + request=None, + state={}, + ) + output = prediction["data"] + if self.batch: + output = [value[0] for value in output] + cache_logger.flag(output) + # Remove the "fake_event" to prevent bugs in loading interfaces from spaces + Context.root_block.dependencies.remove(dependency) + Context.root_block.fns.pop(fn_index) + + # Remove the original load_input_event and replace it with one that + # also populates the input. We do it this way to to allow the cache() + # method to be called independently of the create() method + index = Context.root_block.dependencies.index(self.load_input_event) + Context.root_block.dependencies.pop(index) + Context.root_block.fns.pop(index) + + async def load_example(example_id): + processed_example = self.non_none_processed_examples[ + example_id + ] + await self.load_from_cache(example_id) + return utils.resolve_singleton(processed_example) + + self.load_input_event = self.dataset.click( + load_example, + inputs=[self.dataset], + outputs=self.inputs_with_examples + self.outputs, # type: ignore + show_progress="hidden", + postprocess=False, + queue=False, + api_name=self.api_name, # type: ignore + ) + + print("Caching complete\n") + + async def load_from_cache(self, example_id: int) -> list[Any]: + """Loads a particular cached example for the interface. + Parameters: + example_id: The id of the example to process (zero-indexed). + """ + with open(self.cached_file, encoding="utf-8") as cache: + examples = list(csv.reader(cache)) + example = examples[example_id + 1] # +1 to adjust for header + output = [] + assert self.outputs is not None + for component, value in zip(self.outputs, example): + value_to_use = value + try: + value_as_dict = ast.literal_eval(value) + # File components that output multiple files get saved as a python list + # need to pass the parsed list to serialize + # TODO: Better file serialization in 4.0 + if isinstance(value_as_dict, list) and isinstance( + component, components.File + ): + value_to_use = value_as_dict + assert utils.is_update(value_as_dict) + output.append(value_as_dict) + except (ValueError, TypeError, SyntaxError, AssertionError): + output.append( + component.serialize( + value_to_use, + self.cached_folder, + ) + ) + return output + + +class TrackedIterable: + def __init__( + self, + iterable: Iterable | None, + index: int | None, + length: int | None, + desc: str | None, + unit: str | None, + _tqdm=None, + progress: float | None = None, + ) -> None: + self.iterable = iterable + self.index = index + self.length = length + self.desc = desc + self.unit = unit + self._tqdm = _tqdm + self.progress = progress + + +@document("__call__", "tqdm") +class Progress(Iterable): + """ + The Progress class provides a custom progress tracker that is used in a function signature. + To attach a Progress tracker to a function, simply add a parameter right after the input parameters that has a default value set to a `gradio.Progress()` instance. + The Progress tracker can then be updated in the function by calling the Progress object or using the `tqdm` method on an Iterable. + The Progress tracker is currently only available with `queue()`. + Example: + import gradio as gr + import time + def my_function(x, progress=gr.Progress()): + progress(0, desc="Starting...") + time.sleep(1) + for i in progress.tqdm(range(100)): + time.sleep(0.1) + return x + gr.Interface(my_function, gr.Textbox(), gr.Textbox()).queue().launch() + Demos: progress + """ + + def __init__( + self, + track_tqdm: bool = False, + _callback: Callable | None = None, # for internal use only + _event_id: str | None = None, + ): + """ + Parameters: + track_tqdm: If True, the Progress object will track any tqdm.tqdm iterations with the tqdm library in the function. + """ + self.track_tqdm = track_tqdm + self._callback = _callback + self._event_id = _event_id + self.iterables: list[TrackedIterable] = [] + + def __len__(self): + return self.iterables[-1].length + + def __iter__(self): + return self + + def __next__(self): + """ + Updates progress tracker with next item in iterable. + """ + if self._callback: + current_iterable = self.iterables[-1] + while ( + not hasattr(current_iterable.iterable, "__next__") + and len(self.iterables) > 0 + ): + current_iterable = self.iterables.pop() + self._callback( + event_id=self._event_id, + iterables=self.iterables, + ) + assert current_iterable.index is not None, "Index not set." + current_iterable.index += 1 + try: + return next(current_iterable.iterable) # type: ignore + except StopIteration: + self.iterables.pop() + raise + else: + return self + + def __call__( + self, + progress: float | tuple[int, int | None] | None, + desc: str | None = None, + total: int | None = None, + unit: str = "steps", + _tqdm=None, + ): + """ + Updates progress tracker with progress and message text. + Parameters: + progress: If float, should be between 0 and 1 representing completion. If Tuple, first number represents steps completed, and second value represents total steps or None if unknown. If None, hides progress bar. + desc: description to display. + total: estimated total number of steps. + unit: unit of iterations. + """ + if self._callback: + if isinstance(progress, tuple): + index, total = progress + progress = None + else: + index = None + self._callback( + event_id=self._event_id, + iterables=self.iterables + + [TrackedIterable(None, index, total, desc, unit, _tqdm, progress)], + ) + else: + return progress + + def tqdm( + self, + iterable: Iterable | None, + desc: str | None = None, + total: int | None = None, + unit: str = "steps", + _tqdm=None, + ): + """ + Attaches progress tracker to iterable, like tqdm. + Parameters: + iterable: iterable to attach progress tracker to. + desc: description to display. + total: estimated total number of steps. + unit: unit of iterations. + """ + if self._callback: + if iterable is None: + new_iterable = TrackedIterable(None, 0, total, desc, unit, _tqdm) + self.iterables.append(new_iterable) + self._callback(event_id=self._event_id, iterables=self.iterables) + return self + length = len(iterable) if hasattr(iterable, "__len__") else None # type: ignore + self.iterables.append( + TrackedIterable(iter(iterable), 0, length, desc, unit, _tqdm) + ) + return self + + def update(self, n=1): + """ + Increases latest iterable with specified number of steps. + Parameters: + n: number of steps completed. + """ + if self._callback and len(self.iterables) > 0: + current_iterable = self.iterables[-1] + assert current_iterable.index is not None, "Index not set." + current_iterable.index += n + self._callback( + event_id=self._event_id, + iterables=self.iterables, + ) + else: + return + + def close(self, _tqdm): + """ + Removes iterable with given _tqdm. + """ + if self._callback: + for i in range(len(self.iterables)): + if id(self.iterables[i]._tqdm) == id(_tqdm): + self.iterables.pop(i) + break + self._callback( + event_id=self._event_id, + iterables=self.iterables, + ) + else: + return + + +def create_tracker(root_blocks, event_id, fn, track_tqdm): + progress = Progress(_callback=root_blocks._queue.set_progress, _event_id=event_id) + if not track_tqdm: + return progress, fn + + try: + _tqdm = __import__("tqdm") + except ModuleNotFoundError: + return progress, fn + if not hasattr(root_blocks, "_progress_tracker_per_thread"): + root_blocks._progress_tracker_per_thread = {} + + def init_tqdm( + self, iterable=None, desc=None, total=None, unit="steps", *args, **kwargs + ): + self._progress = root_blocks._progress_tracker_per_thread.get( + threading.get_ident() + ) + if self._progress is not None: + self._progress.event_id = event_id + self._progress.tqdm(iterable, desc, total, unit, _tqdm=self) + kwargs["file"] = open(os.devnull, "w") # noqa: SIM115 + self.__init__orig__(iterable, desc, total, *args, unit=unit, **kwargs) + + def iter_tqdm(self): + if self._progress is not None: + return self._progress + else: + return self.__iter__orig__() + + def update_tqdm(self, n=1): + if self._progress is not None: + self._progress.update(n) + return self.__update__orig__(n) + + def close_tqdm(self): + if self._progress is not None: + self._progress.close(self) + return self.__close__orig__() + + def exit_tqdm(self, exc_type, exc_value, traceback): + if self._progress is not None: + self._progress.close(self) + return self.__exit__orig__(exc_type, exc_value, traceback) + + if not hasattr(_tqdm.tqdm, "__init__orig__"): + _tqdm.tqdm.__init__orig__ = _tqdm.tqdm.__init__ + _tqdm.tqdm.__init__ = init_tqdm + if not hasattr(_tqdm.tqdm, "__update__orig__"): + _tqdm.tqdm.__update__orig__ = _tqdm.tqdm.update + _tqdm.tqdm.update = update_tqdm + if not hasattr(_tqdm.tqdm, "__close__orig__"): + _tqdm.tqdm.__close__orig__ = _tqdm.tqdm.close + _tqdm.tqdm.close = close_tqdm + if not hasattr(_tqdm.tqdm, "__exit__orig__"): + _tqdm.tqdm.__exit__orig__ = _tqdm.tqdm.__exit__ + _tqdm.tqdm.__exit__ = exit_tqdm + if not hasattr(_tqdm.tqdm, "__iter__orig__"): + _tqdm.tqdm.__iter__orig__ = _tqdm.tqdm.__iter__ + _tqdm.tqdm.__iter__ = iter_tqdm + if hasattr(_tqdm, "auto") and hasattr(_tqdm.auto, "tqdm"): + _tqdm.auto.tqdm = _tqdm.tqdm + + def before_fn(): + thread_id = threading.get_ident() + root_blocks._progress_tracker_per_thread[thread_id] = progress + + def after_fn(): + thread_id = threading.get_ident() + del root_blocks._progress_tracker_per_thread[thread_id] + + tracked_fn = utils.function_wrapper(fn, before_fn=before_fn, after_fn=after_fn) + + return progress, tracked_fn + + +def special_args( + fn: Callable, + inputs: list[Any] | None = None, + request: routes.Request | None = None, + event_data: EventData | None = None, +): + """ + Checks if function has special arguments Request or EventData (via annotation) or Progress (via default value). + If inputs is provided, these values will be loaded into the inputs array. + Parameters: + fn: function to check. + inputs: array to load special arguments into. + request: request to load into inputs. + event_data: event-related data to load into inputs. + Returns: + updated inputs, progress index, event data index. + """ + signature = inspect.signature(fn) + type_hints = utils.get_type_hints(fn) + positional_args = [] + for param in signature.parameters.values(): + if param.kind not in (param.POSITIONAL_ONLY, param.POSITIONAL_OR_KEYWORD): + break + positional_args.append(param) + progress_index = None + event_data_index = None + for i, param in enumerate(positional_args): + type_hint = type_hints.get(param.name) + if isinstance(param.default, Progress): + progress_index = i + if inputs is not None: + inputs.insert(i, param.default) + elif type_hint == routes.Request: + if inputs is not None: + inputs.insert(i, request) + elif ( + type_hint + and inspect.isclass(type_hint) + and issubclass(type_hint, EventData) + ): + event_data_index = i + if inputs is not None and event_data is not None: + inputs.insert(i, type_hint(event_data.target, event_data._data)) + elif ( + param.default is not param.empty and inputs is not None and len(inputs) <= i + ): + inputs.insert(i, param.default) + if inputs is not None: + while len(inputs) < len(positional_args): + i = len(inputs) + param = positional_args[i] + if param.default == param.empty: + warnings.warn("Unexpected argument. Filling with None.") + inputs.append(None) + else: + inputs.append(param.default) + return inputs or [], progress_index, event_data_index + + +@document() +def update(**kwargs) -> dict: + """ + Updates component properties. When a function passed into a Gradio Interface or a Blocks events returns a typical value, it updates the value of the output component. But it is also possible to update the properties of an output component (such as the number of lines of a `Textbox` or the visibility of an `Image`) by returning the component's `update()` function, which takes as parameters any of the constructor parameters for that component. + This is a shorthand for using the update method on a component. + For example, rather than using gr.Number.update(...) you can just use gr.update(...). + Note that your editor's autocompletion will suggest proper parameters + if you use the update method on the component. + Demos: blocks_essay, blocks_update, blocks_essay_update + + Parameters: + kwargs: Key-word arguments used to update the component's properties. + Example: + # Blocks Example + import gradio as gr + with gr.Blocks() as demo: + radio = gr.Radio([1, 2, 4], label="Set the value of the number") + number = gr.Number(value=2, interactive=True) + radio.change(fn=lambda value: gr.update(value=value), inputs=radio, outputs=number) + demo.launch() + + # Interface example + import gradio as gr + def change_textbox(choice): + if choice == "short": + return gr.Textbox.update(lines=2, visible=True) + elif choice == "long": + return gr.Textbox.update(lines=8, visible=True) + else: + return gr.Textbox.update(visible=False) + gr.Interface( + change_textbox, + gr.Radio( + ["short", "long", "none"], label="What kind of essay would you like to write?" + ), + gr.Textbox(lines=2), + live=True, + ).launch() + """ + kwargs["__type__"] = "generic_update" + return kwargs + + +def skip() -> dict: + return update() + + +@document() +def make_waveform( + audio: str | tuple[int, np.ndarray], + *, + bg_color: str = "#f3f4f6", + bg_image: str | None = None, + fg_alpha: float = 0.75, + bars_color: str | tuple[str, str] = ("#fbbf24", "#ea580c"), + bar_count: int = 50, + bar_width: float = 0.6, + animate: bool = False, +) -> str: + """ + Generates a waveform video from an audio file. Useful for creating an easy to share audio visualization. The output should be passed into a `gr.Video` component. + Parameters: + audio: Audio file path or tuple of (sample_rate, audio_data) + bg_color: Background color of waveform (ignored if bg_image is provided) + bg_image: Background image of waveform + fg_alpha: Opacity of foreground waveform + bars_color: Color of waveform bars. Can be a single color or a tuple of (start_color, end_color) of gradient + bar_count: Number of bars in waveform + bar_width: Width of bars in waveform. 1 represents full width, 0.5 represents half width, etc. + animate: If true, the audio waveform overlay will be animated, if false, it will be static. + Returns: + A filepath to the output video in mp4 format. + """ + if isinstance(audio, str): + audio_file = audio + audio = processing_utils.audio_from_file(audio) + else: + tmp_wav = tempfile.NamedTemporaryFile(suffix=".wav", delete=False) + processing_utils.audio_to_file(audio[0], audio[1], tmp_wav.name, format="wav") + audio_file = tmp_wav.name + + if not os.path.isfile(audio_file): + raise ValueError("Audio file not found.") + + ffmpeg = shutil.which("ffmpeg") + if not ffmpeg: + raise RuntimeError("ffmpeg not found.") + + duration = round(len(audio[1]) / audio[0], 4) + + # Helper methods to create waveform + def hex_to_rgb(hex_str): + return [int(hex_str[i : i + 2], 16) for i in range(1, 6, 2)] + + def get_color_gradient(c1, c2, n): + assert n > 1 + c1_rgb = np.array(hex_to_rgb(c1)) / 255 + c2_rgb = np.array(hex_to_rgb(c2)) / 255 + mix_pcts = [x / (n - 1) for x in range(n)] + rgb_colors = [((1 - mix) * c1_rgb + (mix * c2_rgb)) for mix in mix_pcts] + return [ + "#" + "".join(f"{int(round(val * 255)):02x}" for val in item) + for item in rgb_colors + ] + + # Reshape audio to have a fixed number of bars + samples = audio[1] + if len(samples.shape) > 1: + samples = np.mean(samples, 1) + bins_to_pad = bar_count - (len(samples) % bar_count) + samples = np.pad(samples, [(0, bins_to_pad)]) + samples = np.reshape(samples, (bar_count, -1)) + samples = np.abs(samples) + samples = np.max(samples, 1) + + with utils.MatplotlibBackendMananger(): + plt.clf() + # Plot waveform + color = ( + bars_color + if isinstance(bars_color, str) + else get_color_gradient(bars_color[0], bars_color[1], bar_count) + ) + + if animate: + fig = plt.figure(figsize=(5, 1), dpi=200, frameon=False) + fig.subplots_adjust(left=0, bottom=0, right=1, top=1) + plt.axis("off") + plt.margins(x=0) + + bar_alpha = fg_alpha if animate else 1.0 + barcollection = plt.bar( + np.arange(0, bar_count), + samples * 2, + bottom=(-1 * samples), + width=bar_width, + color=color, + alpha=bar_alpha, + ) + + tmp_img = tempfile.NamedTemporaryFile(suffix=".png", delete=False) + + savefig_kwargs: dict[str, Any] = {"bbox_inches": "tight"} + if bg_image is not None: + savefig_kwargs["transparent"] = True + if animate: + savefig_kwargs["facecolor"] = "none" + else: + savefig_kwargs["facecolor"] = bg_color + plt.savefig(tmp_img.name, **savefig_kwargs) + + if not animate: + waveform_img = PIL.Image.open(tmp_img.name) + waveform_img = waveform_img.resize((1000, 200)) + + # Composite waveform with background image + if bg_image is not None: + waveform_array = np.array(waveform_img) + waveform_array[:, :, 3] = waveform_array[:, :, 3] * fg_alpha + waveform_img = PIL.Image.fromarray(waveform_array) + + bg_img = PIL.Image.open(bg_image) + waveform_width, waveform_height = waveform_img.size + bg_width, bg_height = bg_img.size + if waveform_width != bg_width: + bg_img = bg_img.resize( + ( + waveform_width, + 2 * int(bg_height * waveform_width / bg_width / 2), + ) + ) + bg_width, bg_height = bg_img.size + composite_height = max(bg_height, waveform_height) + composite = PIL.Image.new( + "RGBA", (waveform_width, composite_height), "#FFFFFF" + ) + composite.paste(bg_img, (0, composite_height - bg_height)) + composite.paste( + waveform_img, (0, composite_height - waveform_height), waveform_img + ) + composite.save(tmp_img.name) + img_width, img_height = composite.size + else: + img_width, img_height = waveform_img.size + waveform_img.save(tmp_img.name) + else: + + def _animate(_): + for idx, b in enumerate(barcollection): + rand_height = np.random.uniform(0.8, 1.2) + b.set_height(samples[idx] * rand_height * 2) + b.set_y((-rand_height * samples)[idx]) + + frames = int(duration * 10) + anim = animation.FuncAnimation( + fig, # type: ignore + _animate, + repeat=False, + blit=False, + frames=frames, + interval=100, + ) + anim.save( + tmp_img.name, + writer="pillow", + fps=10, + codec="png", + savefig_kwargs=savefig_kwargs, + ) + + # Convert waveform to video with ffmpeg + output_mp4 = tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) + + if animate and bg_image is not None: + ffmpeg_cmd = [ + ffmpeg, + "-loop", + "1", + "-i", + bg_image, + "-i", + tmp_img.name, + "-i", + audio_file, + "-filter_complex", + "[0:v]scale=w=trunc(iw/2)*2:h=trunc(ih/2)*2[bg];[1:v]format=rgba,colorchannelmixer=aa=1.0[ov];[bg][ov]overlay=(main_w-overlay_w*0.9)/2:main_h-overlay_h*0.9/2[output]", + "-t", + str(duration), + "-map", + "[output]", + "-map", + "2:a", + "-c:v", + "libx264", + "-c:a", + "aac", + "-shortest", + "-y", + output_mp4.name, + ] + elif animate and bg_image is None: + ffmpeg_cmd = [ + ffmpeg, + "-i", + tmp_img.name, + "-i", + audio_file, + "-filter_complex", + "[0:v][1:a]concat=n=1:v=1:a=1[v][a]", + "-map", + "[v]", + "-map", + "[a]", + "-c:v", + "libx264", + "-c:a", + "aac", + "-shortest", + "-y", + output_mp4.name, + ] + else: + ffmpeg_cmd = [ + ffmpeg, + "-loop", + "1", + "-i", + tmp_img.name, + "-i", + audio_file, + "-vf", + f"color=c=#FFFFFF77:s={img_width}x{img_height}[bar];[0][bar]overlay=-w+(w/{duration})*t:H-h:shortest=1", # type: ignore + "-t", + str(duration), + "-y", + output_mp4.name, + ] + + subprocess.check_call(ffmpeg_cmd) + return output_mp4.name + + +@document() +class EventData: + """ + When a subclass of EventData is added as a type hint to an argument of an event listener method, this object will be passed as that argument. + It contains information about the event that triggered the listener, such the target object, and other data related to the specific event that are attributes of the subclass. + + Example: + table = gr.Dataframe([[1, 2, 3], [4, 5, 6]]) + gallery = gr.Gallery([("cat.jpg", "Cat"), ("dog.jpg", "Dog")]) + textbox = gr.Textbox("Hello World!") + + statement = gr.Textbox() + + def on_select(evt: gr.SelectData): # SelectData is a subclass of EventData + return f"You selected {evt.value} at {evt.index} from {evt.target}" + + table.select(on_select, None, statement) + gallery.select(on_select, None, statement) + textbox.select(on_select, None, statement) + Demos: gallery_selections, tictactoe + """ + + def __init__(self, target: Block | None, _data: Any): + """ + Parameters: + target: The target object that triggered the event. Can be used to distinguish if multiple components are bound to the same listener. + """ + self.target = target + self._data = _data + + +def log_message(message: str, level: Literal["info", "warning"] = "info"): + from gradio import context + + if not hasattr(context.thread_data, "blocks"): # Function called outside of Gradio + if level == "info": + print(message) + elif level == "warning": + warnings.warn(message) + return + if not context.thread_data.blocks.enable_queue: + warnings.warn( + f"Queueing must be enabled to issue {level.capitalize()}: '{message}'." + ) + return + context.thread_data.blocks._queue.log_message( + event_id=context.thread_data.event_id, log=message, level=level + ) + + +@document() +def Warning(message: str = "Warning issued."): # noqa: N802 + """ + This function allows you to pass custom warning messages to the user. You can do so simply with `gr.Warning('message here')`, and when that line is executed the custom message will appear in a modal on the demo. + Parameters: + message: The warning message to be displayed to the user. + """ + log_message(message, level="warning") + + +@document() +def Info(message: str = "Info issued."): # noqa: N802 + """ + Parameters: + message: The info message to be displayed to the user. + """ + log_message(message, level="info") diff --git a/gradio/inputs.py b/gradio/inputs.py new file mode 100644 index 0000000000000000000000000000000000000000..9345530649a0b8843c27d7a0f965ac73bfcce7d6 --- /dev/null +++ b/gradio/inputs.py @@ -0,0 +1,451 @@ +# type: ignore +""" +This module defines various classes that can serve as the `input` to an interface. Each class must inherit from +`InputComponent`, and each class must define a path to its template. All of the subclasses of `InputComponent` are +automatically added to a registry, which allows them to be easily referenced in other parts of the code. +""" + +from __future__ import annotations + +from typing import Any, Optional + +from gradio import components +from gradio.deprecation import warn_deprecation + + +def warn_inputs_deprecation(): + warn_deprecation( + "Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components", + ) + + +class Textbox(components.Textbox): + def __init__( + self, + lines: int = 1, + placeholder: Optional[str] = None, + default: str = "", + numeric: Optional[bool] = False, + type: Optional[str] = "text", + label: Optional[str] = None, + optional: bool = False, + ): + warn_inputs_deprecation() + super().__init__( + value=default, + lines=lines, + placeholder=placeholder, + label=label, + numeric=numeric, + type=type, + optional=optional, + ) + + +class Number(components.Number): + """ + Component creates a field for user to enter numeric input. Provides a number as an argument to the wrapped function. + Input type: float + """ + + def __init__( + self, + default: Optional[float] = None, + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + default (float): default value. + label (str): component name in interface. + optional (bool): If True, the interface can be submitted with no value for this component. + """ + warn_inputs_deprecation() + super().__init__(value=default, label=label, optional=optional) + + +class Slider(components.Slider): + """ + Component creates a slider that ranges from `minimum` to `maximum`. Provides number as an argument to the wrapped function. + Input type: float + """ + + def __init__( + self, + minimum: float = 0, + maximum: float = 100, + step: Optional[float] = None, + default: Optional[float] = None, + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + minimum (float): minimum value for slider. + maximum (float): maximum value for slider. + step (float): increment between slider values. + default (float): default value. + label (str): component name in interface. + optional (bool): this parameter is ignored. + """ + warn_inputs_deprecation() + + super().__init__( + value=default, + minimum=minimum, + maximum=maximum, + step=step, + label=label, + optional=optional, + ) + + +class Checkbox(components.Checkbox): + """ + Component creates a checkbox that can be set to `True` or `False`. Provides a boolean as an argument to the wrapped function. + Input type: bool + """ + + def __init__( + self, + default: bool = False, + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + label (str): component name in interface. + default (bool): if True, checked by default. + optional (bool): this parameter is ignored. + """ + warn_inputs_deprecation() + super().__init__(value=default, label=label, optional=optional) + + +class CheckboxGroup(components.CheckboxGroup): + """ + Component creates a set of checkboxes of which a subset can be selected. Provides a list of strings representing the selected choices as an argument to the wrapped function. + Input type: Union[List[str], List[int]] + """ + + def __init__( + self, + choices: list[str], + default: list[str] | None = None, + type: str = "value", + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + choices (List[str]): list of options to select from. + default (List[str]): default selected list of options. + type (str): Type of value to be returned by component. "value" returns the list of strings of the choices selected, "index" returns the list of indices of the choices selected. + label (str): component name in interface. + optional (bool): this parameter is ignored. + """ + if default is None: + default = [] + warn_inputs_deprecation() + super().__init__( + value=default, + choices=choices, + type=type, + label=label, + optional=optional, + ) + + +class Radio(components.Radio): + """ + Component creates a set of radio buttons of which only one can be selected. Provides string representing selected choice as an argument to the wrapped function. + Input type: Union[str, int] + """ + + def __init__( + self, + choices: list[str], + type: str = "value", + default: Optional[str] = None, + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + choices (List[str]): list of options to select from. + type (str): Type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected. + default (str): the button selected by default. If None, no button is selected by default. + label (str): component name in interface. + optional (bool): this parameter is ignored. + """ + warn_inputs_deprecation() + super().__init__( + choices=choices, + type=type, + value=default, + label=label, + optional=optional, + ) + + +class Dropdown(components.Dropdown): + """ + Component creates a dropdown of which only one can be selected. Provides string representing selected choice as an argument to the wrapped function. + Input type: Union[str, int] + """ + + def __init__( + self, + choices: list[str], + type: str = "value", + default: Optional[str] = None, + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + choices (List[str]): list of options to select from. + type (str): Type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected. + default (str): default value selected in dropdown. If None, no value is selected by default. + label (str): component name in interface. + optional (bool): this parameter is ignored. + """ + warn_inputs_deprecation() + super().__init__( + choices=choices, + type=type, + value=default, + label=label, + optional=optional, + ) + + +class Image(components.Image): + """ + Component creates an image upload box with editing capabilities. + Input type: Union[numpy.array, PIL.Image, file-object] + """ + + def __init__( + self, + shape: tuple[int, int] = None, + image_mode: str = "RGB", + invert_colors: bool = False, + source: str = "upload", + tool: str = "editor", + type: str = "numpy", + label: str = None, + optional: bool = False, + ): + """ + Parameters: + shape (Tuple[int, int]): (width, height) shape to crop and resize image to; if None, matches input image size. + image_mode (str): How to process the uploaded image. Accepts any of the PIL image modes, e.g. "RGB" for color images, "RGBA" to include the transparency mask, "L" for black-and-white images. + invert_colors (bool): whether to invert the image as a preprocessing step. + source (str): Source of image. "upload" creates a box where user can drop an image file, "webcam" allows user to take snapshot from their webcam, "canvas" defaults to a white image that can be edited and drawn upon with tools. + tool (str): Tools used for editing. "editor" allows a full screen editor, "select" provides a cropping and zoom tool. + type (str): Type of value to be returned by component. "numpy" returns a numpy array with shape (height, width, 3) and values from 0 to 255, "pil" returns a PIL image object, "file" returns a temporary file object whose path can be retrieved by file_obj.name, "filepath" returns the path directly. + label (str): component name in interface. + optional (bool): If True, the interface can be submitted with no uploaded image, in which case the input value is None. + """ + warn_inputs_deprecation() + super().__init__( + shape=shape, + image_mode=image_mode, + invert_colors=invert_colors, + source=source, + tool=tool, + type=type, + label=label, + optional=optional, + ) + + +class Video(components.Video): + """ + Component creates a video file upload that is converted to a file path. + + Input type: filepath + """ + + def __init__( + self, + type: Optional[str] = None, + source: str = "upload", + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + type (str): Type of video format to be returned by component, such as 'avi' or 'mp4'. If set to None, video will keep uploaded format. + source (str): Source of video. "upload" creates a box where user can drop an video file, "webcam" allows user to record a video from their webcam. + label (str): component name in interface. + optional (bool): If True, the interface can be submitted with no uploaded video, in which case the input value is None. + """ + warn_inputs_deprecation() + super().__init__(format=type, source=source, label=label, optional=optional) + + +class Audio(components.Audio): + """ + Component accepts audio input files. + Input type: Union[Tuple[int, numpy.array], file-object, numpy.array] + """ + + def __init__( + self, + source: str = "upload", + type: str = "numpy", + label: str = None, + optional: bool = False, + ): + """ + Parameters: + source (str): Source of audio. "upload" creates a box where user can drop an audio file, "microphone" creates a microphone input. + type (str): Type of value to be returned by component. "numpy" returns a 2-set tuple with an integer sample_rate and the data numpy.array of shape (samples, 2), "file" returns a temporary file object whose path can be retrieved by file_obj.name, "filepath" returns the path directly. + label (str): component name in interface. + optional (bool): If True, the interface can be submitted with no uploaded audio, in which case the input value is None. + """ + warn_inputs_deprecation() + super().__init__(source=source, type=type, label=label, optional=optional) + + +class File(components.File): + """ + Component accepts generic file uploads. + Input type: Union[file-object, bytes, List[Union[file-object, bytes]]] + """ + + def __init__( + self, + file_count: str = "single", + type: str = "file", + label: Optional[str] = None, + keep_filename: bool = True, + optional: bool = False, + ): + """ + Parameters: + file_count (str): if single, allows user to upload one file. If "multiple", user uploads multiple files. If "directory", user uploads all files in selected directory. Return type will be list for each file in case of "multiple" or "directory". + type (str): Type of value to be returned by component. "file" returns a temporary file object whose path can be retrieved by file_obj.name, "binary" returns an bytes object. + label (str): component name in interface. + keep_filename (bool): DEPRECATED. Original filename always kept. + optional (bool): If True, the interface can be submitted with no uploaded image, in which case the input value is None. + """ + warn_inputs_deprecation() + super().__init__( + file_count=file_count, + type=type, + label=label, + keep_filename=keep_filename, + optional=optional, + ) + + +class Dataframe(components.Dataframe): + """ + Component accepts 2D input through a spreadsheet interface. + Input type: Union[pandas.DataFrame, numpy.array, List[Union[str, float]], List[List[Union[str, float]]]] + """ + + def __init__( + self, + headers: Optional[list[str]] = None, + row_count: int = 3, + col_count: Optional[int] = 3, + datatype: str | list[str] = "str", + col_width: int | list[int] = None, + default: Optional[list[list[Any]]] = None, + type: str = "pandas", + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + headers (List[str]): Header names to dataframe. If None, no headers are shown. + row_count (int): Limit number of rows for input. + col_count (int): Limit number of columns for input. If equal to 1, return data will be one-dimensional. Ignored if `headers` is provided. + datatype (Union[str, List[str]]): Datatype of values in sheet. Can be provided per column as a list of strings, or for the entire sheet as a single string. Valid datatypes are "str", "number", "bool", and "date". + col_width (Union[int, List[int]]): Width of columns in pixels. Can be provided as single value or list of values per column. + default (List[List[Any]]): Default value + type (str): Type of value to be returned by component. "pandas" for pandas dataframe, "numpy" for numpy array, or "array" for a Python array. + label (str): component name in interface. + optional (bool): this parameter is ignored. + """ + warn_inputs_deprecation() + super().__init__( + value=default, + headers=headers, + row_count=row_count, + col_count=col_count, + datatype=datatype, + col_width=col_width, + type=type, + label=label, + optional=optional, + ) + + +class Timeseries(components.Timeseries): + """ + Component accepts pandas.DataFrame uploaded as a timeseries csv file. + Input type: pandas.DataFrame + """ + + def __init__( + self, + x: Optional[str] = None, + y: str | list[str] = None, + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + x (str): Column name of x (time) series. None if csv has no headers, in which case first column is x series. + y (Union[str, List[str]]): Column name of y series, or list of column names if multiple series. None if csv has no headers, in which case every column after first is a y series. + label (str): component name in interface. + optional (bool): If True, the interface can be submitted with no uploaded csv file, in which case the input value is None. + """ + warn_inputs_deprecation() + super().__init__(x=x, y=y, label=label, optional=optional) + + +class State(components.State): + """ + Special hidden component that stores state across runs of the interface. + Input type: Any + """ + + def __init__( + self, + label: str = None, + default: Any = None, + ): + """ + Parameters: + label (str): component name in interface (not used). + default (Any): the initial value of the state. + optional (bool): this parameter is ignored. + """ + warn_inputs_deprecation() + super().__init__(value=default, label=label) + + +class Image3D(components.Model3D): + """ + Used for 3D image model output. + Input type: File object of type (.obj, glb, or .gltf) + """ + + def __init__( + self, + label: Optional[str] = None, + optional: bool = False, + ): + """ + Parameters: + label (str): component name in interface. + optional (bool): If True, the interface can be submitted with no uploaded image, in which case the input value is None. + """ + warn_inputs_deprecation() + super().__init__(label=label, optional=optional) diff --git a/gradio/interface.py b/gradio/interface.py new file mode 100644 index 0000000000000000000000000000000000000000..211206c33ed8d75f6cefe6d45049f130b76dbeba --- /dev/null +++ b/gradio/interface.py @@ -0,0 +1,923 @@ +""" +This file defines two useful high-level abstractions to build Gradio apps: Interface and TabbedInterface. +""" + +from __future__ import annotations + +import inspect +import json +import os +import warnings +import weakref +from typing import TYPE_CHECKING, Any, Callable + +from gradio_client.documentation import document, set_documentation_group + +from gradio import Examples, external, interpretation, utils +from gradio.blocks import Blocks +from gradio.components import ( + Button, + ClearButton, + DuplicateButton, + Interpretation, + IOComponent, + Markdown, + State, + get_component_instance, +) +from gradio.data_classes import InterfaceTypes +from gradio.deprecation import warn_deprecation +from gradio.events import Changeable, Streamable, Submittable +from gradio.flagging import CSVLogger, FlaggingCallback, FlagMethod +from gradio.layouts import Column, Row, Tab, Tabs +from gradio.pipelines import load_from_pipeline +from gradio.themes import ThemeClass as Theme + +set_documentation_group("interface") + +if TYPE_CHECKING: # Only import for type checking (is False at runtime). + from transformers.pipelines.base import Pipeline + + +@document("launch", "load", "from_pipeline", "integrate", "queue") +class Interface(Blocks): + """ + Interface is Gradio's main high-level class, and allows you to create a web-based GUI / demo + around a machine learning model (or any Python function) in a few lines of code. + You must specify three parameters: (1) the function to create a GUI for (2) the desired input components and + (3) the desired output components. Additional parameters can be used to control the appearance + and behavior of the demo. + + Example: + import gradio as gr + + def image_classifier(inp): + return {'cat': 0.3, 'dog': 0.7} + + demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label") + demo.launch() + Demos: hello_world, hello_world_3, gpt2_xl + Guides: quickstart, key-features, sharing-your-app, interface-state, reactive-interfaces, advanced-interface-features, setting-up-a-gradio-demo-for-maximum-performance + """ + + # stores references to all currently existing Interface instances + instances: weakref.WeakSet = weakref.WeakSet() + + @classmethod + def get_instances(cls) -> list[Interface]: + """ + :return: list of all current instances. + """ + return list(Interface.instances) + + @classmethod + def load( + cls, + name: str, + src: str | None = None, + api_key: str | None = None, + alias: str | None = None, + **kwargs, + ) -> Blocks: + """ + Warning: this method will be deprecated. Use the equivalent `gradio.load()` instead. This is a class + method that constructs a Blocks from a Hugging Face repo. Can accept + model repos (if src is "models") or Space repos (if src is "spaces"). The input + and output components are automatically loaded from the repo. + Parameters: + name: the name of the model (e.g. "gpt2" or "facebook/bart-base") or space (e.g. "flax-community/spanish-gpt2"), can include the `src` as prefix (e.g. "models/facebook/bart-base") + src: the source of the model: `models` or `spaces` (or leave empty if source is provided as a prefix in `name`) + api_key: optional access token for loading private Hugging Face Hub models or spaces. Find your token here: https://huggingface.co/settings/tokens. Warning: only provide this if you are loading a trusted private Space as it can be read by the Space you are loading. + alias: optional string used as the name of the loaded model instead of the default name (only applies if loading a Space running Gradio 2.x) + Returns: + a Gradio Interface object for the given model + """ + warn_deprecation( + "gr.Interface.load() will be deprecated. Use gr.load() instead." + ) + return external.load( + name=name, src=src, hf_token=api_key, alias=alias, **kwargs + ) + + @classmethod + def from_pipeline(cls, pipeline: Pipeline, **kwargs) -> Interface: + """ + Class method that constructs an Interface from a Hugging Face transformers.Pipeline object. + The input and output components are automatically determined from the pipeline. + Parameters: + pipeline: the pipeline object to use. + Returns: + a Gradio Interface object from the given Pipeline + Example: + import gradio as gr + from transformers import pipeline + pipe = pipeline("image-classification") + gr.Interface.from_pipeline(pipe).launch() + """ + interface_info = load_from_pipeline(pipeline) + kwargs = dict(interface_info, **kwargs) + interface = cls(**kwargs) + return interface + + def __init__( + self, + fn: Callable, + inputs: str | IOComponent | list[str | IOComponent] | None, + outputs: str | IOComponent | list[str | IOComponent] | None, + examples: list[Any] | list[list[Any]] | str | None = None, + cache_examples: bool | None = None, + examples_per_page: int = 10, + live: bool = False, + interpretation: Callable | str | None = None, + num_shap: float = 2.0, + title: str | None = None, + description: str | None = None, + article: str | None = None, + thumbnail: str | None = None, + theme: Theme | str | None = None, + css: str | None = None, + allow_flagging: str | None = None, + flagging_options: list[str] | list[tuple[str, str]] | None = None, + flagging_dir: str = "flagged", + flagging_callback: FlaggingCallback = CSVLogger(), + analytics_enabled: bool | None = None, + batch: bool = False, + max_batch_size: int = 4, + _api_mode: bool = False, + allow_duplication: bool = False, + **kwargs, + ): + """ + Parameters: + fn: the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component. + inputs: a single Gradio component, or list of Gradio components. Components can either be passed as instantiated objects, or referred to by their string shortcuts. The number of input components should match the number of parameters in fn. If set to None, then only the output components will be displayed. + outputs: a single Gradio component, or list of Gradio components. Components can either be passed as instantiated objects, or referred to by their string shortcuts. The number of output components should match the number of values returned by fn. If set to None, then only the input components will be displayed. + examples: sample inputs for the function; if provided, appear below the UI components and can be clicked to populate the interface. Should be nested list, in which the outer list consists of samples and each inner list consists of an input corresponding to each input component. A string path to a directory of examples can also be provided, but it should be within the directory with the python file running the gradio app. If there are multiple input components and a directory is provided, a log.csv file must be present in the directory to link corresponding inputs. + cache_examples: If True, caches examples in the server for fast runtime in examples. If `fn` is a generator function, then the last yielded value will be used as the output. The default option in HuggingFace Spaces is True. The default option elsewhere is False. + examples_per_page: If examples are provided, how many to display per page. + live: whether the interface should automatically rerun if any of the inputs change. + interpretation: function that provides interpretation explaining prediction output. Pass "default" to use simple built-in interpreter, "shap" to use a built-in shapley-based interpreter, or your own custom interpretation function. For more information on the different interpretation methods, see the Advanced Interface Features guide. + num_shap: a multiplier that determines how many examples are computed for shap-based interpretation. Increasing this value will increase shap runtime, but improve results. Only applies if interpretation is "shap". + title: a title for the interface; if provided, appears above the input and output components in large font. Also used as the tab title when opened in a browser window. + description: a description for the interface; if provided, appears above the input and output components and beneath the title in regular font. Accepts Markdown and HTML content. + article: an expanded article explaining the interface; if provided, appears below the input and output components in regular font. Accepts Markdown and HTML content. + thumbnail: path or url to image to use as display image when the web demo is shared on social media. + theme: Theme to use, loaded from gradio.themes. + css: custom css or path to custom css file to use with interface. + allow_flagging: one of "never", "auto", or "manual". If "never" or "auto", users will not see a button to flag an input and output. If "manual", users will see a button to flag. If "auto", every input the user submits will be automatically flagged (outputs are not flagged). If "manual", both the input and outputs are flagged when the user clicks flag button. This parameter can be set with environmental variable GRADIO_ALLOW_FLAGGING; otherwise defaults to "manual". + flagging_options: if provided, allows user to select from the list of options when flagging. Only applies if allow_flagging is "manual". Can either be a list of tuples of the form (label, value), where label is the string that will be displayed on the button and value is the string that will be stored in the flagging CSV; or it can be a list of strings ["X", "Y"], in which case the values will be the list of strings and the labels will ["Flag as X", "Flag as Y"], etc. + flagging_dir: what to name the directory where flagged data is stored. + flagging_callback: An instance of a subclass of FlaggingCallback which will be called when a sample is flagged. By default logs to a local CSV file. + analytics_enabled: Whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable if defined, or default to True. + batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component. + max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True) + allow_duplication: If True, then will show a 'Duplicate Spaces' button on Hugging Face Spaces. + """ + super().__init__( + analytics_enabled=analytics_enabled, + mode="interface", + css=css, + title=title or "Gradio", + theme=theme, + **kwargs, + ) + + if isinstance(fn, list): + raise DeprecationWarning( + "The `fn` parameter only accepts a single function, support for a list " + "of functions has been deprecated. Please use gradio.mix.Parallel " + "instead." + ) + + self.interface_type = InterfaceTypes.STANDARD + if (inputs is None or inputs == []) and (outputs is None or outputs == []): + raise ValueError("Must provide at least one of `inputs` or `outputs`") + elif outputs is None or outputs == []: + outputs = [] + self.interface_type = InterfaceTypes.INPUT_ONLY + elif inputs is None or inputs == []: + inputs = [] + self.interface_type = InterfaceTypes.OUTPUT_ONLY + + assert isinstance(inputs, (str, list, IOComponent)) + assert isinstance(outputs, (str, list, IOComponent)) + + if not isinstance(inputs, list): + inputs = [inputs] + if not isinstance(outputs, list): + outputs = [outputs] + + if self.space_id and cache_examples is None: + self.cache_examples = True + else: + self.cache_examples = cache_examples or False + + state_input_indexes = [ + idx for idx, i in enumerate(inputs) if i == "state" or isinstance(i, State) + ] + state_output_indexes = [ + idx for idx, o in enumerate(outputs) if o == "state" or isinstance(o, State) + ] + + if len(state_input_indexes) == 0 and len(state_output_indexes) == 0: + pass + elif len(state_input_indexes) != 1 or len(state_output_indexes) != 1: + raise ValueError( + "If using 'state', there must be exactly one state input and one state output." + ) + else: + state_input_index = state_input_indexes[0] + state_output_index = state_output_indexes[0] + if inputs[state_input_index] == "state": + default = utils.get_default_args(fn)[state_input_index] + state_variable = State(value=default) # type: ignore + else: + state_variable = inputs[state_input_index] + + inputs[state_input_index] = state_variable + outputs[state_output_index] = state_variable + + if cache_examples: + warnings.warn( + "Cache examples cannot be used with state inputs and outputs." + "Setting cache_examples to False." + ) + self.cache_examples = False + + self.input_components = [ + get_component_instance(i, render=False) for i in inputs # type: ignore + ] + self.output_components = [ + get_component_instance(o, render=False) for o in outputs # type: ignore + ] + + for component in self.input_components + self.output_components: + if not (isinstance(component, IOComponent)): + raise ValueError( + f"{component} is not a valid input/output component for Interface." + ) + + if len(self.input_components) == len(self.output_components): + same_components = [ + i is o for i, o in zip(self.input_components, self.output_components) + ] + if all(same_components): + self.interface_type = InterfaceTypes.UNIFIED + + if self.interface_type in [ + InterfaceTypes.STANDARD, + InterfaceTypes.OUTPUT_ONLY, + ]: + for o in self.output_components: + assert isinstance(o, IOComponent) + if o.interactive is None: + # Unless explicitly otherwise specified, force output components to + # be non-interactive + o.interactive = False + if ( + interpretation is None + or isinstance(interpretation, list) + or callable(interpretation) + ): + self.interpretation = interpretation + elif isinstance(interpretation, str): + self.interpretation = [ + interpretation.lower() for _ in self.input_components + ] + else: + raise ValueError("Invalid value for parameter: interpretation") + + self.api_mode = _api_mode + self.fn = fn + self.fn_durations = [0, 0] + self.__name__ = getattr(fn, "__name__", "fn") + self.live = live + self.title = title + + md = utils.get_markdown_parser() + simple_description: str | None = None + if description is not None: + description = md.render(description) + simple_description = utils.remove_html_tags(description) + self.simple_description = simple_description + self.description = description + if article is not None: + article = utils.readme_to_html(article) + article = md.render(article) + self.article = article + + self.thumbnail = thumbnail + + self.examples = examples + self.num_shap = num_shap + self.examples_per_page = examples_per_page + + self.simple_server = None + + # For allow_flagging: (1) first check for parameter, + # (2) check for env variable, (3) default to True/"manual" + if allow_flagging is None: + allow_flagging = os.getenv("GRADIO_ALLOW_FLAGGING", "manual") + if allow_flagging is True: + warnings.warn( + "The `allow_flagging` parameter in `Interface` now" + "takes a string value ('auto', 'manual', or 'never')" + ", not a boolean. Setting parameter to: 'manual'." + ) + self.allow_flagging = "manual" + elif allow_flagging == "manual": + self.allow_flagging = "manual" + elif allow_flagging is False: + warnings.warn( + "The `allow_flagging` parameter in `Interface` now" + "takes a string value ('auto', 'manual', or 'never')" + ", not a boolean. Setting parameter to: 'never'." + ) + self.allow_flagging = "never" + elif allow_flagging == "never": + self.allow_flagging = "never" + elif allow_flagging == "auto": + self.allow_flagging = "auto" + else: + raise ValueError( + "Invalid value for `allow_flagging` parameter." + "Must be: 'auto', 'manual', or 'never'." + ) + + if flagging_options is None: + self.flagging_options = [("Flag", "")] + elif not (isinstance(flagging_options, list)): + raise ValueError( + "flagging_options must be a list of strings or list of (string, string) tuples." + ) + elif all(isinstance(x, str) for x in flagging_options): + self.flagging_options = [(f"Flag as {x}", x) for x in flagging_options] + elif all(isinstance(x, tuple) for x in flagging_options): + self.flagging_options = flagging_options + else: + raise ValueError( + "flagging_options must be a list of strings or list of (string, string) tuples." + ) + + self.flagging_callback = flagging_callback + self.flagging_dir = flagging_dir + self.batch = batch + self.max_batch_size = max_batch_size + self.allow_duplication = allow_duplication + + self.share = None + self.share_url = None + self.local_url = None + + self.favicon_path = None + Interface.instances.add(self) + + param_types = utils.get_type_hints(self.fn) + param_names = inspect.getfullargspec(self.fn)[0] + if len(param_names) > 0 and inspect.ismethod(self.fn): + param_names = param_names[1:] + for param_name in param_names.copy(): + if utils.is_special_typed_parameter(param_name, param_types): + param_names.remove(param_name) + for component, param_name in zip(self.input_components, param_names): + assert isinstance(component, IOComponent) + if component.label is None: + component.label = param_name + for i, component in enumerate(self.output_components): + assert isinstance(component, IOComponent) + if component.label is None: + if len(self.output_components) == 1: + component.label = "output" + else: + component.label = f"output {i}" + + if self.allow_flagging != "never": + if ( + self.interface_type == InterfaceTypes.UNIFIED + or self.allow_flagging == "auto" + ): + self.flagging_callback.setup(self.input_components, self.flagging_dir) # type: ignore + elif self.interface_type == InterfaceTypes.INPUT_ONLY: + pass + else: + self.flagging_callback.setup( + self.input_components + self.output_components, self.flagging_dir # type: ignore + ) + + # Render the Gradio UI + with self: + self.render_title_description() + + submit_btn, clear_btn, stop_btn, flag_btns, duplicate_btn = ( + None, + None, + None, + None, + None, + ) + interpretation_btn, interpretation_set = None, None + input_component_column, interpret_component_column = None, None + + with Row(equal_height=False): + if self.interface_type in [ + InterfaceTypes.STANDARD, + InterfaceTypes.INPUT_ONLY, + InterfaceTypes.UNIFIED, + ]: + ( + submit_btn, + clear_btn, + stop_btn, + flag_btns, + input_component_column, + interpret_component_column, + interpretation_set, + ) = self.render_input_column() + if self.interface_type in [ + InterfaceTypes.STANDARD, + InterfaceTypes.OUTPUT_ONLY, + ]: + ( + submit_btn_out, + clear_btn_2_out, + duplicate_btn, + stop_btn_2_out, + flag_btns_out, + interpretation_btn, + ) = self.render_output_column(submit_btn) + submit_btn = submit_btn or submit_btn_out + clear_btn = clear_btn or clear_btn_2_out + stop_btn = stop_btn or stop_btn_2_out + flag_btns = flag_btns or flag_btns_out + + assert clear_btn is not None, "Clear button not rendered" + + self.attach_submit_events(submit_btn, stop_btn) + self.attach_clear_events( + clear_btn, input_component_column, interpret_component_column + ) + if duplicate_btn is not None: + duplicate_btn.activate() + self.attach_interpretation_events( + interpretation_btn, + interpretation_set, + input_component_column, + interpret_component_column, + ) + + self.attach_flagging_events(flag_btns, clear_btn) + self.render_examples() + self.render_article() + + self.config = self.get_config_file() + + def render_title_description(self) -> None: + if self.title: + Markdown( + f"

{self.title}

" + ) + if self.description: + Markdown(self.description) + + def render_flag_btns(self) -> list[Button]: + return [Button(label) for label, _ in self.flagging_options] + + def render_input_column( + self, + ) -> tuple[ + Button | None, + ClearButton | None, + Button | None, + list[Button] | None, + Column, + Column | None, + list[Interpretation] | None, + ]: + submit_btn, clear_btn, stop_btn, flag_btns = None, None, None, None + interpret_component_column, interpretation_set = None, None + + with Column(variant="panel"): + input_component_column = Column() + with input_component_column: + for component in self.input_components: + component.render() + if self.interpretation: + interpret_component_column = Column(visible=False) + interpretation_set = [] + with interpret_component_column: + for component in self.input_components: + interpretation_set.append(Interpretation(component)) + with Row(): + if self.interface_type in [ + InterfaceTypes.STANDARD, + InterfaceTypes.INPUT_ONLY, + ]: + clear_btn = ClearButton() + if not self.live: + submit_btn = Button("Submit", variant="primary") + # Stopping jobs only works if the queue is enabled + # We don't know if the queue is enabled when the interface + # is created. We use whether a generator function is provided + # as a proxy of whether the queue will be enabled. + # Using a generator function without the queue will raise an error. + if inspect.isgeneratorfunction( + self.fn + ) or inspect.isasyncgenfunction(self.fn): + stop_btn = Button("Stop", variant="stop", visible=False) + elif self.interface_type == InterfaceTypes.UNIFIED: + clear_btn = ClearButton() + submit_btn = Button("Submit", variant="primary") + if ( + inspect.isgeneratorfunction(self.fn) + or inspect.isasyncgenfunction(self.fn) + ) and not self.live: + stop_btn = Button("Stop", variant="stop") + if self.allow_flagging == "manual": + flag_btns = self.render_flag_btns() + elif self.allow_flagging == "auto": + flag_btns = [submit_btn] + return ( + submit_btn, + clear_btn, + stop_btn, + flag_btns, + input_component_column, + interpret_component_column, + interpretation_set, + ) + + def render_output_column( + self, + submit_btn_in: Button | None, + ) -> tuple[ + Button | None, + ClearButton | None, + DuplicateButton, + Button | None, + list | None, + Button | None, + ]: + submit_btn = submit_btn_in + interpretation_btn, clear_btn, duplicate_btn, flag_btns, stop_btn = ( + None, + None, + None, + None, + None, + ) + + with Column(variant="panel"): + for component in self.output_components: + if not (isinstance(component, State)): + component.render() + with Row(): + if self.interface_type == InterfaceTypes.OUTPUT_ONLY: + clear_btn = ClearButton() + submit_btn = Button("Generate", variant="primary") + if ( + inspect.isgeneratorfunction(self.fn) + or inspect.isasyncgenfunction(self.fn) + ) and not self.live: + # Stopping jobs only works if the queue is enabled + # We don't know if the queue is enabled when the interface + # is created. We use whether a generator function is provided + # as a proxy of whether the queue will be enabled. + # Using a generator function without the queue will raise an error. + stop_btn = Button("Stop", variant="stop", visible=False) + if self.allow_flagging == "manual": + flag_btns = self.render_flag_btns() + elif self.allow_flagging == "auto": + assert submit_btn is not None, "Submit button not rendered" + flag_btns = [submit_btn] + + if self.interpretation: + interpretation_btn = Button("Interpret") + + if self.allow_duplication: + duplicate_btn = DuplicateButton(scale=1, size="lg", _activate=False) + + return ( + submit_btn, + clear_btn, + duplicate_btn, + stop_btn, + flag_btns, + interpretation_btn, + ) + + def render_article(self): + if self.article: + Markdown(self.article) + + def attach_submit_events(self, submit_btn: Button | None, stop_btn: Button | None): + if self.live: + if self.interface_type == InterfaceTypes.OUTPUT_ONLY: + assert submit_btn is not None, "Submit button not rendered" + super().load(self.fn, None, self.output_components) + # For output-only interfaces, the user probably still want a "generate" + # button even if the Interface is live + submit_btn.click( + self.fn, + None, + self.output_components, + api_name="predict", + preprocess=not (self.api_mode), + postprocess=not (self.api_mode), + batch=self.batch, + max_batch_size=self.max_batch_size, + ) + else: + for component in self.input_components: + if isinstance(component, Streamable) and component.streaming: + component.stream( + self.fn, + self.input_components, + self.output_components, + api_name="predict", + preprocess=not (self.api_mode), + postprocess=not (self.api_mode), + ) + continue + if isinstance(component, Changeable): + component.change( + self.fn, + self.input_components, + self.output_components, + api_name="predict", + preprocess=not (self.api_mode), + postprocess=not (self.api_mode), + ) + else: + assert submit_btn is not None, "Submit button not rendered" + fn = self.fn + extra_output = [] + + triggers = [submit_btn.click] + [ + component.submit + for component in self.input_components + if isinstance(component, Submittable) + ] + predict_events = [] + + if stop_btn: + extra_output = [submit_btn, stop_btn] + + def cleanup(): + return [Button.update(visible=True), Button.update(visible=False)] + + for i, trigger in enumerate(triggers): + predict_event = trigger( + lambda: ( + submit_btn.update(visible=False), + stop_btn.update(visible=True), + ), + inputs=None, + outputs=[submit_btn, stop_btn], + queue=False, + ).then( + self.fn, + self.input_components, + self.output_components, + api_name="predict" if i == 0 else None, + scroll_to_output=True, + preprocess=not (self.api_mode), + postprocess=not (self.api_mode), + batch=self.batch, + max_batch_size=self.max_batch_size, + ) + predict_events.append(predict_event) + + predict_event.then( + cleanup, + inputs=None, + outputs=extra_output, # type: ignore + queue=False, + ) + + stop_btn.click( + cleanup, + inputs=None, + outputs=[submit_btn, stop_btn], + cancels=predict_events, + queue=False, + ) + else: + for i, trigger in enumerate(triggers): + predict_events.append( + trigger( + fn, + self.input_components, + self.output_components, + api_name="predict" if i == 0 else None, + scroll_to_output=True, + preprocess=not (self.api_mode), + postprocess=not (self.api_mode), + batch=self.batch, + max_batch_size=self.max_batch_size, + ) + ) + + def attach_clear_events( + self, + clear_btn: ClearButton, + input_component_column: Column | None, + interpret_component_column: Column | None, + ): + clear_btn.add(self.input_components + self.output_components) + clear_btn.click( + None, + [], + ( + ([input_component_column] if input_component_column else []) + + ([interpret_component_column] if self.interpretation else []) + ), # type: ignore + _js=f"""() => {json.dumps( + ( + [Column.update(visible=True)] + if self.interface_type + in [ + InterfaceTypes.STANDARD, + InterfaceTypes.INPUT_ONLY, + InterfaceTypes.UNIFIED, + ] + else [] + ) + + ([Column.update(visible=False)] if self.interpretation else []) + )} + """, + ) + + def attach_interpretation_events( + self, + interpretation_btn: Button | None, + interpretation_set: list[Interpretation] | None, + input_component_column: Column | None, + interpret_component_column: Column | None, + ): + if interpretation_btn: + interpretation_btn.click( + self.interpret_func, + inputs=self.input_components + self.output_components, + outputs=(interpretation_set or []) + [input_component_column, interpret_component_column], # type: ignore + preprocess=False, + ) + + def attach_flagging_events( + self, flag_btns: list[Button] | None, clear_btn: ClearButton + ): + if not ( + flag_btns + and self.interface_type + in ( + InterfaceTypes.STANDARD, + InterfaceTypes.OUTPUT_ONLY, + InterfaceTypes.UNIFIED, + ) + ): + return + + if self.allow_flagging == "auto": + flag_method = FlagMethod( + self.flagging_callback, "", "", visual_feedback=False + ) + flag_btns[0].click( # flag_btns[0] is just the "Submit" button + flag_method, + inputs=self.input_components, + outputs=None, + preprocess=False, + queue=False, + ) + return + + if self.interface_type == InterfaceTypes.UNIFIED: + flag_components = self.input_components + else: + flag_components = self.input_components + self.output_components + + for flag_btn, (label, value) in zip(flag_btns, self.flagging_options): + assert isinstance(value, str) + flag_method = FlagMethod(self.flagging_callback, label, value) + flag_btn.click( + lambda: Button.update(value="Saving...", interactive=False), + None, + flag_btn, + queue=False, + ) + flag_btn.click( + flag_method, + inputs=flag_components, + outputs=flag_btn, + preprocess=False, + queue=False, + ) + clear_btn.click( + flag_method.reset, + None, + flag_btn, + queue=False, + ) + + def render_examples(self): + if self.examples: + non_state_inputs = [ + c for c in self.input_components if not isinstance(c, State) + ] + non_state_outputs = [ + c for c in self.output_components if not isinstance(c, State) + ] + self.examples_handler = Examples( + examples=self.examples, + inputs=non_state_inputs, # type: ignore + outputs=non_state_outputs, # type: ignore + fn=self.fn, + cache_examples=self.cache_examples, + examples_per_page=self.examples_per_page, + _api_mode=self.api_mode, + batch=self.batch, + ) + + def __str__(self): + return self.__repr__() + + def __repr__(self): + repr = f"Gradio Interface for: {self.__name__}" + repr += f"\n{'-' * len(repr)}" + repr += "\ninputs:" + for component in self.input_components: + repr += f"\n|-{component}" + repr += "\noutputs:" + for component in self.output_components: + repr += f"\n|-{component}" + return repr + + async def interpret_func(self, *args): + return await self.interpret(list(args)) + [ + Column.update(visible=False), + Column.update(visible=True), + ] + + async def interpret(self, raw_input: list[Any]) -> list[Any]: + return [ + {"original": raw_value, "interpretation": interpretation} + for interpretation, raw_value in zip( + (await interpretation.run_interpret(self, raw_input))[0], raw_input + ) + ] + + def test_launch(self) -> None: + """ + Deprecated. + """ + warn_deprecation("The Interface.test_launch() function is deprecated.") + + +@document() +class TabbedInterface(Blocks): + """ + A TabbedInterface is created by providing a list of Interfaces, each of which gets + rendered in a separate tab. + Demos: stt_or_tts + """ + + def __init__( + self, + interface_list: list[Interface], + tab_names: list[str] | None = None, + title: str | None = None, + theme: Theme | None = None, + analytics_enabled: bool | None = None, + css: str | None = None, + ): + """ + Parameters: + interface_list: a list of interfaces to be rendered in tabs. + tab_names: a list of tab names. If None, the tab names will be "Tab 1", "Tab 2", etc. + title: a title for the interface; if provided, appears above the input and output components in large font. Also used as the tab title when opened in a browser window. + analytics_enabled: whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True. + css: custom css or path to custom css file to apply to entire Blocks + Returns: + a Gradio Tabbed Interface for the given interfaces + """ + super().__init__( + title=title or "Gradio", + theme=theme, + analytics_enabled=analytics_enabled, + mode="tabbed_interface", + css=css, + ) + if tab_names is None: + tab_names = [f"Tab {i}" for i in range(len(interface_list))] + with self: + if title: + Markdown( + f"

{title}

" + ) + with Tabs(): + for interface, tab_name in zip(interface_list, tab_names): + with Tab(label=tab_name): + interface.render() + + +def close_all(verbose: bool = True) -> None: + for io in Interface.get_instances(): + io.close(verbose) diff --git a/gradio/interpretation.py b/gradio/interpretation.py new file mode 100644 index 0000000000000000000000000000000000000000..767ad641b99a51c08b4efadec350c7170bdc734b --- /dev/null +++ b/gradio/interpretation.py @@ -0,0 +1,328 @@ +"""Contains classes and methods related to interpretation for components in Gradio.""" + +from __future__ import annotations + +import copy +import math +from abc import ABC, abstractmethod +from typing import TYPE_CHECKING, Any + +import numpy as np +from gradio_client import utils as client_utils + +from gradio import components + +if TYPE_CHECKING: # Only import for type checking (is False at runtime). + from gradio import Interface + + +class Interpretable(ABC): # noqa: B024 + def __init__(self) -> None: + self.set_interpret_parameters() + + def set_interpret_parameters(self): # noqa: B027 + """ + Set any parameters for interpretation. Properties can be set here to be + used in get_interpretation_neighbors and get_interpretation_scores. + """ + pass + + def get_interpretation_scores( + self, x: Any, neighbors: list[Any] | None, scores: list[float], **kwargs + ) -> list: + """ + Arrange the output values from the neighbors into interpretation scores for the interface to render. + Parameters: + x: Input to interface + neighbors: Neighboring values to input x used for interpretation. + scores: Output value corresponding to each neighbor in neighbors + Returns: + Arrangement of interpretation scores for interfaces to render. + """ + return scores + + +class TokenInterpretable(Interpretable, ABC): + @abstractmethod + def tokenize(self, x: Any) -> tuple[list, list, None]: + """ + Interprets an input data point x by splitting it into a list of tokens (e.g + a string into words or an image into super-pixels). + """ + return [], [], None + + @abstractmethod + def get_masked_inputs(self, tokens: list, binary_mask_matrix: list[list]) -> list: + return [] + + +class NeighborInterpretable(Interpretable, ABC): + @abstractmethod + def get_interpretation_neighbors(self, x: Any) -> tuple[list, dict]: + """ + Generates values similar to input to be used to interpret the significance of the input in the final output. + Parameters: + x: Input to interface + Returns: (neighbor_values, interpret_kwargs, interpret_by_removal) + neighbor_values: Neighboring values to input x to compute for interpretation + interpret_kwargs: Keyword arguments to be passed to get_interpretation_scores + """ + return [], {} + + +async def run_interpret(interface: Interface, raw_input: list): + """ + Runs the interpretation command for the machine learning model. Handles both the "default" out-of-the-box + interpretation for a certain set of UI component types, as well as the custom interpretation case. + Parameters: + raw_input: a list of raw inputs to apply the interpretation(s) on. + """ + if isinstance(interface.interpretation, list): # Either "default" or "shap" + processed_input = [ + input_component.preprocess(raw_input[i]) + for i, input_component in enumerate(interface.input_components) + ] + original_output = await interface.call_function(0, processed_input) + original_output = original_output["prediction"] + + if len(interface.output_components) == 1: + original_output = [original_output] + + scores, alternative_outputs = [], [] + + for i, (x, interp) in enumerate(zip(raw_input, interface.interpretation)): + if interp == "default": + input_component = interface.input_components[i] + neighbor_raw_input = list(raw_input) + if isinstance(input_component, TokenInterpretable): + tokens, neighbor_values, masks = input_component.tokenize(x) + interface_scores = [] + alternative_output = [] + for neighbor_input in neighbor_values: + neighbor_raw_input[i] = neighbor_input + processed_neighbor_input = [ + input_component.preprocess(neighbor_raw_input[i]) + for i, input_component in enumerate( + interface.input_components + ) + ] + + neighbor_output = await interface.call_function( + 0, processed_neighbor_input + ) + neighbor_output = neighbor_output["prediction"] + if len(interface.output_components) == 1: + neighbor_output = [neighbor_output] + processed_neighbor_output = [ + output_component.postprocess(neighbor_output[i]) + for i, output_component in enumerate( + interface.output_components + ) + ] + + alternative_output.append(processed_neighbor_output) + interface_scores.append( + quantify_difference_in_label( + interface, original_output, neighbor_output + ) + ) + alternative_outputs.append(alternative_output) + scores.append( + input_component.get_interpretation_scores( + raw_input[i], + neighbor_values, + interface_scores, + masks=masks, + tokens=tokens, + ) + ) + elif isinstance(input_component, NeighborInterpretable): + ( + neighbor_values, + interpret_kwargs, + ) = input_component.get_interpretation_neighbors( + x + ) # type: ignore + interface_scores = [] + alternative_output = [] + for neighbor_input in neighbor_values: + neighbor_raw_input[i] = neighbor_input + processed_neighbor_input = [ + input_component.preprocess(neighbor_raw_input[i]) + for i, input_component in enumerate( + interface.input_components + ) + ] + neighbor_output = await interface.call_function( + 0, processed_neighbor_input + ) + neighbor_output = neighbor_output["prediction"] + if len(interface.output_components) == 1: + neighbor_output = [neighbor_output] + processed_neighbor_output = [ + output_component.postprocess(neighbor_output[i]) + for i, output_component in enumerate( + interface.output_components + ) + ] + + alternative_output.append(processed_neighbor_output) + interface_scores.append( + quantify_difference_in_label( + interface, original_output, neighbor_output + ) + ) + alternative_outputs.append(alternative_output) + interface_scores = [-score for score in interface_scores] + scores.append( + input_component.get_interpretation_scores( + raw_input[i], + neighbor_values, + interface_scores, + **interpret_kwargs, + ) + ) + else: + raise ValueError( + f"Component {input_component} does not support interpretation" + ) + elif interp == "shap" or interp == "shapley": + try: + import shap # type: ignore + except (ImportError, ModuleNotFoundError) as err: + raise ValueError( + "The package `shap` is required for this interpretation method. Try: `pip install shap`" + ) from err + input_component = interface.input_components[i] + if not isinstance(input_component, TokenInterpretable): + raise ValueError( + f"Input component {input_component} does not support `shap` interpretation" + ) + + tokens, _, masks = input_component.tokenize(x) + + # construct a masked version of the input + def get_masked_prediction(binary_mask): + assert isinstance(input_component, TokenInterpretable) + masked_xs = input_component.get_masked_inputs(tokens, binary_mask) + preds = [] + for masked_x in masked_xs: + processed_masked_input = copy.deepcopy(processed_input) + processed_masked_input[i] = input_component.preprocess(masked_x) + new_output = client_utils.synchronize_async( + interface.call_function, 0, processed_masked_input + ) + new_output = new_output["prediction"] + if len(interface.output_components) == 1: + new_output = [new_output] + pred = get_regression_or_classification_value( + interface, original_output, new_output + ) + preds.append(pred) + return np.array(preds) + + num_total_segments = len(tokens) + explainer = shap.KernelExplainer( + get_masked_prediction, np.zeros((1, num_total_segments)) + ) + shap_values = explainer.shap_values( + np.ones((1, num_total_segments)), + nsamples=int(interface.num_shap * num_total_segments), + silent=True, + ) + assert shap_values is not None, "SHAP values could not be calculated" + scores.append( + input_component.get_interpretation_scores( + raw_input[i], + None, + shap_values[0].tolist(), + masks=masks, + tokens=tokens, + ) + ) + alternative_outputs.append([]) + elif interp is None: + scores.append(None) + alternative_outputs.append([]) + else: + raise ValueError(f"Unknown interpretation method: {interp}") + return scores, alternative_outputs + elif interface.interpretation: # custom interpretation function + processed_input = [ + input_component.preprocess(raw_input[i]) + for i, input_component in enumerate(interface.input_components) + ] + interpreter = interface.interpretation + interpretation = interpreter(*processed_input) + if len(raw_input) == 1: + interpretation = [interpretation] + return interpretation, [] + else: + raise ValueError("No interpretation method specified.") + + +def diff(original: Any, perturbed: Any) -> int | float: + try: # try computing numerical difference + score = float(original) - float(perturbed) + except ValueError: # otherwise, look at strict difference in label + score = int(original != perturbed) + return score + + +def quantify_difference_in_label( + interface: Interface, original_output: list, perturbed_output: list +) -> int | float: + output_component = interface.output_components[0] + post_original_output = output_component.postprocess(original_output[0]) + post_perturbed_output = output_component.postprocess(perturbed_output[0]) + + if isinstance(output_component, components.Label): + original_label = post_original_output["label"] + perturbed_label = post_perturbed_output["label"] + + # Handle different return types of Label interface + if "confidences" in post_original_output: + original_confidence = original_output[0][original_label] + perturbed_confidence = perturbed_output[0][original_label] + score = original_confidence - perturbed_confidence + else: + score = diff(original_label, perturbed_label) + return score + + elif isinstance(output_component, components.Number): + score = diff(post_original_output, post_perturbed_output) + return score + + else: + raise ValueError( + f"This interpretation method doesn't support the Output component: {output_component}" + ) + + +def get_regression_or_classification_value( + interface: Interface, original_output: list, perturbed_output: list +) -> int | float: + """Used to combine regression/classification for Shap interpretation method.""" + output_component = interface.output_components[0] + post_original_output = output_component.postprocess(original_output[0]) + post_perturbed_output = output_component.postprocess(perturbed_output[0]) + + if isinstance(output_component, components.Label): + original_label = post_original_output["label"] + perturbed_label = post_perturbed_output["label"] + + # Handle different return types of Label interface + if "confidences" in post_original_output: + if math.isnan(perturbed_output[0][original_label]): + return 0 + return perturbed_output[0][original_label] + else: + score = diff( + perturbed_label, original_label + ) # Intentionally inverted order of arguments. + return score + + else: + raise ValueError( + f"This interpretation method doesn't support the Output component: {output_component}" + ) diff --git a/gradio/ipython_ext.py b/gradio/ipython_ext.py new file mode 100644 index 0000000000000000000000000000000000000000..94f4404065418a328c312b586370ed1ccd161a35 --- /dev/null +++ b/gradio/ipython_ext.py @@ -0,0 +1,23 @@ +try: + from IPython.core.magic import needs_local_scope, register_cell_magic +except ImportError: + pass + +import warnings + +import gradio as gr + + +def load_ipython_extension(ipython): + __demo = gr.Blocks() + + @register_cell_magic + @needs_local_scope + def blocks(line, cell, local_ns=None): + if "gr.Interface" in cell: + warnings.warn( + "Usage of gradio.Interface with %%blocks may result in errors." + ) + with __demo.clear(): + exec(cell, None, local_ns) + __demo.launch(quiet=True) diff --git a/gradio/layouts.py b/gradio/layouts.py new file mode 100644 index 0000000000000000000000000000000000000000..58a4f20ba2cc2b5a9527a212e067dd01c727f609 --- /dev/null +++ b/gradio/layouts.py @@ -0,0 +1,393 @@ +from __future__ import annotations + +import warnings +from typing import TYPE_CHECKING, Literal + +from gradio_client.documentation import document, set_documentation_group + +from gradio.blocks import BlockContext +from gradio.deprecation import warn_style_method_deprecation +from gradio.events import Changeable, Selectable + +if TYPE_CHECKING: + from gradio.blocks import Block + +set_documentation_group("layout") + + +@document() +class Row(BlockContext): + """ + Row is a layout element within Blocks that renders all children horizontally. + Example: + with gr.Blocks() as demo: + with gr.Row(): + gr.Image("lion.jpg", scale=2) + gr.Image("tiger.jpg", scale=1) + demo.launch() + Guides: controlling-layout + """ + + def __init__( + self, + *, + variant: Literal["default", "panel", "compact"] = "default", + visible: bool = True, + elem_id: str | None = None, + equal_height: bool = True, + **kwargs, + ): + """ + Parameters: + variant: row type, 'default' (no background), 'panel' (gray background color and rounded corners), or 'compact' (rounded corners and no internal gap). + visible: If False, row will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + equal_height: If True, makes every child element have equal height + """ + self.variant = variant + self.equal_height = equal_height + if variant == "compact": + self.allow_expected_parents = False + super().__init__(visible=visible, elem_id=elem_id, **kwargs) + + def get_config(self): + return { + "type": "row", + "variant": self.variant, + "equal_height": self.equal_height, + **super().get_config(), + } + + @staticmethod + def update( + visible: bool | None = None, + ): + return { + "visible": visible, + "__type__": "update", + } + + def style( + self, + *, + equal_height: bool | None = None, + **kwargs, + ): + """ + Styles the Row. + Parameters: + equal_height: If True, makes every child element have equal height + """ + warn_style_method_deprecation() + if equal_height is not None: + self.equal_height = equal_height + return self + + +@document() +class Column(BlockContext): + """ + Column is a layout element within Blocks that renders all children vertically. The widths of columns can be set through the `scale` and `min_width` parameters. + If a certain scale results in a column narrower than min_width, the min_width parameter will win. + Example: + with gr.Blocks() as demo: + with gr.Row(): + with gr.Column(scale=1): + text1 = gr.Textbox() + text2 = gr.Textbox() + with gr.Column(scale=4): + btn1 = gr.Button("Button 1") + btn2 = gr.Button("Button 2") + Guides: controlling-layout + """ + + def __init__( + self, + *, + scale: int = 1, + min_width: int = 320, + variant: Literal["default", "panel", "compact"] = "default", + visible: bool = True, + elem_id: str | None = None, + **kwargs, + ): + """ + Parameters: + scale: relative width compared to adjacent Columns. For example, if Column A has scale=2, and Column B has scale=1, A will be twice as wide as B. + min_width: minimum pixel width of Column, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in a column narrower than min_width, the min_width parameter will be respected first. + variant: column type, 'default' (no background), 'panel' (gray background color and rounded corners), or 'compact' (rounded corners and no internal gap). + visible: If False, column will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.scale = scale + self.min_width = min_width + self.variant = variant + if variant == "compact": + self.allow_expected_parents = False + super().__init__(visible=visible, elem_id=elem_id, **kwargs) + + def get_config(self): + return { + "type": "column", + "variant": self.variant, + "scale": self.scale, + "min_width": self.min_width, + **super().get_config(), + } + + @staticmethod + def update( + variant: str | None = None, + visible: bool | None = None, + ): + return { + "variant": variant, + "visible": visible, + "__type__": "update", + } + + +class Tabs(BlockContext, Changeable, Selectable): + """ + Tabs is a layout element within Blocks that can contain multiple "Tab" Components. + """ + + def __init__( + self, + *, + selected: int | str | None = None, + visible: bool = True, + elem_id: str | None = None, + **kwargs, + ): + """ + Parameters: + selected: The currently selected tab. Must correspond to an id passed to the one of the child TabItems. Defaults to the first TabItem. + visible: If False, Tabs will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + BlockContext.__init__(self, visible=visible, elem_id=elem_id, **kwargs) + Changeable.__init__(self) + Selectable.__init__(self) + self.selected = selected + + def get_config(self): + return {"selected": self.selected, **super(BlockContext, self).get_config()} + + @staticmethod + def update( + selected: int | str | None = None, + ): + return { + "selected": selected, + "__type__": "update", + } + + +@document() +class Tab(BlockContext, Selectable): + """ + Tab (or its alias TabItem) is a layout element. Components defined within the Tab will be visible when this tab is selected tab. + Example: + with gr.Blocks() as demo: + with gr.Tab("Lion"): + gr.Image("lion.jpg") + gr.Button("New Lion") + with gr.Tab("Tiger"): + gr.Image("tiger.jpg") + gr.Button("New Tiger") + Guides: controlling-layout + """ + + def __init__( + self, + label: str, + *, + id: int | str | None = None, + elem_id: str | None = None, + **kwargs, + ): + """ + Parameters: + label: The visual label for the tab + id: An optional identifier for the tab, required if you wish to control the selected tab from a predict function. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + BlockContext.__init__(self, elem_id=elem_id, **kwargs) + Selectable.__init__(self) + self.label = label + self.id = id + + def get_config(self): + return { + "label": self.label, + "id": self.id, + **super(BlockContext, self).get_config(), + } + + def get_expected_parent(self) -> type[Tabs]: + return Tabs + + def get_block_name(self): + return "tabitem" + + +TabItem = Tab + + +@document() +class Group(BlockContext): + """ + Group is a layout element within Blocks which groups together children so that + they do not have any padding or margin between them. + Example: + with gr.Group(): + gr.Textbox(label="First") + gr.Textbox(label="Last") + """ + + def __init__( + self, + *, + visible: bool = True, + elem_id: str | None = None, + **kwargs, + ): + """ + Parameters: + visible: If False, group will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + super().__init__(visible=visible, elem_id=elem_id, **kwargs) + + def get_config(self): + return {"type": "group", **super().get_config()} + + @staticmethod + def update( + visible: bool | None = None, + ): + return { + "visible": visible, + "__type__": "update", + } + + +@document() +class Box(BlockContext): + """ + Box is a a layout element which places children in a box with rounded corners and + some padding around them. + Example: + with gr.Box(): + gr.Textbox(label="First") + gr.Textbox(label="Last") + """ + + def __init__( + self, + *, + visible: bool = True, + elem_id: str | None = None, + **kwargs, + ): + """ + Parameters: + visible: If False, box will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + warnings.warn("gr.Box is deprecated. Use gr.Group instead.", DeprecationWarning) + super().__init__(visible=visible, elem_id=elem_id, **kwargs) + + def get_config(self): + return {"type": "box", **super().get_config()} + + @staticmethod + def update( + visible: bool | None = None, + ): + return { + "visible": visible, + "__type__": "update", + } + + def style(self, **kwargs): + warn_style_method_deprecation() + return self + + +class Form(BlockContext): + def __init__(self, *, scale: int = 0, min_width: int = 0, **kwargs): + """ + Parameters: + scale: relative width compared to adjacent Columns. For example, if Column A has scale=2, and Column B has scale=1, A will be twice as wide as B. + min_width: minimum pixel width of Column, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in a column narrower than min_width, the min_width parameter will be respected first. + """ + self.scale = scale + self.min_width = min_width + super().__init__(**kwargs) + + def add_child(self, child: Block): + if isinstance(self.parent, Row): + scale = getattr(child, "scale", None) + self.scale += 1 if scale is None else scale + self.min_width += getattr(child, "min_width", 0) or 0 + super().add_child(child) + + def get_config(self): + return { + "type": "form", + "scale": self.scale, + "min_width": self.min_width, + **super().get_config(), + } + + +@document() +class Accordion(BlockContext): + """ + Accordion is a layout element which can be toggled to show/hide the contained content. + Example: + with gr.Accordion("See Details"): + gr.Markdown("lorem ipsum") + """ + + def __init__( + self, + label, + *, + open: bool = True, + visible: bool = True, + elem_id: str | None = None, + **kwargs, + ): + """ + Parameters: + label: name of accordion section. + open: if True, accordion is open by default. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + """ + self.label = label + self.open = open + super().__init__(visible=visible, elem_id=elem_id, **kwargs) + + def get_config(self): + return { + "type": "accordion", + "open": self.open, + "label": self.label, + **super().get_config(), + } + + @staticmethod + def update( + open: bool | None = None, + label: str | None = None, + visible: bool | None = None, + ): + return { + "visible": visible, + "label": label, + "open": open, + "__type__": "update", + } diff --git a/gradio/mix.py b/gradio/mix.py new file mode 100644 index 0000000000000000000000000000000000000000..caf2c68b835101c4f3d18d3d53fbb1b8494b3dba --- /dev/null +++ b/gradio/mix.py @@ -0,0 +1,129 @@ +""" +Ways to transform interfaces to produce new interfaces +""" +import asyncio +import warnings + +from gradio_client.documentation import document, set_documentation_group + +import gradio + +set_documentation_group("mix_interface") + + +@document() +class Parallel(gradio.Interface): + """ + Creates a new Interface consisting of multiple Interfaces in parallel (comparing their outputs). + The Interfaces to put in Parallel must share the same input components (but can have different output components). + + Demos: interface_parallel, interface_parallel_load + Guides: advanced-interface-features + """ + + def __init__(self, *interfaces: gradio.Interface, **options): + """ + Parameters: + interfaces: any number of Interface objects that are to be compared in parallel + options: additional kwargs that are passed into the new Interface object to customize it + Returns: + an Interface object comparing the given models + """ + outputs = [] + + for interface in interfaces: + if not (isinstance(interface, gradio.Interface)): + warnings.warn( + "Parallel requires all inputs to be of type Interface. " + "May not work as expected." + ) + outputs.extend(interface.output_components) + + async def parallel_fn(*args): + return_values_with_durations = await asyncio.gather( + *[interface.call_function(0, list(args)) for interface in interfaces] + ) + return_values = [rv["prediction"] for rv in return_values_with_durations] + combined_list = [] + for interface, return_value in zip(interfaces, return_values): + if len(interface.output_components) == 1: + combined_list.append(return_value) + else: + combined_list.extend(return_value) + if len(outputs) == 1: + return combined_list[0] + return combined_list + + parallel_fn.__name__ = " | ".join([io.__name__ for io in interfaces]) + + kwargs = { + "fn": parallel_fn, + "inputs": interfaces[0].input_components, + "outputs": outputs, + } + kwargs.update(options) + super().__init__(**kwargs) + + +@document() +class Series(gradio.Interface): + """ + Creates a new Interface from multiple Interfaces in series (the output of one is fed as the input to the next, + and so the input and output components must agree between the interfaces). + + Demos: interface_series, interface_series_load + Guides: advanced-interface-features + """ + + def __init__(self, *interfaces: gradio.Interface, **options): + """ + Parameters: + interfaces: any number of Interface objects that are to be connected in series + options: additional kwargs that are passed into the new Interface object to customize it + Returns: + an Interface object connecting the given models + """ + + async def connected_fn(*data): + for idx, interface in enumerate(interfaces): + # skip preprocessing for first interface since the Series interface will include it + if idx > 0 and not (interface.api_mode): + data = [ + input_component.preprocess(data[i]) + for i, input_component in enumerate(interface.input_components) + ] + + # run all of predictions sequentially + data = (await interface.call_function(0, list(data)))["prediction"] + if len(interface.output_components) == 1: + data = [data] + + # skip postprocessing for final interface since the Series interface will include it + if idx < len(interfaces) - 1 and not (interface.api_mode): + data = [ + output_component.postprocess(data[i]) + for i, output_component in enumerate( + interface.output_components + ) + ] + + if len(interface.output_components) == 1: # type: ignore + return data[0] + return data + + for interface in interfaces: + if not (isinstance(interface, gradio.Interface)): + warnings.warn( + "Series requires all inputs to be of type Interface. May " + "not work as expected." + ) + connected_fn.__name__ = " => ".join([io.__name__ for io in interfaces]) + + kwargs = { + "fn": connected_fn, + "inputs": interfaces[0].input_components, + "outputs": interfaces[-1].output_components, + "_api_mode": interfaces[0].api_mode, # TODO: set api_mode per-interface + } + kwargs.update(options) + super().__init__(**kwargs) diff --git a/gradio/networking.py b/gradio/networking.py new file mode 100644 index 0000000000000000000000000000000000000000..998e28620216819682007d9b610897b4be50cb51 --- /dev/null +++ b/gradio/networking.py @@ -0,0 +1,208 @@ +""" +Defines helper methods useful for setting up ports, launching servers, and +creating tunnels. +""" +from __future__ import annotations + +import os +import socket +import threading +import time +import warnings +from typing import TYPE_CHECKING + +import requests +import uvicorn + +from gradio.exceptions import ServerFailedToStartError +from gradio.routes import App +from gradio.tunneling import Tunnel + +if TYPE_CHECKING: # Only import for type checking (to avoid circular imports). + from gradio.blocks import Blocks + +# By default, the local server will try to open on localhost, port 7860. +# If that is not available, then it will try 7861, 7862, ... 7959. +INITIAL_PORT_VALUE = int(os.getenv("GRADIO_SERVER_PORT", "7860")) +TRY_NUM_PORTS = int(os.getenv("GRADIO_NUM_PORTS", "100")) +LOCALHOST_NAME = os.getenv("GRADIO_SERVER_NAME", "127.0.0.1") +GRADIO_API_SERVER = "https://api.gradio.app/v2/tunnel-request" + + +class Server(uvicorn.Server): + def install_signal_handlers(self): + pass + + def run_in_thread(self): + self.thread = threading.Thread(target=self.run, daemon=True) + self.thread.start() + start = time.time() + while not self.started: + time.sleep(1e-3) + if time.time() - start > 5: + raise ServerFailedToStartError( + "Server failed to start. Please check that the port is available." + ) + + def close(self): + self.should_exit = True + self.thread.join() + + +def get_first_available_port(initial: int, final: int) -> int: + """ + Gets the first open port in a specified range of port numbers + Parameters: + initial: the initial value in the range of port numbers + final: final (exclusive) value in the range of port numbers, should be greater than `initial` + Returns: + port: the first open port in the range + """ + for port in range(initial, final): + try: + s = socket.socket() # create a socket object + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + s.bind((LOCALHOST_NAME, port)) # Bind to the port + s.close() + return port + except OSError: + pass + raise OSError( + f"All ports from {initial} to {final - 1} are in use. Please close a port." + ) + + +def configure_app(app: App, blocks: Blocks) -> App: + auth = blocks.auth + if auth is not None: + if not callable(auth): + app.auth = {account[0]: account[1] for account in auth} + else: + app.auth = auth + else: + app.auth = None + app.blocks = blocks + app.cwd = os.getcwd() + app.favicon_path = blocks.favicon_path + app.tokens = {} + return app + + +def start_server( + blocks: Blocks, + server_name: str | None = None, + server_port: int | None = None, + ssl_keyfile: str | None = None, + ssl_certfile: str | None = None, + ssl_keyfile_password: str | None = None, + app_kwargs: dict | None = None, +) -> tuple[str, int, str, App, Server]: + """Launches a local server running the provided Interface + Parameters: + blocks: The Blocks object to run on the server + server_name: to make app accessible on local network, set this to "0.0.0.0". Can be set by environment variable GRADIO_SERVER_NAME. + server_port: will start gradio app on this port (if available). Can be set by environment variable GRADIO_SERVER_PORT. + auth: If provided, username and password (or list of username-password tuples) required to access the Blocks. Can also provide function that takes username and password and returns True if valid login. + ssl_keyfile: If a path to a file is provided, will use this as the private key file to create a local server running on https. + ssl_certfile: If a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided. + ssl_keyfile_password: If a password is provided, will use this with the ssl certificate for https. + app_kwargs: Additional keyword arguments to pass to the gradio.routes.App constructor. + + Returns: + port: the port number the server is running on + path_to_local_server: the complete address that the local server can be accessed at + app: the FastAPI app object + server: the server object that is a subclass of uvicorn.Server (used to close the server) + """ + if ssl_keyfile is not None and ssl_certfile is None: + raise ValueError("ssl_certfile must be provided if ssl_keyfile is provided.") + + server_name = server_name or LOCALHOST_NAME + url_host_name = "localhost" if server_name == "0.0.0.0" else server_name + + # Strip IPv6 brackets from the address if they exist. + # This is needed as http://[::1]:port/ is a valid browser address, + # but not a valid IPv6 address, so asyncio will throw an exception. + if server_name.startswith("[") and server_name.endswith("]"): + host = server_name[1:-1] + else: + host = server_name + + app = App.create_app(blocks, app_kwargs=app_kwargs) + + server_ports = ( + [server_port] + if server_port is not None + else range(INITIAL_PORT_VALUE, INITIAL_PORT_VALUE + TRY_NUM_PORTS) + ) + + for port in server_ports: + try: + # The fastest way to check if a port is available is to try to bind to it with socket. + # If the port is not available, socket will throw an OSError. + s = socket.socket() + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + # Really, we should be checking if (server_name, server_port) is available, but + # socket.bind() doesn't seem to throw an OSError with ipv6 addresses, based on my testing. + # Instead, we just check if the port is available on localhost. + s.bind((LOCALHOST_NAME, port)) + s.close() + + # To avoid race conditions, so we also check if the port by trying to start the uvicorn server. + # If the port is not available, this will throw a ServerFailedToStartError. + config = uvicorn.Config( + app=app, + port=port, + host=host, + log_level="warning", + ssl_keyfile=ssl_keyfile, + ssl_certfile=ssl_certfile, + ssl_keyfile_password=ssl_keyfile_password, + ws_max_size=1024 * 1024 * 1024, # Setting max websocket size to be 1 GB + ) + server = Server(config=config) + server.run_in_thread() + break + except (OSError, ServerFailedToStartError): + pass + else: + raise OSError( + f"Cannot find empty port in range: {min(server_ports)}-{max(server_ports)}. You can specify a different port by setting the GRADIO_SERVER_PORT environment variable or passing the `server_port` parameter to `launch()`." + ) + + if ssl_keyfile is not None: + path_to_local_server = f"https://{url_host_name}:{port}/" + else: + path_to_local_server = f"http://{url_host_name}:{port}/" + + return server_name, port, path_to_local_server, app, server + + +def setup_tunnel(local_host: str, local_port: int, share_token: str) -> str: + response = requests.get(GRADIO_API_SERVER) + if response and response.status_code == 200: + try: + payload = response.json()[0] + remote_host, remote_port = payload["host"], int(payload["port"]) + tunnel = Tunnel( + remote_host, remote_port, local_host, local_port, share_token + ) + address = tunnel.start_tunnel() + return address + except Exception as e: + raise RuntimeError(str(e)) from e + raise RuntimeError("Could not get share link from Gradio API Server.") + + +def url_ok(url: str) -> bool: + try: + for _ in range(5): + with warnings.catch_warnings(): + warnings.filterwarnings("ignore") + r = requests.head(url, timeout=3, verify=False) + if r.status_code in (200, 401, 302): # 401 or 302 if auth is set + return True + time.sleep(0.500) + except (ConnectionError, requests.exceptions.ConnectionError): + return False + return False diff --git a/gradio/outputs.py b/gradio/outputs.py new file mode 100644 index 0000000000000000000000000000000000000000..b6d2d20c8f5ecc18e4efda53e1882055332d0756 --- /dev/null +++ b/gradio/outputs.py @@ -0,0 +1,313 @@ +# type: ignore +""" +This module defines various classes that can serve as the `output` to an interface. Each class must inherit from +`OutputComponent`, and each class must define a path to its template. All of the subclasses of `OutputComponent` are +automatically added to a registry, which allows them to be easily referenced in other parts of the code. +""" + +from __future__ import annotations + +from typing import Optional + +from gradio import components +from gradio.deprecation import warn_deprecation + + +def warn_outputs_deprecation(): + warn_deprecation( + "Usage of gradio.outputs is deprecated, and will not be supported in the future, " + "please import your components from gradio.components", + ) + + +class Textbox(components.Textbox): + def __init__( + self, + type: str = "text", + label: Optional[str] = None, + ): + warn_outputs_deprecation() + super().__init__(label=label, type=type) + + +class Image(components.Image): + """ + Component displays an output image. + Output type: Union[numpy.array, PIL.Image, str, matplotlib.pyplot, Tuple[Union[numpy.array, PIL.Image, str], List[Tuple[str, float, float, float, float]]]] + """ + + def __init__( + self, type: str = "auto", plot: bool = False, label: Optional[str] = None + ): + """ + Parameters: + type (str): Type of value to be passed to component. "numpy" expects a numpy array with shape (height, width, 3), "pil" expects a PIL image object, "file" expects a file path to the saved image or a remote URL, "plot" expects a matplotlib.pyplot object, "auto" detects return type. + plot (bool): DEPRECATED. Whether to expect a plot to be returned by the function. + label (str): component name in interface. + """ + warn_outputs_deprecation() + if plot: + type = "plot" + super().__init__(type=type, label=label) + + +class Video(components.Video): + """ + Used for video output. + Output type: filepath + """ + + def __init__(self, type: Optional[str] = None, label: Optional[str] = None): + """ + Parameters: + type (str): Type of video format to be passed to component, such as 'avi' or 'mp4'. Use 'mp4' to ensure browser playability. If set to None, video will keep returned format. + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__(format=type, label=label) + + +class Audio(components.Audio): + """ + Creates an audio player that plays the output audio. + Output type: Union[Tuple[int, numpy.array], str] + """ + + def __init__(self, type: str = "auto", label: Optional[str] = None): + """ + Parameters: + type (str): Type of value to be passed to component. "numpy" returns a 2-set tuple with an integer sample_rate and the data as 16-bit int numpy.array of shape (samples, 2), "file" returns a temporary file path to the saved wav audio file, "auto" detects return type. + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__(type=type, label=label) + + +class File(components.File): + """ + Used for file output. + Output type: Union[file-like, str] + """ + + def __init__(self, label: Optional[str] = None): + """ + Parameters: + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__(label=label) + + +class Dataframe(components.Dataframe): + """ + Component displays 2D output through a spreadsheet interface. + Output type: Union[pandas.DataFrame, numpy.array, List[Union[str, float]], List[List[Union[str, float]]]] + """ + + def __init__( + self, + headers: Optional[list[str]] = None, + max_rows: Optional[int] = 20, + max_cols: Optional[int] = None, + overflow_row_behaviour: str = "paginate", + type: str = "auto", + label: Optional[str] = None, + ): + """ + Parameters: + headers (List[str]): Header names to dataframe. Only applicable if type is "numpy" or "array". + max_rows (int): Maximum number of rows to display at once. Set to None for infinite. + max_cols (int): Maximum number of columns to display at once. Set to None for infinite. + overflow_row_behaviour (str): If set to "paginate", will create pages for overflow rows. If set to "show_ends", will show initial and final rows and truncate middle rows. + type (str): Type of value to be passed to component. "pandas" for pandas dataframe, "numpy" for numpy array, or "array" for Python array, "auto" detects return type. + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__( + headers=headers, + type=type, + label=label, + max_rows=max_rows, + max_cols=max_cols, + overflow_row_behaviour=overflow_row_behaviour, + ) + + +class Timeseries(components.Timeseries): + """ + Component accepts pandas.DataFrame. + Output type: pandas.DataFrame + """ + + def __init__( + self, x: str = None, y: str | list[str] = None, label: Optional[str] = None + ): + """ + Parameters: + x (str): Column name of x (time) series. None if csv has no headers, in which case first column is x series. + y (Union[str, List[str]]): Column name of y series, or list of column names if multiple series. None if csv has no headers, in which case every column after first is a y series. + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__(x=x, y=y, label=label) + + +class State(components.State): + """ + Special hidden component that stores state across runs of the interface. + Output type: Any + """ + + def __init__(self, label: Optional[str] = None): + """ + Parameters: + label (str): component name in interface (not used). + """ + warn_outputs_deprecation() + super().__init__(label=label) + + +class Label(components.Label): + """ + Component outputs a classification label, along with confidence scores of top categories if provided. Confidence scores are represented as a dictionary mapping labels to scores between 0 and 1. + Output type: Union[Dict[str, float], str, int, float] + """ + + def __init__( + self, + num_top_classes: Optional[int] = None, + type: str = "auto", + label: Optional[str] = None, + ): + """ + Parameters: + num_top_classes (int): number of most confident classes to show. + type (str): Type of value to be passed to component. "value" expects a single out label, "confidences" expects a dictionary mapping labels to confidence scores, "auto" detects return type. + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__(num_top_classes=num_top_classes, type=type, label=label) + + +class KeyValues: + """ + Component displays a table representing values for multiple fields. + Output type: Union[Dict, List[Tuple[str, Union[str, int, float]]]] + """ + + def __init__(self, value: str = " ", *, label: Optional[str] = None, **kwargs): + """ + Parameters: + value (str): IGNORED + label (str): component name in interface. + """ + raise DeprecationWarning( + "The KeyValues component is deprecated. Please use the DataFrame or JSON " + "components instead." + ) + + +class HighlightedText(components.HighlightedText): + """ + Component creates text that contains spans that are highlighted by category or numerical value. + Output is represent as a list of Tuple pairs, where the first element represents the span of text represented by the tuple, and the second element represents the category or value of the text. + Output type: List[Tuple[str, Union[float, str]]] + """ + + def __init__( + self, + color_map: dict[str, str] = None, + label: Optional[str] = None, + show_legend: bool = False, + ): + """ + Parameters: + color_map (Dict[str, str]): Map between category and respective colors + label (str): component name in interface. + show_legend (bool): whether to show span categories in a separate legend or inline. + """ + warn_outputs_deprecation() + super().__init__(color_map=color_map, label=label, show_legend=show_legend) + + +class JSON(components.JSON): + """ + Used for JSON output. Expects a JSON string or a Python object that is JSON serializable. + Output type: Union[str, Any] + """ + + def __init__(self, label: Optional[str] = None): + """ + Parameters: + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__(label=label) + + +class HTML(components.HTML): + """ + Used for HTML output. Expects an HTML valid string. + Output type: str + """ + + def __init__(self, label: Optional[str] = None): + """ + Parameters: + label (str): component name in interface. + """ + super().__init__(label=label) + + +class Carousel(components.Carousel): + """ + Component displays a set of output components that can be scrolled through. + """ + + def __init__( + self, + components: components.Component | list[components.Component], + label: Optional[str] = None, + ): + """ + Parameters: + components (Union[List[Component], Component]): Classes of component(s) that will be scrolled through. + label (str): component name in interface. + """ + warn_outputs_deprecation() + super().__init__(components=components, label=label) + + +class Chatbot(components.Chatbot): + """ + Component displays a chatbot output showing both user submitted messages and responses + Output type: List[Tuple[str, str]] + """ + + def __init__(self, label: Optional[str] = None): + """ + Parameters: + label (str): component name in interface (not used). + """ + warn_outputs_deprecation() + super().__init__(label=label) + + +class Image3D(components.Model3D): + """ + Used for 3D image model output. + Input type: File object of type (.obj, glb, or .gltf) + """ + + def __init__( + self, + clear_color=None, + label: Optional[str] = None, + ): + """ + Parameters: + label (str): component name in interface. + optional (bool): If True, the interface can be submitted with no uploaded image, in which case the input value is None. + """ + warn_outputs_deprecation() + super().__init__(clear_color=clear_color, label=label) diff --git a/gradio/package.json b/gradio/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4efaa199d20cba687addf20e19477dd5b724f74d --- /dev/null +++ b/gradio/package.json @@ -0,0 +1,6 @@ +{ + "name": "gradio", + "version": "3.39.0", + "description": "", + "python": "true" +} diff --git a/gradio/pipelines.py b/gradio/pipelines.py new file mode 100644 index 0000000000000000000000000000000000000000..144f1f7ecd59c2c9c71fbd836061de9ed4b1f71b --- /dev/null +++ b/gradio/pipelines.py @@ -0,0 +1,225 @@ +"""This module should not be used directly as its API is subject to change. Instead, +please use the `gr.Interface.from_pipeline()` function.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from gradio import components + +if TYPE_CHECKING: # Only import for type checking (is False at runtime). + from transformers import pipelines + + +def load_from_pipeline(pipeline: pipelines.base.Pipeline) -> dict: + """ + Gets the appropriate Interface kwargs for a given Hugging Face transformers.Pipeline. + pipeline (transformers.Pipeline): the transformers.Pipeline from which to create an interface + Returns: + (dict): a dictionary of kwargs that can be used to construct an Interface object + """ + try: + import transformers + from transformers import pipelines + except ImportError as ie: + raise ImportError( + "transformers not installed. Please try `pip install transformers`" + ) from ie + if not isinstance(pipeline, pipelines.base.Pipeline): + raise ValueError("pipeline must be a transformers.Pipeline") + + # Handle the different pipelines. The has_attr() checks to make sure the pipeline exists in the + # version of the transformers library that the user has installed. + if hasattr(transformers, "AudioClassificationPipeline") and isinstance( + pipeline, pipelines.audio_classification.AudioClassificationPipeline + ): + pipeline_info = { + "inputs": components.Audio( + source="microphone", type="filepath", label="Input" + ), + "outputs": components.Label(label="Class"), + "preprocess": lambda i: {"inputs": i}, + "postprocess": lambda r: {i["label"].split(", ")[0]: i["score"] for i in r}, + } + elif hasattr(transformers, "AutomaticSpeechRecognitionPipeline") and isinstance( + pipeline, + pipelines.automatic_speech_recognition.AutomaticSpeechRecognitionPipeline, + ): + pipeline_info = { + "inputs": components.Audio( + source="microphone", type="filepath", label="Input" + ), + "outputs": components.Textbox(label="Output"), + "preprocess": lambda i: {"inputs": i}, + "postprocess": lambda r: r["text"], + } + elif hasattr(transformers, "FeatureExtractionPipeline") and isinstance( + pipeline, pipelines.feature_extraction.FeatureExtractionPipeline + ): + pipeline_info = { + "inputs": components.Textbox(label="Input"), + "outputs": components.Dataframe(label="Output"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r[0], + } + elif hasattr(transformers, "FillMaskPipeline") and isinstance( + pipeline, pipelines.fill_mask.FillMaskPipeline + ): + pipeline_info = { + "inputs": components.Textbox(label="Input"), + "outputs": components.Label(label="Classification"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: {i["token_str"]: i["score"] for i in r}, + } + elif hasattr(transformers, "ImageClassificationPipeline") and isinstance( + pipeline, pipelines.image_classification.ImageClassificationPipeline + ): + pipeline_info = { + "inputs": components.Image(type="filepath", label="Input Image"), + "outputs": components.Label(type="confidences", label="Classification"), + "preprocess": lambda i: {"images": i}, + "postprocess": lambda r: {i["label"].split(", ")[0]: i["score"] for i in r}, + } + elif hasattr(transformers, "QuestionAnsweringPipeline") and isinstance( + pipeline, pipelines.question_answering.QuestionAnsweringPipeline + ): + pipeline_info = { + "inputs": [ + components.Textbox(lines=7, label="Context"), + components.Textbox(label="Question"), + ], + "outputs": [ + components.Textbox(label="Answer"), + components.Label(label="Score"), + ], + "preprocess": lambda c, q: {"context": c, "question": q}, + "postprocess": lambda r: (r["answer"], r["score"]), + } + elif hasattr(transformers, "SummarizationPipeline") and isinstance( + pipeline, pipelines.text2text_generation.SummarizationPipeline + ): + pipeline_info = { + "inputs": components.Textbox(lines=7, label="Input"), + "outputs": components.Textbox(label="Summary"), + "preprocess": lambda x: {"inputs": x}, + "postprocess": lambda r: r[0]["summary_text"], + } + elif hasattr(transformers, "TextClassificationPipeline") and isinstance( + pipeline, pipelines.text_classification.TextClassificationPipeline + ): + pipeline_info = { + "inputs": components.Textbox(label="Input"), + "outputs": components.Label(label="Classification"), + "preprocess": lambda x: [x], + "postprocess": lambda r: {i["label"].split(", ")[0]: i["score"] for i in r}, + } + elif hasattr(transformers, "TextGenerationPipeline") and isinstance( + pipeline, pipelines.text_generation.TextGenerationPipeline + ): + pipeline_info = { + "inputs": components.Textbox(label="Input"), + "outputs": components.Textbox(label="Output"), + "preprocess": lambda x: {"text_inputs": x}, + "postprocess": lambda r: r[0]["generated_text"], + } + elif hasattr(transformers, "TranslationPipeline") and isinstance( + pipeline, pipelines.text2text_generation.TranslationPipeline + ): + pipeline_info = { + "inputs": components.Textbox(label="Input"), + "outputs": components.Textbox(label="Translation"), + "preprocess": lambda x: [x], + "postprocess": lambda r: r[0]["translation_text"], + } + elif hasattr(transformers, "Text2TextGenerationPipeline") and isinstance( + pipeline, pipelines.text2text_generation.Text2TextGenerationPipeline + ): + pipeline_info = { + "inputs": components.Textbox(label="Input"), + "outputs": components.Textbox(label="Generated Text"), + "preprocess": lambda x: [x], + "postprocess": lambda r: r[0]["generated_text"], + } + elif hasattr(transformers, "ZeroShotClassificationPipeline") and isinstance( + pipeline, pipelines.zero_shot_classification.ZeroShotClassificationPipeline + ): + pipeline_info = { + "inputs": [ + components.Textbox(label="Input"), + components.Textbox(label="Possible class names (" "comma-separated)"), + components.Checkbox(label="Allow multiple true classes"), + ], + "outputs": components.Label(label="Classification"), + "preprocess": lambda i, c, m: { + "sequences": i, + "candidate_labels": c, + "multi_label": m, + }, + "postprocess": lambda r: { + r["labels"][i]: r["scores"][i] for i in range(len(r["labels"])) + }, + } + elif hasattr(transformers, "DocumentQuestionAnsweringPipeline") and isinstance( + pipeline, + pipelines.document_question_answering.DocumentQuestionAnsweringPipeline, # type: ignore + ): + pipeline_info = { + "inputs": [ + components.Image(type="filepath", label="Input Document"), + components.Textbox(label="Question"), + ], + "outputs": components.Label(label="Label"), + "preprocess": lambda img, q: {"image": img, "question": q}, + "postprocess": lambda r: {i["answer"]: i["score"] for i in r}, + } + elif hasattr(transformers, "VisualQuestionAnsweringPipeline") and isinstance( + pipeline, pipelines.visual_question_answering.VisualQuestionAnsweringPipeline + ): + pipeline_info = { + "inputs": [ + components.Image(type="filepath", label="Input Image"), + components.Textbox(label="Question"), + ], + "outputs": components.Label(label="Score"), + "preprocess": lambda img, q: {"image": img, "question": q}, + "postprocess": lambda r: {i["answer"]: i["score"] for i in r}, + } + elif hasattr(transformers, "ImageToTextPipeline") and isinstance( + pipeline, pipelines.image_to_text.ImageToTextPipeline # type: ignore + ): + pipeline_info = { + "inputs": components.Image(type="filepath", label="Input Image"), + "outputs": components.Textbox(label="Text"), + "preprocess": lambda i: {"images": i}, + "postprocess": lambda r: r[0]["generated_text"], + } + else: + raise ValueError(f"Unsupported pipeline type: {type(pipeline)}") + + # define the function that will be called by the Interface + def fn(*params): + data = pipeline_info["preprocess"](*params) + # special cases that needs to be handled differently + if isinstance( + pipeline, + ( + pipelines.text_classification.TextClassificationPipeline, + pipelines.text2text_generation.Text2TextGenerationPipeline, + pipelines.text2text_generation.TranslationPipeline, + ), + ): + data = pipeline(*data) + else: + data = pipeline(**data) + output = pipeline_info["postprocess"](data) + return output + + interface_info = pipeline_info.copy() + interface_info["fn"] = fn + del interface_info["preprocess"] + del interface_info["postprocess"] + + # define the title/description of the Interface + interface_info["title"] = pipeline.model.__class__.__name__ + + return interface_info diff --git a/gradio/processing_utils.py b/gradio/processing_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..e4fecdf4fe0bd7cf4a60b357aa56f1ebca26a40c --- /dev/null +++ b/gradio/processing_utils.py @@ -0,0 +1,546 @@ +from __future__ import annotations + +import base64 +import json +import logging +import os +import shutil +import subprocess +import tempfile +import warnings +from io import BytesIO +from pathlib import Path + +import numpy as np +from gradio_client import utils as client_utils +from PIL import Image, ImageOps, PngImagePlugin + +from gradio import wasm_utils + +if not wasm_utils.IS_WASM: + # TODO: Support ffmpeg on Wasm + from ffmpy import FFmpeg, FFprobe, FFRuntimeError + +with warnings.catch_warnings(): + warnings.simplefilter("ignore") # Ignore pydub warning if ffmpeg is not installed + from pydub import AudioSegment + +log = logging.getLogger(__name__) + +######################### +# GENERAL +######################### + + +def to_binary(x: str | dict) -> bytes: + """Converts a base64 string or dictionary to a binary string that can be sent in a POST.""" + if isinstance(x, dict): + if x.get("data"): + base64str = x["data"] + else: + base64str = client_utils.encode_url_or_file_to_base64(x["name"]) + else: + base64str = x + return base64.b64decode(extract_base64_data(base64str)) + + +def extract_base64_data(x: str) -> str: + """Just extracts the base64 data from a general base64 string.""" + return x.rsplit(",", 1)[-1] + + +######################### +# IMAGE PRE-PROCESSING +######################### + + +def decode_base64_to_image(encoding: str) -> Image.Image: + image_encoded = extract_base64_data(encoding) + img = Image.open(BytesIO(base64.b64decode(image_encoded))) + try: + if hasattr(ImageOps, "exif_transpose"): + img = ImageOps.exif_transpose(img) + except Exception: + log.warning( + "Failed to transpose image %s based on EXIF data.", + img, + exc_info=True, + ) + return img + + +def encode_plot_to_base64(plt): + with BytesIO() as output_bytes: + plt.savefig(output_bytes, format="png") + bytes_data = output_bytes.getvalue() + base64_str = str(base64.b64encode(bytes_data), "utf-8") + return "data:image/png;base64," + base64_str + + +def get_pil_metadata(pil_image): + # Copy any text-only metadata + metadata = PngImagePlugin.PngInfo() + for key, value in pil_image.info.items(): + if isinstance(key, str) and isinstance(value, str): + metadata.add_text(key, value) + + return metadata + + +def encode_pil_to_bytes(pil_image, format="png"): + with BytesIO() as output_bytes: + pil_image.save(output_bytes, format, pnginfo=get_pil_metadata(pil_image)) + return output_bytes.getvalue() + + +def encode_pil_to_base64(pil_image): + bytes_data = encode_pil_to_bytes(pil_image) + base64_str = str(base64.b64encode(bytes_data), "utf-8") + return "data:image/png;base64," + base64_str + + +def encode_array_to_base64(image_array): + with BytesIO() as output_bytes: + pil_image = Image.fromarray(_convert(image_array, np.uint8, force_copy=False)) + pil_image.save(output_bytes, "PNG") + bytes_data = output_bytes.getvalue() + base64_str = str(base64.b64encode(bytes_data), "utf-8") + return "data:image/png;base64," + base64_str + + +def resize_and_crop(img, size, crop_type="center"): + """ + Resize and crop an image to fit the specified size. + args: + size: `(width, height)` tuple. Pass `None` for either width or height + to only crop and resize the other. + crop_type: can be 'top', 'middle' or 'bottom', depending on this + value, the image will cropped getting the 'top/left', 'middle' or + 'bottom/right' of the image to fit the size. + raises: + ValueError: if an invalid `crop_type` is provided. + """ + if crop_type == "top": + center = (0, 0) + elif crop_type == "center": + center = (0.5, 0.5) + else: + raise ValueError + + resize = list(size) + if size[0] is None: + resize[0] = img.size[0] + if size[1] is None: + resize[1] = img.size[1] + return ImageOps.fit(img, resize, centering=center) # type: ignore + + +################## +# Audio +################## + + +def audio_from_file(filename, crop_min=0, crop_max=100): + try: + audio = AudioSegment.from_file(filename) + except FileNotFoundError as e: + isfile = Path(filename).is_file() + msg = ( + f"Cannot load audio from file: `{'ffprobe' if isfile else filename}` not found." + + " Please install `ffmpeg` in your system to use non-WAV audio file formats" + " and make sure `ffprobe` is in your PATH." + if isfile + else "" + ) + raise RuntimeError(msg) from e + if crop_min != 0 or crop_max != 100: + audio_start = len(audio) * crop_min / 100 + audio_end = len(audio) * crop_max / 100 + audio = audio[audio_start:audio_end] + data = np.array(audio.get_array_of_samples()) + if audio.channels > 1: + data = data.reshape(-1, audio.channels) + return audio.frame_rate, data + + +def audio_to_file(sample_rate, data, filename, format="wav"): + if format == "wav": + data = convert_to_16_bit_wav(data) + audio = AudioSegment( + data.tobytes(), + frame_rate=sample_rate, + sample_width=data.dtype.itemsize, + channels=(1 if len(data.shape) == 1 else data.shape[1]), + ) + file = audio.export(filename, format=format) + file.close() # type: ignore + + +def convert_to_16_bit_wav(data): + # Based on: https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.write.html + warning = "Trying to convert audio automatically from {} to 16-bit int format." + if data.dtype in [np.float64, np.float32, np.float16]: + warnings.warn(warning.format(data.dtype)) + data = data / np.abs(data).max() + data = data * 32767 + data = data.astype(np.int16) + elif data.dtype == np.int32: + warnings.warn(warning.format(data.dtype)) + data = data / 65538 + data = data.astype(np.int16) + elif data.dtype == np.int16: + pass + elif data.dtype == np.uint16: + warnings.warn(warning.format(data.dtype)) + data = data - 32768 + data = data.astype(np.int16) + elif data.dtype == np.uint8: + warnings.warn(warning.format(data.dtype)) + data = data * 257 - 32768 + data = data.astype(np.int16) + else: + raise ValueError( + "Audio data cannot be converted automatically from " + f"{data.dtype} to 16-bit int format." + ) + return data + + +################## +# OUTPUT +################## + + +def _convert(image, dtype, force_copy=False, uniform=False): + """ + Adapted from: https://github.com/scikit-image/scikit-image/blob/main/skimage/util/dtype.py#L510-L531 + + Convert an image to the requested data-type. + Warnings are issued in case of precision loss, or when negative values + are clipped during conversion to unsigned integer types (sign loss). + Floating point values are expected to be normalized and will be clipped + to the range [0.0, 1.0] or [-1.0, 1.0] when converting to unsigned or + signed integers respectively. + Numbers are not shifted to the negative side when converting from + unsigned to signed integer types. Negative values will be clipped when + converting to unsigned integers. + Parameters + ---------- + image : ndarray + Input image. + dtype : dtype + Target data-type. + force_copy : bool, optional + Force a copy of the data, irrespective of its current dtype. + uniform : bool, optional + Uniformly quantize the floating point range to the integer range. + By default (uniform=False) floating point values are scaled and + rounded to the nearest integers, which minimizes back and forth + conversion errors. + .. versionchanged :: 0.15 + ``_convert`` no longer warns about possible precision or sign + information loss. See discussions on these warnings at: + https://github.com/scikit-image/scikit-image/issues/2602 + https://github.com/scikit-image/scikit-image/issues/543#issuecomment-208202228 + https://github.com/scikit-image/scikit-image/pull/3575 + References + ---------- + .. [1] DirectX data conversion rules. + https://msdn.microsoft.com/en-us/library/windows/desktop/dd607323%28v=vs.85%29.aspx + .. [2] Data Conversions. In "OpenGL ES 2.0 Specification v2.0.25", + pp 7-8. Khronos Group, 2010. + .. [3] Proper treatment of pixels as integers. A.W. Paeth. + In "Graphics Gems I", pp 249-256. Morgan Kaufmann, 1990. + .. [4] Dirty Pixels. J. Blinn. In "Jim Blinn's corner: Dirty Pixels", + pp 47-57. Morgan Kaufmann, 1998. + """ + dtype_range = { + bool: (False, True), + np.bool_: (False, True), + np.bool8: (False, True), + float: (-1, 1), + np.float_: (-1, 1), + np.float16: (-1, 1), + np.float32: (-1, 1), + np.float64: (-1, 1), + } + + def _dtype_itemsize(itemsize, *dtypes): + """Return first of `dtypes` with itemsize greater than `itemsize` + Parameters + ---------- + itemsize: int + The data type object element size. + Other Parameters + ---------------- + *dtypes: + Any Object accepted by `np.dtype` to be converted to a data + type object + Returns + ------- + dtype: data type object + First of `dtypes` with itemsize greater than `itemsize`. + """ + return next(dt for dt in dtypes if np.dtype(dt).itemsize >= itemsize) + + def _dtype_bits(kind, bits, itemsize=1): + """Return dtype of `kind` that can store a `bits` wide unsigned int + Parameters: + kind: str + Data type kind. + bits: int + Desired number of bits. + itemsize: int + The data type object element size. + Returns + ------- + dtype: data type object + Data type of `kind` that can store a `bits` wide unsigned int + """ + + s = next( + i + for i in (itemsize,) + (2, 4, 8) + if bits < (i * 8) or (bits == (i * 8) and kind == "u") + ) + + return np.dtype(kind + str(s)) + + def _scale(a, n, m, copy=True): + """Scale an array of unsigned/positive integers from `n` to `m` bits. + Numbers can be represented exactly only if `m` is a multiple of `n`. + Parameters + ---------- + a : ndarray + Input image array. + n : int + Number of bits currently used to encode the values in `a`. + m : int + Desired number of bits to encode the values in `out`. + copy : bool, optional + If True, allocates and returns new array. Otherwise, modifies + `a` in place. + Returns + ------- + out : array + Output image array. Has the same kind as `a`. + """ + kind = a.dtype.kind + if n > m and a.max() < 2**m: + return a.astype(_dtype_bits(kind, m)) + elif n == m: + return a.copy() if copy else a + elif n > m: + # downscale with precision loss + if copy: + b = np.empty(a.shape, _dtype_bits(kind, m)) + np.floor_divide(a, 2 ** (n - m), out=b, dtype=a.dtype, casting="unsafe") + return b + else: + a //= 2 ** (n - m) + return a + elif m % n == 0: + # exact upscale to a multiple of `n` bits + if copy: + b = np.empty(a.shape, _dtype_bits(kind, m)) + np.multiply(a, (2**m - 1) // (2**n - 1), out=b, dtype=b.dtype) + return b + else: + a = a.astype(_dtype_bits(kind, m, a.dtype.itemsize), copy=False) + a *= (2**m - 1) // (2**n - 1) + return a + else: + # upscale to a multiple of `n` bits, + # then downscale with precision loss + o = (m // n + 1) * n + if copy: + b = np.empty(a.shape, _dtype_bits(kind, o)) + np.multiply(a, (2**o - 1) // (2**n - 1), out=b, dtype=b.dtype) + b //= 2 ** (o - m) + return b + else: + a = a.astype(_dtype_bits(kind, o, a.dtype.itemsize), copy=False) + a *= (2**o - 1) // (2**n - 1) + a //= 2 ** (o - m) + return a + + image = np.asarray(image) + dtypeobj_in = image.dtype + dtypeobj_out = np.dtype("float64") if dtype is np.floating else np.dtype(dtype) + dtype_in = dtypeobj_in.type + dtype_out = dtypeobj_out.type + kind_in = dtypeobj_in.kind + kind_out = dtypeobj_out.kind + itemsize_in = dtypeobj_in.itemsize + itemsize_out = dtypeobj_out.itemsize + + # Below, we do an `issubdtype` check. Its purpose is to find out + # whether we can get away without doing any image conversion. This happens + # when: + # + # - the output and input dtypes are the same or + # - when the output is specified as a type, and the input dtype + # is a subclass of that type (e.g. `np.floating` will allow + # `float32` and `float64` arrays through) + + if np.issubdtype(dtype_in, np.obj2sctype(dtype)): + if force_copy: + image = image.copy() + return image + + if kind_in in "ui": + imin_in = np.iinfo(dtype_in).min + imax_in = np.iinfo(dtype_in).max + if kind_out in "ui": + imin_out = np.iinfo(dtype_out).min # type: ignore + imax_out = np.iinfo(dtype_out).max # type: ignore + + # any -> binary + if kind_out == "b": + return image > dtype_in(dtype_range[dtype_in][1] / 2) + + # binary -> any + if kind_in == "b": + result = image.astype(dtype_out) + if kind_out != "f": + result *= dtype_out(dtype_range[dtype_out][1]) + return result + + # float -> any + if kind_in == "f": + if kind_out == "f": + # float -> float + return image.astype(dtype_out) + + if np.min(image) < -1.0 or np.max(image) > 1.0: + raise ValueError("Images of type float must be between -1 and 1.") + # floating point -> integer + # use float type that can represent output integer type + computation_type = _dtype_itemsize( + itemsize_out, dtype_in, np.float32, np.float64 + ) + + if not uniform: + if kind_out == "u": + image_out = np.multiply(image, imax_out, dtype=computation_type) # type: ignore + else: + image_out = np.multiply( + image, (imax_out - imin_out) / 2, dtype=computation_type # type: ignore + ) + image_out -= 1.0 / 2.0 + np.rint(image_out, out=image_out) + np.clip(image_out, imin_out, imax_out, out=image_out) # type: ignore + elif kind_out == "u": + image_out = np.multiply(image, imax_out + 1, dtype=computation_type) # type: ignore + np.clip(image_out, 0, imax_out, out=image_out) # type: ignore + else: + image_out = np.multiply( + image, (imax_out - imin_out + 1.0) / 2.0, dtype=computation_type # type: ignore + ) + np.floor(image_out, out=image_out) + np.clip(image_out, imin_out, imax_out, out=image_out) # type: ignore + return image_out.astype(dtype_out) + + # signed/unsigned int -> float + if kind_out == "f": + # use float type that can exactly represent input integers + computation_type = _dtype_itemsize( + itemsize_in, dtype_out, np.float32, np.float64 + ) + + if kind_in == "u": + # using np.divide or np.multiply doesn't copy the data + # until the computation time + image = np.multiply(image, 1.0 / imax_in, dtype=computation_type) # type: ignore + # DirectX uses this conversion also for signed ints + # if imin_in: + # np.maximum(image, -1.0, out=image) + else: + image = np.add(image, 0.5, dtype=computation_type) + image *= 2 / (imax_in - imin_in) # type: ignore + + return np.asarray(image, dtype_out) + + # unsigned int -> signed/unsigned int + if kind_in == "u": + if kind_out == "i": + # unsigned int -> signed int + image = _scale(image, 8 * itemsize_in, 8 * itemsize_out - 1) + return image.view(dtype_out) + else: + # unsigned int -> unsigned int + return _scale(image, 8 * itemsize_in, 8 * itemsize_out) + + # signed int -> unsigned int + if kind_out == "u": + image = _scale(image, 8 * itemsize_in - 1, 8 * itemsize_out) + result = np.empty(image.shape, dtype_out) + np.maximum(image, 0, out=result, dtype=image.dtype, casting="unsafe") + return result + + # signed int -> signed int + if itemsize_in > itemsize_out: + return _scale(image, 8 * itemsize_in - 1, 8 * itemsize_out - 1) + + image = image.astype(_dtype_bits("i", itemsize_out * 8)) + image -= imin_in # type: ignore + image = _scale(image, 8 * itemsize_in, 8 * itemsize_out, copy=False) + image += imin_out # type: ignore + return image.astype(dtype_out) + + +def ffmpeg_installed() -> bool: + if wasm_utils.IS_WASM: + # TODO: Support ffmpeg in WASM + return False + + return shutil.which("ffmpeg") is not None + + +def video_is_playable(video_filepath: str) -> bool: + """Determines if a video is playable in the browser. + + A video is playable if it has a playable container and codec. + .mp4 -> h264 + .webm -> vp9 + .ogg -> theora + """ + try: + container = Path(video_filepath).suffix.lower() + probe = FFprobe( + global_options="-show_format -show_streams -select_streams v -print_format json", + inputs={video_filepath: None}, + ) + output = probe.run(stderr=subprocess.PIPE, stdout=subprocess.PIPE) + output = json.loads(output[0]) + video_codec = output["streams"][0]["codec_name"] + return (container, video_codec) in [ + (".mp4", "h264"), + (".ogg", "theora"), + (".webm", "vp9"), + ] + # If anything goes wrong, assume the video can be played to not convert downstream + except (FFRuntimeError, IndexError, KeyError): + return True + + +def convert_video_to_playable_mp4(video_path: str) -> str: + """Convert the video to mp4. If something goes wrong return the original video.""" + try: + with tempfile.NamedTemporaryFile(delete=False) as tmp_file: + output_path = Path(video_path).with_suffix(".mp4") + shutil.copy2(video_path, tmp_file.name) + # ffmpeg will automatically use h264 codec (playable in browser) when converting to mp4 + ff = FFmpeg( + inputs={str(tmp_file.name): None}, + outputs={str(output_path): None}, + global_options="-y -loglevel quiet", + ) + ff.run() + except FFRuntimeError as e: + print(f"Error converting video to browser-playable format {str(e)}") + output_path = video_path + finally: + # Remove temp file + os.remove(tmp_file.name) # type: ignore + return str(output_path) diff --git a/gradio/queueing.py b/gradio/queueing.py new file mode 100644 index 0000000000000000000000000000000000000000..86cc86a942a01b9fa98d1782807e666ff98b6d74 --- /dev/null +++ b/gradio/queueing.py @@ -0,0 +1,502 @@ +from __future__ import annotations + +import asyncio +import copy +import time +from asyncio import TimeoutError as AsyncTimeOutError +from collections import deque +from typing import Any + +import fastapi +import httpx +from typing_extensions import Literal + +from gradio.data_classes import ( + Estimation, + LogMessage, + PredictBody, + Progress, + ProgressUnit, +) +from gradio.helpers import TrackedIterable +from gradio.utils import AsyncRequest, run_coro_in_background, set_task_name + + +class Event: + def __init__( + self, + websocket: fastapi.WebSocket, + session_hash: str, + fn_index: int, + ): + self.websocket = websocket + self.session_hash: str = session_hash + self.fn_index: int = fn_index + self._id = f"{self.session_hash}_{self.fn_index}" + self.data: PredictBody | None = None + self.lost_connection_time: float | None = None + self.token: str | None = None + self.progress: Progress | None = None + self.progress_pending: bool = False + self.log_messages: deque[LogMessage] = deque() + + async def disconnect(self, code: int = 1000): + await self.websocket.close(code=code) + + +class Queue: + def __init__( + self, + live_updates: bool, + concurrency_count: int, + update_intervals: float, + max_size: int | None, + blocks_dependencies: list, + ): + self.event_queue: deque[Event] = deque() + self.events_pending_reconnection = [] + self.stopped = False + self.max_thread_count = concurrency_count + self.update_intervals = update_intervals + self.active_jobs: list[None | list[Event]] = [None] * concurrency_count + self.delete_lock = asyncio.Lock() + self.server_path = None + self.duration_history_total = 0 + self.duration_history_count = 0 + self.avg_process_time = 0 + self.avg_concurrent_process_time = None + self.queue_duration = 1 + self.live_updates = live_updates + self.sleep_when_free = 0.05 + self.progress_update_sleep_when_free = 0.1 + self.max_size = max_size + self.blocks_dependencies = blocks_dependencies + self.access_token = "" + self.queue_client = None + self.continuous_tasks: list[Event] = [] + + async def start(self, ssl_verify=True): + # So that the client is attached to the running event loop + self.queue_client = httpx.AsyncClient(verify=ssl_verify) + + run_coro_in_background(self.start_processing) + run_coro_in_background(self.start_log_and_progress_updates) + if not self.live_updates: + run_coro_in_background(self.notify_clients) + + def close(self): + self.stopped = True + + def resume(self): + self.stopped = False + + def set_url(self, url: str): + self.server_path = url + + def set_access_token(self, token: str): + self.access_token = token + + def get_active_worker_count(self) -> int: + count = 0 + for worker in self.active_jobs: + if worker is not None: + count += 1 + return count + + def get_events_in_batch(self) -> tuple[list[Event] | None, bool]: + if not (self.event_queue): + return None, False + + first_event = self.event_queue.popleft() + events = [first_event] + + event_fn_index = first_event.fn_index + batch = self.blocks_dependencies[event_fn_index]["batch"] + + if batch: + batch_size = self.blocks_dependencies[event_fn_index]["max_batch_size"] + rest_of_batch = [ + event for event in self.event_queue if event.fn_index == event_fn_index + ][: batch_size - 1] + events.extend(rest_of_batch) + [self.event_queue.remove(event) for event in rest_of_batch] + + return events, batch + + async def start_processing(self) -> None: + while not self.stopped: + if not self.event_queue: + await asyncio.sleep(self.sleep_when_free) + continue + + if None not in self.active_jobs: + await asyncio.sleep(self.sleep_when_free) + continue + # Using mutex to avoid editing a list in use + async with self.delete_lock: + events, batch = self.get_events_in_batch() + + if events: + self.active_jobs[self.active_jobs.index(None)] = events + task = run_coro_in_background(self.process_events, events, batch) + run_coro_in_background(self.broadcast_live_estimations) + set_task_name(task, events[0].session_hash, events[0].fn_index, batch) + + async def start_log_and_progress_updates(self) -> None: + while not self.stopped: + events = [ + evt for job in self.active_jobs if job is not None for evt in job + ] + self.continuous_tasks + + if len(events) == 0: + await asyncio.sleep(self.progress_update_sleep_when_free) + continue + + for event in events: + if event.progress_pending and event.progress: + event.progress_pending = False + client_awake = await self.send_message(event, event.progress.dict()) + if not client_awake: + await self.clean_event(event) + await self.send_log_updates_for_event(event) + + await asyncio.sleep(self.progress_update_sleep_when_free) + + async def send_log_updates_for_event(self, event: Event) -> None: + while True: + try: + message = event.log_messages.popleft() + except IndexError: + break + client_awake = await self.send_message(event, message.dict()) + if not client_awake: + await self.clean_event(event) + + def set_progress( + self, + event_id: str, + iterables: list[TrackedIterable] | None, + ): + if iterables is None: + return + for job in self.active_jobs: + if job is None: + continue + for evt in job: + if evt._id == event_id: + progress_data: list[ProgressUnit] = [] + for iterable in iterables: + progress_unit = ProgressUnit( + index=iterable.index, + length=iterable.length, + unit=iterable.unit, + progress=iterable.progress, + desc=iterable.desc, + ) + progress_data.append(progress_unit) + evt.progress = Progress(progress_data=progress_data) + evt.progress_pending = True + + def log_message( + self, + event_id: str, + log: str, + level: Literal["info", "warning"], + ): + events = [ + evt for job in self.active_jobs if job is not None for evt in job + ] + self.continuous_tasks + for event in events: + if event._id == event_id: + log_message = LogMessage( + log=log, + level=level, + ) + event.log_messages.append(log_message) + + def push(self, event: Event) -> int | None: + """ + Add event to queue, or return None if Queue is full + Parameters: + event: Event to add to Queue + Returns: + rank of submitted Event + """ + queue_len = len(self.event_queue) + if self.max_size is not None and queue_len >= self.max_size: + return None + self.event_queue.append(event) + return queue_len + + async def clean_event(self, event: Event) -> None: + if event in self.event_queue: + async with self.delete_lock: + self.event_queue.remove(event) + + async def broadcast_live_estimations(self) -> None: + """ + Runs 2 functions sequentially instead of concurrently. Otherwise dced clients are tried to get deleted twice. + """ + if self.live_updates: + await self.broadcast_estimations() + + async def gather_event_data(self, event: Event, receive_timeout=60) -> bool: + """ + Gather data for the event + Parameters: + event: the Event to gather data for + receive_timeout: how long to wait for data to be received from frontend + """ + if not event.data: + client_awake = await self.send_message(event, {"msg": "send_data"}) + if not client_awake: + return False + data, client_awake = await self.get_message(event, timeout=receive_timeout) + if not client_awake: + # In the event, we timeout due to large data size + # Let the client know, otherwise will hang + await self.send_message( + event, + { + "msg": "process_completed", + "output": {"error": "Time out uploading data to server"}, + "success": False, + }, + ) + return False + event.data = data + return True + + async def notify_clients(self) -> None: + """ + Notify clients about events statuses in the queue periodically. + """ + while not self.stopped: + await asyncio.sleep(self.update_intervals) + if self.event_queue: + await self.broadcast_estimations() + + async def broadcast_estimations(self) -> None: + estimation = self.get_estimation() + # Send all messages concurrently + await asyncio.gather( + *[ + self.send_estimation(event, estimation, rank) + for rank, event in enumerate(self.event_queue) + ] + ) + + async def send_estimation( + self, event: Event, estimation: Estimation, rank: int + ) -> Estimation: + """ + Send estimation about ETA to the client. + + Parameters: + event: + estimation: + rank: + """ + estimation.rank = rank + + if self.avg_concurrent_process_time is not None: + estimation.rank_eta = ( + estimation.rank * self.avg_concurrent_process_time + + self.avg_process_time + ) + if None not in self.active_jobs: + # Add estimated amount of time for a thread to get empty + estimation.rank_eta += self.avg_concurrent_process_time + client_awake = await self.send_message(event, estimation.dict()) + if not client_awake: + await self.clean_event(event) + return estimation + + def update_estimation(self, duration: float) -> None: + """ + Update estimation by last x element's average duration. + + Parameters: + duration: + """ + self.duration_history_total += duration + self.duration_history_count += 1 + self.avg_process_time = ( + self.duration_history_total / self.duration_history_count + ) + self.avg_concurrent_process_time = self.avg_process_time / min( + self.max_thread_count, self.duration_history_count + ) + self.queue_duration = self.avg_concurrent_process_time * len(self.event_queue) + + def get_estimation(self) -> Estimation: + return Estimation( + queue_size=len(self.event_queue), + avg_event_process_time=self.avg_process_time, + avg_event_concurrent_process_time=self.avg_concurrent_process_time, + queue_eta=self.queue_duration, + ) + + def get_request_params(self, websocket: fastapi.WebSocket) -> dict[str, Any]: + return { + "url": str(websocket.url), + "headers": dict(websocket.headers), + "query_params": dict(websocket.query_params), + "path_params": dict(websocket.path_params), + "client": {"host": websocket.client.host, "port": websocket.client.port}, # type: ignore + } + + async def call_prediction(self, events: list[Event], batch: bool): + data = events[0].data + assert data is not None, "No event data" + token = events[0].token + data.event_id = events[0]._id if not batch else None + try: + data.request = self.get_request_params(events[0].websocket) + except ValueError: + pass + + if batch: + data.data = list(zip(*[event.data.data for event in events if event.data])) + data.request = [ + self.get_request_params(event.websocket) + for event in events + if event.data + ] + data.batched = True + response = await AsyncRequest( + method=AsyncRequest.Method.POST, + url=f"{self.server_path}api/predict", + json=dict(data), + headers={"Authorization": f"Bearer {self.access_token}"}, + cookies={"access-token": token} if token is not None else None, + client=self.queue_client, + ) + return response + + async def process_events(self, events: list[Event], batch: bool) -> None: + awake_events: list[Event] = [] + try: + for event in events: + client_awake = await self.gather_event_data(event) + if client_awake: + client_awake = await self.send_message( + event, {"msg": "process_starts"} + ) + if client_awake: + awake_events.append(event) + if not awake_events: + return + begin_time = time.time() + response = await self.call_prediction(awake_events, batch) + if response.has_exception: + for event in awake_events: + await self.send_message( + event, + { + "msg": "process_completed", + "output": {"error": str(response.exception)}, + "success": False, + }, + ) + elif response.json.get("is_generating", False): + old_response = response + while response.json.get("is_generating", False): + old_response = response + open_ws = [] + for event in awake_events: + open = await self.send_message( + event, + { + "msg": "process_generating", + "output": old_response.json, + "success": old_response.status == 200, + }, + ) + open_ws.append(open) + awake_events = [ + e for e, is_open in zip(awake_events, open_ws) if is_open + ] + if not awake_events: + return + response = await self.call_prediction(awake_events, batch) + for event in awake_events: + if response.status != 200: + relevant_response = response + else: + relevant_response = old_response + await self.send_log_updates_for_event(event) + await self.send_message( + event, + { + "msg": "process_completed", + "output": relevant_response.json, + "success": relevant_response.status == 200, + }, + ) + else: + output = copy.deepcopy(response.json) + for e, event in enumerate(awake_events): + if batch and "data" in output: + output["data"] = list(zip(*response.json.get("data")))[e] + await self.send_log_updates_for_event( + event + ) # clean out pending log updates first + await self.send_message( + event, + { + "msg": "process_completed", + "output": output, + "success": response.status == 200, + }, + ) + end_time = time.time() + if response.status == 200: + self.update_estimation(end_time - begin_time) + except Exception as e: + print(e) + finally: + for event in awake_events: + try: + await event.disconnect() + except Exception: + pass + self.active_jobs[self.active_jobs.index(events)] = None + for event in events: + await self.clean_event(event) + # Always reset the state of the iterator + # If the job finished successfully, this has no effect + # If the job is cancelled, this will enable future runs + # to start "from scratch" + await self.reset_iterators(event.session_hash, event.fn_index) + + async def send_message(self, event, data: dict, timeout: float | int = 1) -> bool: + try: + await asyncio.wait_for( + event.websocket.send_json(data=data), timeout=timeout + ) + return True + except Exception: + await self.clean_event(event) + return False + + async def get_message(self, event, timeout=5) -> tuple[PredictBody | None, bool]: + try: + data = await asyncio.wait_for( + event.websocket.receive_json(), timeout=timeout + ) + return PredictBody(**data), True + except AsyncTimeOutError: + await self.clean_event(event) + return None, False + + async def reset_iterators(self, session_hash: str, fn_index: int): + await AsyncRequest( + method=AsyncRequest.Method.POST, + url=f"{self.server_path}reset", + json={ + "session_hash": session_hash, + "fn_index": fn_index, + }, + client=self.queue_client, + ) diff --git a/gradio/ranged_response.py b/gradio/ranged_response.py new file mode 100644 index 0000000000000000000000000000000000000000..88eb696184e56f683f8feabbf895a1bd6346a667 --- /dev/null +++ b/gradio/ranged_response.py @@ -0,0 +1,185 @@ +# Taken from https://gist.github.com/kevinastone/a6a62db57577b3f24e8a6865ed311463 +# Context: https://github.com/encode/starlette/pull/1090 +from __future__ import annotations + +import os +import re +import stat +from typing import NamedTuple +from urllib.parse import quote + +import aiofiles +from aiofiles.os import stat as aio_stat +from starlette.datastructures import Headers +from starlette.exceptions import HTTPException +from starlette.responses import Response, guess_type +from starlette.staticfiles import StaticFiles +from starlette.types import Receive, Scope, Send + +RANGE_REGEX = re.compile(r"^bytes=(?P\d+)-(?P\d*)$") + + +class ClosedRange(NamedTuple): + start: int + end: int + + def __len__(self) -> int: + return self.end - self.start + 1 + + def __bool__(self) -> bool: + return len(self) > 0 + + +class OpenRange(NamedTuple): + start: int + end: int | None = None + + def clamp(self, start: int, end: int) -> ClosedRange: + begin = max(self.start, start) + end = min(x for x in (self.end, end) if x) + + begin = min(begin, end) + end = max(begin, end) + + return ClosedRange(begin, end) + + +class RangedFileResponse(Response): + chunk_size = 4096 + + def __init__( + self, + path: str | os.PathLike, + range: OpenRange, + headers: dict[str, str] | None = None, + media_type: str | None = None, + filename: str | None = None, + stat_result: os.stat_result | None = None, + method: str | None = None, + ) -> None: + assert aiofiles is not None, "'aiofiles' must be installed to use FileResponse" + self.path = path + self.range = range + self.filename = filename + self.background = None + self.send_header_only = method is not None and method.upper() == "HEAD" + if media_type is None: + media_type = guess_type(filename or path)[0] or "text/plain" + self.media_type = media_type + self.init_headers(headers or {}) + if self.filename is not None: + content_disposition_filename = quote(self.filename) + if content_disposition_filename != self.filename: + content_disposition = ( + f"attachment; filename*=utf-8''{content_disposition_filename}" + ) + else: + content_disposition = f'attachment; filename="{self.filename}"' + self.headers.setdefault("content-disposition", content_disposition) + self.stat_result = stat_result + + def set_range_headers(self, range: ClosedRange) -> None: + assert self.stat_result + total_length = self.stat_result.st_size + content_length = len(range) + self.headers[ + "content-range" + ] = f"bytes {range.start}-{range.end}/{total_length}" + self.headers["content-length"] = str(content_length) + pass + + async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if self.stat_result is None: + try: + stat_result = await aio_stat(self.path) + self.stat_result = stat_result + except FileNotFoundError as fnfe: + raise RuntimeError( + f"File at path {self.path} does not exist." + ) from fnfe + else: + mode = stat_result.st_mode + if not stat.S_ISREG(mode): + raise RuntimeError(f"File at path {self.path} is not a file.") + + byte_range = self.range.clamp(0, self.stat_result.st_size) + self.set_range_headers(byte_range) + + async with aiofiles.open(self.path, mode="rb") as file: + await file.seek(byte_range.start) + await send( + { + "type": "http.response.start", + "status": 206, + "headers": self.raw_headers, + } + ) + if self.send_header_only: + await send( + {"type": "http.response.body", "body": b"", "more_body": False} + ) + else: + remaining_bytes = len(byte_range) + + if not byte_range: + await send( + {"type": "http.response.body", "body": b"", "more_body": False} + ) + return + + while remaining_bytes > 0: + chunk_size = min(self.chunk_size, remaining_bytes) + chunk = await file.read(chunk_size) + remaining_bytes -= len(chunk) + await send( + { + "type": "http.response.body", + "body": chunk, + "more_body": remaining_bytes > 0, + } + ) + + +class RangedStaticFiles(StaticFiles): + def file_response( + self, + full_path: str | os.PathLike, + stat_result: os.stat_result, + scope: Scope, + status_code: int = 200, + ) -> Response: + request_headers = Headers(scope=scope) + + if request_headers.get("range"): + response = self.ranged_file_response( + full_path, stat_result=stat_result, scope=scope + ) + else: + response = super().file_response( + full_path, stat_result=stat_result, scope=scope, status_code=status_code + ) + response.headers["accept-ranges"] = "bytes" + return response + + def ranged_file_response( + self, + full_path: str | os.PathLike, + stat_result: os.stat_result, + scope: Scope, + ) -> Response: + method = scope["method"] + request_headers = Headers(scope=scope) + + range_header = request_headers["range"] + + match = RANGE_REGEX.search(range_header) + if not match: + raise HTTPException(400) + + start, end = match.group("start"), match.group("end") + + range = OpenRange(int(start), int(end) if end else None) + + return RangedFileResponse( + full_path, range, stat_result=stat_result, method=method + ) diff --git a/gradio/reload.py b/gradio/reload.py new file mode 100644 index 0000000000000000000000000000000000000000..55be19b2bf037811aa7341f6830ca2576c757b3a --- /dev/null +++ b/gradio/reload.py @@ -0,0 +1,91 @@ +""" + +Contains the functions that run when `gradio` is called from the command line. Specifically, allows + +$ gradio app.py, to run app.py in reload mode where any changes in the app.py file or Gradio library reloads the demo. +$ gradio app.py my_demo.app, to use variable names other than "demo" +""" +import inspect +import os +import sys +from pathlib import Path + +from uvicorn import Config +from uvicorn.supervisors import ChangeReload + +import gradio +from gradio import networking, utils + + +def _setup_config(): + args = sys.argv[1:] + if len(args) == 0: + raise ValueError("No file specified.") + if len(args) == 1 or args[1].startswith("--"): + demo_name = "demo.app" + else: + demo_name = args[1] + if "." not in demo_name: + print( + "\nWARNING: As of Gradio 3.31, the parameter after the file path must be the name of the FastAPI app, not the Gradio demo. In most cases, this just means you should add '.app' after the name of your demo, e.g. 'demo' -> 'demo.app'." + ) + + original_path = args[0] + abs_original_path = utils.abspath(original_path) + path = os.path.normpath(original_path) + path = path.replace("/", ".") + path = path.replace("\\", ".") + filename = os.path.splitext(path)[0] + + gradio_folder = Path(inspect.getfile(gradio)).parent + + port = networking.get_first_available_port( + networking.INITIAL_PORT_VALUE, + networking.INITIAL_PORT_VALUE + networking.TRY_NUM_PORTS, + ) + print( + f"\nLaunching in *reload mode* on: http://{networking.LOCALHOST_NAME}:{port} (Press CTRL+C to quit)\n" + ) + + gradio_app = f"{filename}:{demo_name}" + message = "Watching:" + message_change_count = 0 + + watching_dirs = [] + if str(gradio_folder).strip(): + watching_dirs.append(gradio_folder) + message += f" '{gradio_folder}'" + message_change_count += 1 + + abs_parent = abs_original_path.parent + if str(abs_parent).strip(): + watching_dirs.append(abs_parent) + if message_change_count == 1: + message += "," + message += f" '{abs_parent}'" + + print(message + "\n") + + # guaranty access to the module of an app + sys.path.insert(0, os.getcwd()) + + # uvicorn.run blocks the execution (looping) which makes it hard to test + return Config( + gradio_app, + reload=True, + port=port, + log_level="warning", + reload_dirs=watching_dirs, + ) + + +def main(): + # default execution pattern to start the server and watch changes + config = _setup_config() + server = networking.Server(config) + sock = config.bind_socket() + ChangeReload(config, target=server.run, sockets=[sock]).run() + + +if __name__ == "__main__": + main() diff --git a/gradio/routes.py b/gradio/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..1fbeb9d07896518f7b3c8e497ed809da08c2a5fb --- /dev/null +++ b/gradio/routes.py @@ -0,0 +1,827 @@ +"""Implements a FastAPI server to run the gradio interface. Note that some types in this +module use the Optional/Union notation so that they work correctly with pydantic.""" + +from __future__ import annotations + +import asyncio +import inspect +import json +import mimetypes +import os +import posixpath +import secrets +import tempfile +import traceback +from asyncio import TimeoutError as AsyncTimeOutError +from collections import defaultdict +from copy import deepcopy +from pathlib import Path +from typing import Any, Dict, List, Optional, Type +from urllib.parse import urlparse + +import fastapi +import httpx +import markupsafe +import orjson +import pkg_resources +from fastapi import Depends, FastAPI, File, HTTPException, UploadFile, WebSocket, status +from fastapi.middleware.cors import CORSMiddleware +from fastapi.responses import ( + FileResponse, + HTMLResponse, + JSONResponse, + PlainTextResponse, +) +from fastapi.security import OAuth2PasswordRequestForm +from fastapi.templating import Jinja2Templates +from gradio_client.documentation import document, set_documentation_group +from jinja2.exceptions import TemplateNotFound +from starlette.background import BackgroundTask +from starlette.responses import RedirectResponse, StreamingResponse +from starlette.websockets import WebSocketState + +import gradio +import gradio.ranged_response as ranged_response +from gradio import utils, wasm_utils +from gradio.context import Context +from gradio.data_classes import PredictBody, ResetBody +from gradio.exceptions import Error +from gradio.helpers import EventData +from gradio.queueing import Estimation, Event +from gradio.utils import cancel_tasks, run_coro_in_background, set_task_name + +mimetypes.init() + +STATIC_TEMPLATE_LIB = pkg_resources.resource_filename("gradio", "templates/") +STATIC_PATH_LIB = pkg_resources.resource_filename("gradio", "templates/frontend/static") +BUILD_PATH_LIB = pkg_resources.resource_filename("gradio", "templates/frontend/assets") +VERSION_FILE = pkg_resources.resource_filename("gradio", "version.txt") +with open(VERSION_FILE) as version_file: + VERSION = version_file.read() + + +class ORJSONResponse(JSONResponse): + media_type = "application/json" + + @staticmethod + def _render(content: Any) -> bytes: + return orjson.dumps( + content, + option=orjson.OPT_SERIALIZE_NUMPY | orjson.OPT_PASSTHROUGH_DATETIME, + default=str, + ) + + def render(self, content: Any) -> bytes: + return ORJSONResponse._render(content) + + @staticmethod + def _render_str(content: Any) -> str: + return ORJSONResponse._render(content).decode("utf-8") + + +def toorjson(value): + return markupsafe.Markup( + ORJSONResponse._render_str(value) + .replace("<", "\\u003c") + .replace(">", "\\u003e") + .replace("&", "\\u0026") + .replace("'", "\\u0027") + ) + + +templates = Jinja2Templates(directory=STATIC_TEMPLATE_LIB) +templates.env.filters["toorjson"] = toorjson + +client = httpx.AsyncClient() + +########### +# Auth +########### + + +class App(FastAPI): + """ + FastAPI App Wrapper + """ + + def __init__(self, **kwargs): + self.tokens = {} + self.auth = None + self.blocks: gradio.Blocks | None = None + self.state_holder = {} + self.iterators = defaultdict(dict) + self.iterators_to_reset = defaultdict(set) + self.lock = asyncio.Lock() + self.queue_token = secrets.token_urlsafe(32) + self.startup_events_triggered = False + self.uploaded_file_dir = os.environ.get("GRADIO_TEMP_DIR") or str( + Path(tempfile.gettempdir()) / "gradio" + ) + # Allow user to manually set `docs_url` and `redoc_url` + # when instantiating an App; when they're not set, disable docs and redoc. + kwargs.setdefault("docs_url", None) + kwargs.setdefault("redoc_url", None) + super().__init__(**kwargs) + + def configure_app(self, blocks: gradio.Blocks) -> None: + auth = blocks.auth + if auth is not None: + if not callable(auth): + self.auth = {account[0]: account[1] for account in auth} + else: + self.auth = auth + else: + self.auth = None + + self.blocks = blocks + if hasattr(self.blocks, "_queue"): + self.blocks._queue.set_access_token(self.queue_token) + self.cwd = os.getcwd() + self.favicon_path = blocks.favicon_path + self.tokens = {} + self.root_path = blocks.root_path + + def get_blocks(self) -> gradio.Blocks: + if self.blocks is None: + raise ValueError("No Blocks has been configured for this app.") + return self.blocks + + def build_proxy_request(self, url_path): + url = httpx.URL(url_path) + assert self.blocks + # Don't proxy a URL unless it's a URL specifically loaded by the user using + # gr.load() to prevent SSRF or harvesting of HF tokens by malicious Spaces. + is_safe_url = any( + url.host == httpx.URL(root).host for root in self.blocks.root_urls + ) + if not is_safe_url: + raise PermissionError("This URL cannot be proxied.") + is_hf_url = url.host.endswith(".hf.space") + headers = {} + if Context.hf_token is not None and is_hf_url: + headers["Authorization"] = f"Bearer {Context.hf_token}" + rp_req = client.build_request("GET", url, headers=headers) + return rp_req + + @staticmethod + def create_app( + blocks: gradio.Blocks, app_kwargs: Dict[str, Any] | None = None + ) -> App: + app_kwargs = app_kwargs or {} + if not wasm_utils.IS_WASM: + app_kwargs.setdefault("default_response_class", ORJSONResponse) + app = App(**app_kwargs) + app.configure_app(blocks) + + if not wasm_utils.IS_WASM: + app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_methods=["*"], + allow_headers=["*"], + ) + + @app.get("/user") + @app.get("/user/") + def get_current_user(request: fastapi.Request) -> Optional[str]: + token = request.cookies.get("access-token") or request.cookies.get( + "access-token-unsecure" + ) + return app.tokens.get(token) + + @app.get("/login_check") + @app.get("/login_check/") + def login_check(user: str = Depends(get_current_user)): + if app.auth is None or user is not None: + return + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, detail="Not authenticated" + ) + + async def ws_login_check(websocket: WebSocket) -> Optional[str]: + token = websocket.cookies.get("access-token") or websocket.cookies.get( + "access-token-unsecure" + ) + return token # token is returned to allow request in queue + + @app.get("/token") + @app.get("/token/") + def get_token(request: fastapi.Request) -> dict: + token = request.cookies.get("access-token") + return {"token": token, "user": app.tokens.get(token)} + + @app.get("/app_id") + @app.get("/app_id/") + def app_id(request: fastapi.Request) -> dict: + return {"app_id": app.get_blocks().app_id} + + @app.post("/login") + @app.post("/login/") + def login(form_data: OAuth2PasswordRequestForm = Depends()): + username, password = form_data.username, form_data.password + if app.auth is None: + return RedirectResponse(url="/", status_code=status.HTTP_302_FOUND) + if ( + not callable(app.auth) + and username in app.auth + and app.auth[username] == password + ) or (callable(app.auth) and app.auth.__call__(username, password)): + token = secrets.token_urlsafe(16) + app.tokens[token] = username + response = JSONResponse(content={"success": True}) + response.set_cookie( + key="access-token", + value=token, + httponly=True, + samesite="none", + secure=True, + ) + response.set_cookie( + key="access-token-unsecure", value=token, httponly=True + ) + return response + else: + raise HTTPException(status_code=400, detail="Incorrect credentials.") + + ############### + # Main Routes + ############### + + @app.head("/", response_class=HTMLResponse) + @app.get("/", response_class=HTMLResponse) + def main(request: fastapi.Request, user: str = Depends(get_current_user)): + mimetypes.add_type("application/javascript", ".js") + blocks = app.get_blocks() + root_path = request.scope.get("root_path", "") + + if app.auth is None or user is not None: + config = app.get_blocks().config + config["root"] = root_path + else: + config = { + "auth_required": True, + "auth_message": blocks.auth_message, + "space_id": app.get_blocks().space_id, + "root": root_path, + } + + try: + template = ( + "frontend/share.html" if blocks.share else "frontend/index.html" + ) + return templates.TemplateResponse( + template, + {"request": request, "config": config}, + ) + except TemplateNotFound as err: + if blocks.share: + raise ValueError( + "Did you install Gradio from source files? Share mode only " + "works when Gradio is installed through the pip package." + ) from err + else: + raise ValueError( + "Did you install Gradio from source files? You need to build " + "the frontend by running /scripts/build_frontend.sh" + ) from err + + @app.get("/info/", dependencies=[Depends(login_check)]) + @app.get("/info", dependencies=[Depends(login_check)]) + def api_info(serialize: bool = True): + config = app.get_blocks().config + return gradio.blocks.get_api_info(config, serialize) # type: ignore + + @app.get("/config/", dependencies=[Depends(login_check)]) + @app.get("/config", dependencies=[Depends(login_check)]) + def get_config(request: fastapi.Request): + root_path = request.scope.get("root_path", "") + config = app.get_blocks().config + config["root"] = root_path + return config + + @app.get("/static/{path:path}") + def static_resource(path: str): + static_file = safe_join(STATIC_PATH_LIB, path) + return FileResponse(static_file) + + @app.get("/assets/{path:path}") + def build_resource(path: str): + build_file = safe_join(BUILD_PATH_LIB, path) + return FileResponse(build_file) + + @app.get("/favicon.ico") + async def favicon(): + blocks = app.get_blocks() + if blocks.favicon_path is None: + return static_resource("img/logo.svg") + else: + return FileResponse(blocks.favicon_path) + + @app.head("/proxy={url_path:path}", dependencies=[Depends(login_check)]) + @app.get("/proxy={url_path:path}", dependencies=[Depends(login_check)]) + async def reverse_proxy(url_path: str): + # Adapted from: https://github.com/tiangolo/fastapi/issues/1788 + try: + rp_req = app.build_proxy_request(url_path) + except PermissionError as err: + raise HTTPException(status_code=400, detail=str(err)) from err + rp_resp = await client.send(rp_req, stream=True) + return StreamingResponse( + rp_resp.aiter_raw(), + status_code=rp_resp.status_code, + headers=rp_resp.headers, # type: ignore + background=BackgroundTask(rp_resp.aclose), + ) + + @app.head("/file={path_or_url:path}", dependencies=[Depends(login_check)]) + @app.get("/file={path_or_url:path}", dependencies=[Depends(login_check)]) + async def file(path_or_url: str, request: fastapi.Request): + blocks = app.get_blocks() + if utils.validate_url(path_or_url): + return RedirectResponse( + url=path_or_url, status_code=status.HTTP_302_FOUND + ) + + abs_path = utils.abspath(path_or_url) + + in_blocklist = any( + utils.is_in_or_equal(abs_path, blocked_path) + for blocked_path in blocks.blocked_paths + ) + is_dotfile = any(part.startswith(".") for part in abs_path.parts) + is_dir = abs_path.is_dir() + + if in_blocklist or is_dotfile or is_dir: + raise HTTPException(403, f"File not allowed: {path_or_url}.") + if not abs_path.exists(): + raise HTTPException(404, f"File not found: {path_or_url}.") + + in_app_dir = utils.is_in_or_equal(abs_path, app.cwd) + created_by_app = str(abs_path) in set().union(*blocks.temp_file_sets) + in_allowlist = any( + utils.is_in_or_equal(abs_path, allowed_path) + for allowed_path in blocks.allowed_paths + ) + was_uploaded = utils.is_in_or_equal(abs_path, app.uploaded_file_dir) + + if not (in_app_dir or created_by_app or in_allowlist or was_uploaded): + raise HTTPException(403, f"File not allowed: {path_or_url}.") + + range_val = request.headers.get("Range", "").strip() + if range_val.startswith("bytes=") and "-" in range_val: + range_val = range_val[6:] + start, end = range_val.split("-") + if start.isnumeric() and end.isnumeric(): + start = int(start) + end = int(end) + response = ranged_response.RangedFileResponse( + abs_path, + ranged_response.OpenRange(start, end), + dict(request.headers), + stat_result=os.stat(abs_path), + ) + return response + return FileResponse(abs_path, headers={"Accept-Ranges": "bytes"}) + + @app.get("/file/{path:path}", dependencies=[Depends(login_check)]) + async def file_deprecated(path: str, request: fastapi.Request): + return await file(path, request) + + @app.post("/reset/") + @app.post("/reset") + async def reset_iterator(body: ResetBody): + if body.session_hash not in app.iterators: + return {"success": False} + async with app.lock: + app.iterators[body.session_hash][body.fn_index] = None + app.iterators_to_reset[body.session_hash].add(body.fn_index) + return {"success": True} + + async def run_predict( + body: PredictBody, + request: Request | List[Request], + fn_index_inferred: int, + ): + fn_index = body.fn_index + if hasattr(body, "session_hash"): + if body.session_hash not in app.state_holder: + app.state_holder[body.session_hash] = { + _id: deepcopy(getattr(block, "value", None)) + for _id, block in app.get_blocks().blocks.items() + if getattr(block, "stateful", False) + } + session_state = app.state_holder[body.session_hash] + # The should_reset set keeps track of the fn_indices + # that have been cancelled. When a job is cancelled, + # the /reset route will mark the jobs as having been reset. + # That way if the cancel job finishes BEFORE the job being cancelled + # the job being cancelled will not overwrite the state of the iterator. + if fn_index in app.iterators_to_reset[body.session_hash]: + iterators = {} + app.iterators_to_reset[body.session_hash].remove(fn_index) + else: + iterators = app.iterators[body.session_hash] + else: + session_state = {} + iterators = {} + + event_id = getattr(body, "event_id", None) + raw_input = body.data + + dependency = app.get_blocks().dependencies[fn_index_inferred] + target = dependency["targets"][0] if len(dependency["targets"]) else None + event_data = EventData( + app.get_blocks().blocks.get(target) if target else None, + body.event_data, + ) + batch = dependency["batch"] + if not (body.batched) and batch: + raw_input = [raw_input] + try: + with utils.MatplotlibBackendMananger(): + output = await app.get_blocks().process_api( + fn_index=fn_index_inferred, + inputs=raw_input, + request=request, + state=session_state, + iterators=iterators, + event_id=event_id, + event_data=event_data, + ) + iterator = output.pop("iterator", None) + if hasattr(body, "session_hash"): + app.iterators[body.session_hash][fn_index] = iterator + if isinstance(output, Error): + raise output + except BaseException as error: + show_error = app.get_blocks().show_error or isinstance(error, Error) + traceback.print_exc() + return JSONResponse( + content={"error": str(error) if show_error else None}, + status_code=500, + ) + + if not (body.batched) and batch: + output["data"] = output["data"][0] + return output + + # had to use '/run' endpoint for Colab compatibility, '/api' supported for backwards compatibility + @app.post("/run/{api_name}", dependencies=[Depends(login_check)]) + @app.post("/run/{api_name}/", dependencies=[Depends(login_check)]) + @app.post("/api/{api_name}", dependencies=[Depends(login_check)]) + @app.post("/api/{api_name}/", dependencies=[Depends(login_check)]) + async def predict( + api_name: str, + body: PredictBody, + request: fastapi.Request, + username: str = Depends(get_current_user), + ): + fn_index_inferred = None + if body.fn_index is None: + for i, fn in enumerate(app.get_blocks().dependencies): + if fn["api_name"] == api_name: + fn_index_inferred = i + break + if fn_index_inferred is None: + return JSONResponse( + content={ + "error": f"This app has no endpoint /api/{api_name}/." + }, + status_code=500, + ) + else: + fn_index_inferred = body.fn_index + if ( + not app.get_blocks().api_open + and app.get_blocks().queue_enabled_for_fn(fn_index_inferred) + and f"Bearer {app.queue_token}" != request.headers.get("Authorization") + ): + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Not authorized to skip the queue", + ) + + # If this fn_index cancels jobs, then the only input we need is the + # current session hash + if app.get_blocks().dependencies[fn_index_inferred]["cancels"]: + body.data = [body.session_hash] + if body.request: + if body.batched: + gr_request = [ + Request(username=username, **req) for req in body.request + ] + else: + assert isinstance(body.request, dict) + gr_request = Request(username=username, **body.request) + else: + gr_request = Request(username=username, request=request) + result = await run_predict( + body=body, + fn_index_inferred=fn_index_inferred, + request=gr_request, + ) + return result + + @app.websocket("/queue/join") + async def join_queue( + websocket: WebSocket, + token: Optional[str] = Depends(ws_login_check), + ): + blocks = app.get_blocks() + if app.auth is not None and token is None: + await websocket.close(code=status.WS_1008_POLICY_VIOLATION) + return + if blocks._queue.server_path is None: + app_url = get_server_url_from_ws_url(str(websocket.url)) + blocks._queue.set_url(app_url) + await websocket.accept() + # In order to cancel jobs, we need the session_hash and fn_index + # to create a unique id for each job + try: + await asyncio.wait_for( + websocket.send_json({"msg": "send_hash"}), timeout=5 + ) + except AsyncTimeOutError: + return + + try: + session_info = await asyncio.wait_for( + websocket.receive_json(), timeout=5 + ) + except AsyncTimeOutError: + return + + event = Event( + websocket, session_info["session_hash"], session_info["fn_index"] + ) + # set the token into Event to allow using the same token for call_prediction + event.token = token + event.session_hash = session_info["session_hash"] + + # Continuous events are not put in the queue so that they do not + # occupy the queue's resource as they are expected to run forever + if blocks.dependencies[event.fn_index].get("every", 0): + await cancel_tasks({f"{event.session_hash}_{event.fn_index}"}) + await blocks._queue.reset_iterators(event.session_hash, event.fn_index) + blocks._queue.continuous_tasks.append(event) + task = run_coro_in_background( + blocks._queue.process_events, [event], False + ) + set_task_name(task, event.session_hash, event.fn_index, batch=False) + else: + rank = blocks._queue.push(event) + + if rank is None: + await blocks._queue.send_message(event, {"msg": "queue_full"}) + await event.disconnect() + return + estimation = blocks._queue.get_estimation() + await blocks._queue.send_estimation(event, estimation, rank) + while True: + await asyncio.sleep(1) + if websocket.application_state == WebSocketState.DISCONNECTED: + return + + @app.get( + "/queue/status", + dependencies=[Depends(login_check)], + response_model=Estimation, + ) + async def get_queue_status(): + return app.get_blocks()._queue.get_estimation() + + @app.post("/upload", dependencies=[Depends(login_check)]) + async def upload_file( + files: List[UploadFile] = File(...), + ): + output_files = [] + file_manager = gradio.File() + for input_file in files: + output_files.append( + await file_manager.save_uploaded_file( + input_file, app.uploaded_file_dir + ) + ) + return output_files + + @app.on_event("startup") + @app.get("/startup-events") + async def startup_events(): + if not app.startup_events_triggered: + app.get_blocks().startup_events() + app.startup_events_triggered = True + return True + return False + + @app.get("/theme.css", response_class=PlainTextResponse) + def theme_css(): + return PlainTextResponse(app.get_blocks().theme_css, media_type="text/css") + + @app.get("/robots.txt", response_class=PlainTextResponse) + def robots_txt(): + if app.get_blocks().share: + return "User-agent: *\nDisallow: /" + else: + return "User-agent: *\nDisallow: " + + return app + + +######## +# Helper functions +######## + + +def safe_join(directory: str, path: str) -> str: + """Safely path to a base directory to avoid escaping the base directory. + Borrowed from: werkzeug.security.safe_join""" + _os_alt_seps: List[str] = [ + sep for sep in [os.path.sep, os.path.altsep] if sep is not None and sep != "/" + ] + + if path == "": + raise HTTPException(400) + + filename = posixpath.normpath(path) + fullpath = os.path.join(directory, filename) + if ( + any(sep in filename for sep in _os_alt_seps) + or os.path.isabs(filename) + or filename == ".." + or filename.startswith("../") + or os.path.isdir(fullpath) + ): + raise HTTPException(403) + + if not os.path.exists(fullpath): + raise HTTPException(404, "File not found") + + return fullpath + + +def get_types(cls_set: List[Type]): + docset = [] + types = [] + for cls in cls_set: + doc = inspect.getdoc(cls) or "" + doc_lines = doc.split("\n") + for line in doc_lines: + if "value (" in line: + types.append(line.split("value (")[1].split(")")[0]) + docset.append(doc_lines[1].split(":")[-1]) + return docset, types + + +def get_server_url_from_ws_url(ws_url: str): + ws_url_parsed = urlparse(ws_url) + scheme = "http" if ws_url_parsed.scheme == "ws" else "https" + port = f":{ws_url_parsed.port}" if ws_url_parsed.port else "" + return f"{scheme}://{ws_url_parsed.hostname}{port}{ws_url_parsed.path.replace('queue/join', '')}" + + +set_documentation_group("routes") + + +class Obj: + """ + Using a class to convert dictionaries into objects. Used by the `Request` class. + Credit: https://www.geeksforgeeks.org/convert-nested-python-dictionary-to-object/ + """ + + def __init__(self, dict_): + self.__dict__.update(dict_) + for key, value in dict_.items(): + if isinstance(value, (dict, list)): + value = Obj(value) + setattr(self, key, value) + + def __getitem__(self, item): + return self.__dict__[item] + + def __setitem__(self, item, value): + self.__dict__[item] = value + + def __iter__(self): + for key, value in self.__dict__.items(): + if isinstance(value, Obj): + yield (key, dict(value)) + else: + yield (key, value) + + def __contains__(self, item) -> bool: + if item in self.__dict__: + return True + for value in self.__dict__.values(): + if isinstance(value, Obj) and item in value: + return True + return False + + def keys(self): + return self.__dict__.keys() + + def values(self): + return self.__dict__.values() + + def items(self): + return self.__dict__.items() + + def __str__(self) -> str: + return str(self.__dict__) + + def __repr__(self) -> str: + return str(self.__dict__) + + +@document() +class Request: + """ + A Gradio request object that can be used to access the request headers, cookies, + query parameters and other information about the request from within the prediction + function. The class is a thin wrapper around the fastapi.Request class. Attributes + of this class include: `headers`, `client`, `query_params`, and `path_params`. If + auth is enabled, the `username` attribute can be used to get the logged in user. + Example: + import gradio as gr + def echo(name, request: gr.Request): + print("Request headers dictionary:", request.headers) + print("IP address:", request.client.host) + return name + io = gr.Interface(echo, "textbox", "textbox").launch() + """ + + def __init__( + self, + request: fastapi.Request | None = None, + username: str | None = None, + **kwargs, + ): + """ + Can be instantiated with either a fastapi.Request or by manually passing in + attributes (needed for websocket-based queueing). + Parameters: + request: A fastapi.Request + """ + self.request = request + self.username = username + self.kwargs: Dict = kwargs + + def dict_to_obj(self, d): + if isinstance(d, dict): + return json.loads(json.dumps(d), object_hook=Obj) + else: + return d + + def __getattr__(self, name): + if self.request: + return self.dict_to_obj(getattr(self.request, name)) + else: + try: + obj = self.kwargs[name] + except KeyError as ke: + raise AttributeError( + f"'Request' object has no attribute '{name}'" + ) from ke + return self.dict_to_obj(obj) + + +@document() +def mount_gradio_app( + app: fastapi.FastAPI, + blocks: gradio.Blocks, + path: str, + gradio_api_url: str | None = None, + app_kwargs: dict[str, Any] | None = None, +) -> fastapi.FastAPI: + """Mount a gradio.Blocks to an existing FastAPI application. + + Parameters: + app: The parent FastAPI application. + blocks: The blocks object we want to mount to the parent app. + path: The path at which the gradio application will be mounted. + gradio_api_url: The full url at which the gradio app will run. This is only needed if deploying to Huggingface spaces of if the websocket endpoints of your deployed app are on a different network location than the gradio app. If deploying to spaces, set gradio_api_url to 'http://localhost:7860/' + app_kwargs: Additional keyword arguments to pass to the underlying FastAPI app as a dictionary of parameter keys and argument values. For example, `{"docs_url": "/docs"}` + Example: + from fastapi import FastAPI + import gradio as gr + app = FastAPI() + @app.get("/") + def read_main(): + return {"message": "This is your main app"} + io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox") + app = gr.mount_gradio_app(app, io, path="/gradio") + # Then run `uvicorn run:app` from the terminal and navigate to http://localhost:8000/gradio. + """ + blocks.dev_mode = False + blocks.config = blocks.get_config_file() + blocks.validate_queue_settings() + gradio_app = App.create_app(blocks, app_kwargs=app_kwargs) + + @app.on_event("startup") + async def start_queue(): + if gradio_app.get_blocks().enable_queue: + if gradio_api_url: + gradio_app.get_blocks()._queue.set_url(gradio_api_url) + gradio_app.get_blocks().startup_events() + + app.mount(path, gradio_app) + return app diff --git a/gradio/strings.py b/gradio/strings.py new file mode 100644 index 0000000000000000000000000000000000000000..d85bc052969438e1e05dbf3abd9c75c8effc7d03 --- /dev/null +++ b/gradio/strings.py @@ -0,0 +1,48 @@ +import os +import threading +from typing import Dict + +import requests + +from gradio import wasm_utils + +MESSAGING_API_ENDPOINT = "https://api.gradio.app/gradio-messaging/en" + +en = { + "RUNNING_LOCALLY": "Running on local URL: {}", + "RUNNING_LOCALLY_SEPARATED": "Running on local URL: {}://{}:{}", + "SHARE_LINK_DISPLAY": "Running on public URL: {}", + "COULD_NOT_GET_SHARE_LINK": "\nCould not create share link. Please check your internet connection or our status page: https://status.gradio.app.", + "COULD_NOT_GET_SHARE_LINK_MISSING_FILE": "\nCould not create share link. Missing file: {}. \n\nPlease check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps: \n\n1. Download this file: {}\n2. Rename the downloaded file to: {}\n3. Move the file to this location: {}", + "COLAB_NO_LOCAL": "Cannot display local interface on google colab, public link created.", + "PUBLIC_SHARE_TRUE": "\nTo create a public link, set `share=True` in `launch()`.", + "MODEL_PUBLICLY_AVAILABLE_URL": "Model available publicly at: {} (may take up to a minute for link to be usable)", + "GENERATING_PUBLIC_LINK": "Generating public link (may take a few seconds...):", + "BETA_INVITE": "\nThanks for being a Gradio user! If you have questions or feedback, please join our Discord server and chat with us: https://discord.gg/feTf9x3ZSB", + "COLAB_DEBUG_TRUE": "Colab notebook detected. This cell will run indefinitely so that you can see errors and logs. " + "To turn off, set debug=False in launch().", + "COLAB_DEBUG_FALSE": "Colab notebook detected. To show errors in colab notebook, set debug=True in launch()", + "COLAB_WARNING": "Note: opening Chrome Inspector may crash demo inside Colab notebooks.", + "SHARE_LINK_MESSAGE": "\nThis share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)", + "INLINE_DISPLAY_BELOW": "Interface loading below...", + "TIPS": [ + "You can add authentication to your app with the `auth=` kwarg in the `launch()` command; for example: `gr.Interface(...).launch(auth=('username', 'password'))`", + "Let users specify why they flagged input with the `flagging_options=` kwarg; for example: `gr.Interface(..., flagging_options=['too slow', 'incorrect output', 'other'])`", + "You can show or hide the button for flagging with the `allow_flagging=` kwarg; for example: gr.Interface(..., allow_flagging=False)", + "The inputs and outputs flagged by the users are stored in the flagging directory, specified by the flagging_dir= kwarg. You can view this data through the interface by setting the examples= kwarg to the flagging directory; for example gr.Interface(..., examples='flagged')", + "You can add a title and description to your interface using the `title=` and `description=` kwargs. The `article=` kwarg can be used to add a description under the interface; for example gr.Interface(..., title='My app', description='Lorem ipsum'). Try using Markdown!", + "For a classification or regression model, set `interpretation='default'` to see why the model made a prediction.", + ], +} + + +def get_updated_messaging(en: Dict): + try: + updated_messaging = requests.get(MESSAGING_API_ENDPOINT, timeout=3).json() + en.update(updated_messaging) + except Exception: # Use default messaging + pass + + +if os.getenv("GRADIO_ANALYTICS_ENABLED", "True") == "True" and not wasm_utils.IS_WASM: + threading.Thread(target=get_updated_messaging, args=(en,)).start() diff --git a/gradio/templates/cdn/assets/BlockLabel-fe40816b.js b/gradio/templates/cdn/assets/BlockLabel-fe40816b.js new file mode 100644 index 0000000000000000000000000000000000000000..f5c4d38f09ec8e04123ec98b51d3fc97b260b5fb --- /dev/null +++ b/gradio/templates/cdn/assets/BlockLabel-fe40816b.js @@ -0,0 +1,2 @@ +import{S as r,e as _,s as h,N as m,k as d,O as w,P as g,K as u,U as o,p as v,M as c,o as I,R as k,z as q,v as B,A as S,x as z}from"./index-fda37c89.js";import"./Button-e3640f74.js";function A(s){let e,n,i,b,f,t;return i=new s[1]({}),{c(){e=m("div"),n=m("span"),d(i.$$.fragment),b=w(),f=g(s[0]),u(n,"class","svelte-1mwvhlq"),u(e,"data-testid","block-label"),u(e,"class","svelte-1mwvhlq"),o(e,"hide",!s[2]),o(e,"sr-only",!s[2]),o(e,"float",s[4]),o(e,"hide-label",s[3])},m(a,l){v(a,e,l),c(e,n),I(i,n,null),c(e,b),c(e,f),t=!0},p(a,[l]){(!t||l&1)&&k(f,a[0]),(!t||l&4)&&o(e,"hide",!a[2]),(!t||l&4)&&o(e,"sr-only",!a[2]),(!t||l&16)&&o(e,"float",a[4]),(!t||l&8)&&o(e,"hide-label",a[3])},i(a){t||(q(i.$$.fragment,a),t=!0)},o(a){B(i.$$.fragment,a),t=!1},d(a){a&&S(e),z(i)}}}function C(s,e,n){let{label:i=null}=e,{Icon:b}=e,{show_label:f=!0}=e,{disable:t=!1}=e,{float:a=!0}=e;return s.$$set=l=>{"label"in l&&n(0,i=l.label),"Icon"in l&&n(1,b=l.Icon),"show_label"in l&&n(2,f=l.show_label),"disable"in l&&n(3,t=l.disable),"float"in l&&n(4,a=l.float)},[i,b,f,t,a]}class M extends r{constructor(e){super(),_(this,e,C,A,h,{label:0,Icon:1,show_label:2,disable:3,float:4})}}export{M as B}; +//# sourceMappingURL=BlockLabel-fe40816b.js.map diff --git a/gradio/templates/cdn/assets/BlockLabel-fe40816b.js.map b/gradio/templates/cdn/assets/BlockLabel-fe40816b.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a3e74a52ee09cc6d7cc8c3bd3773e5fca7a76daa --- /dev/null +++ b/gradio/templates/cdn/assets/BlockLabel-fe40816b.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BlockLabel-fe40816b.js","sources":["../../../../js/atoms/src/BlockLabel.svelte"],"sourcesContent":["\n\n\n\t\n\t\t\n\t\n\n\t{label}\n\n\n\n"],"names":["ctx","insert","target","div","anchor","append","span","label","$$props","Icon","show_label","disable","float"],"mappings":"gSAmBEA,EAAK,CAAA,CAAA,2GAVOA,EAAU,CAAA,CAAA,iBACPA,EAAU,CAAA,CAAA,qCAERA,EAAO,CAAA,CAAA,UAJ1BC,EAYKC,EAAAC,EAAAC,CAAA,EALJC,EAEMF,EAAAG,CAAA,0DAELN,EAAK,CAAA,CAAA,yBAVOA,EAAU,CAAA,CAAA,4BACPA,EAAU,CAAA,CAAA,4DAERA,EAAO,CAAA,CAAA,0GAXd,GAAA,CAAA,MAAAO,EAAuB,IAAI,EAAAC,GAC3B,KAAAC,CAAS,EAAAD,EACT,CAAA,WAAAE,EAAsB,EAAI,EAAAF,EAC1B,CAAA,QAAAG,EAAmB,EAAK,EAAAH,EACxB,CAAA,MAAAI,EAAiB,EAAI,EAAAJ"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/BlockTitle-44d14959.js b/gradio/templates/cdn/assets/BlockTitle-44d14959.js new file mode 100644 index 0000000000000000000000000000000000000000..a5e2ff5e5998ad4ae10cc11287e80431b46105b7 --- /dev/null +++ b/gradio/templates/cdn/assets/BlockTitle-44d14959.js @@ -0,0 +1,2 @@ +import{S as h,e as k,s as g,a9 as w,N as $,O as B,m as I,K as d,U as _,p as c,ab as N,ac as S,ad as j,z as r,u as q,v as m,y as v,A as p,k as z,o as A,x as C,P as K,R as O}from"./index-fda37c89.js";import{I as P}from"./Info-ff627956.js";import"./Button-e3640f74.js";function b(a){let e,l;return e=new P({props:{$$slots:{default:[R]},$$scope:{ctx:a}}}),{c(){z(e.$$.fragment)},m(n,o){A(e,n,o),l=!0},p(n,o){const u={};o&10&&(u.$$scope={dirty:o,ctx:n}),e.$set(u)},i(n){l||(r(e.$$.fragment,n),l=!0)},o(n){m(e.$$.fragment,n),l=!1},d(n){C(e,n)}}}function R(a){let e;return{c(){e=K(a[1])},m(l,n){c(l,e,n)},p(l,n){n&2&&O(e,l[1])},d(l){l&&p(e)}}}function T(a){let e,l,n,o;const u=a[2].default,f=w(u,a,a[3],null);let s=a[1]&&b(a);return{c(){e=$("span"),f&&f.c(),l=B(),s&&s.c(),n=I(),d(e,"data-testid","block-info"),d(e,"class","svelte-1gfkn6j"),_(e,"sr-only",!a[0]),_(e,"hide",!a[0]),_(e,"has-info",a[1]!=null)},m(t,i){c(t,e,i),f&&f.m(e,null),c(t,l,i),s&&s.m(t,i),c(t,n,i),o=!0},p(t,[i]){f&&f.p&&(!o||i&8)&&N(f,u,t,t[3],o?j(u,t[3],i,null):S(t[3]),null),(!o||i&1)&&_(e,"sr-only",!t[0]),(!o||i&1)&&_(e,"hide",!t[0]),(!o||i&2)&&_(e,"has-info",t[1]!=null),t[1]?s?(s.p(t,i),i&2&&r(s,1)):(s=b(t),s.c(),r(s,1),s.m(n.parentNode,n)):s&&(q(),m(s,1,1,()=>{s=null}),v())},i(t){o||(r(f,t),r(s),o=!0)},o(t){m(f,t),m(s),o=!1},d(t){t&&(p(e),p(l),p(n)),f&&f.d(t),s&&s.d(t)}}}function U(a,e,l){let{$$slots:n={},$$scope:o}=e,{show_label:u=!0}=e,{info:f=void 0}=e;return a.$$set=s=>{"show_label"in s&&l(0,u=s.show_label),"info"in s&&l(1,f=s.info),"$$scope"in s&&l(3,o=s.$$scope)},[u,f,n,o]}class G extends h{constructor(e){super(),k(this,e,U,T,g,{show_label:0,info:1})}}export{G as B}; +//# sourceMappingURL=BlockTitle-44d14959.js.map diff --git a/gradio/templates/cdn/assets/BlockTitle-44d14959.js.map b/gradio/templates/cdn/assets/BlockTitle-44d14959.js.map new file mode 100644 index 0000000000000000000000000000000000000000..662fb8ef6b3cf537f7577558f7577dddfe66352a --- /dev/null +++ b/gradio/templates/cdn/assets/BlockTitle-44d14959.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BlockTitle-44d14959.js","sources":["../../../../js/atoms/src/BlockTitle.svelte"],"sourcesContent":["\n\n\n\t\n\n{#if info}\n\t{info}\n{/if}\n\n\n"],"names":["ctx","create_if_block","toggle_class","span","insert","target","anchor","show_label","$$props","info"],"mappings":"8jBAeQA,EAAI,CAAA,CAAA,oCAAJA,EAAI,CAAA,CAAA,0FADPA,EAAI,CAAA,GAAAC,EAAAD,CAAA,oIAPQA,EAAU,CAAA,CAAA,cACbA,EAAU,CAAA,CAAA,EACPE,EAAAC,EAAA,WAAAH,MAAQ,IAAI,UAH7BI,EAOMC,EAAAF,EAAAG,CAAA,yJANWN,EAAU,CAAA,CAAA,yBACbA,EAAU,CAAA,CAAA,aACPE,EAAAC,EAAA,WAAAH,MAAQ,IAAI,EAKxBA,EAAI,CAAA,2PAZG,CAAA,WAAAO,EAAsB,EAAI,EAAAC,EAC1B,CAAA,KAAAC,EAA2B,MAAS,EAAAD"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Blocks-53d5f72d.js b/gradio/templates/cdn/assets/Blocks-53d5f72d.js new file mode 100644 index 0000000000000000000000000000000000000000..7f49667c3a06bedae33bb6acf60c4d600690ec26 --- /dev/null +++ b/gradio/templates/cdn/assets/Blocks-53d5f72d.js @@ -0,0 +1,50 @@ +const VERSION_RE = new RegExp("3.39.0/", "g");function import_fix(mod, base) {const url = new URL(mod, base); return import(`https://gradio.s3-us-west-2.amazonaws.com/3.39.0/${url.pathname?.startsWith('/') ? url.pathname.substring(1).replace(VERSION_RE, "") : url.pathname.replace(VERSION_RE, "")}`);}import{n as $,i as $o,a as Ko,l as el,c as tl,d as nl,g as rl,w as vt,b as Le,_ as F,S as ue,e as ce,s as fe,f as Bt,h as De,j as Ht,k as W,m as de,o as Z,p as y,q as il,r as ol,t as ll,u as le,v as N,x as Y,y as ae,z as B,A as E,B as $e,C as Et,D as al,E as sl,F as ke,G as oe,H as Rn,I as ul,J as be,K as d,L as ge,M as m,N as A,O as x,P as I,Q as Se,R as q,T as Ue,U as Ye,V as Ie,W as cl,X as fl,Y as Lt,Z as _l,$ as hl,a0 as pl,a1 as dl,a2 as ml,a3 as gl,a4 as bl,a5 as vl,a6 as El,a7 as yl}from"./index-fda37c89.js";import{B as yt,a as Sl,c as wl,f as jt}from"./Button-e3640f74.js";function Tl(e,t,n,r){if(!t)return $;const i=e.getBoundingClientRect();if(t.left===i.left&&t.right===i.right&&t.top===i.top&&t.bottom===i.bottom)return $;const{delay:o=0,duration:a=300,easing:l=$o,start:u=Ko()+o,end:s=u+a,tick:c=$,css:h}=n(e,{from:t,to:i},r);let _=!0,p=!1,v;function b(){h&&(v=tl(e,0,1,a,o,l,h)),o||(p=!0)}function g(){h&&nl(e,v),_=!1}return el(S=>{if(!p&&S>=u&&(p=!0),p&&S>=s&&(c(1,0),g()),!_)return!1;if(p){const k=S-u,T=0+1*l(k/a);c(T,1-T)}return!0}),b(),c(0,1),g}function Il(e){const t=getComputedStyle(e);if(t.position!=="absolute"&&t.position!=="fixed"){const{width:n,height:r}=t,i=e.getBoundingClientRect();e.style.position="absolute",e.style.width=n,e.style.height=r,kl(e,i)}}function kl(e,t){const n=e.getBoundingClientRect();if(t.left!==n.left||t.top!==n.top){const r=getComputedStyle(e),i=r.transform==="none"?"":r.transform;e.style.transform=`${i} translate(${t.left-n.left}px, ${t.top-n.top}px)`}}var Al=function(t){return Cl(t)&&!Pl(t)};function Cl(e){return!!e&&typeof e=="object"}function Pl(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Hl(e)}var Ol=typeof Symbol=="function"&&Symbol.for,Bl=Ol?Symbol.for("react.element"):60103;function Hl(e){return e.$$typeof===Bl}function Ll(e){return Array.isArray(e)?[]:{}}function Fe(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Pe(Ll(e),e,t):e}function jl(e,t,n){return e.concat(t).map(function(r){return Fe(r,n)})}function Nl(e,t){if(!t.customMerge)return Pe;var n=t.customMerge(e);return typeof n=="function"?n:Pe}function Rl(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Nt(e){return Object.keys(e).concat(Rl(e))}function Mn(e,t){try{return t in e}catch{return!1}}function Ml(e,t){return Mn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function xl(e,t,n){var r={};return n.isMergeableObject(e)&&Nt(e).forEach(function(i){r[i]=Fe(e[i],n)}),Nt(t).forEach(function(i){Ml(e,i)||(Mn(e,i)&&n.isMergeableObject(t[i])?r[i]=Nl(i,n)(e[i],t[i],n):r[i]=Fe(t[i],n))}),r}function Pe(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||jl,n.isMergeableObject=n.isMergeableObject||Al,n.cloneUnlessOtherwiseSpecified=Fe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):xl(e,t,n):Fe(t,n)}Pe.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Pe(r,i,n)},{})};var Dl=Pe,Fl=Dl;const Gl=rl(Fl);var ft=function(e,t){return ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},ft(e,t)};function Ke(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ft(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var X=function(){return X=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0}),n=[],r=0,i=t;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Yl,function(u,s,c,h,_,p){if(s)t.minimumIntegerDigits=c.length;else{if(h&&_)throw new Error("We currently do not support maximum integer digits");if(p)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Wn.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Mt.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Mt,function(u,s,c,h,_,p){return c==="*"?t.minimumFractionDigits=s.length:h&&h[0]==="#"?t.maximumFractionDigits=h.length:_&&p?(t.minimumFractionDigits=_.length,t.maximumFractionDigits=_.length+p.length):(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length),""});var o=i.options[0];o==="w"?t=X(X({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=X(X({},t),xt(o)));continue}if(Xn.test(i.stem)){t=X(X({},t),xt(i.stem));continue}var a=Zn(i.stem);a&&(t=X(X({},t),a));var l=Jl(i.stem);l&&(t=X(X({},t),l))}return t}var qe={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function $l(e,t){for(var n="",r=0;r>1),u="a",s=Kl(t);for((s=="H"||s=="k")&&(l=0);l-- >0;)n+=u;for(;a-- >0;)n=s+n}else i==="J"?n+="H":n+=i}return n}function Kl(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,r;n!=="root"&&(r=e.maximize().region);var i=qe[r||""]||qe[n||""]||qe["".concat(n,"-001")]||qe["001"];return i[0]}var lt,ea=new RegExp("^".concat(qn.source,"*")),ta=new RegExp("".concat(qn.source,"*$"));function z(e,t){return{start:e,end:t}}var na=!!String.prototype.startsWith,ra=!!String.fromCodePoint,ia=!!Object.fromEntries,oa=!!String.prototype.codePointAt,la=!!String.prototype.trimStart,aa=!!String.prototype.trimEnd,sa=!!Number.isSafeInteger,ua=sa?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ht=!0;try{var ca=Jn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ht=((lt=ca.exec("a"))===null||lt===void 0?void 0:lt[0])==="a"}catch{ht=!1}var Ft=na?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},pt=ra?String.fromCodePoint:function(){for(var t=[],n=0;no;){if(a=t[o++],a>1114111)throw RangeError(a+" is not a valid code point");r+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return r},Gt=ia?Object.fromEntries:function(t){for(var n={},r=0,i=t;r=r)){var i=t.charCodeAt(n),o;return i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},fa=la?function(t){return t.trimStart()}:function(t){return t.replace(ea,"")},_a=aa?function(t){return t.trimEnd()}:function(t){return t.replace(ta,"")};function Jn(e,t){return new RegExp(e,t)}var dt;if(ht){var Ut=Jn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");dt=function(t,n){var r;Ut.lastIndex=n;var i=Ut.exec(t);return(r=i[1])!==null&&r!==void 0?r:""}}else dt=function(t,n){for(var r=[];;){var i=Yn(t,n);if(i===void 0||Qn(i)||ma(i))break;r.push(i),n+=i>=65536?2:1}return pt.apply(void 0,r)};var ha=function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,r){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var a=this.parseArgument(t,r);if(a.err)return a;i.push(a.val)}else{if(o===125&&t>0)break;if(o===35&&(n==="plural"||n==="selectordinal")){var l=this.clonePosition();this.bump(),i.push({type:ee.pound,location:z(l,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(V.UNMATCHED_CLOSING_TAG,z(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&mt(this.peek()||0)){var a=this.parseTag(t,n);if(a.err)return a;i.push(a.val)}else{var a=this.parseLiteral(t,n);if(a.err)return a;i.push(a.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ee.literal,value:"<".concat(i,"/>"),location:z(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,n,!0);if(o.err)return o;var a=o.val,l=this.clonePosition();if(this.bumpIf("")?{val:{type:ee.tag,value:i,children:a,location:z(r,this.clonePosition())},err:null}:this.error(V.INVALID_TAG,z(l,this.clonePosition())))}else return this.error(V.UNCLOSED_TAG,z(r,this.clonePosition()))}else return this.error(V.INVALID_TAG,z(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&da(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var o=this.tryParseQuote(n);if(o){i+=o;continue}var a=this.tryParseUnquoted(t,n);if(a){i+=a;continue}var l=this.tryParseLeftAngleBracket();if(l){i+=l;continue}break}var u=z(r,this.clonePosition());return{val:{type:ee.literal,value:i,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!pa(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return pt.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),pt(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,z(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(V.EMPTY_ARGUMENT,z(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(V.MALFORMED_ARGUMENT,z(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,z(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ee.argument,value:i,location:z(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,z(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(V.MALFORMED_ARGUMENT,z(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=dt(this.message,n),i=n+r.length;this.bumpTo(i);var o=this.clonePosition(),a=z(t,o);return{value:r,location:a}},e.prototype.parseArgumentOptions=function(t,n,r,i){var o,a=this.clonePosition(),l=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(l){case"":return this.error(V.EXPECT_ARGUMENT_TYPE,z(a,u));case"number":case"date":case"time":{this.bumpSpace();var s=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition(),h=this.parseSimpleArgStyleIfPossible();if(h.err)return h;var _=_a(h.val);if(_.length===0)return this.error(V.EXPECT_ARGUMENT_STYLE,z(this.clonePosition(),this.clonePosition()));var p=z(c,this.clonePosition());s={style:_,styleLocation:p}}var v=this.tryParseArgumentClose(i);if(v.err)return v;var b=z(i,this.clonePosition());if(s&&Ft(s?.style,"::",0)){var g=fa(s.style.slice(2));if(l==="number"){var h=this.parseNumberSkeletonFromString(g,s.styleLocation);return h.err?h:{val:{type:ee.number,value:r,location:b,style:h.val},err:null}}else{if(g.length===0)return this.error(V.EXPECT_DATE_TIME_SKELETON,b);var S=g;this.locale&&(S=$l(g,this.locale));var _={type:Oe.dateTime,pattern:S,location:s.styleLocation,parsedOptions:this.shouldParseSkeletons?ql(S):{}},k=l==="date"?ee.date:ee.time;return{val:{type:k,value:r,location:b,style:_},err:null}}}return{val:{type:l==="number"?ee.number:l==="date"?ee.date:ee.time,value:r,location:b,style:(o=s?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var T=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS,z(T,X({},T)));this.bumpSpace();var f=this.parseIdentifierIfPossible(),P=0;if(l!=="select"&&f.value==="offset"){if(!this.bumpIf(":"))return this.error(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,z(this.clonePosition(),this.clonePosition()));this.bumpSpace();var h=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,V.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(h.err)return h;this.bumpSpace(),f=this.parseIdentifierIfPossible(),P=h.val}var H=this.tryParsePluralOrSelectOptions(t,l,n,f);if(H.err)return H;var v=this.tryParseArgumentClose(i);if(v.err)return v;var L=z(i,this.clonePosition());return l==="select"?{val:{type:ee.select,value:r,options:Gt(H.val),location:L},err:null}:{val:{type:ee.plural,value:r,options:Gt(H.val),offset:P,pluralType:l==="plural"?"cardinal":"ordinal",location:L},err:null}}default:return this.error(V.INVALID_ARGUMENT_TYPE,z(a,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,z(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(V.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,z(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=Wl(t)}catch{return this.error(V.INVALID_NUMBER_SKELETON,n)}return{val:{type:Oe.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?Ql(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var o,a=!1,l=[],u=new Set,s=i.value,c=i.location;;){if(s.length===0){var h=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var _=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_SELECTOR,V.INVALID_PLURAL_ARGUMENT_SELECTOR);if(_.err)return _;c=z(h,this.clonePosition()),s=this.message.slice(h.offset,this.offset())}else break}if(u.has(s))return this.error(n==="select"?V.DUPLICATE_SELECT_ARGUMENT_SELECTOR:V.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);s==="other"&&(a=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?V.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:V.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,z(this.clonePosition(),this.clonePosition()));var v=this.parseMessage(t+1,n,r);if(v.err)return v;var b=this.tryParseArgumentClose(p);if(b.err)return b;l.push([s,{value:v.val,location:z(p,this.clonePosition())}]),u.add(s),this.bumpSpace(),o=this.parseIdentifierIfPossible(),s=o.value,c=o.location}return l.length===0?this.error(n==="select"?V.EXPECT_SELECT_ARGUMENT_SELECTOR:V.EXPECT_PLURAL_ARGUMENT_SELECTOR,z(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(V.MISSING_OTHER_CLAUSE,z(this.clonePosition(),this.clonePosition())):{val:l,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,a=0;!this.isEOF();){var l=this.char();if(l>=48&&l<=57)o=!0,a=a*10+(l-48),this.bump();else break}var u=z(i,this.clonePosition());return o?(a*=r,ua(a)?{val:a,err:null}:this.error(n,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Yn(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Ft(this.message,t,this.offset())){for(var n=0;n=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Qn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return r??null},e}();function mt(e){return e>=97&&e<=122||e>=65&&e<=90}function pa(e){return mt(e)||e===47}function da(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Qn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ma(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function gt(e){e.forEach(function(t){if(delete t.location,Gn(t)||Un(t))for(var n in t.options)delete t.options[n].location,gt(t.options[n].value);else xn(t)&&zn(t.style)||(Dn(t)||Fn(t))&&_t(t.style)?delete t.style.location:Vn(t)&>(t.children)})}function ga(e,t){t===void 0&&(t={}),t=X({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new ha(e,t).parse();if(n.err){var r=SyntaxError(V[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t?.captureLocation||gt(n.val),n.val}function at(e,t){var n=t&&t.cache?t.cache:wa,r=t&&t.serializer?t.serializer:Sa,i=t&&t.strategy?t.strategy:va;return i(e,{cache:n,serializer:r})}function ba(e){return e==null||typeof e=="number"||typeof e=="boolean"}function $n(e,t,n,r){var i=ba(r)?r:n(r),o=t.get(i);return typeof o>"u"&&(o=e.call(this,r),t.set(i,o)),o}function Kn(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,r),t.set(i,o)),o}function St(e,t,n,r,i){return n.bind(t,e,r,i)}function va(e,t){var n=e.length===1?$n:Kn;return St(e,this,n,t.cache.create(),t.serializer)}function Ea(e,t){return St(e,this,Kn,t.cache.create(),t.serializer)}function ya(e,t){return St(e,this,$n,t.cache.create(),t.serializer)}var Sa=function(){return JSON.stringify(arguments)};function wt(){this.cache=Object.create(null)}wt.prototype.get=function(e){return this.cache[e]};wt.prototype.set=function(e,t){this.cache[e]=t};var wa={create:function(){return new wt}},st={variadic:Ea,monadic:ya},Be;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Be||(Be={}));var et=function(e){Ke(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.code=r,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Vt=function(e){Ke(t,e);function t(n,r,i,o){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Be.INVALID_VALUE,o)||this}return t}(et),Ta=function(e){Ke(t,e);function t(n,r,i){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),Be.INVALID_VALUE,i)||this}return t}(et),Ia=function(e){Ke(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),Be.MISSING_VALUE,r)||this}return t}(et),he;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(he||(he={}));function ka(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==he.literal||n.type!==he.literal?t.push(n):r.value+=n.value,t},[])}function Aa(e){return typeof e=="function"}function Xe(e,t,n,r,i,o,a){if(e.length===1&&Rt(e[0]))return[{type:he.literal,value:e[0].value}];for(var l=[],u=0,s=e;u0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ga,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const ye={},Ha=(e,t,n)=>n&&(t in ye||(ye[t]={}),e in ye[t]||(ye[t][e]=n),n),er=(e,t)=>{if(t==null)return;if(t in ye&&e in ye[t])return ye[t][e];const n=ze(t);for(let r=0;r0){const u=o.slice(l,o.length).join(".");if(u in a){a=a[u];break}}a=a[o[l]]}else a=void 0;return a}(n,t)}function nr(e,...t){delete ye[e],Ve.update(n=>(n[e]=Gl.all([n[e]||{},...t]),n))}Le([Ve],([e])=>Object.keys(e));Ve.subscribe(e=>Tt=e);const We={};function rr(e){return We[e]}function Je(e){return e!=null&&ze(e).some(t=>{var n;return(n=rr(t))===null||n===void 0?void 0:n.size})}function ja(e,t){return Promise.all(t.map(r=>(function(i,o){We[i].delete(o),We[i].size===0&&delete We[i]}(e,r),r().then(i=>i.default||i)))).then(r=>nr(e,...r))}const Re={};function ir(e){if(!Je(e))return e in Re?Re[e]:Promise.resolve();const t=function(n){return ze(n).map(r=>{const i=rr(r);return[r,i?[...i]:[]]}).filter(([,r])=>r.length>0)}(e);return Re[e]=Promise.all(t.map(([n,r])=>ja(n,r))).then(()=>{if(Je(e))return ir(e);delete Re[e]}),Re[e]}function Na({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${ze(e).join('", "')}".${Je(we())?` + +Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const Me={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function He(){return Me}function Ra(e){const{formats:t,...n}=e,r=e.initialLocale||e.fallbackLocale;return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,n.handleMissingMessage==null?n.handleMissingMessage=Na:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(Me,n,{initialLocale:r}),t&&("number"in t&&Object.assign(Me.formats.number,t.number),"date"in t&&Object.assign(Me.formats.date,t.date),"time"in t&&Object.assign(Me.formats.time,t.time)),je.set(r)}const ct=vt(!1);let bt;const Ze=vt(null);function zt(e){return e.split("-").map((t,n,r)=>r.slice(0,n+1).join("-")).reverse()}function ze(e,t=He().fallbackLocale){const n=zt(e);return t?[...new Set([...n,...zt(t)])]:n}function we(){return bt??void 0}Ze.subscribe(e=>{bt=e??void 0,typeof window<"u"&&e!=null&&document.documentElement.setAttribute("lang",e)});const je={...Ze,set:e=>{if(e&&function(t){if(t==null)return;const n=ze(t);for(let r=0;rct.set(!0),t):ct.set(!0),ir(e).then(()=>{Ze.set(e)}).finally(()=>{clearTimeout(n),ct.set(!1)})}return Ze.set(e)}},Ma=()=>typeof window>"u"?null:window.navigator.language||window.navigator.languages[0],tt=e=>{const t=Object.create(null);return n=>{const r=JSON.stringify(n);return r in t?t[r]:t[r]=e(n)}},Ge=(e,t)=>{const{formats:n}=He();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},xa=tt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=Ge("number",t)),new Intl.NumberFormat(e,n)}),Da=tt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=Ge("date",t):Object.keys(n).length===0&&(n=Ge("date","short")),new Intl.DateTimeFormat(e,n)}),Fa=tt(({locale:e,format:t,...n})=>{if(e==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=Ge("time",t):Object.keys(n).length===0&&(n=Ge("time","short")),new Intl.DateTimeFormat(e,n)}),Ga=({locale:e=we(),...t}={})=>xa({locale:e,...t}),Ua=({locale:e=we(),...t}={})=>Da({locale:e,...t}),Va=({locale:e=we(),...t}={})=>Fa({locale:e,...t}),za=tt((e,t=we())=>new Ba(e,t,He().formats,{ignoreTag:He().ignoreTag})),qa=(e,t={})=>{var n,r,i,o;let a=t;typeof e=="object"&&(a=e,e=a.id);const{values:l,locale:u=we(),default:s}=a;if(u==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let c=er(e,u);if(c){if(typeof c!="string")return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),c}else c=(o=(i=(r=(n=He()).handleMissingMessage)===null||r===void 0?void 0:r.call(n,{locale:u,id:e,defaultValue:s}))!==null&&i!==void 0?i:s)!==null&&o!==void 0?o:e;if(!l)return c;let h=c;try{h=za(c,u).format(l)}catch(_){_ instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,_.message)}return h},Xa=(e,t)=>Va(t).format(e),Wa=(e,t)=>Ua(t).format(e),Za=(e,t)=>Ga(t).format(e),Ya=(e,t=we())=>er(e,t),dc=Le([je,Ve],()=>qa);Le([je],()=>Xa);Le([je],()=>Wa);Le([je],()=>Za);Le([je,Ve],()=>Ya);const Ja={accordion:()=>F(()=>import("./index-cc3af858.js"),["assets/index-cc3af858.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/Column-6dff4b07.js","assets/Column-2853eb31.css","assets/index-8f1feca1.css"]),annotatedimage:()=>F(()=>import("./index-3164dc56.js"),["assets/index-3164dc56.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/Image-23929e47.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/index-f0e43e7d.css"]),audio:()=>F(()=>import("./index-797fe710.js"),["assets/index-797fe710.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/UploadText-df690b17.js","assets/UploadText-690664d1.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/Upload-34ce8178.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/ModifyUpload-3f2fd95a.js","assets/IconButton-9e1f47e2.js","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/ShareButton-50e150a5.js","assets/Download-6021cc15.js","assets/index-1af20794.css"]),box:()=>F(()=>import("./index-e1515348.js"),["assets/index-e1515348.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css"]),button:()=>F(()=>import("./index-8d58d5e3.js"),["assets/index-8d58d5e3.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css"]),chatbot:()=>F(()=>import("./index-1508c6c1.js"),["assets/index-1508c6c1.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/ShareButton-50e150a5.js","assets/IconButton-9e1f47e2.js","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/index-8ad5a6d0.css"]),checkbox:()=>F(()=>import("./index-cd44226c.js"),["assets/index-cd44226c.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/Info-ff627956.js","assets/ColorPicker-5063dbc4.css"]),checkboxgroup:()=>F(()=>import("./index-de539b42.js"),["assets/index-de539b42.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/ColorPicker-5063dbc4.css"]),code:()=>F(()=>import("./index-ea4e155c.js").then(e=>e.F),["assets/index-ea4e155c.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/Copy-be466f7f.js","assets/Download-6021cc15.js","assets/index-4ccfb72c.css"]),colorpicker:()=>F(()=>import("./index-a8430f40.js"),["assets/index-a8430f40.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/ColorPicker-5063dbc4.css"]),column:()=>F(()=>import("./index-78c37856.js"),["assets/index-78c37856.js","assets/Column-6dff4b07.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Column-2853eb31.css"]),dataframe:()=>F(()=>import("./index-dd0d9d46.js"),["assets/index-dd0d9d46.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/Upload-34ce8178.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/dsv-576afacd.js","assets/index-9ae8fa0e.css"]),dataset:()=>F(()=>import("./index-259159d9.js"),["assets/index-259159d9.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/Image-20833b5a.js","assets/Image-003ee87c.css","assets/csv-b0b7514a.js","assets/dsv-576afacd.js","assets/Model3D-7a003e98.js","assets/Model3D-98fc2b2c.css","assets/index-322e8a8e.css"]),dropdown:()=>F(()=>import("./index-0c7e5d30.js"),["assets/index-0c7e5d30.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/ColorPicker-5063dbc4.css"]),file:()=>F(()=>import("./index-53fa8f8b.js"),["assets/index-53fa8f8b.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/File-1850cfd6.js","assets/Upload-34ce8178.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/ModifyUpload-3f2fd95a.js","assets/IconButton-9e1f47e2.js","assets/UploadText-df690b17.js","assets/UploadText-690664d1.css","assets/index-aef3869a.css"]),form:()=>F(()=>import("./index-c603b9de.js"),["assets/index-c603b9de.js","assets/Form-a5f9174c.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Form-3812b7f1.css"]),gallery:()=>F(()=>import("./index-6fe5ee5b.js"),["assets/index-6fe5ee5b.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/ShareButton-50e150a5.js","assets/IconButton-9e1f47e2.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/ModifyUpload-3f2fd95a.js","assets/Image-23929e47.js","assets/index-3223d4c0.css"]),group:()=>F(()=>import("./index-dfc23564.js"),["assets/index-dfc23564.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/index-37519934.css"]),highlightedtext:()=>F(()=>import("./index-834edf87.js"),["assets/index-834edf87.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/color-22b563e6.js","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/index-928645ac.css"]),html:()=>F(()=>import("./index-e2195b03.js"),["assets/index-e2195b03.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/index-329f8260.css"]),image:()=>F(()=>import("./index-3e4003db.js"),["assets/index-3e4003db.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Image-23929e47.js","assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js","assets/StaticImage-508005b4.css","assets/IconButton-9e1f47e2.js","assets/ModifyUpload-3f2fd95a.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/Upload-34ce8178.js","assets/ShareButton-50e150a5.js","assets/Empty-85ccd7df.js","assets/Download-6021cc15.js","assets/UploadText-df690b17.js","assets/UploadText-690664d1.css","assets/Image-20833b5a.js","assets/Image-003ee87c.css"]),interpretation:()=>F(()=>import("./index-45824fdf.js"),["assets/index-45824fdf.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/index-6acaa952.css"]),json:()=>F(()=>import("./index-3f5735f4.js"),["assets/index-3f5735f4.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/Copy-be466f7f.js","assets/Empty-85ccd7df.js","assets/BlockLabel-fe40816b.js","assets/index-3ca142e0.css"]),label:()=>F(()=>import("./index-74643a20.js"),["assets/index-74643a20.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/index-cc2431f4.css"]),markdown:()=>F(()=>import("./index-574ffd56.js"),["assets/index-574ffd56.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/index-edf307d2.css"]),model3d:()=>F(()=>import("./index-cc6d053d.js"),["assets/index-cc6d053d.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/File-1850cfd6.js","assets/IconButton-9e1f47e2.js","assets/Download-6021cc15.js","assets/Upload-34ce8178.js","assets/ModifyUpload-3f2fd95a.js","assets/UploadText-df690b17.js","assets/UploadText-690664d1.css","assets/Model3D-7a003e98.js","assets/Model3D-98fc2b2c.css","assets/index-4ffdbeab.css"]),number:()=>F(()=>import("./index-9b639625.js"),["assets/index-9b639625.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/ColorPicker-5063dbc4.css"]),plot:()=>F(()=>import("./index-8f25b221.js"),["assets/index-8f25b221.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/color-22b563e6.js","assets/linear-58a44b5e.js","assets/dsv-576afacd.js","assets/Empty-85ccd7df.js","assets/BlockLabel-fe40816b.js","assets/index-2908e8a9.css"]),radio:()=>F(()=>import("./index-d1b4a3e6.js"),["assets/index-d1b4a3e6.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/ColorPicker-5063dbc4.css"]),row:()=>F(()=>import("./index-35a96ad2.js"),["assets/index-35a96ad2.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/index-93c91554.css"]),slider:()=>F(()=>import("./index-cb84c4b9.js"),["assets/index-cb84c4b9.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/ColorPicker-5063dbc4.css"]),state:()=>F(()=>import("./index-8fc55f5f.js"),["assets/index-8fc55f5f.js","assets/index-fda37c89.js","assets/index-fabf6055.css"]),statustracker:()=>F(()=>import("./index-9610cf61.js"),["assets/index-9610cf61.js","assets/index-fda37c89.js","assets/index-fabf6055.css"]),tabs:()=>F(()=>import("./index-6a1d7932.js"),["assets/index-6a1d7932.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js","assets/TabItem-e9c69a3d.css","assets/Column-2853eb31.css"]),tabitem:()=>F(()=>import("./index-0ab8b910.js"),["assets/index-0ab8b910.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js","assets/TabItem-e9c69a3d.css","assets/Column-6dff4b07.js","assets/Column-2853eb31.css"]),textbox:()=>F(()=>import("./index-a834191a.js"),["assets/index-a834191a.js","assets/Textbox-f5959df8.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/BlockTitle-44d14959.js","assets/Info-ff627956.js","assets/Copy-be466f7f.js","assets/ColorPicker-5063dbc4.css"]),timeseries:()=>F(()=>import("./index-e70d17b5.js"),["assets/index-e70d17b5.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Upload-34ce8178.js","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/ModifyUpload-3f2fd95a.js","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/IconButton-9e1f47e2.js","assets/BlockLabel-fe40816b.js","assets/Empty-85ccd7df.js","assets/color-22b563e6.js","assets/csv-b0b7514a.js","assets/dsv-576afacd.js","assets/linear-58a44b5e.js","assets/UploadText-df690b17.js","assets/UploadText-690664d1.css","assets/index-9da94804.css"]),uploadbutton:()=>F(()=>import("./index-245a14ce.js"),["assets/index-245a14ce.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/index-03d58ab8.css"]),video:()=>F(()=>import("./index-6367aa63.js"),["assets/index-6367aa63.js","assets/index-fda37c89.js","assets/index-fabf6055.css","assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","assets/ModifyUpload-77b0d4b2.css","assets/Button-e3640f74.js","assets/Button-9b719f62.css","assets/Upload-34ce8178.js","assets/ModifyUpload-3f2fd95a.js","assets/IconButton-9e1f47e2.js","assets/BlockLabel-fe40816b.js","assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js","assets/StaticImage-508005b4.css","assets/Empty-85ccd7df.js","assets/ShareButton-50e150a5.js","assets/Download-6021cc15.js","assets/UploadText-df690b17.js","assets/UploadText-690664d1.css","assets/index-f43c281e.css"])},or="أرسل",lr="أمسح",ar="فسِّر",sr="بلِّغ",ur="أمثلة",cr="أو",Qa={interface:{drop_image:"أسقط الصورة هنا",drop_video:"أسقط الفيديو هنا",drop_audio:"أسقط الملف الصوتي هنا",drop_file:"أسقط الملف هنا",drop_csv:"أسقط ملف البيانات هنا",click_to_upload:"إضغط للتحميل",view_api:"إستخدم واجهة البرمجة",built_with_Gradio:"تم الإنشاء بإستخدام Gradio"},Submit:or,Clear:lr,Interpret:ar,Flag:sr,Examples:ur,or:cr},$a=Object.freeze(Object.defineProperty({__proto__:null,Clear:lr,Examples:ur,Flag:sr,Interpret:ar,Submit:or,default:Qa,or:cr},Symbol.toStringTag,{value:"Module"})),fr="Envia",_r="Neteja",hr="Interpreta",pr="Avisa",dr="Exemples",mr="o",Ka={interface:{drop_image:"Deixeu anar la imatge aquí",drop_video:"Deixeu anar el vídeo aquí",drop_audio:"Deixeu anar l'àudio aquí",drop_file:"Deixeu anar el fitxer aquí",drop_csv:"Deixeu anar el CSV aquí",click_to_upload:"Feu clic per pujar",view_api:"Veure l'API",built_with_Gradio:"Construït amb gradio",copy_to_clipboard:"Copia el json",loading:"S'està carregant",error:"ERROR",empty:"Buit"},Submit:fr,Clear:_r,Interpret:hr,Flag:pr,Examples:dr,or:mr},es=Object.freeze(Object.defineProperty({__proto__:null,Clear:_r,Examples:dr,Flag:pr,Interpret:hr,Submit:fr,default:Ka,or:mr},Symbol.toStringTag,{value:"Module"})),gr="Absenden",br="Löschen",vr="Ersteller",Er="Flag",yr="Beispiele",Sr="oder",ts={interface:{drop_image:"Bild hier ablegen",drop_video:"Video hier ablegen",drop_audio:"Audio hier ablegen",drop_file:"Datei hier ablegen",drop_csv:"CSV Datei hier ablegen",click_to_upload:"Hochladen",view_api:"API anschauen",built_with_Gradio:"Mit Gradio erstellt"},Submit:gr,Clear:br,Interpret:vr,Flag:Er,Examples:yr,or:Sr},ns=Object.freeze(Object.defineProperty({__proto__:null,Clear:br,Examples:yr,Flag:Er,Interpret:vr,Submit:gr,default:ts,or:Sr},Symbol.toStringTag,{value:"Module"})),wr="Submit",Tr="Clear",Ir="Interpret",kr="Flag",Ar="Examples",Cr="or",rs={interface:{drop_image:"Drop Image Here",drop_video:"Drop Video Here",drop_audio:"Drop Audio Here",drop_file:"Drop File Here",drop_csv:"Drop CSV Here",click_to_upload:"Click to Upload",view_api:"view the api",built_with_Gradio:"Built with gradio",copy_to_clipboard:"copy json",loading:"Loading",error:"ERROR",empty:"Empty"},Submit:wr,Clear:Tr,Interpret:Ir,Flag:kr,Examples:Ar,or:Cr},is=Object.freeze(Object.defineProperty({__proto__:null,Clear:Tr,Examples:Ar,Flag:kr,Interpret:Ir,Submit:wr,default:rs,or:Cr},Symbol.toStringTag,{value:"Module"})),Pr="Enviar",Or="Limpiar",Br="Interpretar",Hr="Avisar",Lr="Ejemplos",jr="o",os={interface:{drop_image:"Coloque la imagen aquí",drop_video:"Coloque el video aquí",drop_audio:"Coloque el audio aquí",drop_file:"Coloque el archivo aquí",drop_csv:"Coloque el CSV aquí",click_to_upload:"Haga click para cargar",view_api:"Ver la API",built_with_Gradio:"Construido con Gradio"},Submit:Pr,Clear:Or,Interpret:Br,Flag:Hr,Examples:Lr,or:jr},ls=Object.freeze(Object.defineProperty({__proto__:null,Clear:Or,Examples:Lr,Flag:Hr,Interpret:Br,Submit:Pr,default:os,or:jr},Symbol.toStringTag,{value:"Module"})),Nr="ارسال",Rr="حذف",Mr="تفسیر",xr="پرچم",Dr="مثال ها",Fr="یا",as={interface:{drop_image:"تصویر را اینجا رها کنید",drop_video:"ویدیو را اینجا رها کنید",drop_audio:"صوت را اینجا رها کنید",drop_file:"فایل را اینجا رها کنید",drop_csv:"فایل csv را اینجا رها کنید",click_to_upload:"برای آپلود کلیک کنید",view_api:"api را مشاهده کنید",built_with_Gradio:"ساخته شده با gradio"},Submit:Nr,Clear:Rr,Interpret:Mr,Flag:xr,Examples:Dr,or:Fr},ss=Object.freeze(Object.defineProperty({__proto__:null,Clear:Rr,Examples:Dr,Flag:xr,Interpret:Mr,Submit:Nr,default:as,or:Fr},Symbol.toStringTag,{value:"Module"})),Gr="Soumettre",Ur="Nettoyer",Vr="Interpréter",zr="Signaler",qr="Exemples",Xr="ou",us={interface:{drop_image:"Déposer l'Image Ici",drop_video:"Déposer la Vidéo Ici",drop_audio:"Déposer l'Audio Ici",drop_file:"Déposer le Fichier Ici",drop_csv:"Déposer le CSV Ici",click_to_upload:"Cliquer pour Télécharger",view_api:"Voir l'API",built_with_Gradio:"Conçu avec Gradio"},Submit:Gr,Clear:Ur,Interpret:Vr,Flag:zr,Examples:qr,or:Xr},cs=Object.freeze(Object.defineProperty({__proto__:null,Clear:Ur,Examples:qr,Flag:zr,Interpret:Vr,Submit:Gr,default:us,or:Xr},Symbol.toStringTag,{value:"Module"})),Wr="שלח",Zr="נקה",Yr="לפרש",Jr="סמן",Qr="דוגמות",$r="או",fs={interface:{drop_image:"גרור קובץ תמונה לכאן",drop_video:"גרור קובץ סרטון לכאן",drop_audio:"גרור לכאן קובץ שמע",drop_file:"גרור קובץ לכאן",drop_csv:"גרור csv קובץ לכאן",click_to_upload:"לחץ כדי להעלות",view_api:"צפה ב API",built_with_Gradio:"בנוי עם גרדיו"},Submit:Wr,Clear:Zr,Interpret:Yr,Flag:Jr,Examples:Qr,or:$r},_s=Object.freeze(Object.defineProperty({__proto__:null,Clear:Zr,Examples:Qr,Flag:Jr,Interpret:Yr,Submit:Wr,default:fs,or:$r},Symbol.toStringTag,{value:"Module"})),Kr="सबमिट करे",ei="हटाये",ti="व्याख्या करे",ni="चिह्नित करे",ri="उदाहरण",ii="या",hs={interface:{drop_image:"यहाँ इमेज ड्रॉप करें",drop_video:"यहाँ वीडियो ड्रॉप करें",drop_audio:"यहाँ ऑडियो ड्रॉप करें",drop_file:"यहाँ File ड्रॉप करें",drop_csv:"यहाँ CSV ड्रॉप करें",click_to_upload:"अपलोड के लिए बटन दबायें",view_api:"API को देखे",built_with_Gradio:"Gradio से बना"},Submit:Kr,Clear:ei,Interpret:ti,Flag:ni,Examples:ri,or:ii},ps=Object.freeze(Object.defineProperty({__proto__:null,Clear:ei,Examples:ri,Flag:ni,Interpret:ti,Submit:Kr,default:hs,or:ii},Symbol.toStringTag,{value:"Module"})),oi="送信",li="クリア",ai="解釈",si="フラグする",ui="入力例",ci="または",ds={interface:{drop_image:"ここに画像をドロップ",drop_video:"ここに動画をドロップ",drop_audio:"ここに音声をドロップ",drop_file:"ここにファイルをドロップ",drop_csv:"ここにCSVをドロップ",click_to_upload:"クリックしてアップロード",view_api:"APIを見る",built_with_Gradio:"gradioで作ろう"},Submit:oi,Clear:li,Interpret:ai,Flag:si,Examples:ui,or:ci},ms=Object.freeze(Object.defineProperty({__proto__:null,Clear:li,Examples:ui,Flag:si,Interpret:ai,Submit:oi,default:ds,or:ci},Symbol.toStringTag,{value:"Module"})),fi="제출하기",_i="클리어",hi="설명하기",pi="플래그",di="예시",mi="또는",gs={interface:{drop_image:"이미지를 끌어 놓으세요",drop_video:"비디오를 끌어 놓으세요",drop_audio:"오디오를 끌어 놓으세요",drop_file:"파일을 끌어 놓으세요",drop_csv:"CSV파일을 끌어 놓으세요",click_to_upload:"클릭해서 업로드하기",view_api:"API 보기",built_with_Gradio:"gradio로 제작되었습니다"},Submit:fi,Clear:_i,Interpret:hi,Flag:pi,Examples:di,or:mi},bs=Object.freeze(Object.defineProperty({__proto__:null,Clear:_i,Examples:di,Flag:pi,Interpret:hi,Submit:fi,default:gs,or:mi},Symbol.toStringTag,{value:"Module"})),gi="Pateikti",bi="Trinti",vi="Interpretuoti",Ei="Pažymėti",yi="Pavyzdžiai",Si="arba",vs={interface:{drop_image:"Įkelkite paveikslėlį čia",drop_video:"Įkelkite vaizdo įrašą čia",drop_audio:"Įkelkite garso įrašą čia",drop_file:"Įkelkite bylą čia",drop_csv:"Įkelkite CSV čia",click_to_upload:"Spustelėkite norėdami įkelti",view_api:"peržiūrėti api",built_with_Gradio:"sukurta su gradio"},Submit:gi,Clear:bi,Interpret:vi,Flag:Ei,Examples:yi,or:Si},Es=Object.freeze(Object.defineProperty({__proto__:null,Clear:bi,Examples:yi,Flag:Ei,Interpret:vi,Submit:gi,default:vs,or:Si},Symbol.toStringTag,{value:"Module"})),wi="Zend in",Ti="Wis",Ii="Interpreteer",ki="Vlag",Ai="Voorbeelden",Ci="of",ys={interface:{drop_image:"Sleep een Afbeelding hier",drop_video:"Sleep een Video hier",drop_audio:"Sleep een Geluidsbestand hier",drop_file:"Sleep een Document hier",drop_csv:"Sleep een CSV hier",click_to_upload:"Klik om the Uploaden",view_api:"zie de api",built_with_Gradio:"gemaakt met gradio"},Submit:wi,Clear:Ti,Interpret:Ii,Flag:ki,Examples:Ai,or:Ci},Ss=Object.freeze(Object.defineProperty({__proto__:null,Clear:Ti,Examples:Ai,Flag:ki,Interpret:Ii,Submit:wi,default:ys,or:Ci},Symbol.toStringTag,{value:"Module"})),Pi="Zatwierdź",Oi="Wyczyść",Bi="Interpretuj",Hi="Oznacz",Li="Przykłady",ji="lub",ws={interface:{drop_image:"Przeciągnij tutaj zdjęcie",drop_video:"Przeciągnij tutaj video",drop_audio:"Przeciągnij tutaj audio",drop_file:"Przeciągnij tutaj plik",drop_csv:"Przeciągnij tutaj CSV",click_to_upload:"Kliknij, aby przesłać",view_api:"zobacz api",built_with_Gradio:"utworzone z gradio"},Submit:Pi,Clear:Oi,Interpret:Bi,Flag:Hi,Examples:Li,or:ji},Ts=Object.freeze(Object.defineProperty({__proto__:null,Clear:Oi,Examples:Li,Flag:Hi,Interpret:Bi,Submit:Pi,default:ws,or:ji},Symbol.toStringTag,{value:"Module"})),Ni="Enviar",Ri="Limpar",Mi="Interpretar",xi="Marcar",Di="Exemplos",Fi="ou",Is={interface:{drop_image:"Solte a Imagem Aqui",drop_video:"Solte o Vídeo Aqui",drop_audio:"Solte o Áudio Aqui",drop_file:"Solte o Arquivo Aqui",drop_csv:"Solte o CSV Aqui",click_to_upload:"Clique para o Upload",view_api:"Veja a API",built_with_Gradio:"Construído com gradio",copy_to_clipboard:"copiar para o clipboard",loading:"Carregando",error:"ERRO",empty:"Vazio"},Submit:Ni,Clear:Ri,Interpret:Mi,Flag:xi,Examples:Di,or:Fi},ks=Object.freeze(Object.defineProperty({__proto__:null,Clear:Ri,Examples:Di,Flag:xi,Interpret:Mi,Submit:Ni,default:Is,or:Fi},Symbol.toStringTag,{value:"Module"})),Gi="Исполнить",Ui="Очистить",Vi="Интерпретировать",zi="Пометить",qi="Примеры",Xi="или",As={interface:{drop_image:"Поместите Изображение Здесь",drop_video:"Поместите Видео Здесь",drop_audio:"Поместите Аудио Здесь",drop_file:"Поместите Документ Здесь",drop_csv:"Поместите CSV Здесь",click_to_upload:"Нажмите, чтобы загрузить",view_api:"просмотр api",built_with_Gradio:"сделано с помощью gradio"},Submit:Gi,Clear:Ui,Interpret:Vi,Flag:zi,Examples:qi,or:Xi},Cs=Object.freeze(Object.defineProperty({__proto__:null,Clear:Ui,Examples:qi,Flag:zi,Interpret:Vi,Submit:Gi,default:As,or:Xi},Symbol.toStringTag,{value:"Module"})),Wi="சமர்ப்பி",Zi="அழி",Yi="உட்பொருள்",Ji="கொடியிடு",Qi="எடுத்துக்காட்டுகள்",$i="அல்லது",Ps={interface:{drop_image:"படத்தை வை",drop_video:"வீடியோவை வை",drop_audio:"ஆடியோவை வை",drop_file:"கோப்பை வை",drop_csv:"சிஎஸ்வி வை",click_to_upload:"பதிவேற்ற கிளிக் செய்",view_api:"அபியை காண்",built_with_Gradio:"க்ரேடியோ-வுடன் கட்டப்பட்டது"},Submit:Wi,Clear:Zi,Interpret:Yi,Flag:Ji,Examples:Qi,or:$i},Os=Object.freeze(Object.defineProperty({__proto__:null,Clear:Zi,Examples:Qi,Flag:Ji,Interpret:Yi,Submit:Wi,default:Ps,or:$i},Symbol.toStringTag,{value:"Module"})),Ki="Yükle",eo="Temizle",to="Yorumla",no="Etiketle",ro="örnekler",io="veya",Bs={interface:{drop_image:"Resmi Buraya Sürükle",drop_video:"Videoyu Buraya Sürükle",drop_audio:"Kaydı Buraya Sürükle",drop_file:"Dosyayı Buraya Sürükle",drop_csv:"CSV'yi Buraya Sürükle",click_to_upload:"Yüklemek için Tıkla",view_api:"api'yi görüntüle",built_with_Gradio:"Gradio ile oluşturulmuştur"},Submit:Ki,Clear:eo,Interpret:to,Flag:no,Examples:ro,or:io},Hs=Object.freeze(Object.defineProperty({__proto__:null,Clear:eo,Examples:ro,Flag:no,Interpret:to,Submit:Ki,default:Bs,or:io},Symbol.toStringTag,{value:"Module"})),oo="Надіслати",lo="Очистити",ao="Пояснити результат",so="Позначити",uo="Приклади",co="або",Ls={interface:{drop_image:"Перетягніть зображення сюди",drop_video:"Перетягніть відео сюди",drop_audio:"Перетягніть аудіо сюди",drop_file:"Перетягніть файл сюди",drop_csv:"Перетягніть CSV-файл сюди",click_to_upload:"Натисніть щоб завантажити",view_api:"Переглянути API",built_with_Gradio:"Зроблено на основі gradio"},Submit:oo,Clear:lo,Interpret:ao,Flag:so,Examples:uo,or:co},js=Object.freeze(Object.defineProperty({__proto__:null,Clear:lo,Examples:uo,Flag:so,Interpret:ao,Submit:oo,default:Ls,or:co},Symbol.toStringTag,{value:"Module"})),fo="جمع کریں",_o="ہٹا دیں",ho="تشریح کریں",po="نشان لگائیں",mo="مثالیں",go="یا",Ns={interface:{drop_image:"یہاں تصویر ڈراپ کریں",drop_video:"یہاں ویڈیو ڈراپ کریں",drop_audio:"یہاں آڈیو ڈراپ کریں",drop_file:"یہاں فائل ڈراپ کریں",drop_csv:"یہاں فائل ڈراپ کریں",click_to_upload:"اپ لوڈ کے لیے کلک کریں",view_api:"API دیکھیں",built_with_Gradio:"کے ساتھ بنایا گیا Gradio"},Submit:fo,Clear:_o,Interpret:ho,Flag:po,Examples:mo,or:go},Rs=Object.freeze(Object.defineProperty({__proto__:null,Clear:_o,Examples:mo,Flag:po,Interpret:ho,Submit:fo,default:Ns,or:go},Symbol.toStringTag,{value:"Module"})),bo="Yubor",vo="Tozalash",Eo="Tushuntirish",yo="Bayroq",So="Namunalar",wo="或",Ms={interface:{drop_image:"Rasmni Shu Yerga Tashlang",drop_video:"Videoni Shu Yerga Tashlang",drop_audio:"Audioni Shu Yerga Tashlang",drop_file:"Faylni Shu Yerga Tashlang",drop_csv:"CSVni Shu Yerga Tashlang",click_to_upload:"Yuklash uchun Bosing",view_api:"apini ko'ring",built_with_Gradio:"gradio bilan qilingan"},Submit:bo,Clear:vo,Interpret:Eo,Flag:yo,Examples:So,or:wo},xs=Object.freeze(Object.defineProperty({__proto__:null,Clear:vo,Examples:So,Flag:yo,Interpret:Eo,Submit:bo,default:Ms,or:wo},Symbol.toStringTag,{value:"Module"})),To="提交",Io="清除",ko="解释",Ao="标记",Co="示例",Po="或",Ds={interface:{drop_image:"拖放图片至此处",drop_video:"拖放视频至此处",drop_audio:"拖放音频至此处",drop_file:"拖放文件至此处",drop_csv:"拖放CSV至此处",click_to_upload:"点击上传",view_api:"查看API",built_with_Gradio:"使用Gradio构建"},Submit:To,Clear:Io,Interpret:ko,Flag:Ao,Examples:Co,or:Po},Fs=Object.freeze(Object.defineProperty({__proto__:null,Clear:Io,Examples:Co,Flag:Ao,Interpret:ko,Submit:To,default:Ds,or:Po},Symbol.toStringTag,{value:"Module"})),Oo="提交",Bo="清除",Ho="解釋",Lo="Flag",jo="範例",No="或",Gs={interface:{drop_image:"刪除圖片",drop_video:"刪除影片",drop_audio:"刪除音頻",drop_file:"刪除檔案",drop_csv:"刪除CSV",click_to_upload:"點擊上傳",view_api:"查看API",built_with_Gradio:"使用Gradio構建"},Submit:Oo,Clear:Bo,Interpret:Ho,Flag:Lo,Examples:jo,or:No},Us=Object.freeze(Object.defineProperty({__proto__:null,Clear:Bo,Examples:jo,Flag:Lo,Interpret:Ho,Submit:Oo,default:Gs,or:No},Symbol.toStringTag,{value:"Module"})),qt=Object.assign({"./lang/ar.json":$a,"./lang/ca.json":es,"./lang/de.json":ns,"./lang/en.json":is,"./lang/es.json":ls,"./lang/fa.json":ss,"./lang/fr.json":cs,"./lang/he.json":_s,"./lang/hi.json":ps,"./lang/ja.json":ms,"./lang/ko.json":bs,"./lang/lt.json":Es,"./lang/nl.json":Ss,"./lang/pl.json":Ts,"./lang/pt-BR.json":ks,"./lang/ru.json":Cs,"./lang/ta.json":Os,"./lang/tr.json":Hs,"./lang/uk.json":js,"./lang/ur.json":Rs,"./lang/uz.json":xs,"./lang/zh-CN.json":Fs,"./lang/zh-tw.json":Us});function Vs(){let e={};for(const t in qt){const n=t.split("/").pop().split(".").shift();e[n]=qt[t].default}return e}const Xt=Vs();for(const e in Xt)nr(e,Xt[e]);function zs(){Ra({fallbackLocale:"en",initialLocale:Ma()})}function Wt(e,t,n){const r=e.slice();return r[8]=t[n].component,r[17]=t[n].id,r[2]=t[n].props,r[18]=t[n].children,r[9]=t[n].has_modes,r}function Zt(e){let t=[],n=new Map,r,i,o=oe(e[1]);const a=l=>l[17];for(let l=0;l{r=null}),ae())},i(i){n||(B(r),n=!0)},o(i){N(r),n=!1},d(i){i&&E(t),r&&r.d(i)}}}function Xs(e){let t,n,r,i;const o=[{elem_id:"elem_id"in e[2]&&e[2].elem_id||`component-${e[4]}`},{elem_classes:"elem_classes"in e[2]&&e[2].elem_classes||[]},{target:e[6]},e[2],{theme_mode:e[7]},{root:e[3]}];function a(s){e[15](s)}var l=e[8];function u(s){let c={$$slots:{default:[qs]},$$scope:{ctx:s}};for(let h=0;hHt(t,"value",a)),t.$on("prop_change",e[10])),{c(){t&&W(t.$$.fragment),r=de()},m(s,c){t&&Z(t,s,c),y(s,r,c),i=!0},p(s,[c]){const h=c&220?il(o,[c&20&&{elem_id:"elem_id"in s[2]&&s[2].elem_id||`component-${s[4]}`},c&4&&{elem_classes:"elem_classes"in s[2]&&s[2].elem_classes||[]},c&64&&{target:s[6]},c&4&&ol(s[2]),c&128&&{theme_mode:s[7]},c&8&&{root:s[3]}]):{};if(c&2097387&&(h.$$scope={dirty:c,ctx:s}),!n&&c&17&&(n=!0,h.value=s[0][s[4]].props.value,ll(()=>n=!1)),c&256&&l!==(l=s[8])){if(t){le();const _=t;N(_.$$.fragment,1,0,()=>{Y(_,1)}),ae()}l?(t=Bt(l,u(s)),s[14](t),De.push(()=>Ht(t,"value",a)),t.$on("prop_change",s[10]),W(t.$$.fragment),B(t.$$.fragment,1),Z(t,r.parentNode,r)):t=null}else l&&t.$set(h)},i(s){i||(t&&B(t.$$.fragment,s),i=!0)},o(s){t&&N(t.$$.fragment,s),i=!1},d(s){s&&E(r),e[14](null),t&&Y(t,s)}}}function Ws(e,t,n){let{root:r}=t,{component:i}=t,{instance_map:o}=t,{id:a}=t,{props:l}=t,{children:u}=t,{dynamic_ids:s}=t,{has_modes:c}=t,{parent:h=null}=t,{target:_}=t,{theme_mode:p}=t;const v=$e();c&&(l.interactive===!1?l.mode="static":l.interactive===!0||s.has(a)?l.mode="dynamic":l.mode="static"),Et(()=>(v("mount",a),()=>v("destroy",a))),al("BLOCK_KEY",h);function b(f){for(const P in f.detail)n(0,o[a].props[P]=f.detail[P],o)}function g(f){ke.call(this,e,f)}function S(f){ke.call(this,e,f)}function k(f){De[f?"unshift":"push"](()=>{o[a].instance=f,n(0,o)})}function T(f){e.$$.not_equal(o[a].props.value,f)&&(o[a].props.value=f,n(0,o))}return e.$$set=f=>{"root"in f&&n(3,r=f.root),"component"in f&&n(8,i=f.component),"instance_map"in f&&n(0,o=f.instance_map),"id"in f&&n(4,a=f.id),"props"in f&&n(2,l=f.props),"children"in f&&n(1,u=f.children),"dynamic_ids"in f&&n(5,s=f.dynamic_ids),"has_modes"in f&&n(9,c=f.has_modes),"parent"in f&&n(11,h=f.parent),"target"in f&&n(6,_=f.target),"theme_mode"in f&&n(7,p=f.theme_mode)},e.$$.update=()=>{e.$$.dirty&3&&n(1,u=u&&u.filter(f=>o[f.id].type!=="statustracker")),e.$$.dirty&19&&o[a].type==="form"&&(u?.every(f=>!f.props.visible)?n(2,l.visible=!1,l):n(2,l.visible=!0,l))},[o,u,l,r,a,s,_,p,i,c,b,h,g,S,k,T]}class Ro extends ue{constructor(t){super(),ce(this,t,Ws,Xs,fe,{root:3,component:8,instance_map:0,id:4,props:2,children:1,dynamic_ids:5,has_modes:9,parent:11,target:6,theme_mode:7})}}function Zs(e){let t,n,r,i;return{c(){t=be("svg"),n=be("g"),r=be("path"),i=be("path"),d(r,"d","M3.789,0.09C3.903,-0.024 4.088,-0.024 4.202,0.09L4.817,0.705C4.931,0.819 4.931,1.004 4.817,1.118L1.118,4.817C1.004,4.931 0.819,4.931 0.705,4.817L0.09,4.202C-0.024,4.088 -0.024,3.903 0.09,3.789L3.789,0.09Z"),d(i,"d","M4.825,3.797C4.934,3.907 4.934,4.084 4.825,4.193L4.193,4.825C4.084,4.934 3.907,4.934 3.797,4.825L0.082,1.11C-0.027,1.001 -0.027,0.823 0.082,0.714L0.714,0.082C0.823,-0.027 1.001,-0.027 1.11,0.082L4.825,3.797Z"),d(t,"width","100%"),d(t,"height","100%"),d(t,"viewBox","0 0 5 5"),d(t,"version","1.1"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),d(t,"xml:space","preserve"),ge(t,"fill","currentColor"),ge(t,"fill-rule","evenodd"),ge(t,"clip-rule","evenodd"),ge(t,"stroke-linejoin","round"),ge(t,"stroke-miterlimit","2")},m(o,a){y(o,t,a),m(t,n),m(n,r),m(n,i)},p:$,i:$,o:$,d(o){o&&E(t)}}}class Mo extends ue{constructor(t){super(),ce(this,t,null,Zs,fe,{})}}function Ys(e){let t,n,r,i,o,a,l,u,s,c,h,_,p,v,b;return _=new Mo({}),{c(){t=A("div"),n=A("h1"),n.textContent="API Docs",r=x(),i=A("p"),o=I(`No API Routes found for + `),a=A("code"),l=I(e[0]),u=x(),s=A("p"),s.innerHTML=`To expose an API endpoint of your app in this page, set the api_name + parameter of the event listener. +
+ For more information, visit the + API Page guide + . To hide the API documentation button and this page, set + show_api=False + in the + Blocks.launch() + method.`,c=x(),h=A("button"),W(_.$$.fragment),d(a,"class","svelte-e1ha0f"),d(i,"class","attention svelte-e1ha0f"),d(t,"class","wrap prose svelte-e1ha0f"),d(h,"class","svelte-e1ha0f")},m(g,S){y(g,t,S),m(t,n),m(t,r),m(t,i),m(i,o),m(i,a),m(a,l),m(t,u),m(t,s),y(g,c,S),y(g,h,S),Z(_,h,null),p=!0,v||(b=Se(h,"click",e[2]),v=!0)},p(g,[S]){(!p||S&1)&&q(l,g[0])},i(g){p||(B(_.$$.fragment,g),p=!0)},o(g){N(_.$$.fragment,g),p=!1},d(g){g&&(E(t),E(c),E(h)),Y(_),v=!1,b()}}}function Js(e,t,n){const r=$e();let{root:i}=t;const o=()=>r("close");return e.$$set=a=>{"root"in a&&n(0,i=a.root)},[i,r,o]}class Qs extends ue{constructor(t){super(),ce(this,t,Js,Ys,fe,{root:0})}}function Qe(e,t,n=null){return t===void 0?n==="py"?"None":null:t==="string"||t==="str"?n===null?e:'"'+e+'"':t==="number"?n===null?parseFloat(e):e:t==="boolean"||t=="bool"?n==="py"?(e=String(e),e==="true"?"True":"False"):n==="js"?e:e==="true":t==="List[str]"?(e=JSON.stringify(e),e):n===null?e===""?null:JSON.parse(e):typeof e=="string"?e===""?n==="py"?"None":"null":e:JSON.stringify(e)}const xo="https://gradio.s3-us-west-2.amazonaws.com/3.39.0/assets/api-logo-5346f193.svg";function Jt(e){let t;return{c(){t=I("s")},m(n,r){y(n,t,r)},d(n){n&&E(t)}}}function $s(e){let t,n,r,i,o,a,l,u,s,c,h,_,p,v,b,g,S,k,T,f=e[1]>1&&Jt();return g=new Mo({}),{c(){t=A("h2"),n=A("img"),i=x(),o=A("div"),a=I(`API documentation + `),l=A("div"),u=I(e[0]),s=x(),c=A("span"),h=A("span"),_=I(e[1]),p=I(" API endpoint"),f&&f.c(),v=x(),b=A("button"),W(g.$$.fragment),Ue(n.src,r=xo)||d(n,"src",r),d(n,"alt",""),d(n,"class","svelte-3n2nxs"),d(l,"class","url svelte-3n2nxs"),d(h,"class","url svelte-3n2nxs"),d(c,"class","counts svelte-3n2nxs"),d(t,"class","svelte-3n2nxs"),d(b,"class","svelte-3n2nxs")},m(P,H){y(P,t,H),m(t,n),m(t,i),m(t,o),m(o,a),m(o,l),m(l,u),m(t,s),m(t,c),m(c,h),m(h,_),m(c,p),f&&f.m(c,null),y(P,v,H),y(P,b,H),Z(g,b,null),S=!0,k||(T=Se(b,"click",e[3]),k=!0)},p(P,[H]){(!S||H&1)&&q(u,P[0]),(!S||H&2)&&q(_,P[1]),P[1]>1?f||(f=Jt(),f.c(),f.m(c,null)):f&&(f.d(1),f=null)},i(P){S||(B(g.$$.fragment,P),S=!0)},o(P){N(g.$$.fragment,P),S=!1},d(P){P&&(E(t),E(v),E(b)),f&&f.d(),Y(g),k=!1,T()}}}function Ks(e,t,n){let{root:r}=t,{api_count:i}=t;const o=$e(),a=()=>o("close");return e.$$set=l=>{"root"in l&&n(0,r=l.root),"api_count"in l&&n(1,i=l.api_count)},[r,i,o,a]}class eu extends ue{constructor(t){super(),ce(this,t,Ks,$s,fe,{root:0,api_count:1})}}function tu(e){let t,n;return{c(){t=be("svg"),n=be("path"),d(n,"stroke-linecap","round"),d(n,"stroke-linejoin","round"),d(n,"d","M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"),d(t,"fill","none"),d(t,"stroke","currentColor"),d(t,"viewBox","0 0 24 24"),d(t,"width","100%"),d(t,"height","100%"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(t,"aria-hidden","true"),d(t,"stroke-width","2"),d(t,"stroke-linecap","round"),d(t,"stroke-linejoin","round")},m(r,i){y(r,t,i),m(t,n)},p:$,i:$,o:$,d(r){r&&E(t)}}}let nu=class extends ue{constructor(t){super(),ce(this,t,null,tu,fe,{})}};function ru(e){let t,n;return{c(){t=be("svg"),n=be("path"),d(n,"stroke-linecap","round"),d(n,"stroke-linejoin","round"),d(n,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),d(t,"fill","none"),d(t,"stroke","currentColor"),d(t,"viewBox","0 0 24 24"),d(t,"width","100%"),d(t,"height","100%"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(t,"aria-hidden","true"),d(t,"stroke-width","2"),d(t,"stroke-linecap","round"),d(t,"stroke-linejoin","round")},m(r,i){y(r,t,i),m(t,n)},p:$,i:$,o:$,d(r){r&&E(t)}}}class iu extends ue{constructor(t){super(),ce(this,t,null,ru,fe,{})}}function ou(e){let t,n;return{c(){t=be("svg"),n=be("path"),d(n,"stroke-linecap","round"),d(n,"stroke-linejoin","round"),d(n,"d","M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"),d(t,"fill","none"),d(t,"stroke","currentColor"),d(t,"stroke-width","2"),d(t,"viewBox","0 0 24 24"),d(t,"width","100%"),d(t,"height","100%"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(t,"aria-hidden","true"),d(t,"stroke-linecap","round"),d(t,"stroke-linejoin","round")},m(r,i){y(r,t,i),m(t,n)},p:$,i:$,o:$,d(r){r&&E(t)}}}class lu extends ue{constructor(t){super(),ce(this,t,null,ou,fe,{})}}function Qt(e,t,n){const r=e.slice();return r[10]=t[n].label,r[11]=t[n].type,r[12]=t[n].python_type,r[13]=t[n].component,r[14]=t[n].serializer,r[16]=n,r}function $t(e){let t;return{c(){t=I("(")},m(n,r){y(n,t,r)},d(n){n&&E(t)}}}function au(e){let t=e[2][e[16]].type+"",n;return{c(){n=I(t)},m(r,i){y(r,n,i)},p(r,i){i&4&&t!==(t=r[2][r[16]].type+"")&&q(n,t)},d(r){r&&E(n)}}}function su(e){let t=e[12].type+"",n;return{c(){n=I(t)},m(r,i){y(r,n,i)},p(r,i){i&2&&t!==(t=r[12].type+"")&&q(n,t)},d(r){r&&E(n)}}}function Kt(e){let t;return{c(){t=I(",")},m(n,r){y(n,t,r)},d(n){n&&E(t)}}}function en(e){let t,n,r,i,o=e[10]+"",a,l,u=e[13]+"",s,c;function h(b,g){return b[3]==="python"?su:au}let _=h(e),p=_(e),v=e[1].length>1&&Kt();return{c(){t=A("div"),n=A("span"),r=I("# "),p.c(),i=I(` + representing output in '`),a=I(o),l=I("' "),s=I(u),c=I(` + component`),v&&v.c(),d(n,"class","desc svelte-1c7hj3i"),d(t,"class","svelte-1c7hj3i"),Ye(t,"second-level",e[1].length>1)},m(b,g){y(b,t,g),m(t,n),m(n,r),p.m(n,null),m(n,i),m(n,a),m(n,l),m(n,s),m(n,c),v&&v.m(t,null)},p(b,g){_===(_=h(b))&&p?p.p(b,g):(p.d(1),p=_(b),p&&(p.c(),p.m(n,i))),g&2&&o!==(o=b[10]+"")&&q(a,o),g&2&&u!==(u=b[13]+"")&&q(s,u),b[1].length>1?v||(v=Kt(),v.c(),v.m(t,null)):v&&(v.d(1),v=null),g&2&&Ye(t,"second-level",b[1].length>1)},d(b){b&&E(t),p.d(),v&&v.d()}}}function tn(e){let t;return{c(){t=I(")")},m(n,r){y(n,t,r)},d(n){n&&E(t)}}}function nn(e){let t,n,r;return n=new cl({props:{margin:!1}}),{c(){t=A("div"),W(n.$$.fragment),d(t,"class","load-wrap svelte-1c7hj3i")},m(i,o){y(i,t,o),Z(n,t,null),r=!0},i(i){r||(B(n.$$.fragment,i),r=!0)},o(i){N(n.$$.fragment,i),r=!1},d(i){i&&E(t),Y(n)}}}function uu(e){let t,n,r,i,o,a,l=e[1].length>1&&$t(),u=oe(e[1]),s=[];for(let _=0;_1&&tn(),h=e[0]&&nn();return{c(){t=A("div"),n=A("div"),l&&l.c(),r=x();for(let _=0;_1?l||(l=$t(),l.c(),l.m(n,r)):l&&(l.d(1),l=null),p&14){u=oe(_[1]);let v;for(v=0;v1?c||(c=tn(),c.c(),c.m(n,null)):c&&(c.d(1),c=null),(!a||p&1)&&Ye(n,"hide",_[0]),_[0]?h?p&1&&B(h,1):(h=nn(),h.c(),B(h,1),h.m(t,null)):h&&(le(),N(h,1,1,()=>{h=null}),ae())},i(_){a||(B(h),a=!0)},o(_){N(h),a=!1},d(_){_&&E(t),l&&l.d(),Ie(s,_),c&&c.d(),h&&h.d()}}}function cu(e){let t,n,r,i;return r=new yt({props:{$$slots:{default:[uu]},$$scope:{ctx:e}}}),{c(){t=A("h4"),t.innerHTML=`
+ Return Type(s)`,n=x(),W(r.$$.fragment),d(t,"class","svelte-1c7hj3i")},m(o,a){y(o,t,a),y(o,n,a),Z(r,o,a),i=!0},p(o,[a]){const l={};a&131087&&(l.$$scope={dirty:a,ctx:o}),r.$set(l)},i(o){i||(B(r.$$.fragment,o),i=!0)},o(o){N(r.$$.fragment,o),i=!1},d(o){o&&(E(t),E(n)),Y(r,o)}}}function fu(e,t,n){let{dependency:r}=t,{dependency_index:i}=t,{instance_map:o}=t,{dependency_outputs:a}=t,{is_running:l}=t,{root:u}=t,{endpoint_returns:s}=t,{js_returns:c}=t,{named:h}=t,{current_language:_}=t;return e.$$set=p=>{"dependency"in p&&n(4,r=p.dependency),"dependency_index"in p&&n(5,i=p.dependency_index),"instance_map"in p&&n(6,o=p.instance_map),"dependency_outputs"in p&&n(7,a=p.dependency_outputs),"is_running"in p&&n(0,l=p.is_running),"root"in p&&n(8,u=p.root),"endpoint_returns"in p&&n(1,s=p.endpoint_returns),"js_returns"in p&&n(2,c=p.js_returns),"named"in p&&n(9,h=p.named),"current_language"in p&&n(3,_=p.current_language)},[l,s,c,_,r,i,o,a,u,h]}class Do extends ue{constructor(t){super(),ce(this,t,fu,cu,fe,{dependency:4,dependency_index:5,instance_map:6,dependency_outputs:7,is_running:0,root:8,endpoint_returns:1,js_returns:2,named:9,current_language:3})}}function _u(e){let t;return{c(){t=I(e[0])},m(n,r){y(n,t,r)},p(n,r){r&1&&q(t,n[0])},d(n){n&&E(t)}}}function hu(e){let t,n;return t=new Sl({props:{size:"sm",$$slots:{default:[_u]},$$scope:{ctx:e}}}),t.$on("click",e[1]),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},p(r,[i]){const o={};i&9&&(o.$$scope={dirty:i,ctx:r}),t.$set(o)},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function pu(e,t,n){let{code:r}=t,i="copy";function o(){navigator.clipboard.writeText(r),n(0,i="copied!"),setTimeout(()=>{n(0,i="copy")},1500)}return e.$$set=a=>{"code"in a&&n(2,r=a.code)},[i,o,r]}class nt extends ue{constructor(t){super(),ce(this,t,pu,hu,fe,{code:2})}}function du(e){let t,n,r,i,o,a;return n=new nt({props:{code:on}}),{c(){t=A("div"),W(n.$$.fragment),r=x(),i=A("div"),o=A("pre"),o.textContent=`$ ${on}`,d(t,"class","copy svelte-hq8ezf"),d(o,"class","svelte-hq8ezf")},m(l,u){y(l,t,u),Z(n,t,null),y(l,r,u),y(l,i,u),m(i,o),a=!0},p:$,i(l){a||(B(n.$$.fragment,l),a=!0)},o(l){N(n.$$.fragment,l),a=!1},d(l){l&&(E(t),E(r),E(i)),Y(n)}}}function mu(e){let t,n,r,i,o,a;return n=new nt({props:{code:rn}}),{c(){t=A("div"),W(n.$$.fragment),r=x(),i=A("div"),o=A("pre"),o.textContent=`$ ${rn}`,d(t,"class","copy svelte-hq8ezf"),d(o,"class","svelte-hq8ezf")},m(l,u){y(l,t,u),Z(n,t,null),y(l,r,u),y(l,i,u),m(i,o),a=!0},p:$,i(l){a||(B(n.$$.fragment,l),a=!0)},o(l){N(n.$$.fragment,l),a=!1},d(l){l&&(E(t),E(r),E(i)),Y(n)}}}function gu(e){let t,n,r,i;const o=[mu,du],a=[];function l(u,s){return u[0]==="python"?0:u[0]==="javascript"?1:-1}return~(n=l(e))&&(r=a[n]=o[n](e)),{c(){t=A("code"),r&&r.c(),d(t,"class","svelte-hq8ezf")},m(u,s){y(u,t,s),~n&&a[n].m(t,null),i=!0},p(u,s){let c=n;n=l(u),n===c?~n&&a[n].p(u,s):(r&&(le(),N(a[c],1,1,()=>{a[c]=null}),ae()),~n?(r=a[n],r?r.p(u,s):(r=a[n]=o[n](u),r.c()),B(r,1),r.m(t,null)):r=null)},i(u){i||(B(r),i=!0)},o(u){N(r),i=!1},d(u){u&&E(t),~n&&a[n].d()}}}function bu(e){let t,n;return t=new yt({props:{$$slots:{default:[gu]},$$scope:{ctx:e}}}),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},p(r,[i]){const o={};i&3&&(o.$$scope={dirty:i,ctx:r}),t.$set(o)},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}let rn="pip install gradio_client",on="npm i -D @gradio/client";function vu(e,t,n){let{current_language:r}=t;return e.$$set=i=>{"current_language"in i&&n(0,r=i.current_language)},[r]}class Eu extends ue{constructor(t){super(),ce(this,t,vu,bu,fe,{current_language:0})}}function yu(e){let t,n,r,i;return{c(){t=A("h3"),n=I(`fn_index: + `),r=A("span"),i=I(e[1]),d(r,"class","post svelte-41kcm6"),d(t,"class","svelte-41kcm6")},m(o,a){y(o,t,a),m(t,n),m(t,r),m(r,i)},p(o,a){a&2&&q(i,o[1])},d(o){o&&E(t)}}}function Su(e){let t,n,r,i="/"+e[0],o;return{c(){t=A("h3"),n=I(`api_name: + `),r=A("span"),o=I(i),d(r,"class","post svelte-41kcm6"),d(t,"class","svelte-41kcm6")},m(a,l){y(a,t,l),m(t,n),m(t,r),m(r,o)},p(a,l){l&1&&i!==(i="/"+a[0])&&q(o,i)},d(a){a&&E(t)}}}function wu(e){let t;function n(o,a){return o[2]?Su:yu}let r=n(e),i=r(e);return{c(){i.c(),t=de()},m(o,a){i.m(o,a),y(o,t,a)},p(o,[a]){r===(r=n(o))&&i?i.p(o,a):(i.d(1),i=r(o),i&&(i.c(),i.m(t.parentNode,t)))},i:$,o:$,d(o){o&&E(t),i.d(o)}}}function Tu(e,t,n){let{api_name:r=null}=t,{fn_index:i=null}=t,{named:o}=t;return e.$$set=a=>{"api_name"in a&&n(0,r=a.api_name),"fn_index"in a&&n(1,i=a.fn_index),"named"in a&&n(2,o=a.named)},[r,i,o]}class Fo extends ue{constructor(t){super(),ce(this,t,Tu,wu,fe,{api_name:0,fn_index:1,named:2})}}function ln(e,t,n){const r=e.slice();return r[17]=t[n].label,r[18]=t[n].type,r[19]=t[n].python_type,r[20]=t[n].component,r[21]=t[n].example_input,r[22]=t[n].serializer,r[24]=n,r}function an(e,t,n){const r=e.slice();return r[17]=t[n].label,r[18]=t[n].type,r[19]=t[n].python_type,r[20]=t[n].component,r[21]=t[n].example_input,r[22]=t[n].serializer,r[24]=n,r}function sn(e,t,n){const r=e.slice();return r[17]=t[n].label,r[18]=t[n].type,r[19]=t[n].python_type,r[20]=t[n].component,r[21]=t[n].example_input,r[22]=t[n].serializer,r[24]=n,r}function Iu(e){let t,n;return t=new Fo({props:{named:e[6],fn_index:e[1]}}),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},p(r,i){const o={};i&64&&(o.named=r[6]),i&2&&(o.fn_index=r[1]),t.$set(o)},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function ku(e){let t,n;return t=new Fo({props:{named:e[6],api_name:e[0].api_name}}),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},p(r,i){const o={};i&64&&(o.named=r[6]),i&1&&(o.api_name=r[0].api_name),t.$set(o)},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function Au(e){let t,n,r,i,o,a,l,u,s,c,h,_,p,v,b;n=new nt({props:{code:e[9]?.innerText}});let g=oe(e[11]),S=[];for(let L=0;L{a[c]=null}),ae()),~n?(r=a[n],r?r.p(u,s):(r=a[n]=o[n](u),r.c()),B(r,1),r.m(t,null)):r=null)},i(u){i||(B(r),i=!0)},o(u){N(r),i=!1},d(u){u&&E(t),~n&&a[n].d()}}}function Ru(e){let t,n,r,i,o,a;const l=[ku,Iu],u=[];function s(c,h){return c[6]?0:1}return n=s(e),r=u[n]=l[n](e),o=new yt({props:{$$slots:{default:[Nu]},$$scope:{ctx:e}}}),{c(){t=A("div"),r.c(),i=x(),W(o.$$.fragment),d(t,"class","container svelte-1d98qmk")},m(c,h){y(c,t,h),u[n].m(t,null),m(t,i),Z(o,t,null),a=!0},p(c,[h]){let _=n;n=s(c),n===_?u[n].p(c,h):(le(),N(u[_],1,1,()=>{u[_]=null}),ae(),r=u[n],r?r.p(c,h):(r=u[n]=l[n](c),r.c()),B(r,1),r.m(t,i));const p={};h&134218751&&(p.$$scope={dirty:h,ctx:c}),o.$set(p)},i(c){a||(B(r),B(o.$$.fragment,c),a=!0)},o(c){N(r),N(o.$$.fragment,c),a=!1},d(c){c&&E(t),u[n].d(),Y(o)}}}function Mu(e,t,n){let{dependency:r}=t,{dependencies:i}=t,{dependency_index:o}=t,{instance_map:a}=t,{root:l}=t,{dependency_inputs:u}=t,{dependency_failures:s}=t,{endpoint_parameters:c}=t,{js_parameters:h}=t,{named:_}=t,{current_language:p}=t,v,b,g=["Audio","File","Image","Video"],S=c.filter(f=>g.includes(f.component));function k(f){De[f?"unshift":"push"](()=>{v=f,n(8,v)})}function T(f){De[f?"unshift":"push"](()=>{b=f,n(9,b)})}return e.$$set=f=>{"dependency"in f&&n(0,r=f.dependency),"dependencies"in f&&n(12,i=f.dependencies),"dependency_index"in f&&n(1,o=f.dependency_index),"instance_map"in f&&n(13,a=f.instance_map),"root"in f&&n(2,l=f.root),"dependency_inputs"in f&&n(14,u=f.dependency_inputs),"dependency_failures"in f&&n(3,s=f.dependency_failures),"endpoint_parameters"in f&&n(4,c=f.endpoint_parameters),"js_parameters"in f&&n(5,h=f.js_parameters),"named"in f&&n(6,_=f.named),"current_language"in f&&n(7,p=f.current_language)},[r,o,l,s,c,h,_,p,v,b,g,S,i,a,u,k,T]}class Go extends ue{constructor(t){super(),ce(this,t,Mu,Ru,fe,{dependency:0,dependencies:12,dependency_index:1,instance_map:13,root:2,dependency_inputs:14,dependency_failures:3,endpoint_parameters:4,js_parameters:5,named:6,current_language:7})}}const xu="https://gradio.s3-us-west-2.amazonaws.com/3.39.0/assets/python-20e39c92.svg",Du="https://gradio.s3-us-west-2.amazonaws.com/3.39.0/assets/javascript-850cf94b.svg";function dn(e,t,n){const r=e.slice();return r[18]=t[n],r[20]=n,r}function mn(e,t,n){const r=e.slice();return r[18]=t[n],r[20]=n,r}function gn(e,t,n){const r=e.slice();return r[22]=t[n][0],r[23]=t[n][1],r}function bn(e){let t,n,r,i,o;const a=[Gu,Fu],l=[];function u(s,c){return c&128&&(t=null),t==null&&(t=!!(Object.keys(s[7].named_endpoints).length+Object.keys(s[7].unnamed_endpoints).length)),t?0:1}return n=u(e,-1),r=l[n]=a[n](e),{c(){r.c(),i=de()},m(s,c){l[n].m(s,c),y(s,i,c),o=!0},p(s,c){let h=n;n=u(s,c),n===h?l[n].p(s,c):(le(),N(l[h],1,1,()=>{l[h]=null}),ae(),r=l[n],r?r.p(s,c):(r=l[n]=a[n](s),r.c()),B(r,1),r.m(i.parentNode,i))},i(s){o||(B(r),o=!0)},o(s){N(r),o=!1},d(s){s&&E(i),l[n].d(s)}}}function Fu(e){let t,n;return t=new Qs({props:{root:e[0]}}),t.$on("close",e[14]),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},p(r,i){const o={};i&1&&(o.root=r[0]),t.$set(o)},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function Gu(e){let t,n,r,i,o,a,l,u,s,c,h,_=Object.keys(e[7].named_endpoints).length,p,v,b=Object.keys(e[7].unnamed_endpoints).length,g,S;n=new eu({props:{root:e[0],api_count:Object.keys(e[7].named_endpoints).length+Object.keys(e[7].unnamed_endpoints).length}}),n.$on("close",e[12]);let k=oe(e[9]),T=[];for(let j=0;jN(H[j],1,1,()=>{H[j]=null});let D=b&&wn(),J=oe(e[2]),C=[];for(let j=0;jN(C[j],1,1,()=>{C[j]=null});return{c(){t=A("div"),W(n.$$.fragment),r=x(),i=A("div"),o=A("div"),o.innerHTML=`

Use the gradio_client + Python library or the + @gradio/client Javascript package to query the demo via API.

`,a=x(),l=A("div"),u=A("div");for(let j=0;j{r=null}),ae())},i(i){n||(B(r),n=!0)},o(i){N(r),n=!1},d(i){i&&E(t),r&&r.d(i)}}}function wn(e){let t;return{c(){t=A("h2"),t.textContent="Unnamed Endpoints",d(t,"class","header svelte-bdjvpc")},m(n,r){y(n,t,r)},d(n){n&&E(t)}}}function Tn(e){let t,n,r,i,o,a;return n=new Go({props:{named:!1,endpoint_parameters:e[7].unnamed_endpoints[e[20]].parameters,js_parameters:e[8].unnamed_endpoints[e[20]].parameters,instance_map:e[1],dependency:e[18],dependency_index:e[20],current_language:e[3],root:e[0],dependency_inputs:e[10],dependencies:e[2],dependency_failures:e[6]}}),i=new Do({props:{named:!1,endpoint_returns:e[7].unnamed_endpoints[e[20]].returns,js_returns:e[8].unnamed_endpoints[e[20]].returns,instance_map:e[1],dependency:e[18],dependency_index:e[20],is_running:e[4],dependency_outputs:e[5],current_language:e[3],root:e[0]}}),{c(){t=A("div"),W(n.$$.fragment),r=x(),W(i.$$.fragment),o=x(),d(t,"class","endpoint-container svelte-bdjvpc")},m(l,u){y(l,t,u),Z(n,t,null),m(t,r),Z(i,t,null),m(t,o),a=!0},p(l,u){const s={};u&128&&(s.endpoint_parameters=l[7].unnamed_endpoints[l[20]].parameters),u&256&&(s.js_parameters=l[8].unnamed_endpoints[l[20]].parameters),u&2&&(s.instance_map=l[1]),u&4&&(s.dependency=l[18]),u&8&&(s.current_language=l[3]),u&1&&(s.root=l[0]),u&4&&(s.dependencies=l[2]),u&64&&(s.dependency_failures=l[6]),n.$set(s);const c={};u&128&&(c.endpoint_returns=l[7].unnamed_endpoints[l[20]].returns),u&256&&(c.js_returns=l[8].unnamed_endpoints[l[20]].returns),u&2&&(c.instance_map=l[1]),u&4&&(c.dependency=l[18]),u&16&&(c.is_running=l[4]),u&32&&(c.dependency_outputs=l[5]),u&8&&(c.current_language=l[3]),u&1&&(c.root=l[0]),i.$set(c)},i(l){a||(B(n.$$.fragment,l),B(i.$$.fragment,l),a=!0)},o(l){N(n.$$.fragment,l),N(i.$$.fragment,l),a=!1},d(l){l&&E(t),Y(n),Y(i)}}}function In(e){let t,n,r=e[7].unnamed_endpoints[e[20]]&&Tn(e);return{c(){r&&r.c(),t=de()},m(i,o){r&&r.m(i,o),y(i,t,o),n=!0},p(i,o){i[7].unnamed_endpoints[i[20]]?r?(r.p(i,o),o&128&&B(r,1)):(r=Tn(i),r.c(),B(r,1),r.m(t.parentNode,t)):r&&(le(),N(r,1,1,()=>{r=null}),ae())},i(i){n||(B(r),n=!0)},o(i){N(r),n=!1},d(i){i&&E(t),r&&r.d(i)}}}function Uu(e){let t,n,r=e[7]&&bn(e);return{c(){r&&r.c(),t=de()},m(i,o){r&&r.m(i,o),y(i,t,o),n=!0},p(i,[o]){i[7]?r?(r.p(i,o),o&128&&B(r,1)):(r=bn(i),r.c(),B(r,1),r.m(t.parentNode,t)):r&&(le(),N(r,1,1,()=>{r=null}),ae())},i(i){n||(B(r),n=!0)},o(i){N(r),n=!1},d(i){i&&E(t),r&&r.d(i)}}}function Vu(e,t,n){let{instance_map:r}=t,{dependencies:i}=t,{root:o}=t,{app:a}=t;o===""&&(o=location.protocol+"//"+location.host+location.pathname),o.endsWith("/")||(o+="/");let l="python";const u=[["python",xu],["javascript",Du]];let s=!1,c=i.map(f=>f.inputs.map(P=>{let H=r[P].documentation?.example_data;return H===void 0?H="":typeof H=="object"&&(H=JSON.stringify(H)),H})),h=i.map(f=>new Array(f.outputs.length)),_=i.map(f=>new Array(f.inputs.length).fill(!1));async function p(){return await(await fetch(o+"info")).json()}async function v(){return await a.view_api()}let b,g;p().then(f=>n(7,b=f)).catch(f=>console.log(f)),v().then(f=>n(8,g=f)),Et(()=>(document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0),()=>{document.body.style.overflow="auto"}));function S(f){ke.call(this,e,f)}const k=f=>n(3,l=f);function T(f){ke.call(this,e,f)}return e.$$set=f=>{"instance_map"in f&&n(1,r=f.instance_map),"dependencies"in f&&n(2,i=f.dependencies),"root"in f&&n(0,o=f.root),"app"in f&&n(11,a=f.app)},[o,r,i,l,s,h,_,b,g,u,c,a,S,k,T]}class zu extends ue{constructor(t){super(),ce(this,t,Vu,Uu,fe,{instance_map:1,dependencies:2,root:0,app:11})}}function qu(e,{from:t,to:n},r={}){const i=getComputedStyle(e),o=i.transform==="none"?"":i.transform,[a,l]=i.transformOrigin.split(" ").map(parseFloat),u=t.left+t.width*a/n.width-(n.left+a),s=t.top+t.height*l/n.height-(n.top+l),{delay:c=0,duration:h=p=>Math.sqrt(p)*120,easing:_=wl}=r;return{delay:c,duration:fl(h)?h(Math.sqrt(u*u+s*s)):h,easing:_,css:(p,v)=>{const b=v*u,g=v*s,S=p+v*t.width/n.width,k=p+v*t.height/n.height;return`transform: ${o} translate(${b}px, ${g}px) scale(${S}, ${k});`}}}function Xu(e){let t,n;return t=new nu({}),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function Wu(e){let t,n;return t=new iu({}),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function Zu(e){let t,n;return t=new lu({}),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function Yu(e){let t,n,r,i,o,a,l,u,s,c,h,_,p,v,b,g,S,k,T,f,P,H,L,D,J,C,pe,j;const G=[Zu,Wu,Xu],Q=[];function ve(O,K){return O[1]==="warning"?0:O[1]==="info"?1:O[1]==="error"?2:-1}return~(r=ve(e))&&(i=Q[r]=G[r](e)),{c(){t=A("div"),n=A("div"),i&&i.c(),a=x(),l=A("div"),u=A("div"),s=I(e[1]),h=x(),_=A("div"),p=I(e[0]),g=x(),S=A("button"),k=A("span"),k.textContent="×",f=x(),P=A("div"),d(n,"class",o="toast-icon "+e[1]+" svelte-z3l7qj"),d(u,"class",c="toast-title "+e[1]+" svelte-z3l7qj"),d(_,"class",v="toast-text "+e[1]+" svelte-z3l7qj"),d(l,"class",b="toast-details "+e[1]+" svelte-z3l7qj"),d(k,"aria-hidden","true"),d(S,"class",T="toast-close "+e[1]+" svelte-z3l7qj"),d(S,"type","button"),d(S,"aria-label","Close"),d(S,"data-testid","toast-close"),d(P,"class",H="timer "+e[1]+" svelte-z3l7qj"),d(t,"class",L="toast-body "+e[1]+" svelte-z3l7qj"),d(t,"role","alert"),d(t,"data-testid","toast-body")},m(O,K){y(O,t,K),m(t,n),~r&&Q[r].m(n,null),m(t,a),m(t,l),m(l,u),m(u,s),m(l,h),m(l,_),m(_,p),m(t,g),m(t,S),m(S,k),m(t,f),m(t,P),C=!0,pe||(j=[Se(S,"click",e[2]),Se(t,"click",Lt(e[4])),Se(t,"keydown",Lt(e[5]))],pe=!0)},p(O,[K]){let Ae=r;r=ve(O),r!==Ae&&(i&&(le(),N(Q[Ae],1,1,()=>{Q[Ae]=null}),ae()),~r?(i=Q[r],i||(i=Q[r]=G[r](O),i.c()),B(i,1),i.m(n,null)):i=null),(!C||K&2&&o!==(o="toast-icon "+O[1]+" svelte-z3l7qj"))&&d(n,"class",o),(!C||K&2)&&q(s,O[1]),(!C||K&2&&c!==(c="toast-title "+O[1]+" svelte-z3l7qj"))&&d(u,"class",c),(!C||K&1)&&q(p,O[0]),(!C||K&2&&v!==(v="toast-text "+O[1]+" svelte-z3l7qj"))&&d(_,"class",v),(!C||K&2&&b!==(b="toast-details "+O[1]+" svelte-z3l7qj"))&&d(l,"class",b),(!C||K&2&&T!==(T="toast-close "+O[1]+" svelte-z3l7qj"))&&d(S,"class",T),(!C||K&2&&H!==(H="timer "+O[1]+" svelte-z3l7qj"))&&d(P,"class",H),(!C||K&2&&L!==(L="toast-body "+O[1]+" svelte-z3l7qj"))&&d(t,"class",L)},i(O){C||(B(i),O&&_l(()=>{C&&(J&&J.end(1),D=hl(t,jt,{duration:200,delay:100}),D.start())}),C=!0)},o(O){N(i),D&&D.invalidate(),O&&(J=pl(t,jt,{duration:200})),C=!1},d(O){O&&E(t),~r&&Q[r].d(),O&&J&&J.end(),pe=!1,dl(j)}}}function Ju(e,t,n){let{message:r=""}=t,{type:i}=t,{id:o}=t;const a=$e();function l(){a("close",o)}Et(()=>{setTimeout(()=>{l()},1e4)});function u(c){ke.call(this,e,c)}function s(c){ke.call(this,e,c)}return e.$$set=c=>{"message"in c&&n(0,r=c.message),"type"in c&&n(1,i=c.type),"id"in c&&n(3,o=c.id)},[r,i,l,o,u,s]}class Qu extends ue{constructor(t){super(),ce(this,t,Ju,Yu,fe,{message:0,type:1,id:3})}}function kn(e,t,n){const r=e.slice();return r[2]=t[n].type,r[3]=t[n].message,r[4]=t[n].id,r}function An(e,t){let n,r,i,o,a=$,l;return r=new Qu({props:{type:t[2],message:t[3],id:t[4]}}),r.$on("close",t[1]),{key:e,first:null,c(){n=A("div"),W(r.$$.fragment),i=x(),ge(n,"width","100%"),this.first=n},m(u,s){y(u,n,s),Z(r,n,null),m(n,i),l=!0},p(u,s){t=u;const c={};s&1&&(c.type=t[2]),s&1&&(c.message=t[3]),s&1&&(c.id=t[4]),r.$set(c)},r(){o=n.getBoundingClientRect()},f(){Il(n),a()},a(){a(),a=Tl(n,o,qu,{duration:300})},i(u){l||(B(r.$$.fragment,u),l=!0)},o(u){N(r.$$.fragment,u),l=!1},d(u){u&&E(n),Y(r)}}}function $u(e){let t,n=[],r=new Map,i,o=oe(e[0]);const a=l=>l[4];for(let l=0;l0&&"parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0)}function ec(e,t,n){let{messages:r=[]}=t;function i(o){ke.call(this,e,o)}return e.$$set=o=>{"messages"in o&&n(0,r=o.messages)},e.$$.update=()=>{e.$$.dirty&1&&Ku(r)},[r,i]}class tc extends ue{constructor(t){super(),ce(this,t,ec,$u,fe,{messages:0})}}const nc="https://gradio.s3-us-west-2.amazonaws.com/3.39.0/assets/logo-0a070fcf.svg";const{document:xe}=El;function Cn(e){return xe.title=e[3],{c:$,m:$,d:$}}function Pn(e){let t,n,r,i;return{c(){t=A("script"),t.innerHTML="",r=x(),i=A("script"),i.textContent=`window.dataLayer = window.dataLayer || []; + function gtag() { + dataLayer.push(arguments); + } + gtag("js", new Date()); + gtag("config", "UA-156449732-1");`,t.async=!0,t.defer=!0,Ue(t.src,n="https://www.googletagmanager.com/gtag/js?id=UA-156449732-1")||d(t,"src",n)},m(o,a){y(o,t,a),y(o,r,a),y(o,i,a)},d(o){o&&(E(t),E(r),E(i))}}}function On(e){let t,n;return t=new Ro({props:{has_modes:e[12].has_modes,component:e[12].component,id:e[12].id,props:e[12].props,children:e[12].children,dynamic_ids:e[17],instance_map:e[18],root:e[1],target:e[5],theme_mode:e[10]}}),t.$on("mount",e[20]),t.$on("destroy",e[27]),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},p(r,i){const o={};i[0]&4096&&(o.has_modes=r[12].has_modes),i[0]&4096&&(o.component=r[12].component),i[0]&4096&&(o.id=r[12].id),i[0]&4096&&(o.props=r[12].props),i[0]&4096&&(o.children=r[12].children),i[0]&2&&(o.root=r[1]),i[0]&32&&(o.target=r[5]),i[0]&1024&&(o.theme_mode=r[10]),t.$set(o)},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function Bn(e){let t,n,r,i,o,a,l=e[6]&&Hn(e);return{c(){t=A("footer"),l&&l.c(),n=x(),r=A("a"),i=I(`Built with Gradio + `),o=A("img"),Ue(o.src,a=nc)||d(o,"src",a),d(o,"alt","logo"),d(o,"class","svelte-1ax1toq"),d(r,"href","https://gradio.app"),d(r,"class","built-with svelte-1ax1toq"),d(r,"target","_blank"),d(r,"rel","noreferrer"),d(t,"class","svelte-1ax1toq")},m(u,s){y(u,t,s),l&&l.m(t,null),m(t,n),m(t,r),m(r,i),m(r,o)},p(u,s){u[6]?l?l.p(u,s):(l=Hn(u),l.c(),l.m(t,n)):l&&(l.d(1),l=null)},d(u){u&&E(t),l&&l.d()}}}function Hn(e){let t,n,r,i,o,a,l,u;return{c(){t=A("button"),n=I("Use via API "),r=A("img"),o=x(),a=A("div"),a.textContent="·",Ue(r.src,i=xo)||d(r,"src",i),d(r,"alt",""),d(r,"class","svelte-1ax1toq"),d(t,"class","show-api svelte-1ax1toq"),d(a,"class","svelte-1ax1toq")},m(s,c){y(s,t,c),m(t,n),m(t,r),y(s,o,c),y(s,a,c),l||(u=Se(t,"click",e[28]),l=!0)},p:$,d(s){s&&(E(t),E(o),E(a)),l=!1,u()}}}function Ln(e){let t,n,r,i,o,a,l,u;return o=new zu({props:{instance_map:e[18],dependencies:e[2],root:e[1],app:e[11]}}),o.$on("close",e[30]),{c(){t=A("div"),n=A("div"),r=x(),i=A("div"),W(o.$$.fragment),d(n,"class","backdrop svelte-1ax1toq"),d(i,"class","api-docs-wrap svelte-1ax1toq"),d(t,"class","api-docs svelte-1ax1toq")},m(s,c){y(s,t,c),m(t,n),m(t,r),m(t,i),Z(o,i,null),a=!0,l||(u=Se(n,"click",e[29]),l=!0)},p(s,c){const h={};c[0]&4&&(h.dependencies=s[2]),c[0]&2&&(h.root=s[1]),c[0]&2048&&(h.app=s[11]),o.$set(h)},i(s){a||(B(o.$$.fragment,s),a=!0)},o(s){N(o.$$.fragment,s),a=!1},d(s){s&&E(t),Y(o),l=!1,u()}}}function jn(e){let t,n;return t=new tc({props:{messages:e[14]}}),t.$on("close",e[19]),{c(){W(t.$$.fragment)},m(r,i){Z(t,r,i),n=!0},p(r,i){const o={};i[0]&16384&&(o.messages=r[14]),t.$set(o)},i(r){n||(B(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){Y(t,r)}}}function rc(e){let t,n,r,i,o,a,l,u,s,c,h=e[8]&&Cn(e),_=e[4]&&Pn(),p=e[0]&&On(e),v=e[7]&&Bn(e),b=e[13]&&e[0]&&Ln(e),g=e[14]&&jn(e);return{c(){h&&h.c(),t=de(),_&&_.c(),n=de(),r=x(),i=A("div"),o=A("div"),p&&p.c(),a=x(),v&&v.c(),l=x(),b&&b.c(),u=x(),g&&g.c(),s=de(),d(o,"class","contain"),ge(o,"flex-grow",e[9]?"1":"auto"),d(i,"class","wrap svelte-1ax1toq"),ge(i,"min-height",e[9]?"100%":"auto")},m(S,k){h&&h.m(xe.head,null),m(xe.head,t),_&&_.m(xe.head,null),m(xe.head,n),y(S,r,k),y(S,i,k),m(i,o),p&&p.m(o,null),m(i,a),v&&v.m(i,null),y(S,l,k),b&&b.m(S,k),y(S,u,k),g&&g.m(S,k),y(S,s,k),c=!0},p(S,k){S[8]?h||(h=Cn(S),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),S[4]?_||(_=Pn(),_.c(),_.m(n.parentNode,n)):_&&(_.d(1),_=null),S[0]?p?(p.p(S,k),k[0]&1&&B(p,1)):(p=On(S),p.c(),B(p,1),p.m(o,null)):p&&(le(),N(p,1,1,()=>{p=null}),ae()),k[0]&512&&ge(o,"flex-grow",S[9]?"1":"auto"),S[7]?v?v.p(S,k):(v=Bn(S),v.c(),v.m(i,null)):v&&(v.d(1),v=null),k[0]&512&&ge(i,"min-height",S[9]?"100%":"auto"),S[13]&&S[0]?b?(b.p(S,k),k[0]&8193&&B(b,1)):(b=Ln(S),b.c(),B(b,1),b.m(u.parentNode,u)):b&&(le(),N(b,1,1,()=>{b=null}),ae()),S[14]?g?(g.p(S,k),k[0]&16384&&B(g,1)):(g=jn(S),g.c(),B(g,1),g.m(s.parentNode,s)):g&&(le(),N(g,1,1,()=>{g=null}),ae())},i(S){c||(B(p),B(b),B(g),c=!0)},o(S){N(p),N(b),N(g),c=!1},d(S){S&&(E(r),E(i),E(l),E(u),E(s)),h&&h.d(S),E(t),_&&_.d(S),E(n),p&&p.d(),v&&v.d(),b&&b.d(S),g&&g.d(S)}}}const ic=/^'([^]+)'$/,oc="There is a long queue of requests pending. Duplicate this Space to skip.",lc="On mobile, the connection can break if this tab is unfocused or the device sleeps, losing your position in queue.",ac="Lost connection due to leaving page. Rejoining queue...",sc=15,uc=10;function Nn(e,t,n){for(const r of n)for(const i of r[t])if(i===e)return!0;return!1}function cc(e){return Array.isArray(e)&&e.length===0||e===""||e===0||!e}function fc(e,t,n){let r;zs();let{root:i}=t,{components:o}=t,{layout:a}=t,{dependencies:l}=t,{title:u="Gradio"}=t,{analytics_enabled:s=!1}=t,{target:c}=t,{autoscroll:h}=t,{show_api:_=!0}=t,{show_footer:p=!0}=t,{control_page_title:v=!1}=t,{app_mode:b}=t,{theme_mode:g}=t,{app:S}=t,{space_id:k}=t,T=gl();bl(e,T,w=>n(26,r=w));let f={id:a.id,type:"column",props:{},has_modes:!1,instance:{},component:{}};o.push(f);const P=Object.getPrototypeOf(async function(){}).constructor;l.forEach(w=>{if(w.js){const R=w.backend_fn?w.inputs.length===1:w.outputs.length===1;try{w.frontend_fn=new P("__fn_args",`let result = await (${w.js})(...__fn_args); + return (${R} && !Array.isArray(result)) ? [result] : result;`)}catch(M){console.error("Could not parse custom js method."),console.error(M)}}});let L=new URLSearchParams(window.location.search).get("view")==="api";const D=w=>{n(13,L=w);let R=new URLSearchParams(window.location.search);w?R.set("view","api"):R.delete("view"),history.replaceState(null,"","?"+R.toString())},J=new Set;for(const w of o){const{id:R,props:M}=w;(Nn(R,"inputs",l)||!Nn(R,"outputs",l)&&cc(M?.value))&&J.add(R)}let C=o.reduce((w,R)=>(w[R.id]=R,w),{});async function pe(w){try{const R=await Ja[w]();return{name:w,component:R}}catch(R){throw console.error(`failed to load: ${w}`),console.error(R),R}}const j=new Set,G=new Map;async function Q(w){let R=C[w.id];const M=(await G.get(R.type)).component;R.component=M.Component,M.document&&(R.documentation=M.document(R.props)),M.modes&&M.modes.length>1&&(R.has_modes=!0),w.children&&(R.children=w.children.map(U=>C[U.id]),await Promise.all(w.children.map(U=>Q(U))))}o.forEach(async w=>{const R=pe(w.type);j.add(R),G.set(w.type,R)});let{ready:ve=!1}=t;Promise.all(Array.from(j)).then(()=>{Q(a).then(async()=>{n(0,ve=!0)}).catch(w=>{console.error(w)})});function O(w,R){const M=l[R].outputs;w?.forEach((U,_e)=>{const me=C[M[_e]];if(me.props.value_is_output=!0,typeof U=="object"&&U!==null&&U.__type__==="update")for(const[re,ie]of Object.entries(U))re!=="__type__"&&(me.props[re]=ie);else me.props.value=U}),n(12,f)}let K=new Map;function Ae(w,R,M){w?.props||(w.props={}),w.props[R]=M,n(12,f)}let Ee=[],se=[];const Ce=(w,R,M)=>({message:w,fn_index:R,type:M,id:++Uo});let Uo=-1,rt=!1;document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&(rt=!0)});const It=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);let kt=!1,At=!1;const Ne=async(w,R=null)=>{let M=l[w];const U=T.get_status_for_fn(w);if(n(14,se=se.filter(({fn_index:re})=>re!==w)),M.cancels&&await Promise.all(M.cancels.map(async re=>{const ie=K.get(re);return ie?.cancel(),ie})),U==="pending"||U==="generating")return;let _e={fn_index:w,data:M.inputs.map(re=>C[re].props.value),event_data:M.collects_event_data?R:null};M.frontend_fn?M.frontend_fn(_e.data.concat(M.outputs.map(re=>C[re].props.value))).then(re=>{M.backend_fn?(_e.data=re,me()):O(re,w)}):M.backend_fn&&me();function me(){const re=S.submit(_e.fn_index,_e.data,_e.event_data).on("data",({data:ie,fn_index:ne})=>{O(ie,ne)}).on("status",({fn_index:ie,...ne})=>{if(T.update({...ne,status:ne.stage,progress:ne.progress_data,fn_index:ie}),!kt&&k!==null&&ne.position!==void 0&&ne.position>=2&&ne.eta!==void 0&&ne.eta>sc&&(kt=!0,n(14,se=[Ce(oc,ie,"warning"),...se])),!At&&It&&ne.eta!==void 0&&ne.eta>uc&&(At=!0,n(14,se=[Ce(lc,ie,"warning"),...se])),ne.stage==="complete"&&(l.map(async(te,Te)=>{te.trigger_after===ie&&Ne(Te)}),re.destroy()),ne.broken&&It&&rt)window.setTimeout(()=>{n(14,se=[Ce(ac,ie,"error"),...se])},0),Ne(w,R),rt=!1;else if(ne.stage==="error"){if(ne.message){const te=ne.message.replace(ic,(Te,it)=>it);n(14,se=[Ce(te,ie,"error"),...se])}l.map(async(te,Te)=>{te.trigger_after===ie&&!te.trigger_only_on_success&&Ne(Te)}),re.destroy()}}).on("log",({log:ie,fn_index:ne,level:te})=>{n(14,se=[Ce(ie,ne,te),...se])});K.set(w,re)}},Vo=(w,R)=>{if(k===null)return;const M=new URL(`https://huggingface.co/spaces/${k}/discussions/new`);w!==void 0&&w.length>0&&M.searchParams.set("title",w),M.searchParams.set("description",R),window.open(M.toString(),"_blank")};function zo(w){const R=w.detail;n(14,se=se.filter(M=>M.id!==R))}const qo=w=>w&&new URL(w,location.href).origin!==location.origin;let Ct=[],Pt=[];async function Xo(){await yl();for(var w=c.getElementsByTagName("a"),R=0;R{let{targets:_e,trigger:me,inputs:re,outputs:ie}=M;const ne=_e.map(te=>[te,C[te]]);_e.length===0&&!Ee[U]?.includes(-1)&&me==="load"&&ie.every(te=>C?.[te].instance)&&re.every(te=>C?.[te].instance)&&(Ne(U),Ee[U]=[-1]),ne.filter(te=>!!te&&!!te[1]).forEach(([te,{instance:Te}])=>{Ee[U]?.includes(te)||!Te||(Te?.$on(me,it=>{Ne(U,it.detail)}),Ee[U]||(Ee[U]=[]),Ee[U].push(te))})}),o.forEach(M=>{M.props.show_share_button&&!Pt.includes(M.id)&&(Pt.push(M.id),M.instance.$on("share",U=>{const{title:_e,description:me}=U.detail;Vo(_e,me)}))}),o.forEach(M=>{Ct.includes(M.id)||M.instance&&(Ct.push(M.id),M.instance.$on("error",U=>{n(14,se=[Ce(U.detail,-1,"error"),...se])}))})}function Ot(w){Ee=Ee.map(R=>R.filter(M=>M!==w))}l.forEach((w,R)=>{T.register(R,w.inputs,w.outputs)});function Wo(w){for(const M in w){let U=w[M],_e=l[U.fn_index];U.scroll_to_output=_e.scroll_to_output,U.show_progress=_e.show_progress,Ae(C[M],"loading_status",U)}const R=T.get_inputs_to_update();for(const[M,U]of R)Ae(C[M],"pending",U==="pending")}const Zo=({detail:w})=>Ot(w),Yo=()=>{D(!L)},Jo=()=>{D(!1)},Qo=()=>{D(!1)};return e.$$set=w=>{"root"in w&&n(1,i=w.root),"components"in w&&n(22,o=w.components),"layout"in w&&n(23,a=w.layout),"dependencies"in w&&n(2,l=w.dependencies),"title"in w&&n(3,u=w.title),"analytics_enabled"in w&&n(4,s=w.analytics_enabled),"target"in w&&n(5,c=w.target),"autoscroll"in w&&n(24,h=w.autoscroll),"show_api"in w&&n(6,_=w.show_api),"show_footer"in w&&n(7,p=w.show_footer),"control_page_title"in w&&n(8,v=w.control_page_title),"app_mode"in w&&n(9,b=w.app_mode),"theme_mode"in w&&n(10,g=w.theme_mode),"app"in w&&n(11,S=w.app),"space_id"in w&&n(25,k=w.space_id),"ready"in w&&n(0,ve=w.ready)},e.$$.update=()=>{e.$$.dirty[0]&16777216&&vl.update(w=>({...w,autoscroll:h})),e.$$.dirty[0]&67108864&&Wo(r)},[ve,i,l,u,s,c,_,p,v,b,g,S,f,L,se,T,D,J,C,zo,Xo,Ot,o,a,h,k,r,Zo,Yo,Jo,Qo]}class _c extends ue{constructor(t){super(),ce(this,t,fc,rc,fe,{root:1,components:22,layout:23,dependencies:2,title:3,analytics_enabled:4,target:5,autoscroll:24,show_api:6,show_footer:7,control_page_title:8,app_mode:9,theme_mode:10,app:11,space_id:25,ready:0},null,[-1,-1])}}const gc=Object.freeze(Object.defineProperty({__proto__:null,default:_c},Symbol.toStringTag,{value:"Module"}));export{gc as B,dc as X}; +//# sourceMappingURL=Blocks-53d5f72d.js.map diff --git a/gradio/templates/cdn/assets/Blocks-53d5f72d.js.map b/gradio/templates/cdn/assets/Blocks-53d5f72d.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e54641f223b13f665e00597c7ea7ede5a2945f24 --- /dev/null +++ b/gradio/templates/cdn/assets/Blocks-53d5f72d.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":"4kBAUO,SAASA,GAAiBC,EAAMC,EAAMC,EAAIC,EAAQ,CACxD,GAAI,CAACF,EAAM,OAAOG,EAClB,MAAMC,EAAKL,EAAK,wBAChB,GACCC,EAAK,OAASI,EAAG,MACjBJ,EAAK,QAAUI,EAAG,OAClBJ,EAAK,MAAQI,EAAG,KAChBJ,EAAK,SAAWI,EAAG,OAEnB,OAAOD,EACR,KAAM,CACL,MAAAE,EAAQ,EACR,SAAAC,EAAW,IACX,OAAAC,EAASC,GAET,MAAOC,EAAaC,GAAG,EAAKL,EAE5B,IAAAM,EAAMF,EAAaH,EACnB,KAAAM,EAAOT,EACP,IAAAU,CACF,EAAKZ,EAAGF,EAAM,CAAE,KAAAC,EAAM,GAAAI,CAAE,EAAIF,CAAM,EACjC,IAAIY,EAAU,GACVC,EAAU,GACVC,EAEJ,SAASC,GAAQ,CACZJ,IACHG,EAAOE,GAAYnB,EAAM,EAAG,EAAGO,EAAUD,EAAOE,EAAQM,CAAG,GAEvDR,IACJU,EAAU,GAEX,CAED,SAASI,GAAO,CACXN,GAAKO,GAAYrB,EAAMiB,CAAI,EAC/BF,EAAU,EACV,CACD,OAAAO,GAAMX,GAAQ,CAQb,GAPI,CA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,CAAM,EAAGsB,GAA0BS,CAAG,CAAC,GAE1E,SAGJ,GAAIZ,GAA4B,KAAKgB,EAAM,IAAI,EAAG,CAC9CnC,EAAS3B,EAASA,EAAS,GAAI2B,CAAM,EAAGsB,GAA0Ba,EAAM,IAAI,CAAC,EAC7E,SAEJ,IAAIH,EAAWL,GAAUQ,EAAM,IAAI,EAC/BH,IACAhC,EAAS3B,EAASA,EAAS,CAAE,EAAE2B,CAAM,EAAGgC,CAAQ,GAEpD,IAAIQ,EAAsCZ,GAAyCO,EAAM,IAAI,EACzFK,IACAxC,EAAS3B,EAASA,EAAS,CAAE,EAAE2B,CAAM,EAAGwC,CAAmC,GAGnF,OAAOxC,CACX,CCpSO,IAAIyC,GAAW,CAClB,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,GAAM,CACF,IACA,GACH,EACD,MAAO,CACH,IACA,GACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,QAAS,CACL,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,QAAS,CACL,IACA,IACA,IACH,EACD,QAAS,CACL,IACA,IACA,IACH,EACD,QAAS,CACL,IACA,IACA,IACH,EACD,QAAS,CACL,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,QAAS,CACL,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,QAAS,CACL,IACA,IACA,KACA,IACH,EACD,QAAS,CACL,IACA,IACA,KACA,IACH,EACD,QAAS,CACL,IACA,IACA,KACA,IACH,EACD,QAAS,CACL,IACA,IACA,KACA,IACH,EACD,QAAS,CACL,IACA,IACA,KACA,IACH,EACD,QAAS,CACL,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,KACA,IACH,EACD,GAAM,CACF,IACA,IACA,GACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,SAAU,CACN,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,IACA,IACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,SAAU,CACN,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,IACA,KACA,KACA,GACH,EACD,QAAS,CACL,IACA,KACA,KACA,GACH,EACD,GAAM,CACF,KACA,GACH,EACD,GAAM,CACF,KACA,GACH,EACD,QAAS,CACL,KACA,IACA,GACH,EACD,QAAS,CACL,KACA,IACA,GACH,EACD,QAAS,CACL,KACA,IACA,GACH,EACD,QAAS,CACL,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,IACA,IACA,IACH,EACD,QAAS,CACL,KACA,IACA,KACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,EACD,QAAS,CACL,KACA,KACA,IACA,GACH,EACD,QAAS,CACL,KACA,KACA,IACA,GACH,EACD,QAAS,CACL,KACA,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,EACD,GAAM,CACF,KACA,KACA,IACA,GACH,CACL,EClzCO,SAASC,GAAe3C,EAAU4C,EAAQ,CAE7C,QADIC,EAAe,GACVC,EAAa,EAAGA,EAAa9C,EAAS,OAAQ8C,IAAc,CACjE,IAAIC,EAAc/C,EAAS,OAAO8C,CAAU,EAC5C,GAAIC,IAAgB,IAAK,CAErB,QADIC,EAAc,EACXF,EAAa,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","now","end","tick","css","running","started","name","start","create_rule","stop","delete_rule","loop","p","t","fix_position","style","width","height","a","add_transform","b","transform","isMergeableObject","value","isNonNullObject","isSpecial","stringValue","isReactElement","canUseSymbol","REACT_ELEMENT_TYPE","emptyTarget","val","cloneUnlessOtherwiseSpecified","options","deepmerge","defaultArrayMerge","target","source","element","getMergeFunction","key","customMerge","getEnumerableOwnPropertySymbols","symbol","getKeys","propertyIsOnObject","object","property","propertyIsUnsafe","mergeObject","destination","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","array","prev","next","deepmerge_1","cjs","extendStatics","d","__extends","__","__assign","s","i","n","__spreadArray","pack","l","ar","ErrorKind","TYPE","SKELETON_TYPE","isLiteralElement","el","isArgumentElement","isNumberElement","isDateElement","isTimeElement","isSelectElement","isPluralElement","isPoundElement","isTagElement","isNumberSkeleton","isDateTimeSkeleton","SPACE_SEPARATOR_REGEX","DATE_TIME_REGEX","parseDateTimeSkeleton","skeleton","result","match","len","WHITE_SPACE_REGEX","parseNumberSkeletonFromString","stringTokens","x","tokens","_i","stringTokens_1","stringToken","stemAndOptions","stem","_a","options_1","option","icuUnitToEcma","unit","FRACTION_PRECISION_REGEX","SIGNIFICANT_PRECISION_REGEX","INTEGER_WIDTH_REGEX","CONCISE_INTEGER_WIDTH_REGEX","parseSignificantPrecision","str","_","g1","g2","parseSign","parseConciseScientificAndEngineeringStem","signDisplay","parseNotationOptions","opt","signOpts","parseNumberSkeleton","tokens_1","token","all","g3","g4","g5","conciseScientificAndEngineeringOpts","timeData","getBestPattern","locale","skeletonCopy","patternPos","patternChar","extraLength","hourLen","dayPeriodLen","dayPeriodChar","hourChar","getDefaultHourSymbolFromLocale","hourCycle","languageTag","regionTag","hourCycles","SPACE_SEPARATOR_START_REGEX","SPACE_SEPARATOR_END_REGEX","createLocation","hasNativeStartsWith","hasNativeFromCodePoint","hasNativeFromEntries","hasNativeCodePointAt","hasTrimStart","hasTrimEnd","hasNativeIsSafeInteger","isSafeInteger","REGEX_SUPPORTS_U_AND_Y","re","RE","startsWith","search","position","fromCodePoint","codePoints","elements","length","code","fromEntries","entries","obj","entries_1","k","v","codePointAt","index","size","first","second","trimStart","trimEnd","flag","matchIdentifierAtIndex","IDENTIFIER_PREFIX_RE_1","c","_isWhiteSpace","_isPatternSyntax","Parser","message","nestingLevel","parentArgType","expectingCloseTag","char","_isAlpha","startPosition","tagName","childrenResult","children","endTagStartPosition","closingTagNameStartPosition","closingTagName","startOffset","_isPotentialElementNameChar","parseQuoteResult","parseUnquotedResult","parseLeftAngleResult","location","_isAlphaOrSlash","ch","openingBracePosition","startingPosition","endOffset","endPosition","typeStartPosition","argType","typeEndPosition","styleAndLocation","styleStartPosition","styleLocation","argCloseResult","location_1","dateTimePattern","type","typeEndPosition_1","identifierAndLocation","pluralOffset","optionsResult","location_2","nestedBraces","apostrophePosition","expectCloseTag","parsedFirstIdentifier","hasOtherClause","parsedSelectors","selector","selectorLocation","fragmentResult","expectNumberError","invalidNumberError","sign","hasDigits","decimal","offset","kind","prefix","pattern","currentOffset","targetOffset","nextCode","codepoint","pruneLocation","els","parse","opts","error","memoize","cache","cacheDefault","serializer","serializerDefault","strategy","strategyDefault","isPrimitive","monadic","arg","cacheKey","computedValue","variadic","args","assemble","context","serialize","strategyVariadic","strategyMonadic","ObjectWithoutPrototypeCache","strategies","ErrorCode","FormatError","_super","msg","originalMessage","_this","InvalidValueError","variableId","InvalidValueTypeError","MissingValueError","PART_TYPE","mergeLiteral","parts","part","lastPart","isFormatXMLElementFn","formatToParts","locales","formatters","formats","values","currentPluralValue","els_1","varName","value_1","formatFn","chunks","rule","mergeConfig","c1","c2","mergeConfigs","defaultConfig","configs","createFastMemoizeCache","store","createDefaultFormatters","IntlMessageFormat","overrideFormats","supportedLocales","r","E","o","e","u","m","g","h","w","D","M","j","O","$","T","L","z","Z","C","G","J","U","V","q","B","H","f","K","Q","R","W","X","component_map","__vitePreload","langs","process_langs","_langs","lang","processed_langs","addMessages","setupi18n","init","getLocaleFromNavigator","ctx","create_if_block","switch_instance_props","switch_instance_changes","root","$$props","component","instance_map","id","props","dynamic_ids","has_modes","parent","theme_mode","dispatch","createEventDispatcher","onMount","setContext","handle_prop_change","$$value","$$self","insert","svg","anchor","append","path0","path1","div","h1","p0","code0","p1","button","click_handler","represent_value","api_logo","if_block","attr","img","img_src_value","h2","div1","div0","span1","span0","api_count","path","set_data","t_value","dirty","create_if_block_3","create_if_block_2","span","t2","t2_value","t4","t4_value","create_if_block_4","create_if_block_1","h4","dependency","dependency_index","dependency_outputs","is_running","endpoint_returns","js_returns","named","current_language","copy_text","copy","$$invalidate","js_install","pre","py_install","h3","t1_value","t1","api_name","fn_index","endpointdetail_changes","create_if_block_7","copybutton_changes","create_if_block_6","t7","t7_value","t9","t9_value","t5","t5_value","if_block1","dependencies","dependency_inputs","dependency_failures","endpoint_parameters","js_parameters","python_code","js_code","blob_components","blob_examples","param","python","javascript","show_if","show_if_1","div4","div3","div2","apibanner_changes","each_blocks_1","each_blocks","li","li_class_value","codesnippets_changes","responseobject_changes","app","_id","default_data","get_info","get_js_info","info","js_info","data","err","js_api_info","language","flip","ox","oy","dx","dy","cubicOut","is_function","y","sx","sy","div5","div5_intro","create_in_transition","fade","div5_outro","create_out_transition","close_message","stop_animation","rect","scroll_to_top","_messages","messages","logo","script0","script1","render_changes","footer","create_if_block_5","if_block4","MESSAGE_QUOTE_RE","DUPLICATE_MESSAGE","MOBILE_QUEUE_WARNING","MOBILE_RECONNECT_MESSAGE","SHOW_DUPLICATE_MESSAGE_ON_ETA","SHOW_MOBILE_QUEUE_WARNING_ON_ETA","is_dep","deps","dep","dep_item","has_no_default_value","components","layout","title","analytics_enabled","autoscroll","show_api","show_footer","control_page_title","app_mode","space_id","loading_status","create_loading_status_store","rootNode","AsyncFunction","wrap","api_docs_visible","set_api_docs_visible","visible","comp","acc","load_component","component_set","_component_map","walk_layout","instance","_component","_c","ready","handle_update","outputs","output","update_key","update_value","submit_map","set_prop","prop","handled_dependencies","new_message","_error_id","user_left_page","is_mobile_device","showed_duplicate_message","showed_mobile_warning","trigger_api_call","dep_index","event_data","current_status","submission","payload","make_prediction","status","_message","log","level","trigger_share","description","discussion_url","handle_error_close","is_external_url","link","attached_error_listeners","shareable_components","handle_mount","_target","_link","targets","trigger","inputs","target_instances","handle_destroy","set_status","statuses","inputs_to_update","pending_status","detail","app_state","$loading_status"],"sources":["../../../../node_modules/.pnpm/svelte@4.0.0/node_modules/svelte/src/runtime/internal/animations.js","../../../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js","../../../../node_modules/.pnpm/tslib@2.5.3/node_modules/tslib/tslib.es6.mjs","../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.1.0/node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.1.0/node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.1.0/node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.3.6/node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.3.6/node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.3.6/node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.1.0/node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.1.0/node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.1.0/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.1.0/node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../../../node_modules/.pnpm/@formatjs+fast-memoize@1.2.1/node_modules/@formatjs/fast-memoize/lib/index.js","../../../../node_modules/.pnpm/intl-messageformat@9.13.0/node_modules/intl-messageformat/lib/src/error.js","../../../../node_modules/.pnpm/intl-messageformat@9.13.0/node_modules/intl-messageformat/lib/src/formatters.js","../../../../node_modules/.pnpm/intl-messageformat@9.13.0/node_modules/intl-messageformat/lib/src/core.js","../../../../node_modules/.pnpm/svelte-i18n@3.6.0_svelte@4.0.0/node_modules/svelte-i18n/dist/runtime.esm.js","../../../../js/app/src/components/directory.ts","../../../../js/app/src/i18n.ts","../../../../js/app/src/Render.svelte","../../../../js/app/src/api_docs/img/clear.svelte","../../../../js/app/src/api_docs/NoApi.svelte","../../../../js/app/src/api_docs/utils.ts","../../../../js/app/src/api_docs/img/api-logo.svg","../../../../js/app/src/api_docs/ApiBanner.svelte","../../../../js/icons/src/Error.svelte","../../../../js/icons/src/Info.svelte","../../../../js/icons/src/Warning.svelte","../../../../js/app/src/api_docs/ResponseObject.svelte","../../../../js/app/src/api_docs/CopyButton.svelte","../../../../js/app/src/api_docs/InstallSnippet.svelte","../../../../js/app/src/api_docs/EndpointDetail.svelte","../../../../js/app/src/api_docs/CodeSnippets.svelte","../../../../js/app/src/api_docs/img/python.svg","../../../../js/app/src/api_docs/img/javascript.svg","../../../../js/app/src/api_docs/ApiDocs.svelte","../../../../node_modules/.pnpm/svelte@4.0.0/node_modules/svelte/src/runtime/animate/index.js","../../../../js/app/src/components/StatusTracker/ToastContent.svelte","../../../../js/app/src/components/StatusTracker/Toast.svelte","../../../../js/app/src/images/logo.svg","../../../../js/app/src/Blocks.svelte"],"sourcesContent":["import { identity as linear, noop } from './utils.js';\nimport { now } from './environment.js';\nimport { loop } from './loop.js';\nimport { create_rule, delete_rule } from './style_manager.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {import('./private.js').PositionRect} from\n * @param {import('./private.js').AnimationFn} fn\n */\nexport function create_animation(node, from, fn, params) {\n\tif (!from) return noop;\n\tconst to = node.getBoundingClientRect();\n\tif (\n\t\tfrom.left === to.left &&\n\t\tfrom.right === to.right &&\n\t\tfrom.top === to.top &&\n\t\tfrom.bottom === to.bottom\n\t)\n\t\treturn noop;\n\tconst {\n\t\tdelay = 0,\n\t\tduration = 300,\n\t\teasing = linear,\n\t\t// @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n\t\tstart: start_time = now() + delay,\n\t\t// @ts-ignore todo:\n\t\tend = start_time + duration,\n\t\ttick = noop,\n\t\tcss\n\t} = fn(node, { from, to }, params);\n\tlet running = true;\n\tlet started = false;\n\tlet name;\n\t/** @returns {void} */\n\tfunction start() {\n\t\tif (css) {\n\t\t\tname = create_rule(node, 0, 1, duration, delay, easing, css);\n\t\t}\n\t\tif (!delay) {\n\t\t\tstarted = true;\n\t\t}\n\t}\n\t/** @returns {void} */\n\tfunction stop() {\n\t\tif (css) delete_rule(node, name);\n\t\trunning = false;\n\t}\n\tloop((now) => {\n\t\tif (!started && now >= start_time) {\n\t\t\tstarted = true;\n\t\t}\n\t\tif (started && now >= end) {\n\t\t\ttick(1, 0);\n\t\t\tstop();\n\t\t}\n\t\tif (!running) {\n\t\t\treturn false;\n\t\t}\n\t\tif (started) {\n\t\t\tconst p = now - start_time;\n\t\t\tconst t = 0 + 1 * easing(p / duration);\n\t\t\ttick(t, 1 - t);\n\t\t}\n\t\treturn true;\n\t});\n\tstart();\n\ttick(0, 1);\n\treturn stop;\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @returns {void}\n */\nexport function fix_position(node) {\n\tconst style = getComputedStyle(node);\n\tif (style.position !== 'absolute' && style.position !== 'fixed') {\n\t\tconst { width, height } = style;\n\t\tconst a = node.getBoundingClientRect();\n\t\tnode.style.position = 'absolute';\n\t\tnode.style.width = width;\n\t\tnode.style.height = height;\n\t\tadd_transform(node, a);\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {import('./private.js').PositionRect} a\n * @returns {void}\n */\nexport function add_transform(node, a) {\n\tconst b = node.getBoundingClientRect();\n\tif (a.left !== b.left || a.top !== b.top) {\n\t\tconst style = getComputedStyle(node);\n\t\tconst transform = style.transform === 'none' ? '' : style.transform;\n\t\tnode.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n\t}\n}\n","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"AX\": [\n \"H\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"AR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CL\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BO\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-EC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-PE\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"GT\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"HN\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MX\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"NI\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"PY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"SV\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"UY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"JP\": [\n \"H\",\n \"h\",\n \"K\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BO\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"EC\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"PE\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ]\n};\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith;\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n","//\n// Main\n//\nexport default function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTimeElement, isTagElement, } from '@formatjs/icu-messageformat-parser';\nimport { MissingValueError, InvalidValueError, ErrorCode, FormatError, InvalidValueTypeError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __spreadArray } from \"tslib\";\nimport { parse } from '@formatjs/icu-messageformat-parser';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n var _this = this;\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () { return ({\n locale: _this.resolvedLocale.toString(),\n }); };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, {\n ignoreTag: opts === null || opts === void 0 ? void 0 : opts.ignoreTag,\n locale: this.resolvedLocale,\n });\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","import{writable as e,derived as n}from\"svelte/store\";import t from\"deepmerge\";import o from\"intl-messageformat\";const i={},r=(e,n,t)=>t?(n in i||(i[n]={}),e in i[n]||(i[n][e]=t),t):t,s=(e,n)=>{if(null==n)return;if(n in i&&e in i[n])return i[n][e];const t=E(n);for(let o=0;o0){const n=t.slice(e,t.length).join(\".\");if(n in o){o=o[n];break}}o=o[t[e]]}else o=void 0;return o}(t,n)}function m(e,...n){delete i[e],a.update((o=>(o[e]=t.all([o[e]||{},...n]),o)))}const f=n([a],(([e])=>Object.keys(e)));a.subscribe((e=>l=e));const d={};function g(e){return d[e]}function h(e){return null!=e&&E(e).some((e=>{var n;return null===(n=g(e))||void 0===n?void 0:n.size}))}function w(e,n){const t=Promise.all(n.map((n=>(function(e,n){d[e].delete(n),0===d[e].size&&delete d[e]}(e,n),n().then((e=>e.default||e))))));return t.then((n=>m(e,...n)))}const p={};function b(e){if(!h(e))return e in p?p[e]:Promise.resolve();const n=function(e){return E(e).map((e=>{const n=g(e);return[e,n?[...n]:[]]})).filter((([,e])=>e.length>0))}(e);return p[e]=Promise.all(n.map((([e,n])=>w(e,n)))).then((()=>{if(h(e))return b(e);delete p[e]})),p[e]}function y(e,n){g(e)||function(e){d[e]=new Set}(e);const t=g(e);g(e).has(n)||(u(e)||a.update((n=>(n[e]={},n))),t.add(n))}function v({locale:e,id:n}){console.warn(`[svelte-i18n] The message \"${n}\" was not found in \"${E(e).join('\", \"')}\".${h(D())?\"\\n\\nNote: there are at least one loader still registered to this locale that wasn't executed.\":\"\"}`)}const M={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:\"scientific\"},engineering:{notation:\"engineering\"},compactLong:{notation:\"compact\",compactDisplay:\"long\"},compactShort:{notation:\"compact\",compactDisplay:\"short\"}},date:{short:{month:\"numeric\",day:\"numeric\",year:\"2-digit\"},medium:{month:\"short\",day:\"numeric\",year:\"numeric\"},long:{month:\"long\",day:\"numeric\",year:\"numeric\"},full:{weekday:\"long\",month:\"long\",day:\"numeric\",year:\"numeric\"}},time:{short:{hour:\"numeric\",minute:\"numeric\"},medium:{hour:\"numeric\",minute:\"numeric\",second:\"numeric\"},long:{hour:\"numeric\",minute:\"numeric\",second:\"numeric\",timeZoneName:\"short\"},full:{hour:\"numeric\",minute:\"numeric\",second:\"numeric\",timeZoneName:\"short\"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function j(){return M}function O(e){const{formats:n,...t}=e,o=e.initialLocale||e.fallbackLocale;return t.warnOnMissingMessages&&(delete t.warnOnMissingMessages,null==t.handleMissingMessage?t.handleMissingMessage=v:console.warn('[svelte-i18n] The \"warnOnMissingMessages\" option is deprecated. Please use the \"handleMissingMessage\" option instead.')),Object.assign(M,t,{initialLocale:o}),n&&(\"number\"in n&&Object.assign(M.formats.number,n.number),\"date\"in n&&Object.assign(M.formats.date,n.date),\"time\"in n&&Object.assign(M.formats.time,n.time)),x.set(o)}const $=e(!1);let k;const T=e(null);function L(e){return e.split(\"-\").map(((e,n,t)=>t.slice(0,n+1).join(\"-\"))).reverse()}function E(e,n=j().fallbackLocale){const t=L(e);return n?[...new Set([...t,...L(n)])]:t}function D(){return null!=k?k:void 0}T.subscribe((e=>{k=null!=e?e:void 0,\"undefined\"!=typeof window&&null!=e&&document.documentElement.setAttribute(\"lang\",e)}));const x={...T,set:e=>{if(e&&function(e){if(null==e)return;const n=E(e);for(let e=0;e$.set(!0)),n):$.set(!0),b(e).then((()=>{T.set(e)})).finally((()=>{clearTimeout(t),$.set(!1)}))}return T.set(e)}},N=(e,n)=>{const t=e.split(\"&\").find((e=>0===e.indexOf(`${n}=`)));return t?t.split(\"=\").pop():null},A=(e,n)=>{const t=n.exec(e);return t&&t[1]||null},P=e=>\"undefined\"==typeof window?null:A(window.location.hostname,e),S=e=>\"undefined\"==typeof window?null:A(window.location.pathname,e),z=()=>\"undefined\"==typeof window?null:window.navigator.language||window.navigator.languages[0],F=e=>\"undefined\"==typeof window?null:N(window.location.search.substr(1),e),I=e=>\"undefined\"==typeof window?null:N(window.location.hash.substr(1),e),Z=e=>{const n=Object.create(null);return t=>{const o=JSON.stringify(t);return o in n?n[o]:n[o]=e(t)}},C=(e,n)=>{const{formats:t}=j();if(e in t&&n in t[e])return t[e][n];throw new Error(`[svelte-i18n] Unknown \"${n}\" ${e} format.`)},G=Z((({locale:e,format:n,...t})=>{if(null==e)throw new Error('[svelte-i18n] A \"locale\" must be set to format numbers');return n&&(t=C(\"number\",n)),new Intl.NumberFormat(e,t)})),J=Z((({locale:e,format:n,...t})=>{if(null==e)throw new Error('[svelte-i18n] A \"locale\" must be set to format dates');return n?t=C(\"date\",n):0===Object.keys(t).length&&(t=C(\"date\",\"short\")),new Intl.DateTimeFormat(e,t)})),U=Z((({locale:e,format:n,...t})=>{if(null==e)throw new Error('[svelte-i18n] A \"locale\" must be set to format time values');return n?t=C(\"time\",n):0===Object.keys(t).length&&(t=C(\"time\",\"short\")),new Intl.DateTimeFormat(e,t)})),V=({locale:e=D(),...n}={})=>G({locale:e,...n}),_=({locale:e=D(),...n}={})=>J({locale:e,...n}),q=({locale:e=D(),...n}={})=>U({locale:e,...n}),B=Z(((e,n=D())=>new o(e,n,j().formats,{ignoreTag:j().ignoreTag}))),H=(e,n={})=>{var t,o,i,r;let l=n;\"object\"==typeof e&&(l=e,e=l.id);const{values:a,locale:u=D(),default:c}=l;if(null==u)throw new Error(\"[svelte-i18n] Cannot format a message without first setting the initial locale.\");let m=s(e,u);if(m){if(\"string\"!=typeof m)return console.warn(`[svelte-i18n] Message with id \"${e}\" must be of type \"string\", found: \"${typeof m}\". Gettin its value through the \"$format\" method is deprecated; use the \"json\" method instead.`),m}else m=null!==(r=null!==(i=null===(o=(t=j()).handleMissingMessage)||void 0===o?void 0:o.call(t,{locale:u,id:e,defaultValue:c}))&&void 0!==i?i:c)&&void 0!==r?r:e;if(!a)return m;let f=m;try{f=B(m,u).format(a)}catch(n){n instanceof Error&&console.warn(`[svelte-i18n] Message \"${e}\" has syntax error:`,n.message)}return f},K=(e,n)=>q(n).format(e),Q=(e,n)=>_(n).format(e),R=(e,n)=>V(n).format(e),W=(e,n=D())=>s(e,n),X=n([x,a],(()=>H)),Y=n([x],(()=>K)),ee=n([x],(()=>Q)),ne=n([x],(()=>R)),te=n([x,a],(()=>W));function oe(e){let n;const t=e.subscribe((e=>n=e)),o=(...e)=>n(...e);return o.freeze=t,o}function ie(e){return e}function re(e){return b(e||D()||j().initialLocale)}export{X as _,m as addMessages,ee as date,ie as defineMessages,a as dictionary,X as format,_ as getDateFormatter,I as getLocaleFromHash,P as getLocaleFromHostname,z as getLocaleFromNavigator,S as getLocaleFromPathname,F as getLocaleFromQueryString,B as getMessageFormatter,V as getNumberFormatter,q as getTimeFormatter,O as init,$ as isLoading,te as json,x as locale,f as locales,ne as number,y as register,X as t,Y as time,oe as unwrapFunctionStore,re as waitLocale};\n","export const component_map = {\n\taccordion: () => import(\"./Accordion\"),\n\tannotatedimage: () => import(\"./AnnotatedImage\"),\n\taudio: () => import(\"./Audio\"),\n\tbox: () => import(\"./Box\"),\n\tbutton: () => import(\"./Button\"),\n\tchatbot: () => import(\"./Chatbot\"),\n\tcheckbox: () => import(\"./Checkbox\"),\n\tcheckboxgroup: () => import(\"./CheckboxGroup\"),\n\tcode: () => import(\"./Code\"),\n\tcolorpicker: () => import(\"./ColorPicker\"),\n\tcolumn: () => import(\"./Column\"),\n\tdataframe: () => import(\"./DataFrame\"),\n\tdataset: () => import(\"./Dataset\"),\n\tdropdown: () => import(\"./Dropdown\"),\n\tfile: () => import(\"./File\"),\n\tform: () => import(\"./Form\"),\n\tgallery: () => import(\"./Gallery\"),\n\tgroup: () => import(\"./Group\"),\n\thighlightedtext: () => import(\"./HighlightedText\"),\n\thtml: () => import(\"./HTML\"),\n\timage: () => import(\"./Image\"),\n\tinterpretation: () => import(\"./Interpretation\"),\n\tjson: () => import(\"./Json\"),\n\tlabel: () => import(\"./Label\"),\n\tmarkdown: () => import(\"./Markdown\"),\n\tmodel3d: () => import(\"./Model3D\"),\n\tnumber: () => import(\"./Number\"),\n\tplot: () => import(\"./Plot\"),\n\tradio: () => import(\"./Radio\"),\n\trow: () => import(\"./Row\"),\n\tslider: () => import(\"./Slider\"),\n\tstate: () => import(\"./State\"),\n\tstatustracker: () => import(\"./StatusTracker\"),\n\ttabs: () => import(\"./Tabs\"),\n\ttabitem: () => import(\"./TabItem\"),\n\ttextbox: () => import(\"./Textbox\"),\n\ttimeseries: () => import(\"./TimeSeries\"),\n\tuploadbutton: () => import(\"./UploadButton\"),\n\tvideo: () => import(\"./Video\")\n};\n","/// \n\nimport { addMessages, init, getLocaleFromNavigator } from \"svelte-i18n\";\n\nconst langs = import.meta.globEager(\"./lang/*.json\");\n\nexport function process_langs() {\n\tlet _langs: Record<\n\t\tstring,\n\t\t{\n\t\t\t[key: string]: any;\n\t\t}\n\t> = {};\n\n\tfor (const lang in langs) {\n\t\tconst code = (lang.split(\"/\").pop() as string).split(\".\").shift() as string;\n\t\t_langs[code] = (langs[lang] as Record).default;\n\t}\n\n\treturn _langs;\n}\n\nconst processed_langs = process_langs();\n\nfor (const lang in processed_langs) {\n\taddMessages(lang, processed_langs[lang]);\n}\n\nexport function setupi18n() {\n\tinit({\n\t\tfallbackLocale: \"en\",\n\t\tinitialLocale: getLocaleFromNavigator()\n\t});\n}\n","\n\n\n\t{#if children && children.length}\n\t\t{#each children as { component, id: each_id, props, children: _children, has_modes } (each_id)}\n\t\t\t\n\t\t{/each}\n\t{/if}\n\n","\n\t\n\t\t\n\t\t\n\t\n\n","\n\n
\n\t

API Docs

\n\t

\n\t\tNo API Routes found for\n\t\t\n\t\t\t{root}\n\t\t\n\t

\n\t

\n\t\tTo expose an API endpoint of your app in this page, set the \n\t\t\tapi_name\n\t\t\n\t\tparameter of the event listener.\n\t\t
\n\t\tFor more information, visit the\n\t\t\n\t\t\tAPI Page guide\n\t\t\n\t\t. To hide the API documentation button and this page, set\n\t\tshow_api=False\n\t\tin the\n\t\tBlocks.launch()\n\t\tmethod.\n\t

\n
\n\n\n\n\n","export function represent_value(\n\tvalue: string,\n\ttype: string | undefined,\n\tlang: \"js\" | \"py\" | null = null\n) {\n\tif (type === undefined) {\n\t\treturn lang === \"py\" ? \"None\" : null;\n\t}\n\tif (type === \"string\" || type === \"str\") {\n\t\treturn lang === null ? value : '\"' + value + '\"';\n\t} else if (type === \"number\") {\n\t\treturn lang === null ? parseFloat(value) : value;\n\t} else if (type === \"boolean\" || type == \"bool\") {\n\t\tif (lang === \"py\") {\n\t\t\tvalue = String(value);\n\t\t\treturn value === \"true\" ? \"True\" : \"False\";\n\t\t} else if (lang === \"js\") {\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn value === \"true\";\n\t\t}\n\t} else if (type === \"List[str]\") {\n\t\tvalue = JSON.stringify(value);\n\t\treturn value;\n\t} else {\n\t\t// assume object type\n\t\tif (lang === null) {\n\t\t\treturn value === \"\" ? null : JSON.parse(value);\n\t\t} else if (typeof value === \"string\") {\n\t\t\tif (value === \"\") {\n\t\t\t\treturn lang === \"py\" ? \"None\" : \"null\";\n\t\t\t}\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn JSON.stringify(value);\n\t\t}\n\t}\n}\n","export default \"__VITE_ASSET__ffd29fb0__\"","\n\n

\n\t\"\"\n\t
\n\t\tAPI documentation\n\t\t
\n\t\t\t{root}\n\t\t
\n\t
\n\t\n\t\t{api_count} API endpoint{#if api_count > 1}s{/if}\n\t\n

\n\n\n\n\n","\n\t\n\n","\n\t\n\n","\n\t\n\n","\n\n

\n\t
\n\t\t
\n\t
\n\tReturn Type(s)\n

\n\n\t
\n\t\t
\n\t\t\t{#if endpoint_returns.length > 1}({/if}\n\t\t\t{#each endpoint_returns as { label, type, python_type, component, serializer }, i}\n\t\t\t\t
1}>\n\t\t\t\t\t # {#if current_language === \"python\"}{python_type.type}{:else}{js_returns[\n\t\t\t\t\t\t\t\ti\n\t\t\t\t\t\t\t].type}{/if}\n\t\t\t\t\t\trepresenting output in '{label}' {component}\n\t\t\t\t\t\tcomponent{#if endpoint_returns.length > 1},{/if}\n\t\t\t\t
\n\t\t\t{/each}\n\t\t\t{#if endpoint_returns.length > 1}){/if}\n\t\t
\n\t\t{#if is_running}\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t{/if}\n\t
\n
\n\n\n","\n\n\n","\n\n\n\t\n\t\t{#if current_language === \"python\"}\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t
$ {py_install}
\n\t\t\t
\n\t\t{:else if current_language === \"javascript\"}\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t
$ {js_install}
\n\t\t\t
\n\t\t{/if}\n\t
\n
\n\n\n","\n\n{#if named}\n\t

\n\t\tapi_name:\n\t\t{\"/\" + api_name}\n\t

\n{:else}\n\t

\n\t\tfn_index:\n\t\t{fn_index}\n\t

\n{/if}\n\n\n","\n\n
\n\t{#if named}\n\t\t\n\t{:else}\n\t\t\n\t{/if}\n\t\n\t\t\n\t\t\t{#if current_language === \"python\"}\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
from gradio_client import Client\n\nclient = Client(\"{root}\")\nresult = client.predict({#each endpoint_parameters as { label, type, python_type, component, example_input, serializer }, i}\n\t\t\t\t{represent_value(example_input, python_type.type, \"py\")},{#if dependency_failures[dependency_index][i]}ERROR{/if}\t# {python_type.type} {#if python_type.description}({python_type.description}) {/if}in '{label}' {component} component\n\t\t\t\t\t\t{/each}\n\t\t\t\t{#if named}\n\t\t\t\t\t\t\tapi_name=\"/{dependency.api_name}\"\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\tfn_index={dependency_index}\n\t\t\t\t\t\t{/if}\n)\nprint(result)
\n\t\t\t\t
\n\t\t\t{:else if current_language === \"javascript\"}\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
import { client } from \"@gradio/client\";\n{#each blob_examples as { label, type, python_type, component, example_input, serializer }, i}\nconst response_{i} = await fetch(\"{example_input}\");\nconst example{component} = await response_{i}.blob();\n\t\t\t\t\t\t{/each}\nconst app = await client(\"{root}\");\nconst result = await app.predict({#if named}\"/{dependency.api_name}\"{:else}{dependency_index}{/if}, [{#each endpoint_parameters as { label, type, python_type, component, example_input, serializer }, i}{#if blob_components.includes(component)}\n\t\t\t\texample{component}, \t// blob in '{label}' {component} component{:else}\t\t\n\t\t\t\t{represent_value(\n\t\t\t\t\t\t\t\t\t\texample_input,\n\t\t\t\t\t\t\t\t\t\tpython_type.type,\n\t\t\t\t\t\t\t\t\t\t\"js\"\n\t\t\t\t\t\t\t\t\t)}, // {js_parameters[i]\n\t\t\t\t\t\t\t\t\t\t.type} {#if js_parameters[i].description}({js_parameters[i]\n\t\t\t\t\t\t\t\t\t\t\t.description}){/if} in '{label}' {component} component{/if}\n\t\t\t\t\t\t{/each}\n\t]);\n\nconsole.log(result.data);\n
\n\t\t\t\t
\n\t\t\t{/if}\n\t\t
\n\t
\n
\n\n\n","export default \"__VITE_ASSET__dc7a038c__\"","export default \"__VITE_ASSET__90c1298d__\"","\n\n{#if info}\n\t{#if Object.keys(info.named_endpoints).length + Object.keys(info.unnamed_endpoints).length}\n\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t{:else}\n\t\t\n\t{/if}\n{/if}\n\n\n","import { cubicOut } from '../easing/index.js';\nimport { is_function } from '../internal/index.js';\n\n/**\n * The flip function calculates the start and end position of an element and animates between them, translating the x and y values.\n * `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).\n *\n * https://svelte.dev/docs/svelte-animate#flip\n * @param {Element} node\n * @param {{ from: DOMRect; to: DOMRect }} fromTo\n * @param {import('./public.js').FlipParams} params\n * @returns {import('./public.js').AnimationConfig}\n */\nexport function flip(node, { from, to }, params = {}) {\n\tconst style = getComputedStyle(node);\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst [ox, oy] = style.transformOrigin.split(' ').map(parseFloat);\n\tconst dx = from.left + (from.width * ox) / to.width - (to.left + ox);\n\tconst dy = from.top + (from.height * oy) / to.height - (to.top + oy);\n\tconst { delay = 0, duration = (d) => Math.sqrt(d) * 120, easing = cubicOut } = params;\n\treturn {\n\t\tdelay,\n\t\tduration: is_function(duration) ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,\n\t\teasing,\n\t\tcss: (t, u) => {\n\t\t\tconst x = u * dx;\n\t\t\tconst y = u * dy;\n\t\t\tconst sx = t + (u * from.width) / to.width;\n\t\t\tconst sy = t + (u * from.height) / to.height;\n\t\t\treturn `transform: ${transform} translate(${x}px, ${y}px) scale(${sx}, ${sy});`;\n\t\t}\n\t};\n}\n","\n\n\n\t
\n\t\t{#if type === \"warning\"}\n\t\t\t\n\t\t{:else if type === \"info\"}\n\t\t\t\n\t\t{:else if type === \"error\"}\n\t\t\t\n\t\t{/if}\n\t
\n\n\t
\n\t\t
{type}
\n\t\t
\n\t\t\t{message}\n\t\t
\n\t
\n\n\t\n\t\t×\n\t\n\n\t
\n
\n\n\n","\n\n
\n\t{#each messages as { type, message, id } (id)}\n\t\t
\n\t\t\t\n\t\t
\n\t{/each}\n
\n\n\n","export default \"__VITE_ASSET__c2b3a5f0__\"","\n\n\n\t{#if control_page_title}\n\t\t{title}\n\t{/if}\n\t{#if analytics_enabled}\n\t\t\n\t\t\n\t{/if}\n\n\n
\n\n{#if api_docs_visible && ready}\n\t
\n\t\t {\n\t\t\t\tset_api_docs_visible(false);\n\t\t\t}}\n\t\t/>\n\t\t
\n\t\t\t {\n\t\t\t\t\tset_api_docs_visible(false);\n\t\t\t\t}}\n\t\t\t\t{instance_map}\n\t\t\t\t{dependencies}\n\t\t\t\t{root}\n\t\t\t\t{app}\n\t\t\t/>\n\t\t
\n\t
\n{/if}\n\n{#if messages}\n\t\n{/if}\n\n\n"],"file":"assets/Blocks-53d5f72d.js"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Blocks-f08d137e.css b/gradio/templates/cdn/assets/Blocks-f08d137e.css new file mode 100644 index 0000000000000000000000000000000000000000..028c684737030c5c326c5d5ba0cfb036fb8ec127 --- /dev/null +++ b/gradio/templates/cdn/assets/Blocks-f08d137e.css @@ -0,0 +1 @@ +.wrap.svelte-e1ha0f.svelte-e1ha0f{padding:var(--size-6)}.attention.svelte-e1ha0f.svelte-e1ha0f{font-weight:var(--weight-bold);font-size:var(--text-lg)}.attention.svelte-e1ha0f code.svelte-e1ha0f{border:none;background:none;color:var(--color-accent);font-weight:var(--weight-bold)}button.svelte-e1ha0f.svelte-e1ha0f{position:absolute;top:var(--size-5);right:var(--size-6);width:var(--size-4);color:var(--body-text-color)}button.svelte-e1ha0f.svelte-e1ha0f:hover{color:var(--color-accent)}@media (min-width: 768px){button.svelte-e1ha0f.svelte-e1ha0f{top:var(--size-6)}}h2.svelte-3n2nxs.svelte-3n2nxs{display:flex;color:var(--body-text-color);font-weight:var(--weight-semibold);gap:var(--size-4)}h2.svelte-3n2nxs img.svelte-3n2nxs{margin-right:var(--size-2);width:var(--size-4);display:inline-block}.url.svelte-3n2nxs.svelte-3n2nxs{color:var(--color-accent);font-weight:400}button.svelte-3n2nxs.svelte-3n2nxs{position:absolute;top:var(--size-5);right:var(--size-6);width:var(--size-4);color:var(--body-text-color)}button.svelte-3n2nxs.svelte-3n2nxs:hover{color:var(--color-accent)}@media (min-width: 768px){button.svelte-3n2nxs.svelte-3n2nxs{top:var(--size-6)}h2.svelte-3n2nxs img.svelte-3n2nxs{width:var(--size-5)}}.counts.svelte-3n2nxs.svelte-3n2nxs{margin-top:auto;margin-right:var(--size-8);margin-bottom:auto;margin-left:auto;color:var(--body-text-color);font-weight:var(--weight-light)}.load-wrap.svelte-1c7hj3i{display:flex;justify-content:center;align-items:center}h4.svelte-1c7hj3i{display:flex;align-items:center;margin-top:var(--size-6);margin-bottom:var(--size-3);color:var(--body-text-color);font-weight:var(--weight-bold)}.toggle-icon.svelte-1c7hj3i{display:flex;align-items:center;margin-right:var(--size-2);border-radius:var(--radius-full);background:var(--color-grey-300);width:12px;height:4px}.toggle-dot.svelte-1c7hj3i{margin-left:auto;border-radius:var(--radius-full);background:var(--color-grey-700);width:6px;height:6px}.response-wrap.svelte-1c7hj3i{font-family:var(--font-mono)}.desc.svelte-1c7hj3i{color:var(--body-text-color-subdued)}.hide.svelte-1c7hj3i{display:none}.second-level.svelte-1c7hj3i{margin-left:var(--size-4)}code.svelte-hq8ezf pre.svelte-hq8ezf{overflow-x:auto;color:var(--body-text-color);font-family:var(--font-mono);tab-size:2}code.svelte-hq8ezf.svelte-hq8ezf{position:relative;display:block}.copy.svelte-hq8ezf.svelte-hq8ezf{position:absolute;top:0;right:0;margin-top:-5px;margin-right:-5px}h3.svelte-41kcm6{color:var(--body-text-color);font-weight:var(--section-header-text-weight);font-size:var(--text-lg)}.post.svelte-41kcm6{margin-right:var(--size-2);border:1px solid var(--border-color-accent);border-radius:var(--radius-sm);background:var(--color-accent-soft);padding-right:var(--size-1);padding-bottom:var(--size-1);padding-left:var(--size-1);color:var(--color-accent);font-weight:var(--weight-semibold)}code.svelte-1d98qmk pre.svelte-1d98qmk{overflow-x:auto;color:var(--body-text-color);font-family:var(--font-mono);tab-size:2}.token.string.svelte-1d98qmk.svelte-1d98qmk{display:contents;color:var(--color-accent-base)}code.svelte-1d98qmk.svelte-1d98qmk{position:relative;display:block}.copy.svelte-1d98qmk.svelte-1d98qmk{position:absolute;top:0;right:0;margin-top:-5px;margin-right:-5px}.container.svelte-1d98qmk.svelte-1d98qmk{display:flex;flex-direction:column;gap:var(--spacing-xxl);margin-top:var(--size-3);margin-bottom:var(--size-3)}.error.svelte-1d98qmk.svelte-1d98qmk{color:var(--error-text-color)}.desc.svelte-1d98qmk.svelte-1d98qmk{color:var(--body-text-color-subdued)}.example-inputs.svelte-1d98qmk.svelte-1d98qmk{border:1px solid var(--border-color-accent);border-radius:var(--radius-sm);background:var(--color-accent-soft);padding-right:var(--size-1);padding-left:var(--size-1);color:var(--color-accent)}.space.svelte-1j8n062{display:flex;flex-basis:1;margin-top:var(--size-4)}.banner-wrap.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{position:relative;border-bottom:1px solid var(--border-color-primary);padding:var(--size-4) var(--size-6);font-size:var(--text-md)}@media (min-width: 768px){.banner-wrap.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{font-size:var(--text-xl)}}.docs-wrap.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{display:flex;flex-direction:column;gap:var(--spacing-xxl)}.endpoint.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{border-radius:var(--radius-md);background:var(--background-fill-primary);padding:var(--size-6);padding-top:var(--size-1);font-size:var(--text-md)}.client-doc.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{padding-top:var(--size-6);padding-right:var(--size-6);padding-left:var(--size-6);font-size:var(--text-md)}.library.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{border:1px solid var(--border-color-accent);border-radius:var(--radius-sm);background:var(--color-accent-soft);padding-right:var(--size-1);padding-bottom:var(--size-1);padding-left:var(--size-1);color:var(--color-accent)}.snippets.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{display:flex;align-items:center;margin-bottom:var(--size-4)}.snippets.svelte-bdjvpc>.svelte-bdjvpc+.svelte-bdjvpc{margin-left:var(--size-2)}.snippet.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{display:flex;align-items:center;border:1px solid var(--border-color-primary);border-radius:var(--radius-md);padding:var(--size-1) var(--size-1-5);color:var(--body-text-color-subdued);color:var(--body-text-color);line-height:1;user-select:none;text-transform:capitalize}.current-lang.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{border:1px solid var(--body-text-color-subdued);color:var(--body-text-color)}.inactive-lang.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{cursor:pointer;color:var(--body-text-color-subdued)}.inactive-lang.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc:hover,.inactive-lang.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc:focus{box-shadow:var(--shadow-drop);color:var(--body-text-color)}.snippet.svelte-bdjvpc img.svelte-bdjvpc.svelte-bdjvpc{margin-right:var(--size-1-5);width:var(--size-3)}.header.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{margin-top:var(--size-6);font-size:var(--text-xl)}.endpoint-container.svelte-bdjvpc.svelte-bdjvpc.svelte-bdjvpc{margin-top:var(--size-3);margin-bottom:var(--size-3);border:1px solid var(--border-color-primary);border-radius:var(--radius-xl);padding:var(--size-3);padding-top:0}.toast-body.svelte-z3l7qj{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-z3l7qj{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-z3l7qj{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-z3l7qj{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-z3l7qj{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-z3l7qj{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-z3l7qj{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-z3l7qj{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-z3l7qj{color:var(--color-red-700)}.dark .toast-title.error.svelte-z3l7qj{color:var(--color-red-50)}.toast-title.warning.svelte-z3l7qj{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-z3l7qj{color:var(--color-yellow-50)}.toast-title.info.svelte-z3l7qj{color:var(--color-grey-700)}.dark .toast-title.info.svelte-z3l7qj{color:var(--color-grey-50)}.toast-close.svelte-z3l7qj{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-z3l7qj{color:var(--color-red-700)}.dark .toast-close.error.svelte-z3l7qj{color:var(--color-red-500)}.toast-close.warning.svelte-z3l7qj{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-z3l7qj{color:var(--color-yellow-500)}.toast-close.info.svelte-z3l7qj{color:var(--color-grey-700)}.dark .toast-close.info.svelte-z3l7qj{color:var(--color-grey-500)}.toast-text.svelte-z3l7qj{font-size:var(--text-lg)}.toast-text.error.svelte-z3l7qj{color:var(--color-red-700)}.dark .toast-text.error.svelte-z3l7qj{color:var(--color-red-50)}.toast-text.warning.svelte-z3l7qj{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-z3l7qj{color:var(--color-yellow-50)}.toast-text.info.svelte-z3l7qj{color:var(--color-grey-700)}.dark .toast-text.info.svelte-z3l7qj{color:var(--color-grey-50)}.toast-details.svelte-z3l7qj{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-z3l7qj{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-z3l7qj{color:var(--color-red-700)}.dark .toast-icon.error.svelte-z3l7qj{color:var(--color-red-500)}.toast-icon.warning.svelte-z3l7qj{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-z3l7qj{color:var(--color-yellow-500)}.toast-icon.info.svelte-z3l7qj{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-z3l7qj{color:var(--color-grey-500)}@keyframes svelte-z3l7qj-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-z3l7qj{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-z3l7qj-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-z3l7qj{background:var(--color-red-700)}.dark .timer.error.svelte-z3l7qj{background:var(--color-red-500)}.timer.warning.svelte-z3l7qj{background:var(--color-yellow-700)}.dark .timer.warning.svelte-z3l7qj{background:var(--color-yellow-500)}.timer.info.svelte-z3l7qj{background:var(--color-grey-700)}.dark .timer.info.svelte-z3l7qj{background:var(--color-grey-500)}.toast-wrap.svelte-pu0yf1{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (min-width: 640px){.toast-wrap.svelte-pu0yf1{width:calc(var(--size-96) + var(--size-10))}}.wrap.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{display:flex;flex-grow:1;flex-direction:column;width:var(--size-full);font-weight:var(--body-text-weight);font-size:var(--body-text-size)}footer.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{display:flex;justify-content:center;margin-top:var(--size-4);color:var(--body-text-color-subdued)}footer.svelte-1ax1toq>.svelte-1ax1toq+.svelte-1ax1toq{margin-left:var(--size-2)}.show-api.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{display:flex;align-items:center}.show-api.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq:hover{color:var(--body-text-color)}.show-api.svelte-1ax1toq img.svelte-1ax1toq.svelte-1ax1toq{margin-right:var(--size-1);margin-left:var(--size-2);width:var(--size-3)}.built-with.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{display:flex;align-items:center}.built-with.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq:hover{color:var(--body-text-color)}.built-with.svelte-1ax1toq img.svelte-1ax1toq.svelte-1ax1toq{margin-right:var(--size-1);margin-left:var(--size-2);width:var(--size-3)}.api-docs.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{display:flex;position:fixed;top:0;right:0;z-index:var(--layer-5);background:rgba(0,0,0,.5);width:var(--size-screen);height:var(--size-screen-h)}.backdrop.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{flex:1 1 0%;backdrop-filter:blur(4px)}.api-docs-wrap.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{box-shadow:var(--shadow-drop-lg);background:var(--background-fill-primary);overflow-x:hidden;overflow-y:auto}@media (min-width: 768px){.api-docs-wrap.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg);width:950px}}@media (min-width: 1536px){.api-docs-wrap.svelte-1ax1toq.svelte-1ax1toq.svelte-1ax1toq{width:1150px}} diff --git a/gradio/templates/cdn/assets/Button-9b719f62.css b/gradio/templates/cdn/assets/Button-9b719f62.css new file mode 100644 index 0000000000000000000000000000000000000000..1febd1de643feeadb668f5d0fc297f661ce47482 --- /dev/null +++ b/gradio/templates/cdn/assets/Button-9b719f62.css @@ -0,0 +1 @@ +.block.svelte-90oupt{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-90oupt{border-color:var(--color-accent)}.padded.svelte-90oupt{padding:var(--block-padding)}.hidden.svelte-90oupt{display:none}.hide-container.svelte-90oupt{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-e8n7p6{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-1gfkn6j{margin-bottom:var(--spacing-xs)}span.svelte-1gfkn6j:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-1gfkn6j{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-1gfkn6j{margin:0;height:0}div.svelte-1mwvhlq{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group div.svelte-1mwvhlq{border-top-left-radius:0}div.float.svelte-1mwvhlq{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}div.svelte-1mwvhlq:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-1mwvhlq{height:0}span.svelte-1mwvhlq{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-1mwvhlq{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-1030q2h{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-1);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color);border-radius:var(--radius-sm);background:var(--background-fill-primary);padding:2px;color:var(--block-label-text-color)}button.svelte-1030q2h:hover{cursor:pointer;border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-1030q2h{padding:0 1px;font-size:10px}div.svelte-1030q2h{padding:2px;width:14px;height:14px}.pending.svelte-1030q2h{animation:svelte-1030q2h-flash .5s infinite}@keyframes svelte-1030q2h-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.empty.svelte-lk9eg8{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-lk9eg8{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-lk9eg8{min-height:calc(var(--size-32) - 20px)}.large.svelte-lk9eg8{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-lk9eg8{margin-top:0}.small_parent.svelte-lk9eg8{min-height:100%!important}.dropdown-arrow.svelte-p5edak{fill:var(--body-text-color);margin-right:var(--size-2);width:var(--size-5)}button.svelte-1e89no8{display:inline-flex;justify-content:center;align-items:center;transition:var(--button-transition);box-shadow:var(--button-shadow);padding:var(--size-0-5) var(--size-2);text-align:center}button.svelte-1e89no8:hover,button[disabled].svelte-1e89no8{box-shadow:var(--button-shadow-hover)}button.svelte-1e89no8:active{box-shadow:var(--button-shadow-active)}button[disabled].svelte-1e89no8{opacity:.5;filter:grayscale(30%);cursor:not-allowed}.hidden.svelte-1e89no8{display:none}.primary.svelte-1e89no8{border:var(--button-border-width) solid var(--button-primary-border-color);background:var(--button-primary-background-fill);color:var(--button-primary-text-color)}.primary.svelte-1e89no8:hover,.primary[disabled].svelte-1e89no8{border-color:var(--button-primary-border-color-hover);background:var(--button-primary-background-fill-hover);color:var(--button-primary-text-color-hover)}.secondary.svelte-1e89no8{border:var(--button-border-width) solid var(--button-secondary-border-color);background:var(--button-secondary-background-fill);color:var(--button-secondary-text-color)}.secondary.svelte-1e89no8:hover,.secondary[disabled].svelte-1e89no8{border-color:var(--button-secondary-border-color-hover);background:var(--button-secondary-background-fill-hover);color:var(--button-secondary-text-color-hover)}.stop.svelte-1e89no8{border:var(--button-border-width) solid var(--button-cancel-border-color);background:var(--button-cancel-background-fill);color:var(--button-cancel-text-color)}.stop.svelte-1e89no8:hover,.stop[disabled].svelte-1e89no8{border-color:var(--button-cancel-border-color-hover);background:var(--button-cancel-background-fill-hover);color:var(--button-cancel-text-color-hover)}.sm.svelte-1e89no8{border-radius:var(--button-small-radius);padding:var(--button-small-padding);font-weight:var(--button-small-text-weight);font-size:var(--button-small-text-size)}.lg.svelte-1e89no8{border-radius:var(--button-large-radius);padding:var(--button-large-padding);font-weight:var(--button-large-text-weight);font-size:var(--button-large-text-size)} diff --git a/gradio/templates/cdn/assets/Button-e3640f74.js b/gradio/templates/cdn/assets/Button-e3640f74.js new file mode 100644 index 0000000000000000000000000000000000000000..7a74ee9ff5ade26260d58dd1c4a47dd750b41694 --- /dev/null +++ b/gradio/templates/cdn/assets/Button-e3640f74.js @@ -0,0 +1,4 @@ +import{i as Q,a8 as C,S as q,e as A,s as E,z as k,v as B,a9 as I,E as T,N as L,aa as U,U as c,L as o,p as V,ab as D,ac as F,ad as K,q as G,A as N,K as y,Q as H,F as J}from"./index-fda37c89.js";function M(t){const e=t-1;return e*e*e+1}function x(t,{delay:e=0,duration:i=400,easing:n=Q}={}){const u=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:n,css:d=>`opacity: ${d*u}`}}function p(t,{delay:e=0,duration:i=400,easing:n=M,x:u=0,y:d=0,opacity:m=0}={}){const f=getComputedStyle(t),l=+f.opacity,s=f.transform==="none"?"":f.transform,h=l*(1-m),[r,b]=C(u),[w,_]=C(d);return{delay:e,duration:i,easing:n,css:(g,v)=>` + transform: ${s} translate(${(1-g)*r}${b}, ${(1-g)*w}${_}); + opacity: ${l-h*v}`}}function P(t){let e,i,n;const u=t[17].default,d=I(u,t,t[16],null);let m=[{"data-testid":t[7]},{id:t[2]},{class:i="block "+t[3].join(" ")+" svelte-90oupt"}],f={};for(let l=0;l{"height"in a&&i(0,d=a.height),"width"in a&&i(1,m=a.width),"elem_id"in a&&i(2,f=a.elem_id),"elem_classes"in a&&i(3,l=a.elem_classes),"variant"in a&&i(4,s=a.variant),"border_mode"in a&&i(5,h=a.border_mode),"padding"in a&&i(6,r=a.padding),"type"in a&&i(15,b=a.type),"test_id"in a&&i(7,w=a.test_id),"explicit_call"in a&&i(8,_=a.explicit_call),"container"in a&&i(9,g=a.container),"visible"in a&&i(10,v=a.visible),"allow_overflow"in a&&i(11,z=a.allow_overflow),"scale"in a&&i(12,j=a.scale),"min_width"in a&&i(13,S=a.min_width),"$$scope"in a&&i(16,u=a.$$scope)},[d,m,f,l,s,h,r,w,_,g,v,z,j,S,O,b,u,n]}class $ extends q{constructor(e){super(),A(this,e,W,R,E,{height:0,width:1,elem_id:2,elem_classes:3,variant:4,border_mode:5,padding:6,type:15,test_id:7,explicit_call:8,container:9,visible:10,allow_overflow:11,scale:12,min_width:13})}}function X(t){let e,i,n,u,d;const m=t[9].default,f=I(m,t,t[8],null);return{c(){e=L("button"),f&&f.c(),y(e,"class",i=t[4]+" "+t[3]+" "+t[1].join(" ")+" svelte-1e89no8"),y(e,"id",t[0]),e.disabled=t[5],c(e,"hidden",!t[2]),o(e,"flex-grow",t[6]),o(e,"width",t[6]===0?"fit-content":null),o(e,"min-width",typeof t[7]=="number"?`calc(min(${t[7]}px, 100%))`:null)},m(l,s){V(l,e,s),f&&f.m(e,null),n=!0,u||(d=H(e,"click",t[10]),u=!0)},p(l,[s]){f&&f.p&&(!n||s&256)&&D(f,m,l,l[8],n?K(m,l[8],s,null):F(l[8]),null),(!n||s&26&&i!==(i=l[4]+" "+l[3]+" "+l[1].join(" ")+" svelte-1e89no8"))&&y(e,"class",i),(!n||s&1)&&y(e,"id",l[0]),(!n||s&32)&&(e.disabled=l[5]),(!n||s&30)&&c(e,"hidden",!l[2]),s&64&&o(e,"flex-grow",l[6]),s&64&&o(e,"width",l[6]===0?"fit-content":null),s&128&&o(e,"min-width",typeof l[7]=="number"?`calc(min(${l[7]}px, 100%))`:null)},i(l){n||(k(f,l),n=!0)},o(l){B(f,l),n=!1},d(l){l&&N(e),f&&f.d(l),u=!1,d()}}}function Y(t,e,i){let{$$slots:n={},$$scope:u}=e,{elem_id:d=""}=e,{elem_classes:m=[]}=e,{visible:f=!0}=e,{variant:l="secondary"}=e,{size:s="lg"}=e,{disabled:h=!1}=e,{scale:r=null}=e,{min_width:b=void 0}=e;function w(_){J.call(this,t,_)}return t.$$set=_=>{"elem_id"in _&&i(0,d=_.elem_id),"elem_classes"in _&&i(1,m=_.elem_classes),"visible"in _&&i(2,f=_.visible),"variant"in _&&i(3,l=_.variant),"size"in _&&i(4,s=_.size),"disabled"in _&&i(5,h=_.disabled),"scale"in _&&i(6,r=_.scale),"min_width"in _&&i(7,b=_.min_width),"$$scope"in _&&i(8,u=_.$$scope)},[d,m,f,l,s,h,r,b,u,n,w]}class ee extends q{constructor(e){super(),A(this,e,Y,X,E,{elem_id:0,elem_classes:1,visible:2,variant:3,size:4,disabled:5,scale:6,min_width:7})}}export{$ as B,ee as a,p as b,M as c,x as f}; +//# sourceMappingURL=Button-e3640f74.js.map diff --git a/gradio/templates/cdn/assets/Button-e3640f74.js.map b/gradio/templates/cdn/assets/Button-e3640f74.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e451a7a5e2df01b15916a5a16850c0407c6fea5b --- /dev/null +++ b/gradio/templates/cdn/assets/Button-e3640f74.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Button-e3640f74.js","sources":["../../../../node_modules/.pnpm/svelte@4.0.0/node_modules/svelte/src/runtime/easing/index.js","../../../../node_modules/.pnpm/svelte@4.0.0/node_modules/svelte/src/runtime/transition/index.js","../../../../js/atoms/src/Block.svelte","../../../../js/button/src/Button.svelte"],"sourcesContent":["/*\nAdapted from https://github.com/mattdesl\nDistributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md\n*/\nexport { identity as linear } from '../internal/index.js';\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backInOut(t) {\n\tconst s = 1.70158 * 1.525;\n\tif ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));\n\treturn 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backIn(t) {\n\tconst s = 1.70158;\n\treturn t * t * ((s + 1) * t - s);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function backOut(t) {\n\tconst s = 1.70158;\n\treturn --t * t * ((s + 1) * t + s) + 1;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceOut(t) {\n\tconst a = 4.0 / 11.0;\n\tconst b = 8.0 / 11.0;\n\tconst c = 9.0 / 10.0;\n\tconst ca = 4356.0 / 361.0;\n\tconst cb = 35442.0 / 1805.0;\n\tconst cc = 16061.0 / 1805.0;\n\tconst t2 = t * t;\n\treturn t < a\n\t\t? 7.5625 * t2\n\t\t: t < b\n\t\t? 9.075 * t2 - 9.9 * t + 3.4\n\t\t: t < c\n\t\t? ca * t2 - cb * t + cc\n\t\t: 10.8 * t * t - 20.52 * t + 10.72;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceInOut(t) {\n\treturn t < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0)) : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function bounceIn(t) {\n\treturn 1.0 - bounceOut(1.0 - t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circInOut(t) {\n\tif ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1);\n\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circIn(t) {\n\treturn 1.0 - Math.sqrt(1.0 - t * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function circOut(t) {\n\treturn Math.sqrt(1 - --t * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicInOut(t) {\n\treturn t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicIn(t) {\n\treturn t * t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function cubicOut(t) {\n\tconst f = t - 1.0;\n\treturn f * f * f + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticInOut(t) {\n\treturn t < 0.5\n\t\t? 0.5 * Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0))\n\t\t: 0.5 *\n\t\t\t\tMath.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *\n\t\t\t\tMath.pow(2.0, -10.0 * (2.0 * t - 1.0)) +\n\t\t\t\t1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticIn(t) {\n\treturn Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function elasticOut(t) {\n\treturn Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoInOut(t) {\n\treturn t === 0.0 || t === 1.0\n\t\t? t\n\t\t: t < 0.5\n\t\t? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)\n\t\t: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoIn(t) {\n\treturn t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function expoOut(t) {\n\treturn t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadInOut(t) {\n\tt /= 0.5;\n\tif (t < 1) return 0.5 * t * t;\n\tt--;\n\treturn -0.5 * (t * (t - 2) - 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadIn(t) {\n\treturn t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quadOut(t) {\n\treturn -t * (t - 2.0);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartInOut(t) {\n\treturn t < 0.5 ? +8.0 * Math.pow(t, 4.0) : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartIn(t) {\n\treturn Math.pow(t, 4.0);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quartOut(t) {\n\treturn Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintInOut(t) {\n\tif ((t *= 2) < 1) return 0.5 * t * t * t * t * t;\n\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintIn(t) {\n\treturn t * t * t * t * t;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function quintOut(t) {\n\treturn --t * t * t * t * t + 1;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineInOut(t) {\n\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineIn(t) {\n\tconst v = Math.cos(t * Math.PI * 0.5);\n\tif (Math.abs(v) < 1e-14) return 1;\n\telse return 1 - v;\n}\n\n/**\n * https://svelte.dev/docs/svelte-easing\n * @param {number} t\n * @returns {number}\n */\nexport function sineOut(t) {\n\treturn Math.sin((t * Math.PI) / 2);\n}\n","import { cubicOut, cubicInOut, linear } from '../easing/index.js';\nimport { assign, split_css_unit, is_function } from '../internal/index.js';\n\n/**\n * Animates a `blur` filter alongside an element's opacity.\n *\n * https://svelte.dev/docs/svelte-transition#blur\n * @param {Element} node\n * @param {import('./public').BlurParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function blur(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst f = style.filter === 'none' ? '' : style.filter;\n\tconst od = target_opacity * (1 - opacity);\n\tconst [value, unit] = split_css_unit(amount);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_t, u) => `opacity: ${target_opacity - od * u}; filter: ${f} blur(${u * value}${unit});`\n\t};\n}\n\n/**\n * Animates the opacity of an element from 0 to the current opacity for `in` transitions and from the current opacity to 0 for `out` transitions.\n *\n * https://svelte.dev/docs/svelte-transition#fade\n * @param {Element} node\n * @param {import('./public').FadeParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function fade(node, { delay = 0, duration = 400, easing = linear } = {}) {\n\tconst o = +getComputedStyle(node).opacity;\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t) => `opacity: ${t * o}`\n\t};\n}\n\n/**\n * Animates the x and y positions and the opacity of an element. `in` transitions animate from the provided values, passed as parameters to the element's default values. `out` transitions animate from the element's default values to the provided values.\n *\n * https://svelte.dev/docs/svelte-transition#fly\n * @param {Element} node\n * @param {import('./public').FlyParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function fly(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst od = target_opacity * (1 - opacity);\n\tconst [xValue, xUnit] = split_css_unit(x);\n\tconst [yValue, yUnit] = split_css_unit(y);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t, u) => `\n\t\t\ttransform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit});\n\t\t\topacity: ${target_opacity - od * u}`\n\t};\n}\n\n/**\n * Slides an element in and out.\n *\n * https://svelte.dev/docs/svelte-transition#slide\n * @param {Element} node\n * @param {import('./public').SlideParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = 'y' } = {}) {\n\tconst style = getComputedStyle(node);\n\tconst opacity = +style.opacity;\n\tconst primary_property = axis === 'y' ? 'height' : 'width';\n\tconst primary_property_value = parseFloat(style[primary_property]);\n\tconst secondary_properties = axis === 'y' ? ['top', 'bottom'] : ['left', 'right'];\n\tconst capitalized_secondary_properties = secondary_properties.map(\n\t\t(e) => `${e[0].toUpperCase()}${e.slice(1)}`\n\t);\n\tconst padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);\n\tconst padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);\n\tconst margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);\n\tconst margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);\n\tconst border_width_start_value = parseFloat(\n\t\tstyle[`border${capitalized_secondary_properties[0]}Width`]\n\t);\n\tconst border_width_end_value = parseFloat(\n\t\tstyle[`border${capitalized_secondary_properties[1]}Width`]\n\t);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (t) =>\n\t\t\t'overflow: hidden;' +\n\t\t\t`opacity: ${Math.min(t * 20, 1) * opacity};` +\n\t\t\t`${primary_property}: ${t * primary_property_value}px;` +\n\t\t\t`padding-${secondary_properties[0]}: ${t * padding_start_value}px;` +\n\t\t\t`padding-${secondary_properties[1]}: ${t * padding_end_value}px;` +\n\t\t\t`margin-${secondary_properties[0]}: ${t * margin_start_value}px;` +\n\t\t\t`margin-${secondary_properties[1]}: ${t * margin_end_value}px;` +\n\t\t\t`border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` +\n\t\t\t`border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`\n\t};\n}\n\n/**\n * Animates the opacity and scale of an element. `in` transitions animate from an element's current (default) values to the provided values, passed as parameters. `out` transitions animate from the provided values to an element's default values.\n *\n * https://svelte.dev/docs/svelte-transition#scale\n * @param {Element} node\n * @param {import('./public').ScaleParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function scale(\n\tnode,\n\t{ delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {}\n) {\n\tconst style = getComputedStyle(node);\n\tconst target_opacity = +style.opacity;\n\tconst transform = style.transform === 'none' ? '' : style.transform;\n\tconst sd = 1 - start;\n\tconst od = target_opacity * (1 - opacity);\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_t, u) => `\n\t\t\ttransform: ${transform} scale(${1 - sd * u});\n\t\t\topacity: ${target_opacity - od * u}\n\t\t`\n\t};\n}\n\n/**\n * Animates the stroke of an SVG element, like a snake in a tube. `in` transitions begin with the path invisible and draw the path to the screen over time. `out` transitions start in a visible state and gradually erase the path. `draw` only works with elements that have a `getTotalLength` method, like `` and ``.\n *\n * https://svelte.dev/docs/svelte-transition#draw\n * @param {SVGElement & { getTotalLength(): number }} node\n * @param {import('./public').DrawParams} [params]\n * @returns {import('./public').TransitionConfig}\n */\nexport function draw(node, { delay = 0, speed, duration, easing = cubicInOut } = {}) {\n\tlet len = node.getTotalLength();\n\tconst style = getComputedStyle(node);\n\tif (style.strokeLinecap !== 'butt') {\n\t\tlen += parseInt(style.strokeWidth);\n\t}\n\tif (duration === undefined) {\n\t\tif (speed === undefined) {\n\t\t\tduration = 800;\n\t\t} else {\n\t\t\tduration = len / speed;\n\t\t}\n\t} else if (typeof duration === 'function') {\n\t\tduration = duration(len);\n\t}\n\treturn {\n\t\tdelay,\n\t\tduration,\n\t\teasing,\n\t\tcss: (_, u) => `\n\t\t\tstroke-dasharray: ${len};\n\t\t\tstroke-dashoffset: ${u * len};\n\t\t`\n\t};\n}\n\n/**\n * The `crossfade` function creates a pair of [transitions](/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.\n *\n * https://svelte.dev/docs/svelte-transition#crossfade\n * @param {import('./public').CrossfadeParams & {\n * \tfallback?: (node: Element, params: import('./public').CrossfadeParams, intro: boolean) => import('./public').TransitionConfig;\n * }} params\n * @returns {[(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig, (node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig]}\n */\nexport function crossfade({ fallback, ...defaults }) {\n\t/** @type {Map} */\n\tconst to_receive = new Map();\n\t/** @type {Map} */\n\tconst to_send = new Map();\n\t/**\n\t * @param {Element} from_node\n\t * @param {Element} node\n\t * @param {import('./public').CrossfadeParams} params\n\t * @returns {import('./public').TransitionConfig}\n\t */\n\tfunction crossfade(from_node, node, params) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = (d) => Math.sqrt(d) * 30,\n\t\t\teasing = cubicOut\n\t\t} = assign(assign({}, defaults), params);\n\t\tconst from = from_node.getBoundingClientRect();\n\t\tconst to = node.getBoundingClientRect();\n\t\tconst dx = from.left - to.left;\n\t\tconst dy = from.top - to.top;\n\t\tconst dw = from.width / to.width;\n\t\tconst dh = from.height / to.height;\n\t\tconst d = Math.sqrt(dx * dx + dy * dy);\n\t\tconst style = getComputedStyle(node);\n\t\tconst transform = style.transform === 'none' ? '' : style.transform;\n\t\tconst opacity = +style.opacity;\n\t\treturn {\n\t\t\tdelay,\n\t\t\tduration: is_function(duration) ? duration(d) : duration,\n\t\t\teasing,\n\t\t\tcss: (t, u) => `\n\t\t\t\topacity: ${t * opacity};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${\n\t\t\t\tt + (1 - t) * dh\n\t\t\t});\n\t\t\t`\n\t\t};\n\t}\n\n\t/**\n\t * @param {Map} items\n\t * @param {Map} counterparts\n\t * @param {boolean} intro\n\t * @returns {(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig}\n\t */\n\tfunction transition(items, counterparts, intro) {\n\t\treturn (node, params) => {\n\t\t\titems.set(params.key, node);\n\t\t\treturn () => {\n\t\t\t\tif (counterparts.has(params.key)) {\n\t\t\t\t\tconst other_node = counterparts.get(params.key);\n\t\t\t\t\tcounterparts.delete(params.key);\n\t\t\t\t\treturn crossfade(other_node, node, params);\n\t\t\t\t}\n\t\t\t\t// if the node is disappearing altogether\n\t\t\t\t// (i.e. wasn't claimed by the other list)\n\t\t\t\t// then we need to supply an outro\n\t\t\t\titems.delete(params.key);\n\t\t\t\treturn fallback && fallback(node, params, intro);\n\t\t\t};\n\t\t};\n\t}\n\treturn [transition(to_send, to_receive, false), transition(to_receive, to_send, true)];\n}\n","\n\n\n\t\n\n\n\n","\n\n\n\t\n\n\n\n"],"names":["cubicOut","f","fade","node","delay","duration","easing","linear","o","t","fly","x","y","opacity","style","target_opacity","transform","od","xValue","xUnit","split_css_unit","yValue","yUnit","u","ctx","svelte_element","svelte_element_data","toggle_class","set_style","insert","target","anchor","get_spread_update","svelte_element_levels","svelte_element_class_value","create_dynamic_element","height","$$props","width","elem_id","elem_classes","variant","border_mode","padding","type","test_id","explicit_call","container","visible","allow_overflow","scale","min_width","tag","attr","button","button_class_value","current","dirty","size","disabled"],"mappings":"iMAgIO,SAASA,EAAS,EAAG,CAC3B,MAAMC,EAAI,EAAI,EACd,OAAOA,EAAIA,EAAIA,EAAI,CACpB,CC/FO,SAASC,EAAKC,EAAM,CAAE,MAAAC,EAAQ,EAAG,SAAAC,EAAW,IAAK,OAAAC,EAASC,CAAQ,EAAG,GAAI,CAC/E,MAAMC,EAAI,CAAC,iBAAiBL,CAAI,EAAE,QAClC,MAAO,CACN,MAAAC,EACA,SAAAC,EACA,OAAAC,EACA,IAAMG,GAAM,YAAYA,EAAID,GAC9B,CACA,CAUO,SAASE,EACfP,EACA,CAAE,MAAAC,EAAQ,EAAG,SAAAC,EAAW,IAAK,OAAAC,EAASN,EAAU,EAAAW,EAAI,EAAG,EAAAC,EAAI,EAAG,QAAAC,EAAU,CAAG,EAAG,CAAE,EAC/E,CACD,MAAMC,EAAQ,iBAAiBX,CAAI,EAC7BY,EAAiB,CAACD,EAAM,QACxBE,EAAYF,EAAM,YAAc,OAAS,GAAKA,EAAM,UACpDG,EAAKF,GAAkB,EAAIF,GAC3B,CAACK,EAAQC,CAAK,EAAIC,EAAeT,CAAC,EAClC,CAACU,EAAQC,CAAK,EAAIF,EAAeR,CAAC,EACxC,MAAO,CACN,MAAAR,EACA,SAAAC,EACA,OAAAC,EACA,IAAK,CAACG,EAAGc,IAAM;AAAA,gBACDP,gBAAwB,EAAIP,GAAKS,IAASC,OAAW,EAAIV,GAAKY,IAASC;AAAA,cACzEP,EAAiBE,EAAKM,GACpC,CACA,yFClDcC,EAAO,CAAA,CAAA,MAChBA,EAAO,CAAA,CAAA,oBAEGA,EAAY,CAAA,EAAC,KAAK,GAAG,EAAA,+EAJ7BA,EAAG,EAAA,CAAA,aAAHA,EAAG,EAAA,CAAA,EAAAC,EAAAC,CA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B,IAAI,8HAlBI,CAAA,QAAAe,EAAU,EAAE,EAAAF,GACZ,aAAAG,EAAY,EAAA,EAAAH,EACZ,CAAA,QAAAW,EAAU,EAAI,EAAAX,EACd,CAAA,QAAAI,EAA4C,WAAW,EAAAJ,EACvD,CAAA,KAAAqB,EAAoB,IAAI,EAAArB,EACxB,CAAA,SAAAsB,EAAW,EAAK,EAAAtB,EAChB,CAAA,MAAAa,EAAuB,IAAI,EAAAb,EAC3B,CAAA,UAAAc,EAAgC,MAAS,EAAAd","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/ColorPicker-5063dbc4.css b/gradio/templates/cdn/assets/ColorPicker-5063dbc4.css new file mode 100644 index 0000000000000000000000000000000000000000..268eef5e9fd01a5bb7158b5d24de920141ba055d --- /dev/null +++ b/gradio/templates/cdn/assets/ColorPicker-5063dbc4.css @@ -0,0 +1 @@ +label.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70{display:flex;align-items:center;cursor:pointer;color:var(--body-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}label.svelte-1ojmf70>.svelte-1ojmf70+.svelte-1ojmf70{margin-left:var(--size-2)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70{--ring-color:transparent;position:relative;box-shadow:var(--input-shadow);border:1px solid var(--checkbox-border-color);border-radius:var(--checkbox-border-radius);background-color:var(--checkbox-background-color);line-height:var(--line-sm)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:checked,input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:checked:hover,input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:checked:focus{border-color:var(--checkbox-border-color-selected);background-image:var(--checkbox-check);background-color:var(--checkbox-background-color-selected)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:hover{border-color:var(--checkbox-border-color-hover);background-color:var(--checkbox-background-color-hover)}input.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70:focus{border-color:var(--checkbox-border-color-focus);background-color:var(--checkbox-background-color-focus)}input[disabled].svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70,.disabled.svelte-1ojmf70.svelte-1ojmf70.svelte-1ojmf70{cursor:not-allowed}.wrap.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{display:flex;flex-wrap:wrap;gap:var(--checkbox-label-gap)}label.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{display:flex;align-items:center;transition:var(--button-transition);cursor:pointer;box-shadow:var(--checkbox-label-shadow);border:var(--checkbox-label-border-width) solid var(--checkbox-label-border-color);border-radius:var(--button-small-radius);background:var(--checkbox-label-background-fill);padding:var(--checkbox-label-padding);color:var(--checkbox-label-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}label.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:hover{background:var(--checkbox-label-background-fill-hover)}label.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:focus{background:var(--checkbox-label-background-fill-focus)}label.selected.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{background:var(--checkbox-label-background-fill-selected);color:var(--checkbox-label-text-color-selected)}label.svelte-1qxcj04>.svelte-1qxcj04+.svelte-1qxcj04{margin-left:var(--size-2)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{--ring-color:transparent;position:relative;box-shadow:var(--checkbox-shadow);border:var(--checkbox-border-width) solid var(--checkbox-border-color);border-radius:var(--checkbox-border-radius);background-color:var(--checkbox-background-color);line-height:var(--line-sm)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:checked,input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:checked:hover,input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:checked:focus{border-color:var(--checkbox-border-color-selected);background-image:var(--checkbox-check);background-color:var(--checkbox-background-color-selected)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:hover{border-color:var(--checkbox-border-color-hover);background-color:var(--checkbox-background-color-hover)}input.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04:focus{border-color:var(--checkbox-border-color-focus);background-color:var(--checkbox-background-color-focus)}input[disabled].svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04,.disabled.svelte-1qxcj04.svelte-1qxcj04.svelte-1qxcj04{cursor:not-allowed}.options.svelte-1aonegi{--window-padding:var(--size-8);position:fixed;z-index:var(--layer-top);margin-left:0;box-shadow:var(--shadow-drop-lg);border-radius:var(--container-radius);background:var(--background-fill-primary);min-width:fit-content;max-width:inherit;overflow:auto;color:var(--body-text-color);list-style:none}.item.svelte-1aonegi{display:flex;cursor:pointer;padding:var(--size-2)}.item.svelte-1aonegi:hover,.active.svelte-1aonegi{background:var(--background-fill-secondary)}.inner-item.svelte-1aonegi{padding-right:var(--size-1)}.hide.svelte-1aonegi{visibility:hidden}label.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0:not(.container),label.svelte-c0u3f0:not(.container) .wrap.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) .wrap-inner.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) .secondary-wrap.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) .token.svelte-c0u3f0.svelte-c0u3f0,label.svelte-c0u3f0:not(.container) input.svelte-c0u3f0.svelte-c0u3f0{height:100%}.container.svelte-c0u3f0 .wrap.svelte-c0u3f0.svelte-c0u3f0{box-shadow:var(--input-shadow);border:var(--input-border-width) solid var(--border-color-primary)}.wrap.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{position:relative;border-radius:var(--input-radius);background:var(--input-background-fill)}.wrap.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0:focus-within{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}.wrap-inner.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:flex;position:relative;flex-wrap:wrap;align-items:center;gap:var(--checkbox-label-gap);padding:var(--checkbox-label-padding)}.token.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:flex;align-items:center;transition:var(--button-transition);cursor:pointer;box-shadow:var(--checkbox-label-shadow);border:var(--checkbox-label-border-width) solid var(--checkbox-label-border-color);border-radius:var(--button-small-radius);background:var(--checkbox-label-background-fill);padding:var(--checkbox-label-padding);color:var(--checkbox-label-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}.token.svelte-c0u3f0>.svelte-c0u3f0+.svelte-c0u3f0{margin-left:var(--size-2)}.token-remove.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{fill:var(--body-text-color);display:flex;justify-content:center;align-items:center;cursor:pointer;border:var(--checkbox-border-width) solid var(--border-color-primary);border-radius:var(--radius-full);background:var(--background-fill-primary);padding:var(--size-0-5);width:18px;height:18px}.secondary-wrap.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:flex;flex:1 1 0%;align-items:center;border:none;min-width:min-content}input.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{margin:var(--spacing-sm);outline:none;border:none;background:inherit;width:var(--size-full);color:var(--body-text-color);font-size:var(--input-text-size)}input.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1;cursor:not-allowed}.remove-all.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{margin-left:var(--size-1);width:20px;height:20px}.hide.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{display:none}.subdued.svelte-c0u3f0.svelte-c0u3f0.svelte-c0u3f0{color:var(--body-text-color-subdued)}label.svelte-gigvtq.svelte-gigvtq:not(.container),label.svelte-gigvtq:not(.container)>input.svelte-gigvtq{height:100%;border:none}.container.svelte-gigvtq>input.svelte-gigvtq{border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius)}input[type=number].svelte-gigvtq.svelte-gigvtq{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);background:var(--input-background-fill);padding:var(--input-padding);width:100%;color:var(--body-text-color);font-size:var(--input-text-size);line-height:var(--line-sm)}input.svelte-gigvtq.svelte-gigvtq:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}input.svelte-gigvtq.svelte-gigvtq:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}input.svelte-gigvtq.svelte-gigvtq::placeholder{color:var(--input-placeholder-color)}input.svelte-gigvtq.svelte-gigvtq:out-of-range{border:var(--input-border-width) solid var(--error-border-color)}.wrap.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{display:flex;flex-wrap:wrap;gap:var(--checkbox-label-gap)}label.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{display:flex;align-items:center;transition:var(--button-transition);cursor:pointer;box-shadow:var(--checkbox-label-shadow);border:var(--checkbox-label-border-width) solid var(--checkbox-label-border-color);border-radius:var(--button-small-radius);background:var(--checkbox-label-background-fill);padding:var(--checkbox-label-padding);color:var(--checkbox-label-text-color);font-weight:var(--checkbox-label-text-weight);font-size:var(--checkbox-label-text-size);line-height:var(--line-md)}label.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:hover{background:var(--checkbox-label-background-fill-hover)}label.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:focus{background:var(--checkbox-label-background-fill-focus)}label.selected.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{background:var(--checkbox-label-background-fill-selected);color:var(--checkbox-label-text-color-selected)}label.svelte-1p9xokt>.svelte-1p9xokt+.svelte-1p9xokt{margin-left:var(--size-2)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{--ring-color:transparent;position:relative;box-shadow:var(--checkbox-shadow);border:var(--checkbox-border-width) solid var(--checkbox-border-color);border-radius:var(--radius-full);background-color:var(--checkbox-background-color);line-height:var(--line-sm)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:checked,input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:checked:hover,input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:checked:focus{border-color:var(--checkbox-border-color-selected);background-image:var(--radio-circle);background-color:var(--checkbox-background-color-selected)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:hover{border-color:var(--checkbox-border-color-hover);background-color:var(--checkbox-background-color-hover)}input.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt:focus{border-color:var(--checkbox-border-color-focus);background-color:var(--checkbox-background-color-focus)}input[disabled].svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt,.disabled.svelte-1p9xokt.svelte-1p9xokt.svelte-1p9xokt{cursor:not-allowed}label.svelte-1kcgrqr.svelte-1kcgrqr{display:block;width:100%}input.svelte-1kcgrqr.svelte-1kcgrqr,textarea.svelte-1kcgrqr.svelte-1kcgrqr{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);background:var(--input-background-fill);padding:var(--input-padding);width:100%;color:var(--body-text-color);font-weight:var(--input-text-weight);font-size:var(--input-text-size);line-height:var(--line-sm);border:none}label.svelte-1kcgrqr.svelte-1kcgrqr:not(.container),label.svelte-1kcgrqr:not(.container)>input.svelte-1kcgrqr,label.svelte-1kcgrqr:not(.container)>textarea.svelte-1kcgrqr{height:100%}.container.svelte-1kcgrqr>input.svelte-1kcgrqr,.container.svelte-1kcgrqr>textarea.svelte-1kcgrqr{border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius)}input.svelte-1kcgrqr.svelte-1kcgrqr:disabled,textarea.svelte-1kcgrqr.svelte-1kcgrqr:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}input.svelte-1kcgrqr.svelte-1kcgrqr:focus,textarea.svelte-1kcgrqr.svelte-1kcgrqr:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}input.svelte-1kcgrqr.svelte-1kcgrqr::placeholder,textarea.svelte-1kcgrqr.svelte-1kcgrqr::placeholder{color:var(--input-placeholder-color)}button.svelte-1kcgrqr.svelte-1kcgrqr{display:flex;position:absolute;top:var(--block-label-margin);right:var(--block-label-margin);align-items:center;box-shadow:var(--shadow-drop);border:1px solid var(--color-border-primary);border-top:none;border-right:none;border-radius:var(--block-label-right-radius);background:var(--block-label-background-fill);padding:5px;width:22px;height:22px;overflow:hidden;color:var(--block-label-color);font:var(--font-sans);font-size:var(--button-small-text-size)}.wrap.svelte-1cl284s{display:flex;flex-direction:column;width:100%}.head.svelte-1cl284s{display:flex;justify-content:space-between}input[type=number].svelte-1cl284s{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius);background:var(--input-background-fill);padding:var(--size-2) var(--size-2);height:var(--size-6);color:var(--body-text-color);font-size:var(--input-text-size);line-height:var(--line-sm);text-align:center}input.svelte-1cl284s:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}input[type=number].svelte-1cl284s:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}input.svelte-1cl284s::placeholder{color:var(--input-placeholder-color)}input[type=range].svelte-1cl284s{width:100%;accent-color:var(--slider-color)}input[disabled].svelte-1cl284s{cursor:not-allowed}input.svelte-56zyyb{display:block;position:relative;background:var(--background-fill-primary);line-height:var(--line-sm)} diff --git a/gradio/templates/cdn/assets/ColorPicker.svelte_svelte_type_style_lang-944454b5.js.map b/gradio/templates/cdn/assets/ColorPicker.svelte_svelte_type_style_lang-944454b5.js.map new file mode 100644 index 0000000000000000000000000000000000000000..be866501c4d98793ad8705c89fc02f1a46228e22 --- /dev/null +++ b/gradio/templates/cdn/assets/ColorPicker.svelte_svelte_type_style_lang-944454b5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ColorPicker.svelte_svelte_type_style_lang-944454b5.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Column-2853eb31.css b/gradio/templates/cdn/assets/Column-2853eb31.css new file mode 100644 index 0000000000000000000000000000000000000000..8657e4c7112cc9a8232f875b00f9cf9aaac5e9f6 --- /dev/null +++ b/gradio/templates/cdn/assets/Column-2853eb31.css @@ -0,0 +1 @@ +div.svelte-vt1mxs{display:flex;position:relative;flex-direction:column}div.svelte-vt1mxs>*,div.svelte-vt1mxs>.form>*{width:var(--size-full)}.gap.svelte-vt1mxs{gap:var(--layout-gap)}.hide.svelte-vt1mxs{display:none}.compact.svelte-vt1mxs>*,.compact.svelte-vt1mxs .box{border-radius:0}.compact.svelte-vt1mxs,.panel.svelte-vt1mxs{border:solid var(--panel-border-width) var(--panel-border-color);border-radius:var(--container-radius);background:var(--panel-background-fill);padding:var(--spacing-lg)} diff --git a/gradio/templates/cdn/assets/Column-6dff4b07.js b/gradio/templates/cdn/assets/Column-6dff4b07.js new file mode 100644 index 0000000000000000000000000000000000000000..d005f7a0fc7cbea5b01e8993b273f80d346561ce --- /dev/null +++ b/gradio/templates/cdn/assets/Column-6dff4b07.js @@ -0,0 +1,2 @@ +import{S as w,e as b,s as r,a9 as C,N as j,K as c,as as v,U as f,L as o,p as S,ab as q,ac as z,ad as A,z as K,v as L,A as N}from"./index-fda37c89.js";/* empty css */function U(t){let e,_,m=`calc(min(${t[2]}px, 100%))`,i;const u=t[8].default,n=C(u,t,t[7],null);return{c(){e=j("div"),n&&n.c(),c(e,"id",t[3]),c(e,"class",_=v(t[4].join(" "))+" svelte-vt1mxs"),f(e,"gap",t[1]),f(e,"compact",t[6]==="compact"),f(e,"panel",t[6]==="panel"),f(e,"hide",!t[5]),o(e,"flex-grow",t[0]),o(e,"min-width",m)},m(l,s){S(l,e,s),n&&n.m(e,null),i=!0},p(l,[s]){n&&n.p&&(!i||s&128)&&q(n,u,l,l[7],i?A(u,l[7],s,null):z(l[7]),null),(!i||s&8)&&c(e,"id",l[3]),(!i||s&16&&_!==(_=v(l[4].join(" "))+" svelte-vt1mxs"))&&c(e,"class",_),(!i||s&18)&&f(e,"gap",l[1]),(!i||s&80)&&f(e,"compact",l[6]==="compact"),(!i||s&80)&&f(e,"panel",l[6]==="panel"),(!i||s&48)&&f(e,"hide",!l[5]),s&1&&o(e,"flex-grow",l[0]),s&4&&m!==(m=`calc(min(${l[2]}px, 100%))`)&&o(e,"min-width",m)},i(l){i||(K(n,l),i=!0)},o(l){L(n,l),i=!1},d(l){l&&N(e),n&&n.d(l)}}}function k(t,e,_){let{$$slots:m={},$$scope:i}=e,{scale:u=null}=e,{gap:n=!0}=e,{min_width:l=0}=e,{elem_id:s=""}=e,{elem_classes:g=[]}=e,{visible:d=!0}=e,{variant:h="default"}=e;return t.$$set=a=>{"scale"in a&&_(0,u=a.scale),"gap"in a&&_(1,n=a.gap),"min_width"in a&&_(2,l=a.min_width),"elem_id"in a&&_(3,s=a.elem_id),"elem_classes"in a&&_(4,g=a.elem_classes),"visible"in a&&_(5,d=a.visible),"variant"in a&&_(6,h=a.variant),"$$scope"in a&&_(7,i=a.$$scope)},[u,n,l,s,g,d,h,i,m]}class E extends w{constructor(e){super(),b(this,e,k,U,r,{scale:0,gap:1,min_width:2,elem_id:3,elem_classes:4,visible:5,variant:6})}}export{E as C}; +//# sourceMappingURL=Column-6dff4b07.js.map diff --git a/gradio/templates/cdn/assets/Column-6dff4b07.js.map b/gradio/templates/cdn/assets/Column-6dff4b07.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b830bb705bb21971b96e527fe08afa23a5495838 --- /dev/null +++ b/gradio/templates/cdn/assets/Column-6dff4b07.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Column-6dff4b07.js","sources":["../../../../js/app/src/components/Column/Column.svelte"],"sourcesContent":["\n\n\n\t\n\n\n\n"],"names":["ctx","toggle_class","div","insert","target","anchor","scale","$$props","gap","min_width","elem_id","elem_classes","visible","variant"],"mappings":"qPAkB4BA,EAAS,CAAA,gGAPhCA,EAAO,CAAA,CAAA,kBACJA,EAAY,CAAA,EAAC,KAAK,GAAG,CAAA,EAAA,gBAAA,kBAEbC,EAAAC,EAAA,UAAAF,OAAY,SAAS,EACvBC,EAAAC,EAAA,QAAAF,OAAY,OAAO,cACnBA,EAAO,CAAA,CAAA,kBACHA,EAAK,CAAA,CAAA,6BAPvBG,EAWKC,EAAAF,EAAAG,CAAA,uHAVAL,EAAO,CAAA,CAAA,sBACJA,EAAY,CAAA,EAAC,KAAK,GAAG,CAAA,EAAA,2EAEbC,EAAAC,EAAA,UAAAF,OAAY,SAAS,cACvBC,EAAAC,EAAA,QAAAF,OAAY,OAAO,0BACnBA,EAAO,CAAA,CAAA,uBACHA,EAAK,CAAA,CAAA,0BACKA,EAAS,CAAA,sJAjBzB,CAAA,MAAAM,EAAuB,IAAI,EAAAC,EAC3B,CAAA,IAAAC,EAAe,EAAI,EAAAD,EACnB,CAAA,UAAAE,EAAoB,CAAC,EAAAF,EACrB,CAAA,QAAAG,EAAkB,EAAE,EAAAH,GACpB,aAAAI,EAAY,EAAA,EAAAJ,EACZ,CAAA,QAAAK,EAAmB,EAAI,EAAAL,EACvB,CAAA,QAAAM,EAA2C,SAAS,EAAAN"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Column.svelte_svelte_type_style_lang-bf454eb5.js.map b/gradio/templates/cdn/assets/Column.svelte_svelte_type_style_lang-bf454eb5.js.map new file mode 100644 index 0000000000000000000000000000000000000000..04609ea9d4247b02f775cb942a2950cfa509c355 --- /dev/null +++ b/gradio/templates/cdn/assets/Column.svelte_svelte_type_style_lang-bf454eb5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Column.svelte_svelte_type_style_lang-bf454eb5.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Copy-be466f7f.js b/gradio/templates/cdn/assets/Copy-be466f7f.js new file mode 100644 index 0000000000000000000000000000000000000000..c1a5dd4c62a856de39bc3b17e22649ffe59e2f38 --- /dev/null +++ b/gradio/templates/cdn/assets/Copy-be466f7f.js @@ -0,0 +1,2 @@ +import{S as p,e as c,s as h,J as a,K as e,p as u,M as i,n as o,A as d}from"./index-fda37c89.js";function v(l){let t,s;return{c(){t=a("svg"),s=a("polyline"),e(s,"points","20 6 9 17 4 12"),e(t,"xmlns","http://www.w3.org/2000/svg"),e(t,"width","100%"),e(t,"height","100%"),e(t,"viewBox","0 0 24 24"),e(t,"fill","none"),e(t,"stroke","currentColor"),e(t,"stroke-width","3"),e(t,"stroke-linecap","round"),e(t,"stroke-linejoin","round")},m(n,r){u(n,t,r),i(t,s)},p:o,i:o,o,d(n){n&&d(t)}}}class m extends p{constructor(t){super(),c(this,t,null,v,h,{})}}function w(l){let t,s,n;return{c(){t=a("svg"),s=a("path"),n=a("path"),e(s,"fill","currentColor"),e(s,"d","M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"),e(n,"fill","currentColor"),e(n,"d","M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"),e(t,"xmlns","http://www.w3.org/2000/svg"),e(t,"width","100%"),e(t,"height","100%"),e(t,"viewBox","0 0 32 32")},m(r,g){u(r,t,g),i(t,s),i(t,n)},p:o,i:o,o,d(r){r&&d(t)}}}class x extends p{constructor(t){super(),c(this,t,null,w,h,{})}}export{x as C,m as a}; +//# sourceMappingURL=Copy-be466f7f.js.map diff --git a/gradio/templates/cdn/assets/Copy-be466f7f.js.map b/gradio/templates/cdn/assets/Copy-be466f7f.js.map new file mode 100644 index 0000000000000000000000000000000000000000..97a66196e30d47ab92c1ba2e2f1445ba5bfb5e9b --- /dev/null +++ b/gradio/templates/cdn/assets/Copy-be466f7f.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Copy-be466f7f.js","sources":["../../../../js/icons/src/Check.svelte","../../../../js/icons/src/Copy.svelte"],"sourcesContent":["\n","\n"],"names":["insert","target","svg","anchor","append","polyline","path0","path1"],"mappings":"sbAAAA,EAUAC,EAAAC,EAAAC,CAAA,EADyBC,EAAoCF,EAAAG,CAAA,geCT7DL,EASAC,EAAAC,EAAAC,CAAA,EAJEC,EAGCF,EAAAI,CAAA,EAAAF,EAAgEF,EAAAK,CAAA"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Download-6021cc15.js b/gradio/templates/cdn/assets/Download-6021cc15.js new file mode 100644 index 0000000000000000000000000000000000000000..8fc01ffd6a3cc8d5aca490996ae5b47e6c170725 --- /dev/null +++ b/gradio/templates/cdn/assets/Download-6021cc15.js @@ -0,0 +1,2 @@ +import{S as i,e as p,s as v,J as o,K as e,p as h,M as c,n,A as m}from"./index-fda37c89.js";function d(l){let t,s;return{c(){t=o("svg"),s=o("path"),e(s,"fill","currentColor"),e(s,"d","M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"),e(t,"xmlns","http://www.w3.org/2000/svg"),e(t,"width","100%"),e(t,"height","100%"),e(t,"viewBox","0 0 32 32")},m(a,r){h(a,t,r),c(t,s)},p:n,i:n,o:n,d(a){a&&m(t)}}}class u extends i{constructor(t){super(),p(this,t,null,d,v,{})}}export{u as D}; +//# sourceMappingURL=Download-6021cc15.js.map diff --git a/gradio/templates/cdn/assets/Download-6021cc15.js.map b/gradio/templates/cdn/assets/Download-6021cc15.js.map new file mode 100644 index 0000000000000000000000000000000000000000..00a5d2c47089e3aa52f9cf3606475724fa91e368 --- /dev/null +++ b/gradio/templates/cdn/assets/Download-6021cc15.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Download-6021cc15.js","sources":["../../../../js/icons/src/Download.svelte"],"sourcesContent":["\n"],"names":["insert","target","svg","anchor","append","path"],"mappings":"qaAAAA,EASAC,EAAAC,EAAAC,CAAA,EAJEC,EAGCF,EAAAG,CAAA"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Empty-85ccd7df.js b/gradio/templates/cdn/assets/Empty-85ccd7df.js new file mode 100644 index 0000000000000000000000000000000000000000..864e6f1025a6b21dc0a8cdbca14778b79a1870d2 --- /dev/null +++ b/gradio/templates/cdn/assets/Empty-85ccd7df.js @@ -0,0 +1,2 @@ +import{S as h,e as b,s as z,a9 as v,N as f,K as g,U as u,p as k,M as C,ab as E,ac as B,ad as R,z as S,v as q,A,h as K}from"./index-fda37c89.js";import"./Button-e3640f74.js";function M(n){let e,o,a;const _=n[5].default,s=v(_,n,n[4],null);return{c(){e=f("div"),o=f("div"),s&&s.c(),g(o,"class","icon svelte-lk9eg8"),g(e,"class","empty svelte-lk9eg8"),u(e,"small",n[0]==="small"),u(e,"large",n[0]==="large"),u(e,"unpadded_box",n[1]),u(e,"small_parent",n[3])},m(t,i){k(t,e,i),C(e,o),s&&s.m(o,null),n[6](e),a=!0},p(t,[i]){s&&s.p&&(!a||i&16)&&E(s,_,t,t[4],a?R(_,t[4],i,null):B(t[4]),null),(!a||i&1)&&u(e,"small",t[0]==="small"),(!a||i&1)&&u(e,"large",t[0]==="large"),(!a||i&2)&&u(e,"unpadded_box",t[1]),(!a||i&8)&&u(e,"small_parent",t[3])},i(t){a||(S(s,t),a=!0)},o(t){q(s,t),a=!1},d(t){t&&A(e),s&&s.d(t),n[6](null)}}}function N(n,e,o){let a,{$$slots:_={},$$scope:s}=e,{size:t="small"}=e,{unpadded_box:i=!1}=e,d;function m(l){if(!l)return;const{height:r}=l.getBoundingClientRect(),{height:c}=l.parentElement?.getBoundingClientRect()||{height:r};return r>c+2}function p(l){K[l?"unshift":"push"](()=>{d=l,o(2,d)})}return n.$$set=l=>{"size"in l&&o(0,t=l.size),"unpadded_box"in l&&o(1,i=l.unpadded_box),"$$scope"in l&&o(4,s=l.$$scope)},n.$$.update=()=>{n.$$.dirty&4&&o(3,a=m(d))},[t,i,d,a,s,_,p]}class w extends h{constructor(e){super(),b(this,e,N,M,z,{size:0,unpadded_box:1})}}export{w as E}; +//# sourceMappingURL=Empty-85ccd7df.js.map diff --git a/gradio/templates/cdn/assets/Empty-85ccd7df.js.map b/gradio/templates/cdn/assets/Empty-85ccd7df.js.map new file mode 100644 index 0000000000000000000000000000000000000000..8905b752ad1e92a20410a579963016d170492d07 --- /dev/null +++ b/gradio/templates/cdn/assets/Empty-85ccd7df.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Empty-85ccd7df.js","sources":["../../../../js/atoms/src/Empty.svelte"],"sourcesContent":["\n\n\n\t
\n\t\t\n\t
\n\n\n\n"],"names":["toggle_class","div1","ctx","insert","target","anchor","append","div0","size","$$props","unpadded_box","el","compare_el_to_parent","el_height","parent_height","$$value","$$invalidate"],"mappings":"4VAoBcA,EAAAC,EAAA,QAAAC,OAAS,OAAO,EAChBF,EAAAC,EAAA,QAAAC,OAAS,OAAO,8CAGTA,EAAa,CAAA,CAAA,UANlCC,EAWKC,EAAAH,EAAAI,CAAA,EAHJC,EAEKL,EAAAM,CAAA,qHARQP,EAAAC,EAAA,QAAAC,OAAS,OAAO,aAChBF,EAAAC,EAAA,QAAAC,OAAS,OAAO,oEAGTA,EAAa,CAAA,CAAA,mIAvBtB,CAAA,KAAAM,EAA0B,OAAO,EAAAC,EACjC,CAAA,aAAAC,EAAe,EAAK,EAAAD,EAE3BE,EAGK,SAAAC,EAAqBD,EAAkB,KAC1CA,EAAE,OAEC,KAAA,CAAA,OAAQE,CAAc,EAAAF,EAAG,sBAAqB,GAC9C,OAAQG,CAAa,EAC5BH,EAAG,eAAe,yBAAqB,CAAQ,OAAQE,UAEjDA,EAAYC,EAAgB,2CASzBH,EAAEI,kKAlBVC,EAAA,EAAAF,EAAgBF,EAAqBD,CAAE,CAAA"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/File-1850cfd6.js b/gradio/templates/cdn/assets/File-1850cfd6.js new file mode 100644 index 0000000000000000000000000000000000000000..294f06ca99520f613feb13d54e793af6d07fda86 --- /dev/null +++ b/gradio/templates/cdn/assets/File-1850cfd6.js @@ -0,0 +1,2 @@ +import{S as h,e as c,s as d,J as o,K as t,p as f,M as l,n as r,A as u}from"./index-fda37c89.js";function g(i){let e,s,n;return{c(){e=o("svg"),s=o("path"),n=o("polyline"),t(s,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),t(n,"points","13 2 13 9 20 9"),t(e,"xmlns","http://www.w3.org/2000/svg"),t(e,"width","100%"),t(e,"height","100%"),t(e,"viewBox","0 0 24 24"),t(e,"fill","none"),t(e,"stroke","currentColor"),t(e,"stroke-width","1.5"),t(e,"stroke-linecap","round"),t(e,"stroke-linejoin","round"),t(e,"class","feather feather-file")},m(a,p){f(a,e,p),l(e,s),l(e,n)},p:r,i:r,o:r,d(a){a&&u(e)}}}class v extends h{constructor(e){super(),c(this,e,null,g,d,{})}}export{v as F}; +//# sourceMappingURL=File-1850cfd6.js.map diff --git a/gradio/templates/cdn/assets/File-1850cfd6.js.map b/gradio/templates/cdn/assets/File-1850cfd6.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e7a4003cdc37cca6cea775e5e6b556099c2a85d9 --- /dev/null +++ b/gradio/templates/cdn/assets/File-1850cfd6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"File-1850cfd6.js","sources":["../../../../js/icons/src/File.svelte"],"sourcesContent":["\n\t\n\t\n\n"],"names":["insert","target","svg","anchor","append","path","polyline"],"mappings":"gjBAAAA,EAcKC,EAAAC,EAAAC,CAAA,EAFJC,EAAsEF,EAAAG,CAAA,EACtED,EAAmCF,EAAAI,CAAA"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Form-3812b7f1.css b/gradio/templates/cdn/assets/Form-3812b7f1.css new file mode 100644 index 0000000000000000000000000000000000000000..772d43d65ae1a3157ab24e69b7ecb88a3649b4fe --- /dev/null +++ b/gradio/templates/cdn/assets/Form-3812b7f1.css @@ -0,0 +1 @@ +div.svelte-sfqy0y{display:flex;flex-direction:inherit;flex-wrap:wrap;gap:var(--form-gap-width);box-shadow:var(--block-shadow);border:var(--block-border-width) solid var(--border-color-primary);border-radius:var(--block-radius);background:var(--border-color-primary);overflow-y:hidden}div.svelte-sfqy0y .block{box-shadow:none!important;border-width:0px!important;border-radius:0!important}.hidden.svelte-sfqy0y{display:none} diff --git a/gradio/templates/cdn/assets/Form-a5f9174c.js b/gradio/templates/cdn/assets/Form-a5f9174c.js new file mode 100644 index 0000000000000000000000000000000000000000..f90122410ced7de6dea2b8aacf297821c968e36d --- /dev/null +++ b/gradio/templates/cdn/assets/Form-a5f9174c.js @@ -0,0 +1,2 @@ +import{S as m,e as c,s as r,a9 as d,N as h,K as g,U as u,L as _,p as v,ab as w,ac as b,ad as F,z as q,v as y,A as S}from"./index-fda37c89.js";function z(n){let s,l;const f=n[4].default,t=d(f,n,n[3],null);return{c(){s=h("div"),t&&t.c(),g(s,"class","form svelte-sfqy0y"),u(s,"hidden",!n[0]),_(s,"flex-grow",n[1]),_(s,"min-width",`calc(min(${n[2]}px, 100%))`)},m(e,i){v(e,s,i),t&&t.m(s,null),l=!0},p(e,[i]){t&&t.p&&(!l||i&8)&&w(t,f,e,e[3],l?F(f,e[3],i,null):b(e[3]),null),(!l||i&1)&&u(s,"hidden",!e[0]),i&2&&_(s,"flex-grow",e[1]),i&4&&_(s,"min-width",`calc(min(${e[2]}px, 100%))`)},i(e){l||(q(t,e),l=!0)},o(e){y(t,e),l=!1},d(e){e&&S(s),t&&t.d(e)}}}function A(n,s,l){let{$$slots:f={},$$scope:t}=s,{visible:e=!0}=s,{scale:i=null}=s,{min_width:o=0}=s;return n.$$set=a=>{"visible"in a&&l(0,e=a.visible),"scale"in a&&l(1,i=a.scale),"min_width"in a&&l(2,o=a.min_width),"$$scope"in a&&l(3,t=a.$$scope)},[e,i,o,t,f]}class K extends m{constructor(s){super(),c(this,s,A,z,r,{visible:0,scale:1,min_width:2})}}export{K as F}; +//# sourceMappingURL=Form-a5f9174c.js.map diff --git a/gradio/templates/cdn/assets/Form-a5f9174c.js.map b/gradio/templates/cdn/assets/Form-a5f9174c.js.map new file mode 100644 index 0000000000000000000000000000000000000000..bb470a6c3f3e93b16ae19d3a5a353011d41375cc --- /dev/null +++ b/gradio/templates/cdn/assets/Form-a5f9174c.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Form-a5f9174c.js","sources":["../../../../js/app/src/components/Form/Form.svelte"],"sourcesContent":["\n\n\n\t\n\n\n\n"],"names":["ctx","insert","target","div","anchor","visible","$$props","scale","min_width"],"mappings":"2RAQgBA,EAAO,CAAA,CAAA,kBACLA,EAAK,CAAA,CAAA,8BACOA,EAAS,CAAA,aAAA,UAJvCC,EAOKC,EAAAC,EAAAC,CAAA,0HALWJ,EAAO,CAAA,CAAA,uBACLA,EAAK,CAAA,CAAA,mCACOA,EAAS,CAAA,aAAA,qHAT3B,CAAA,QAAAK,EAAU,EAAI,EAAAC,EACd,CAAA,MAAAC,EAAuB,IAAI,EAAAD,EAC3B,CAAA,UAAAE,EAAoB,CAAC,EAAAF"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/IconButton-9e1f47e2.js b/gradio/templates/cdn/assets/IconButton-9e1f47e2.js new file mode 100644 index 0000000000000000000000000000000000000000..ce40d1f27fb6bae05457ed0339c594a91dde7b5a --- /dev/null +++ b/gradio/templates/cdn/assets/IconButton-9e1f47e2.js @@ -0,0 +1,2 @@ +import{S as I,e as k,s as w,N as m,O as p,k as q,K as f,U as b,p as g,M as _,o as v,Q as S,z,v as A,A as h,x as B,P as C,R as F,F as K}from"./index-fda37c89.js";import"./Button-e3640f74.js";function d(l){let e,i;return{c(){e=m("span"),i=C(l[1]),f(e,"class","svelte-1030q2h")},m(a,s){g(a,e,s),_(e,i)},p(a,s){s&2&&F(i,a[1])},d(a){a&&h(e)}}}function M(l){let e,i,a,s,o,c,r,n=l[2]&&d(l);return s=new l[0]({}),{c(){e=m("button"),n&&n.c(),i=p(),a=m("div"),q(s.$$.fragment),f(a,"class","svelte-1030q2h"),f(e,"aria-label",l[1]),f(e,"title",l[1]),f(e,"class","svelte-1030q2h"),b(e,"pending",l[3])},m(t,u){g(t,e,u),n&&n.m(e,null),_(e,i),_(e,a),v(s,a,null),o=!0,c||(r=S(e,"click",l[4]),c=!0)},p(t,[u]){t[2]?n?n.p(t,u):(n=d(t),n.c(),n.m(e,i)):n&&(n.d(1),n=null),(!o||u&2)&&f(e,"aria-label",t[1]),(!o||u&2)&&f(e,"title",t[1]),(!o||u&8)&&b(e,"pending",t[3])},i(t){o||(z(s.$$.fragment,t),o=!0)},o(t){A(s.$$.fragment,t),o=!1},d(t){t&&h(e),n&&n.d(),B(s),c=!1,r()}}}function N(l,e,i){let{Icon:a}=e,{label:s=""}=e,{show_label:o=!1}=e,{pending:c=!1}=e;function r(n){K.call(this,l,n)}return l.$$set=n=>{"Icon"in n&&i(0,a=n.Icon),"label"in n&&i(1,s=n.label),"show_label"in n&&i(2,o=n.show_label),"pending"in n&&i(3,c=n.pending)},[a,s,o,c,r]}class Q extends I{constructor(e){super(),k(this,e,N,M,w,{Icon:0,label:1,show_label:2,pending:3})}}export{Q as I}; +//# sourceMappingURL=IconButton-9e1f47e2.js.map diff --git a/gradio/templates/cdn/assets/IconButton-9e1f47e2.js.map b/gradio/templates/cdn/assets/IconButton-9e1f47e2.js.map new file mode 100644 index 0000000000000000000000000000000000000000..da2c43f8222963928b0f862567e76846a01e7d40 --- /dev/null +++ b/gradio/templates/cdn/assets/IconButton-9e1f47e2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IconButton-9e1f47e2.js","sources":["../../../../js/atoms/src/IconButton.svelte"],"sourcesContent":["\n\n\n\n\n"],"names":["ctx","insert","target","span","anchor","create_if_block","button","append","div","Icon","$$props","label","show_label","pending"],"mappings":"+OAQwBA,EAAK,CAAA,CAAA,wCAAZC,EAAoBC,EAAAC,EAAAC,CAAA,0BAAbJ,EAAK,CAAA,CAAA,oDAAvBA,EAAU,CAAA,GAAAK,EAAAL,CAAA,qIADaA,EAAK,CAAA,CAAA,cAASA,EAAK,CAAA,CAAA,4DAAhDC,EAGQC,EAAAI,EAAAF,CAAA,wBADPG,EAAkBD,EAAAE,CAAA,2DADbR,EAAU,CAAA,oFADaA,EAAK,CAAA,CAAA,yBAASA,EAAK,CAAA,CAAA,+JANpC,KAAAS,CAAS,EAAAC,EACT,CAAA,MAAAC,EAAQ,EAAE,EAAAD,EACV,CAAA,WAAAE,EAAsB,EAAK,EAAAF,EAC3B,CAAA,QAAAG,EAAmB,EAAK,EAAAH"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Image-003ee87c.css b/gradio/templates/cdn/assets/Image-003ee87c.css new file mode 100644 index 0000000000000000000000000000000000000000..60f45635043d082881d8d8a529c1142ee028a68b --- /dev/null +++ b/gradio/templates/cdn/assets/Image-003ee87c.css @@ -0,0 +1 @@ +img.svelte-gqt00k{border-radius:var(--radius-lg);max-width:none}img.selected.svelte-gqt00k{border-color:var(--border-color-accent)}.table.svelte-gqt00k{margin:0 auto;border:2px solid var(--border-color-primary);border-radius:var(--radius-lg);width:var(--size-20);height:var(--size-20);object-fit:cover}.gallery.svelte-gqt00k{border:2px solid var(--border-color-primary);max-height:var(--size-20);object-fit:cover} diff --git a/gradio/templates/cdn/assets/Image-20833b5a.js b/gradio/templates/cdn/assets/Image-20833b5a.js new file mode 100644 index 0000000000000000000000000000000000000000..cd02e786331d9faff142a14dfddc54bb17a349f9 --- /dev/null +++ b/gradio/templates/cdn/assets/Image-20833b5a.js @@ -0,0 +1,2 @@ +import{S as g,e as u,s as d,N as y,T as f,K as c,U as i,p as o,n as r,A as v}from"./index-fda37c89.js";function b(t){let e,s;return{c(){e=y("img"),f(e.src,s=t[1]+t[0])||c(e,"src",s),c(e,"class","svelte-gqt00k"),i(e,"table",t[2]==="table"),i(e,"gallery",t[2]==="gallery"),i(e,"selected",t[3])},m(l,a){o(l,e,a)},p(l,[a]){a&3&&!f(e.src,s=l[1]+l[0])&&c(e,"src",s),a&4&&i(e,"table",l[2]==="table"),a&4&&i(e,"gallery",l[2]==="gallery"),a&8&&i(e,"selected",l[3])},i:r,o:r,d(l){l&&v(e)}}}function q(t,e,s){let{value:l}=e,{samples_dir:a}=e,{type:m}=e,{selected:_=!1}=e;return t.$$set=n=>{"value"in n&&s(0,l=n.value),"samples_dir"in n&&s(1,a=n.samples_dir),"type"in n&&s(2,m=n.type),"selected"in n&&s(3,_=n.selected)},[l,a,m,_]}class I extends g{constructor(e){super(),u(this,e,q,b,d,{value:0,samples_dir:1,type:2,selected:3})}}const E=I;export{E}; +//# sourceMappingURL=Image-20833b5a.js.map diff --git a/gradio/templates/cdn/assets/Image-20833b5a.js.map b/gradio/templates/cdn/assets/Image-20833b5a.js.map new file mode 100644 index 0000000000000000000000000000000000000000..072338cf01775df25fdfc0252f77012683e0e362 --- /dev/null +++ b/gradio/templates/cdn/assets/Image-20833b5a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Image-20833b5a.js","sources":["../../../../js/app/src/components/Dataset/ExampleComponents/Image.svelte"],"sourcesContent":["\n\n\n\n\n\n"],"names":["src_url_equal","img","img_src_value","ctx","attr","toggle_class","insert","target","anchor","dirty","value","$$props","samples_dir","type","selected"],"mappings":"mJASMA,EAAAC,EAAA,IAAAC,EAAAC,KAAcA,EAAK,CAAA,CAAA,GAAAC,EAAAH,EAAA,MAAAC,CAAA,+BACXG,EAAAJ,EAAA,QAAAE,OAAS,OAAO,EACdE,EAAAJ,EAAA,UAAAE,OAAS,SAAS,+BAHlCG,EAKCC,EAAAN,EAAAO,CAAA,YAJKC,EAAA,GAAA,CAAAT,EAAAC,EAAA,IAAAC,EAAAC,KAAcA,EAAK,CAAA,CAAA,qBACXE,EAAAJ,EAAA,QAAAE,OAAS,OAAO,OACdE,EAAAJ,EAAA,UAAAE,OAAS,SAAS,0EAVtB,MAAAO,CAAa,EAAAC,GACb,YAAAC,CAAmB,EAAAD,GACnB,KAAAE,CAAyB,EAAAF,EACzB,CAAA,SAAAG,EAAoB,EAAK,EAAAH"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Image-23929e47.js b/gradio/templates/cdn/assets/Image-23929e47.js new file mode 100644 index 0000000000000000000000000000000000000000..bfb1d373edaaf5c9b87b6a8a0b60dedf71d81ecc --- /dev/null +++ b/gradio/templates/cdn/assets/Image-23929e47.js @@ -0,0 +1,2 @@ +import{S as h,e as g,s as d,J as n,K as e,p as m,M as i,n as l,A as u}from"./index-fda37c89.js";function f(c){let t,r,s,o;return{c(){t=n("svg"),r=n("rect"),s=n("circle"),o=n("polyline"),e(r,"x","3"),e(r,"y","3"),e(r,"width","18"),e(r,"height","18"),e(r,"rx","2"),e(r,"ry","2"),e(s,"cx","8.5"),e(s,"cy","8.5"),e(s,"r","1.5"),e(o,"points","21 15 16 10 5 21"),e(t,"xmlns","http://www.w3.org/2000/svg"),e(t,"width","100%"),e(t,"height","100%"),e(t,"viewBox","0 0 24 24"),e(t,"fill","none"),e(t,"stroke","currentColor"),e(t,"stroke-width","1.5"),e(t,"stroke-linecap","round"),e(t,"stroke-linejoin","round"),e(t,"class","feather feather-image")},m(a,p){m(a,t,p),i(t,r),i(t,s),i(t,o)},p:l,i:l,o:l,d(a){a&&u(t)}}}class x extends h{constructor(t){super(),g(this,t,null,f,d,{})}}export{x as I}; +//# sourceMappingURL=Image-23929e47.js.map diff --git a/gradio/templates/cdn/assets/Image-23929e47.js.map b/gradio/templates/cdn/assets/Image-23929e47.js.map new file mode 100644 index 0000000000000000000000000000000000000000..6524fbb5c3374c33a10bdb9834b5e30507183f00 --- /dev/null +++ b/gradio/templates/cdn/assets/Image-23929e47.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Image-23929e47.js","sources":["../../../../js/icons/src/Image.svelte"],"sourcesContent":["\n\t\n\t\n\t\n\n"],"names":["insert","target","svg","anchor","append","rect","circle","polyline"],"mappings":"uoBAAAA,EAeKC,EAAAC,EAAAC,CAAA,EAHJC,EAAwDF,EAAAG,CAAA,EACxDD,EAAmCF,EAAAI,CAAA,EACnCF,EAAqCF,EAAAK,CAAA"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Info-ff627956.js b/gradio/templates/cdn/assets/Info-ff627956.js new file mode 100644 index 0000000000000000000000000000000000000000..389faf6a3935808e349b0cceaf9501ee036fd956 --- /dev/null +++ b/gradio/templates/cdn/assets/Info-ff627956.js @@ -0,0 +1,2 @@ +import{S as i,e as r,s as u,a9 as f,N as _,K as c,p,ab as d,ac as m,ad as $,z as v,v as g,A as b}from"./index-fda37c89.js";import"./Button-e3640f74.js";function h(n){let s,a;const l=n[1].default,e=f(l,n,n[0],null);return{c(){s=_("div"),e&&e.c(),c(s,"class","svelte-e8n7p6")},m(t,o){p(t,s,o),e&&e.m(s,null),a=!0},p(t,[o]){e&&e.p&&(!a||o&1)&&d(e,l,t,t[0],a?$(l,t[0],o,null):m(t[0]),null)},i(t){a||(v(e,t),a=!0)},o(t){g(e,t),a=!1},d(t){t&&b(s),e&&e.d(t)}}}function I(n,s,a){let{$$slots:l={},$$scope:e}=s;return n.$$set=t=>{"$$scope"in t&&a(0,e=t.$$scope)},[e,l]}class z extends i{constructor(s){super(),r(this,s,I,h,u,{})}}export{z as I}; +//# sourceMappingURL=Info-ff627956.js.map diff --git a/gradio/templates/cdn/assets/Info-ff627956.js.map b/gradio/templates/cdn/assets/Info-ff627956.js.map new file mode 100644 index 0000000000000000000000000000000000000000..37b65f3ccefaa36383194d21368bbd9dab57252e --- /dev/null +++ b/gradio/templates/cdn/assets/Info-ff627956.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Info-ff627956.js","sources":["../../../../js/atoms/src/Info.svelte"],"sourcesContent":["
\n\t\n
\n\n\n"],"names":["insert","target","div","anchor"],"mappings":"0RAAAA,EAEKC,EAAAC,EAAAC,CAAA"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/KaTeX_AMS-Regular-0cdd387c.woff2 b/gradio/templates/cdn/assets/KaTeX_AMS-Regular-0cdd387c.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..0acaaff03d4bb7606de02a827aeee338e5a86910 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_AMS-Regular-0cdd387c.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_AMS-Regular-30da91e8.woff b/gradio/templates/cdn/assets/KaTeX_AMS-Regular-30da91e8.woff new file mode 100644 index 0000000000000000000000000000000000000000..b804d7b33a3fa5b2587d2d1d55006aed678e3eb2 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_AMS-Regular-30da91e8.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_AMS-Regular-68534840.ttf b/gradio/templates/cdn/assets/KaTeX_AMS-Regular-68534840.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c6f9a5e7c03f9e64e9c7b4773a8e37ade8eaf406 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_AMS-Regular-68534840.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf new file mode 100644 index 0000000000000000000000000000000000000000..9ff4a5e04421e5107f74c28e27354e0b2a4e7ef8 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff new file mode 100644 index 0000000000000000000000000000000000000000..9759710d1d3e16eb10012d56babb73f2479ba9f0 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2 b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..f390922eceffe1f6dfb81a3dc086a92d98171b02 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-3398dd02.woff b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-3398dd02.woff new file mode 100644 index 0000000000000000000000000000000000000000..9bdd534fd2beb9b878f0219da9d63ffba56677e2 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-3398dd02.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2 b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..75344a1f98e37e2c631e178065854c3a81fb842f Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f522294ff0f3f8c52dfdaef7ebfaa06ebfcfaabf Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-74444efd.woff2 b/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-74444efd.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..395f28beac23c7b0f7f3a1e714bd8dac253dd3bc Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-74444efd.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-9163df9c.ttf b/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-9163df9c.ttf new file mode 100644 index 0000000000000000000000000000000000000000..4e98259c3b54076d684bf3459baeaeae8dbce97a Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-9163df9c.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff b/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff new file mode 100644 index 0000000000000000000000000000000000000000..e7730f66275c87c28f26530d89264cffecf90be0 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf b/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf new file mode 100644 index 0000000000000000000000000000000000000000..b8461b275fae76efd0d21fd0f1aaa696a5b10f9a Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-51814d27.woff2 b/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-51814d27.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..735f6948d63c8cc7f8233735bb9c8d843c83d804 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-51814d27.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-5e28753b.woff b/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-5e28753b.woff new file mode 100644 index 0000000000000000000000000000000000000000..acab069f90b6fe6301a004e6f8beaf6a0db48bce Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Fraktur-Regular-5e28753b.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Bold-0f60d1b8.woff2 b/gradio/templates/cdn/assets/KaTeX_Main-Bold-0f60d1b8.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..ab2ad21da6fbe6c171bb869240954d0ead8f68fd Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Bold-0f60d1b8.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Bold-138ac28d.ttf b/gradio/templates/cdn/assets/KaTeX_Main-Bold-138ac28d.ttf new file mode 100644 index 0000000000000000000000000000000000000000..4060e627dc341c1854260cbc3f7386e222a4d297 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Bold-138ac28d.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Bold-c76c5d69.woff b/gradio/templates/cdn/assets/KaTeX_Main-Bold-c76c5d69.woff new file mode 100644 index 0000000000000000000000000000000000000000..f38136ac1cc2dcdc9d9b10b8521487468b1f768c Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Bold-c76c5d69.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf b/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf new file mode 100644 index 0000000000000000000000000000000000000000..dc007977ee709a236d9e82719cf7d4e5577a81b9 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2 b/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..5931794de4a2a485fa70099bf2659b145976d043 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff b/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff new file mode 100644 index 0000000000000000000000000000000000000000..67807b0bd4f867853271f5917fb3adf377f93f53 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Italic-0d85ae7c.ttf b/gradio/templates/cdn/assets/KaTeX_Main-Italic-0d85ae7c.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0e9b0f354ad460202bba554359f5adcc8da666b7 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Italic-0d85ae7c.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Italic-97479ca6.woff2 b/gradio/templates/cdn/assets/KaTeX_Main-Italic-97479ca6.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b50920e138807f385d0b0359f4f0f09891f18406 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Italic-97479ca6.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Italic-f1d6ef86.woff b/gradio/templates/cdn/assets/KaTeX_Main-Italic-f1d6ef86.woff new file mode 100644 index 0000000000000000000000000000000000000000..6f43b594b6c1d863a0e3f93b001f8dd503316464 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Italic-f1d6ef86.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Regular-c2342cd8.woff2 b/gradio/templates/cdn/assets/KaTeX_Main-Regular-c2342cd8.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..eb24a7ba282b03d830fa6c63ee897d92a5188736 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Regular-c2342cd8.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Regular-c6368d87.woff b/gradio/templates/cdn/assets/KaTeX_Main-Regular-c6368d87.woff new file mode 100644 index 0000000000000000000000000000000000000000..21f5812968c42392a3eaea9b0c6320870b6b8b38 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Regular-c6368d87.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Main-Regular-d0332f52.ttf b/gradio/templates/cdn/assets/KaTeX_Main-Regular-d0332f52.ttf new file mode 100644 index 0000000000000000000000000000000000000000..dd45e1ed2e18b32c516d9b481ebed3cb8bffa711 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Main-Regular-d0332f52.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-850c0af5.woff b/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-850c0af5.woff new file mode 100644 index 0000000000000000000000000000000000000000..0ae390d74c9f665cf8b1e5ea5483395da7513444 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-850c0af5.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-dc47344d.woff2 b/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-dc47344d.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..29657023adc09956249f6295746c8ce4469b50d3 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-dc47344d.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf b/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf new file mode 100644 index 0000000000000000000000000000000000000000..728ce7a1e2cb689df32c3a6c26e1bd072dcf2acb Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Math-Italic-08ce98e5.ttf b/gradio/templates/cdn/assets/KaTeX_Math-Italic-08ce98e5.ttf new file mode 100644 index 0000000000000000000000000000000000000000..70d559b4e937ca1b805eb39f544cbebe3c58ca6f Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Math-Italic-08ce98e5.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Math-Italic-7af58c5e.woff2 b/gradio/templates/cdn/assets/KaTeX_Math-Italic-7af58c5e.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..215c143fd7805a5c2b222bd7892a1a2b09610020 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Math-Italic-7af58c5e.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Math-Italic-8a8d2445.woff b/gradio/templates/cdn/assets/KaTeX_Math-Italic-8a8d2445.woff new file mode 100644 index 0000000000000000000000000000000000000000..eb5159d4c1ca83fb92b3190223698427df0e010c Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Math-Italic-8a8d2445.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf b/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf new file mode 100644 index 0000000000000000000000000000000000000000..2f65a8a3a6d3628d11ea9c26c9077cef672fe427 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-e99ae511.woff2 b/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-e99ae511.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..cfaa3bda59246b49e94298478d6de3b3208066c8 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-e99ae511.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-ece03cfd.woff b/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-ece03cfd.woff new file mode 100644 index 0000000000000000000000000000000000000000..8d47c02d9408d34b2a9d566c0fe0d42bf82fb735 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Bold-ece03cfd.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2 b/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..349c06dc609f896392fd5bc8b364d3bc3efc9330 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-3931dd81.ttf b/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-3931dd81.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d5850df98ec19de2eee9ff922ef59586efe471d0 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-3931dd81.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-91ee6750.woff b/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-91ee6750.woff new file mode 100644 index 0000000000000000000000000000000000000000..7e02df963621a5e26d53d510f0b4992eebde1c60 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Italic-91ee6750.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff b/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff new file mode 100644 index 0000000000000000000000000000000000000000..31b84829b42edae20d0148eeec0d922dad2108c4 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2 b/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..a90eea85f6f7bded69ff5d40114447a6d8b48cfe Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-f36ea897.ttf b/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-f36ea897.ttf new file mode 100644 index 0000000000000000000000000000000000000000..537279f6bd2184ed32f1a5168850609147d58ee6 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_SansSerif-Regular-f36ea897.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Script-Regular-036d4e95.woff2 b/gradio/templates/cdn/assets/KaTeX_Script-Regular-036d4e95.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b3048fc115681ee6c1bc86b0aa158cfbbf59daa3 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Script-Regular-036d4e95.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Script-Regular-1c67f068.ttf b/gradio/templates/cdn/assets/KaTeX_Script-Regular-1c67f068.ttf new file mode 100644 index 0000000000000000000000000000000000000000..fd679bf374af72f2a183b97b40c9c7e9e51fbe5e Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Script-Regular-1c67f068.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Script-Regular-d96cdf2b.woff b/gradio/templates/cdn/assets/KaTeX_Script-Regular-d96cdf2b.woff new file mode 100644 index 0000000000000000000000000000000000000000..0e7da821eee0dd05a0a6f0b16c2c1345dc573a84 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Script-Regular-d96cdf2b.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size1-Regular-6b47c401.woff2 b/gradio/templates/cdn/assets/KaTeX_Size1-Regular-6b47c401.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..c5a8462fbfe2c39a7c1857b9e296e62500a8a8a5 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size1-Regular-6b47c401.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size1-Regular-95b6d2f1.ttf b/gradio/templates/cdn/assets/KaTeX_Size1-Regular-95b6d2f1.ttf new file mode 100644 index 0000000000000000000000000000000000000000..871fd7d19d8658f64d8696ed9cdfc82c821ed76d Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size1-Regular-95b6d2f1.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size1-Regular-c943cc98.woff b/gradio/templates/cdn/assets/KaTeX_Size1-Regular-c943cc98.woff new file mode 100644 index 0000000000000000000000000000000000000000..7f292d91184f257054ef77cc1cd3443db757c9cc Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size1-Regular-c943cc98.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size2-Regular-2014c523.woff b/gradio/templates/cdn/assets/KaTeX_Size2-Regular-2014c523.woff new file mode 100644 index 0000000000000000000000000000000000000000..d241d9be2d317f7b39b401d96c8b18836acea0fa Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size2-Regular-2014c523.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size2-Regular-a6b2099f.ttf b/gradio/templates/cdn/assets/KaTeX_Size2-Regular-a6b2099f.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7a212caf91c0007e826fee2d622bf48acbd30dde Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size2-Regular-a6b2099f.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size2-Regular-d04c5421.woff2 b/gradio/templates/cdn/assets/KaTeX_Size2-Regular-d04c5421.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..e1bccfe2403a4ed770c1697ae7c15b9e1cd9bc4e Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size2-Regular-d04c5421.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size3-Regular-500e04d5.ttf b/gradio/templates/cdn/assets/KaTeX_Size3-Regular-500e04d5.ttf new file mode 100644 index 0000000000000000000000000000000000000000..00bff3495fa9d2f98c1c9ce436add6a1bcfe87fb Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size3-Regular-500e04d5.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size3-Regular-6ab6b62e.woff b/gradio/templates/cdn/assets/KaTeX_Size3-Regular-6ab6b62e.woff new file mode 100644 index 0000000000000000000000000000000000000000..e6e9b658dcf1cd031ac82b6b8f312444c55d4fc0 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size3-Regular-6ab6b62e.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size4-Regular-99f9c675.woff b/gradio/templates/cdn/assets/KaTeX_Size4-Regular-99f9c675.woff new file mode 100644 index 0000000000000000000000000000000000000000..e1ec5457664f438ce5a1cc6dd8409bf60ca7804b Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size4-Regular-99f9c675.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size4-Regular-a4af7d41.woff2 b/gradio/templates/cdn/assets/KaTeX_Size4-Regular-a4af7d41.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..680c13085076a2f6c5a7e695935ec3f21cddb65f Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size4-Regular-a4af7d41.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Size4-Regular-c647367d.ttf b/gradio/templates/cdn/assets/KaTeX_Size4-Regular-c647367d.ttf new file mode 100644 index 0000000000000000000000000000000000000000..74f08921f00f71f413ca42c9d1c90202e672ef38 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Size4-Regular-c647367d.ttf differ diff --git a/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-71d517d6.woff2 b/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-71d517d6.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..771f1af705f5cef5f578b3a1e7d8eff66f9b76b0 Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-71d517d6.woff2 differ diff --git a/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-e14fed02.woff b/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-e14fed02.woff new file mode 100644 index 0000000000000000000000000000000000000000..2432419f28936aff53ddfa2a732d027e6a6648fd Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-e14fed02.woff differ diff --git a/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf b/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c83252c5714c71a3e0ec62195884167339a0129b Binary files /dev/null and b/gradio/templates/cdn/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf differ diff --git a/gradio/templates/cdn/assets/Login-5439d08a.js b/gradio/templates/cdn/assets/Login-5439d08a.js new file mode 100644 index 0000000000000000000000000000000000000000..108b1537f91c6f744dbb6132a6b69a18f548c2d9 --- /dev/null +++ b/gradio/templates/cdn/assets/Login-5439d08a.js @@ -0,0 +1,3 @@ +import{S as j,e as q,s as A,N as h,k as $,K as C,U as L,p,o as v,z as x,v as w,A as c,x as k,O as g,P,M as B,R as H,h as N,j as S,t as I}from"./index-fda37c89.js";import{F as K}from"./Form-a5f9174c.js";import{T}from"./Textbox-f5959df8.js";import{a as M}from"./Button-e3640f74.js";import{C as R}from"./Column-6dff4b07.js";/* empty css */import"./BlockTitle-44d14959.js";import"./Info-ff627956.js";import"./Copy-be466f7f.js";/* empty css */function z(i){let e,s;return{c(){e=h("p"),s=P(i[0]),C(e,"class","auth svelte-1ogxbi0")},m(l,o){p(l,e,o),B(e,s)},p(l,o){o&1&&H(s,l[0])},d(l){l&&c(e)}}}function D(i){let e;return{c(){e=h("p"),e.textContent=`If you are visiting a HuggingFace Space in Incognito mode, you must + enable third party cookies.`,C(e,"class","auth svelte-1ogxbi0")},m(s,l){p(s,e,l)},d(s){s&&c(e)}}}function O(i){let e;return{c(){e=h("p"),e.textContent="Incorrect Credentials",C(e,"class","creds svelte-1ogxbi0")},m(s,l){p(s,e,l)},d(s){s&&c(e)}}}function U(i){let e,s,l,o,r,m;function d(n){i[8](n)}let _={label:"username",lines:1,show_label:!0,max_lines:1,mode:"dynamic"};i[3]!==void 0&&(_.value=i[3]),e=new T({props:_}),N.push(()=>S(e,"value",d)),e.$on("submit",i[6]);function b(n){i[9](n)}let u={label:"password",lines:1,show_label:!0,max_lines:1,mode:"dynamic",type:"password"};return i[4]!==void 0&&(u.value=i[4]),o=new T({props:u}),N.push(()=>S(o,"value",b)),o.$on("submit",i[6]),{c(){$(e.$$.fragment),l=g(),$(o.$$.fragment)},m(n,f){v(e,n,f),p(n,l,f),v(o,n,f),m=!0},p(n,f){const t={};!s&&f&8&&(s=!0,t.value=n[3],I(()=>s=!1)),e.$set(t);const a={};!r&&f&16&&(r=!0,a.value=n[4],I(()=>r=!1)),o.$set(a)},i(n){m||(x(e.$$.fragment,n),x(o.$$.fragment,n),m=!0)},o(n){w(e.$$.fragment,n),w(o.$$.fragment,n),m=!1},d(n){n&&c(l),k(e,n),k(o,n)}}}function E(i){let e;return{c(){e=P("Login")},m(s,l){p(s,e,l)},d(s){s&&c(e)}}}function G(i){let e,s,l,o,r,m,d,_,b,u=i[0]&&z(i),n=i[2]&&D(),f=i[5]&&O();return m=new K({props:{$$slots:{default:[U]},$$scope:{ctx:i}}}),_=new M({props:{size:"lg",variant:"primary",$$slots:{default:[E]},$$scope:{ctx:i}}}),_.$on("click",i[6]),{c(){e=h("h2"),e.textContent="Login",s=g(),u&&u.c(),l=g(),n&&n.c(),o=g(),f&&f.c(),r=g(),$(m.$$.fragment),d=g(),$(_.$$.fragment),C(e,"class","svelte-1ogxbi0")},m(t,a){p(t,e,a),p(t,s,a),u&&u.m(t,a),p(t,l,a),n&&n.m(t,a),p(t,o,a),f&&f.m(t,a),p(t,r,a),v(m,t,a),p(t,d,a),v(_,t,a),b=!0},p(t,a){t[0]?u?u.p(t,a):(u=z(t),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),t[2]?n||(n=D(),n.c(),n.m(o.parentNode,o)):n&&(n.d(1),n=null),t[5]?f||(f=O(),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null);const y={};a&1048&&(y.$$scope={dirty:a,ctx:t}),m.$set(y);const F={};a&1024&&(F.$$scope={dirty:a,ctx:t}),_.$set(F)},i(t){b||(x(m.$$.fragment,t),x(_.$$.fragment,t),b=!0)},o(t){w(m.$$.fragment,t),w(_.$$.fragment,t),b=!1},d(t){t&&(c(e),c(s),c(l),c(o),c(r),c(d)),u&&u.d(t),n&&n.d(t),f&&f.d(t),k(m,t),k(_,t)}}}function J(i){let e,s,l;return s=new R({props:{variant:"panel",min_width:480,$$slots:{default:[G]},$$scope:{ctx:i}}}),{c(){e=h("div"),$(s.$$.fragment),C(e,"class","wrap svelte-1ogxbi0"),L(e,"min-h-screen",i[1])},m(o,r){p(o,e,r),v(s,e,null),l=!0},p(o,[r]){const m={};r&1085&&(m.$$scope={dirty:r,ctx:o}),s.$set(m),(!l||r&2)&&L(e,"min-h-screen",o[1])},i(o){l||(x(s.$$.fragment,o),l=!0)},o(o){w(s.$$.fragment,o),l=!1},d(o){o&&c(e),k(s)}}}function Q(i,e,s){let{root:l}=e,{auth_message:o}=e,{app_mode:r}=e,{space_id:m}=e,d="",_="",b=!1;const u=async()=>{const t=new FormData;t.append("username",d),t.append("password",_);let a=await fetch(l+"/login",{method:"POST",body:t});a.status===400?(s(5,b=!0),s(3,d=""),s(4,_="")):a.status==200&&location.reload()};function n(t){d=t,s(3,d)}function f(t){_=t,s(4,_)}return i.$$set=t=>{"root"in t&&s(7,l=t.root),"auth_message"in t&&s(0,o=t.auth_message),"app_mode"in t&&s(1,r=t.app_mode),"space_id"in t&&s(2,m=t.space_id)},[o,r,m,d,_,b,u,l,n,f]}class le extends j{constructor(e){super(),q(this,e,Q,J,A,{root:7,auth_message:0,app_mode:1,space_id:2})}}export{le as default}; +//# sourceMappingURL=Login-5439d08a.js.map diff --git a/gradio/templates/cdn/assets/Login-5439d08a.js.map b/gradio/templates/cdn/assets/Login-5439d08a.js.map new file mode 100644 index 0000000000000000000000000000000000000000..669a7ea84a67886fb2c6d6e717bad47cfb9e4a7c --- /dev/null +++ b/gradio/templates/cdn/assets/Login-5439d08a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Login-5439d08a.js","sources":["../../../../js/app/src/Login.svelte"],"sourcesContent":["\n\n
\n\t\n\t\t

Login

\n\t\t{#if auth_message}\n\t\t\t

{auth_message}

\n\t\t{/if}\n\t\t{#if space_id}\n\t\t\t

\n\t\t\t\tIf you are visiting a HuggingFace Space in Incognito mode, you must\n\t\t\t\tenable third party cookies.\n\t\t\t

\n\t\t{/if}\n\t\t{#if incorrect_credentials}\n\t\t\t

Incorrect Credentials

\n\t\t{/if}\n\t\t
\n\t\t\t\n\t\t\t\n\t\t\n\n\t\t\n\t
\n
\n\n\n"],"names":["ctx","insert","target","p","anchor","create_if_block_2","create_if_block_1","create_if_block","h2","div","root","$$props","auth_message","app_mode","space_id","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,EACbM,EAAA,EAAAL,EAAW,EAAE,GACHI,EAAS,QAAU,KAC7B,SAAS,OAAM,iBA4BFL,EAAQO,uBAURN,EAAQM"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Login-9c3cc0eb.css b/gradio/templates/cdn/assets/Login-9c3cc0eb.css new file mode 100644 index 0000000000000000000000000000000000000000..9901bcac6c93474ed045092f6d91d6e683ba5b32 --- /dev/null +++ b/gradio/templates/cdn/assets/Login-9c3cc0eb.css @@ -0,0 +1 @@ +.wrap.svelte-1ogxbi0{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:var(--size-3);background:var(--background-fill-primary);width:var(--size-full)}h2.svelte-1ogxbi0{margin-bottom:var(--size-3);color:var(--body-text-color);font-weight:var(--section-header-text-weight);font-size:var(--text-xl)}.auth.svelte-1ogxbi0{margin-top:var(--size-1);margin-bottom:var(--size-1);color:var(--body-text-color)}.creds.svelte-1ogxbi0{margin-top:var(--size-4);margin-bottom:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold)} diff --git a/gradio/templates/cdn/assets/Model3D-7a003e98.js b/gradio/templates/cdn/assets/Model3D-7a003e98.js new file mode 100644 index 0000000000000000000000000000000000000000..e232b445e4ba9d530035cdf1f053597954858388 --- /dev/null +++ b/gradio/templates/cdn/assets/Model3D-7a003e98.js @@ -0,0 +1,2 @@ +import{S as o,e as d,s as u,N as _,P as g,K as r,U as i,p as v,M as y,R as m,n as c,A as b}from"./index-fda37c89.js";function M(a){let e,s;return{c(){e=_("div"),s=g(a[0]),r(e,"class","svelte-1ayixqk"),i(e,"table",a[1]==="table"),i(e,"gallery",a[1]==="gallery"),i(e,"selected",a[2])},m(t,l){v(t,e,l),y(e,s)},p(t,[l]){l&1&&m(s,t[0]),l&2&&i(e,"table",t[1]==="table"),l&2&&i(e,"gallery",t[1]==="gallery"),l&4&&i(e,"selected",t[2])},i:c,o:c,d(t){t&&b(e)}}}function D(a,e,s){let{value:t}=e,{type:l}=e,{selected:f=!1}=e;return a.$$set=n=>{"value"in n&&s(0,t=n.value),"type"in n&&s(1,l=n.type),"selected"in n&&s(2,f=n.selected)},[t,l,f]}class h extends o{constructor(e){super(),d(this,e,D,M,u,{value:0,type:1,selected:2})}}const E=h;export{E}; +//# sourceMappingURL=Model3D-7a003e98.js.map diff --git a/gradio/templates/cdn/assets/Model3D-7a003e98.js.map b/gradio/templates/cdn/assets/Model3D-7a003e98.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a9c2befa42281a9c493bd4b117c2a2d59bfa1d84 --- /dev/null +++ b/gradio/templates/cdn/assets/Model3D-7a003e98.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Model3D-7a003e98.js","sources":["../../../../js/app/src/components/Dataset/ExampleComponents/Model3D.svelte"],"sourcesContent":["\n\n\n\t{value}\n\n\n\n"],"names":["ctx","toggle_class","div","insert","target","anchor","value","$$props","type","selected"],"mappings":"qKAaEA,EAAK,CAAA,CAAA,gCAJOC,EAAAC,EAAA,QAAAF,OAAS,OAAO,EACdC,EAAAC,EAAA,UAAAF,OAAS,SAAS,+BAFlCG,EAMKC,EAAAF,EAAAG,CAAA,4BADHL,EAAK,CAAA,CAAA,OAJOC,EAAAC,EAAA,QAAAF,OAAS,OAAO,OACdC,EAAAC,EAAA,UAAAF,OAAS,SAAS,0EAPtB,MAAAM,CAAY,EAAAC,GACZ,KAAAC,CAAyB,EAAAD,EACzB,CAAA,SAAAE,EAAoB,EAAK,EAAAF"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Model3D-98fc2b2c.css b/gradio/templates/cdn/assets/Model3D-98fc2b2c.css new file mode 100644 index 0000000000000000000000000000000000000000..cee82ea831d77ca0e001baf10a07f84e176679f0 --- /dev/null +++ b/gradio/templates/cdn/assets/Model3D-98fc2b2c.css @@ -0,0 +1 @@ +.gallery.svelte-1ayixqk{padding:var(--size-1) var(--size-2)} diff --git a/gradio/templates/cdn/assets/ModifyUpload-3f2fd95a.js b/gradio/templates/cdn/assets/ModifyUpload-3f2fd95a.js new file mode 100644 index 0000000000000000000000000000000000000000..ba5cbcaf1a50546735b19b2f96658f321f57a86c --- /dev/null +++ b/gradio/templates/cdn/assets/ModifyUpload-3f2fd95a.js @@ -0,0 +1,2 @@ +import{S as g,e as w,s as _,J as p,K as o,L as i,p as k,M as m,n as u,A as b,N as z,O as B,k as $,U as v,o as C,z as d,u as I,v as h,y as E,x as M,B as j}from"./index-fda37c89.js";import"./Button-e3640f74.js";import{I as L}from"./IconButton-9e1f47e2.js";import"./ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js";function S(a){let e,s,t,l;return{c(){e=p("svg"),s=p("g"),t=p("path"),l=p("path"),o(t,"d","M18,6L6.087,17.913"),i(t,"fill","none"),i(t,"fill-rule","nonzero"),i(t,"stroke-width","2px"),o(s,"transform","matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"),o(l,"d","M4.364,4.364L19.636,19.636"),i(l,"fill","none"),i(l,"fill-rule","nonzero"),i(l,"stroke-width","2px"),o(e,"width","100%"),o(e,"height","100%"),o(e,"viewBox","0 0 24 24"),o(e,"version","1.1"),o(e,"xmlns","http://www.w3.org/2000/svg"),o(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),o(e,"xml:space","preserve"),o(e,"stroke","currentColor"),i(e,"fill-rule","evenodd"),i(e,"clip-rule","evenodd"),i(e,"stroke-linecap","round"),i(e,"stroke-linejoin","round")},m(n,r){k(n,e,r),m(e,s),m(s,t),m(e,l)},p:u,i:u,o:u,d(n){n&&b(e)}}}class U extends g{constructor(e){super(),w(this,e,null,S,_,{})}}function q(a){let e,s;return{c(){e=p("svg"),s=p("path"),o(s,"d","M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"),o(e,"xmlns","http://www.w3.org/2000/svg"),o(e,"width","100%"),o(e,"height","100%"),o(e,"viewBox","0 0 24 24"),o(e,"fill","none"),o(e,"stroke","currentColor"),o(e,"stroke-width","1.5"),o(e,"stroke-linecap","round"),o(e,"stroke-linejoin","round"),o(e,"class","feather feather-edit-2")},m(t,l){k(t,e,l),m(e,s)},p:u,i:u,o:u,d(t){t&&b(e)}}}class y extends g{constructor(e){super(),w(this,e,null,q,_,{})}}function x(a){let e,s;return e=new L({props:{Icon:y,label:"Edit"}}),e.$on("click",a[3]),{c(){$(e.$$.fragment)},m(t,l){C(e,t,l),s=!0},p:u,i(t){s||(d(e.$$.fragment,t),s=!0)},o(t){h(e.$$.fragment,t),s=!1},d(t){M(e,t)}}}function A(a){let e,s,t,l,n=a[0]&&x(a);return t=new L({props:{Icon:U,label:"Clear"}}),t.$on("click",a[4]),{c(){e=z("div"),n&&n.c(),s=B(),$(t.$$.fragment),o(e,"class","svelte-19sk1im"),v(e,"not-absolute",!a[1]),i(e,"position",a[1]?"absolute":"static")},m(r,c){k(r,e,c),n&&n.m(e,null),m(e,s),C(t,e,null),l=!0},p(r,[c]){r[0]?n?(n.p(r,c),c&1&&d(n,1)):(n=x(r),n.c(),d(n,1),n.m(e,s)):n&&(I(),h(n,1,1,()=>{n=null}),E()),(!l||c&2)&&v(e,"not-absolute",!r[1]),c&2&&i(e,"position",r[1]?"absolute":"static")},i(r){l||(d(n),d(t.$$.fragment,r),l=!0)},o(r){h(n),h(t.$$.fragment,r),l=!1},d(r){r&&b(e),n&&n.d(),M(t)}}}function D(a,e,s){let{editable:t=!1}=e,{absolute:l=!0}=e;const n=j(),r=()=>n("edit"),c=f=>{n("clear"),f.stopPropagation()};return a.$$set=f=>{"editable"in f&&s(0,t=f.editable),"absolute"in f&&s(1,l=f.absolute)},[t,l,n,r,c]}class P extends g{constructor(e){super(),w(this,e,D,A,_,{editable:0,absolute:1})}}export{U as C,P as M}; +//# sourceMappingURL=ModifyUpload-3f2fd95a.js.map diff --git a/gradio/templates/cdn/assets/ModifyUpload-3f2fd95a.js.map b/gradio/templates/cdn/assets/ModifyUpload-3f2fd95a.js.map new file mode 100644 index 0000000000000000000000000000000000000000..45443c094437b6fdd99d6a25a693f108e0edb38f --- /dev/null +++ b/gradio/templates/cdn/assets/ModifyUpload-3f2fd95a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ModifyUpload-3f2fd95a.js","sources":["../../../../js/icons/src/Clear.svelte","../../../../js/icons/src/Edit.svelte","../../../../js/upload/src/ModifyUpload.svelte"],"sourcesContent":["\n\t\n\t\t\n\t\n\t\n\n","\n\t\n\n","\n\n\n\t{#if editable}\n\t\t dispatch(\"edit\")} />\n\t{/if}\n\n\t {\n\t\t\tdispatch(\"clear\");\n\t\t\tevent.stopPropagation();\n\t\t}}\n\t/>\n\n\n\n"],"names":["insert","target","svg","anchor","append","g","path0","path1","path","Edit","ctx","create_if_block","Clear","div","editable","$$props","absolute","dispatch","createEventDispatcher","click_handler","event"],"mappings":"iiCAAAA,EAuBKC,EAAAC,EAAAC,CAAA,EAZJC,EAOGF,EAAAG,CAAA,EAJFD,EAGCC,EAAAC,CAAA,EAEFF,EAGCF,EAAAK,CAAA,4fCtBFP,EAaKC,EAAAC,EAAAC,CAAA,EADJC,EAAmEF,EAAAM,CAAA,gJCKhDC,EAAI,MAAA,MAAA,CAAA,CAAA,kLADlBC,EAAQ,CAAA,GAAAC,EAAAD,CAAA,8BAKNE,EAAK,MAAA,OAAA,CAAA,CAAA,wHARSF,EAAQ,CAAA,CAAA,iBACbA,EAAQ,CAAA,EAAG,WAAa,QAAQ,UAFjDV,EAgBKC,EAAAY,EAAAV,CAAA,mDAZCO,EAAQ,CAAA,4HAHQA,EAAQ,CAAA,CAAA,sBACbA,EAAQ,CAAA,EAAG,WAAa,QAAQ,6HARrC,GAAA,CAAA,SAAAI,EAAoB,EAAK,EAAAC,EACzB,CAAA,SAAAC,EAAoB,EAAI,EAAAD,EAE7B,MAAAE,EAAWC,IAQqCC,EAAA,IAAAF,EAAS,MAAM,IAMzDG,GAAK,CACfH,EAAS,OAAO,EAChBG,EAAM,gBAAe"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/ModifyUpload-77b0d4b2.css b/gradio/templates/cdn/assets/ModifyUpload-77b0d4b2.css new file mode 100644 index 0000000000000000000000000000000000000000..c78d71f8b6eaf75f8134375ed017f1c03b6edf1a --- /dev/null +++ b/gradio/templates/cdn/assets/ModifyUpload-77b0d4b2.css @@ -0,0 +1 @@ +div.svelte-116rqfv{cursor:pointer;width:var(--size-full);height:var(--size-full)}.center.svelte-116rqfv{text-align:center}.flex.svelte-116rqfv{display:flex;justify-content:center;align-items:center}input.svelte-116rqfv{display:none}div.svelte-19sk1im{display:flex;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-1)}.not-absolute.svelte-19sk1im{margin:var(--size-1)} diff --git a/gradio/templates/cdn/assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js b/gradio/templates/cdn/assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js new file mode 100644 index 0000000000000000000000000000000000000000..ea59a3c30d1a396de1e3dcd8e62be35a7e273f73 --- /dev/null +++ b/gradio/templates/cdn/assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js @@ -0,0 +1,2 @@ +function l(e,n,a){if(e==null)return null;if(typeof e=="string")return{name:"file_data",data:e};if(Array.isArray(e)){const s=[];for(const t of e)t===null?s.push(null):s.push(l(t,n,a));return s}else e.is_file&&(a==null?e.data=n+"/file="+e.name:e.data="/proxy="+a+"file="+e.name);return e}const r=e=>{const n=new FileReader;return n.readAsDataURL(e),new Promise(a=>{n.onloadend=()=>{a(n.result)}})};export{r as b,l as n}; +//# sourceMappingURL=ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js.map diff --git a/gradio/templates/cdn/assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js.map b/gradio/templates/cdn/assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b34107c922d58516281c3e412b13f18218cb5753 --- /dev/null +++ b/gradio/templates/cdn/assets/ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js","sources":["../../../../js/upload/src/utils.ts"],"sourcesContent":["import type { FileData } from \"./types\";\n\nexport function normalise_file(\n\tfile: string | FileData | null,\n\troot: string,\n\troot_url: string | null\n): FileData | null;\n\nexport function normalise_file(\n\tfile: FileData[] | null,\n\troot: string,\n\troot_url: string | null\n): FileData[] | null;\n\nexport function normalise_file(\n\tfile: FileData[] | FileData | null,\n\troot: string,\n\troot_url: string | null\n): FileData[] | FileData | null;\n\nexport function normalise_file(\n\tfile: FileData[] | FileData | string | null,\n\troot: string,\n\troot_url: string | null\n): FileData[] | FileData | null {\n\tif (file == null) return null;\n\tif (typeof file === \"string\") {\n\t\treturn {\n\t\t\tname: \"file_data\",\n\t\t\tdata: file\n\t\t};\n\t} else if (Array.isArray(file)) {\n\t\tconst normalized_file: (FileData | null)[] = [];\n\n\t\tfor (const x of file) {\n\t\t\tif (x === null) {\n\t\t\t\tnormalized_file.push(null);\n\t\t\t} else {\n\t\t\t\tnormalized_file.push(normalise_file(x, root, root_url));\n\t\t\t}\n\t\t}\n\n\t\treturn normalized_file as FileData[];\n\t} else if (file.is_file) {\n\t\tif (root_url == null) {\n\t\t\tfile.data = root + \"/file=\" + file.name;\n\t\t} else {\n\t\t\tfile.data = \"/proxy=\" + root_url + \"file=\" + file.name;\n\t\t}\n\t}\n\treturn file;\n}\n\nexport const blobToBase64 = (blob: File): Promise => {\n\tconst reader = new FileReader();\n\treader.readAsDataURL(blob);\n\treturn new Promise((resolve) => {\n\t\treader.onloadend = (): void => {\n\t\t\tresolve(reader.result as string);\n\t\t};\n\t});\n};\n"],"names":["normalise_file","file","root","root_url","normalized_file","x","blobToBase64","blob","reader","resolve"],"mappings":"AAoBgB,SAAAA,EACfC,EACAC,EACAC,EAC+B,CAC/B,GAAIF,GAAQ,KAAa,OAAA,KACrB,GAAA,OAAOA,GAAS,SACZ,MAAA,CACN,KAAM,YACN,KAAMA,CAAA,EAEG,GAAA,MAAM,QAAQA,CAAI,EAAG,CAC/B,MAAMG,EAAuC,CAAA,EAE7C,UAAWC,KAAKJ,EACXI,IAAM,KACTD,EAAgB,KAAK,IAAI,EAEzBA,EAAgB,KAAKJ,EAAeK,EAAGH,EAAMC,CAAQ,CAAC,EAIjD,OAAAC,OACGH,EAAK,UACXE,GAAY,KACVF,EAAA,KAAOC,EAAO,SAAWD,EAAK,KAEnCA,EAAK,KAAO,UAAYE,EAAW,QAAUF,EAAK,MAG7C,OAAAA,CACR,CAEa,MAAAK,EAAgBC,GAAgC,CACtD,MAAAC,EAAS,IAAI,WACnB,OAAAA,EAAO,cAAcD,CAAI,EAClB,IAAI,QAASE,GAAY,CAC/BD,EAAO,UAAY,IAAY,CAC9BC,EAAQD,EAAO,MAAgB,CAAA,CAChC,CACA,CACF"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/ShareButton-50e150a5.js b/gradio/templates/cdn/assets/ShareButton-50e150a5.js new file mode 100644 index 0000000000000000000000000000000000000000..97eeb45d252dfdddc66d1e1aeffbe98723fb720a --- /dev/null +++ b/gradio/templates/cdn/assets/ShareButton-50e150a5.js @@ -0,0 +1,2 @@ +import{S as h,e as m,s as d,J as f,K as c,p as w,M as _,n as u,A as y,k as b,o as v,z as S,v as x,x as A,B}from"./index-fda37c89.js";import{I as M}from"./IconButton-9e1f47e2.js";import"./Button-e3640f74.js";function C(r){let e,n;return{c(){e=f("svg"),n=f("path"),c(n,"d","M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"),c(n,"fill","currentColor"),c(e,"id","icon"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"viewBox","0 0 32 32")},m(t,a){w(t,e,a),_(e,n)},p:u,i:u,o:u,d(t){t&&y(e)}}}class k extends h{constructor(e){super(),m(this,e,null,C,d,{})}}class l extends Error{constructor(e){super(e),this.name="ShareError"}}const I=async(r,e)=>{if(window.__gradio_space__==null)throw new l("Must be on Spaces to share.");let n,t,a;if(e==="url"){const o=await fetch(r);n=await o.blob(),t=o.headers.get("content-type")||"",a=o.headers.get("content-disposition")||""}else n=E(r),t=r.split(";")[0].split(":")[1],a="file"+t.split("/")[1];const s=new File([n],a,{type:t}),i=await fetch("https://huggingface.co/uploads",{method:"POST",body:s,headers:{"Content-Type":s.type,"X-Requested-With":"XMLHttpRequest"}});if(!i.ok){if(i.headers.get("content-type")?.includes("application/json")){const o=await i.json();throw new l(`Upload failed: ${o.error}`)}throw new l("Upload failed.")}return await i.text()};function E(r){for(var e=r.split(","),n=e[0].match(/:(.*?);/)[1],t=atob(e[1]),a=t.length,s=new Uint8Array(a);a--;)s[a]=t.charCodeAt(a);return new Blob([s],{type:n})}function R(r){let e,n;return e=new M({props:{Icon:k,label:"Share",pending:r[2]}}),e.$on("click",r[4]),{c(){b(e.$$.fragment)},m(t,a){v(e,t,a),n=!0},p(t,[a]){const s={};a&4&&(s.pending=t[2]),e.$set(s)},i(t){n||(S(e.$$.fragment,t),n=!0)},o(t){x(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function T(r,e,n){const t=B();let{formatter:a}=e,{value:s}=e,i=!1;const p=async()=>{try{n(2,i=!0);const o=await a(s);t("share",{description:o})}catch(o){console.error(o);let g=o instanceof l?o.message:"Share failed.";t("error",g)}finally{n(2,i=!1)}};return r.$$set=o=>{"formatter"in o&&n(0,a=o.formatter),"value"in o&&n(1,s=o.value)},[a,s,i,t,p]}class L extends h{constructor(e){super(),m(this,e,T,R,d,{formatter:0,value:1})}}export{L as S,I as u}; +//# sourceMappingURL=ShareButton-50e150a5.js.map diff --git a/gradio/templates/cdn/assets/ShareButton-50e150a5.js.map b/gradio/templates/cdn/assets/ShareButton-50e150a5.js.map new file mode 100644 index 0000000000000000000000000000000000000000..bdcfe05993fd9dfa50d12478bfa9c6d17e7e0483 --- /dev/null +++ b/gradio/templates/cdn/assets/ShareButton-50e150a5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ShareButton-50e150a5.js","sources":["../../../../js/icons/src/Community.svelte","../../../../js/utils/src/utils.ts","../../../../js/atoms/src/ShareButton.svelte"],"sourcesContent":["\n","export interface SelectData {\n\tindex: number | [number, number];\n\tvalue: any;\n\tselected?: boolean;\n}\n\nexport interface ShareData {\n\tdescription: string;\n\ttitle?: string;\n}\n\nexport class ShareError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"ShareError\";\n\t}\n}\n\nexport const uploadToHuggingFace = async (\n\tdata: string,\n\ttype: \"base64\" | \"url\"\n) => {\n\tif (window.__gradio_space__ == null) {\n\t\tthrow new ShareError(\"Must be on Spaces to share.\");\n\t}\n\tlet blob: Blob;\n\tlet contentType: string;\n\tlet filename: string;\n\tif (type === \"url\") {\n\t\tconst response = await fetch(data);\n\t\tblob = await response.blob();\n\t\tcontentType = response.headers.get(\"content-type\") || \"\";\n\t\tfilename = response.headers.get(\"content-disposition\") || \"\";\n\t} else {\n\t\tblob = dataURLtoBlob(data);\n\t\tcontentType = data.split(\";\")[0].split(\":\")[1];\n\t\tfilename = \"file\" + contentType.split(\"/\")[1];\n\t}\n\n\tconst file = new File([blob], filename, { type: contentType });\n\n\t// Send file to endpoint\n\tconst uploadResponse = await fetch(\"https://huggingface.co/uploads\", {\n\t\tmethod: \"POST\",\n\t\tbody: file,\n\t\theaders: {\n\t\t\t\"Content-Type\": file.type,\n\t\t\t\"X-Requested-With\": \"XMLHttpRequest\"\n\t\t}\n\t});\n\n\t// Check status of response\n\tif (!uploadResponse.ok) {\n\t\tif (\n\t\t\tuploadResponse.headers.get(\"content-type\")?.includes(\"application/json\")\n\t\t) {\n\t\t\tconst error = await uploadResponse.json();\n\t\t\tthrow new ShareError(`Upload failed: ${error.error}`);\n\t\t}\n\t\tthrow new ShareError(`Upload failed.`);\n\t}\n\n\t// Return response if needed\n\tconst result = await uploadResponse.text();\n\treturn result;\n};\n\nfunction dataURLtoBlob(dataurl: string) {\n\tvar arr = dataurl.split(\",\"),\n\t\tmime = (arr[0].match(/:(.*?);/) as RegExpMatchArray)[1],\n\t\tbstr = atob(arr[1]),\n\t\tn = bstr.length,\n\t\tu8arr = new Uint8Array(n);\n\twhile (n--) {\n\t\tu8arr[n] = bstr.charCodeAt(n);\n\t}\n\treturn new Blob([u8arr], { type: mime });\n}\n","\n\n {\n\t\ttry {\n\t\t\tpending = true;\n\t\t\tconst formatted = await formatter(value);\n\t\t\tdispatch(\"share\", {\n\t\t\t\tdescription: formatted\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t\tlet message = e instanceof ShareError ? e.message : \"Share failed.\";\n\t\t\tdispatch(\"error\", message);\n\t\t} finally {\n\t\t\tpending = false;\n\t\t}\n\t}}\n/>\n"],"names":["insert","target","svg","anchor","append","path","ShareError","message","uploadToHuggingFace","data","type","blob","contentType","filename","response","dataURLtoBlob","file","uploadResponse","error","dataurl","arr","mime","bstr","n","u8arr","Community","dispatch","createEventDispatcher","formatter","$$props","value","pending","$$invalidate","formatted","e"],"mappings":"8qBAAAA,EAKAC,EAAAC,EAAAC,CAAA,EAJEC,EAGCF,EAAAG,CAAA,8FCOI,MAAMC,UAAmB,KAAM,CACrC,YAAYC,EAAiB,CAC5B,MAAMA,CAAO,EACb,KAAK,KAAO,YACb,CACD,CAEa,MAAAC,EAAsB,MAClCC,EACAC,IACI,CACA,GAAA,OAAO,kBAAoB,KACxB,MAAA,IAAIJ,EAAW,6BAA6B,EAE/C,IAAAK,EACAC,EACAC,EACJ,GAAIH,IAAS,MAAO,CACb,MA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,MAASL,EAAUE,CAAK,EACvCJ,EAAS,QACR,CAAA,YAAaO,CAAA,CAAA,QAENC,GACR,QAAQ,MAAMA,CAAC,MACX3B,EAAU2B,aAAa5B,EAAa4B,EAAE,QAAU,gBACpDR,EAAS,QAASnB,CAAO,UAEzByB,EAAA,EAAAD,EAAU,EAAK"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/StaticImage-508005b4.css b/gradio/templates/cdn/assets/StaticImage-508005b4.css new file mode 100644 index 0000000000000000000000000000000000000000..867db01e98d8648a1afa22a934018f3ef506a4ae --- /dev/null +++ b/gradio/templates/cdn/assets/StaticImage-508005b4.css @@ -0,0 +1 @@ +canvas.svelte-yigbas{display:block;position:absolute;inset:0;margin:auto}.lr.svelte-yigbas{border-right:1px solid var(--border-color-primary);border-left:1px solid var(--border-color-primary)}.tb.svelte-yigbas{border-top:1px solid var(--border-color-primary);border-bottom:1px solid var(--border-color-primary)}canvas.svelte-yigbas:hover{cursor:none}.wrap.svelte-yigbas{position:relative;width:var(--size-full);height:var(--size-full);touch-action:none}.start-prompt.svelte-yigbas{display:flex;position:absolute;inset:0;justify-content:center;align-items:center;z-index:var(--layer-4);touch-action:none;pointer-events:none;color:var(--body-text-color-subdued)}.wrap.svelte-425ent{position:relative;width:var(--size-full);height:var(--size-full);min-height:var(--size-60)}video.svelte-425ent{width:var(--size-full);height:var(--size-full)}button.svelte-425ent{display:flex;position:absolute;right:0;bottom:var(--size-2);left:0;justify-content:center;align-items:center;margin:auto;box-shadow:var(--shadow-drop-lg);border-radius:var(--radius-xl);background-color:#000000e6;width:var(--size-10);height:var(--size-10)}@media (min-width: 768px){button.svelte-425ent{bottom:var(--size-4)}}@media (min-width: 1280px){button.svelte-425ent{bottom:var(--size-8)}}.icon.svelte-425ent{opacity:.8;width:50%;height:50%;color:#fff}.flip.svelte-425ent{transform:scaleX(-1)}div.svelte-s6ybro{display:flex;position:absolute;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-5)}.wrap.svelte-p4aq0j.svelte-p4aq0j{display:flex;position:absolute;top:var(--size-10);right:var(--size-2);flex-direction:column;justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-5)}.brush.svelte-p4aq0j.svelte-p4aq0j{top:0;right:0}.brush.svelte-p4aq0j input.svelte-p4aq0j{position:absolute;top:3px;right:calc(100% + 5px)}.col.svelte-p4aq0j input.svelte-p4aq0j{position:absolute;right:calc(100% + 5px);bottom:-4px}.image-container.svelte-p3y7hu,img.svelte-p3y7hu{width:var(--size-full);height:var(--size-full)}img.svelte-p3y7hu{object-fit:contain}.selectable.svelte-p3y7hu{cursor:crosshair}.absolute-img.svelte-p3y7hu{position:absolute;opacity:0}.webcam.svelte-p3y7hu{transform:scaleX(-1)}img.svelte-1btp92j{width:var(--size-full);height:var(--size-full);object-fit:contain}.selectable.svelte-1btp92j{cursor:crosshair}.icon-buttons.svelte-1btp92j{display:flex;position:absolute;top:6px;right:6px;gap:var(--size-1)} diff --git a/gradio/templates/cdn/assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js b/gradio/templates/cdn/assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js new file mode 100644 index 0000000000000000000000000000000000000000..415b8c7bd676697d97df18b1a17ff9587d14cd7f --- /dev/null +++ b/gradio/templates/cdn/assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js @@ -0,0 +1,11 @@ +import{S as bt,e as wt,s as yt,J as H,K as p,p as U,M as Z,n as I,A as j,N as ct,O as je,U as re,z as W,u as jt,v as G,y as Vt,B as Ve,C as Ge,Q as qe,X as Fe,h as Ke,k as Gt,o as qt,x as Ft,m as Qe}from"./index-fda37c89.js";import"./Button-e3640f74.js";function Ze(a){let t,e,i;return{c(){t=H("svg"),e=H("path"),i=H("circle"),p(e,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),p(i,"cx","12"),p(i,"cy","13"),p(i,"r","4"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","none"),p(t,"stroke","currentColor"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-camera")},m(n,r){U(n,t,r),Z(t,e),Z(t,i)},p:I,i:I,o:I,d(n){n&&j(t)}}}class Je extends bt{constructor(t){super(),wt(this,t,null,Ze,yt,{})}}function $e(a){let t,e;return{c(){t=H("svg"),e=H("circle"),p(e,"cx","12"),p(e,"cy","12"),p(e,"r","10"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","red"),p(t,"stroke","red"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-circle")},m(i,n){U(i,t,n),Z(t,e)},p:I,i:I,o:I,d(i){i&&j(t)}}}class ti extends bt{constructor(t){super(),wt(this,t,null,$e,yt,{})}}function ei(a){let t,e;return{c(){t=H("svg"),e=H("rect"),p(e,"x","3"),p(e,"y","3"),p(e,"width","18"),p(e,"height","18"),p(e,"rx","2"),p(e,"ry","2"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","red"),p(t,"stroke","red"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-square")},m(i,n){U(i,t,n),Z(t,e)},p:I,i:I,o:I,d(i){i&&j(t)}}}class ii extends bt{constructor(t){super(),wt(this,t,null,ei,yt,{})}}function ai(a){let t,e,i;return{c(){t=H("svg"),e=H("polyline"),i=H("path"),p(e,"points","1 4 1 10 7 10"),p(i,"d","M3.51 15a9 9 0 1 0 2.13-9.36L1 10"),p(t,"xmlns","http://www.w3.org/2000/svg"),p(t,"width","100%"),p(t,"height","100%"),p(t,"viewBox","0 0 24 24"),p(t,"fill","none"),p(t,"stroke","currentColor"),p(t,"stroke-width","1.5"),p(t,"stroke-linecap","round"),p(t,"stroke-linejoin","round"),p(t,"class","feather feather-rotate-ccw")},m(n,r){U(n,t,r),Z(t,e),Z(t,i)},p:I,i:I,o:I,d(n){n&&j(t)}}}class ba extends bt{constructor(t){super(),wt(this,t,null,ai,yt,{})}}/*! + * Cropper.js v1.5.12 + * https://fengyuanchen.github.io/cropperjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2021-06-12T08:00:17.411Z + */function ne(a,t){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(a,n).enumerable})),e.push.apply(e,i)}return e}function Ee(a){for(var t=1;ta.length)&&(t=a.length);for(var e=0,i=new Array(t);e
',yi=Number.isNaN||X.isNaN;function b(a){return typeof a=="number"&&!yi(a)}var be=function(t){return t>0&&t<1/0};function St(a){return typeof a>"u"}function at(a){return Dt(a)==="object"&&a!==null}var _i=Object.prototype.hasOwnProperty;function nt(a){if(!at(a))return!1;try{var t=a.constructor,e=t.prototype;return t&&e&&_i.call(e,"isPrototypeOf")}catch{return!1}}function S(a){return typeof a=="function"}var xi=Array.prototype.slice;function Se(a){return Array.from?Array.from(a):xi.call(a)}function C(a,t){return a&&S(t)&&(Array.isArray(a)||b(a.length)?Se(a).forEach(function(e,i){t.call(a,e,i,a)}):at(a)&&Object.keys(a).forEach(function(e){t.call(a,a[e],e,a)})),a}var D=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n0&&i.forEach(function(r){at(r)&&Object.keys(r).forEach(function(o){t[o]=r[o]})}),t},Ei=/\.\d*(?:0|9){12}\d*$/;function st(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ei.test(a)?Math.round(a*t)/t:a}var Di=/^width|height|left|top|marginLeft|marginTop$/;function K(a,t){var e=a.style;C(t,function(i,n){Di.test(n)&&b(i)&&(i="".concat(i,"px")),e[n]=i})}function Mi(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function A(a,t){if(t){if(b(a.length)){C(a,function(i){A(i,t)});return}if(a.classList){a.classList.add(t);return}var e=a.className.trim();e?e.indexOf(t)<0&&(a.className="".concat(e," ").concat(t)):a.className=t}}function Y(a,t){if(t){if(b(a.length)){C(a,function(e){Y(e,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function ot(a,t,e){if(t){if(b(a.length)){C(a,function(i){ot(i,t,e)});return}e?A(a,t):Y(a,t)}}var Oi=/([a-z\d])([A-Z])/g;function $t(a){return a.replace(Oi,"$1-$2").toLowerCase()}function Xt(a,t){return at(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat($t(t)))}function mt(a,t,e){at(e)?a[t]=e:a.dataset?a.dataset[t]=e:a.setAttribute("data-".concat($t(t)),e)}function Ti(a,t){if(at(a[t]))try{delete a[t]}catch{a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch{a.dataset[t]=void 0}else a.removeAttribute("data-".concat($t(t)))}var ke=/\s\s*/,Ie=function(){var a=!1;if(Ct){var t=!1,e=function(){},i=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});X.addEventListener("test",e,i),X.removeEventListener("test",e,i)}return a}();function z(a,t,e){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=e;t.trim().split(ke).forEach(function(r){if(!Ie){var o=a.listeners;o&&o[r]&&o[r][e]&&(n=o[r][e],delete o[r][e],Object.keys(o[r]).length===0&&delete o[r],Object.keys(o).length===0&&delete a.listeners)}a.removeEventListener(r,n,i)})}function B(a,t,e){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=e;t.trim().split(ke).forEach(function(r){if(i.once&&!Ie){var o=a.listeners,s=o===void 0?{}:o;n=function(){delete s[r][e],a.removeEventListener(r,n,i);for(var f=arguments.length,h=new Array(f),c=0;cMath.abs(e)&&(e=u)})}),e}function Et(a,t){var e=a.pageX,i=a.pageY,n={endX:e,endY:i};return t?n:Ee({startX:e,startY:i},n)}function Ai(a){var t=0,e=0,i=0;return C(a,function(n){var r=n.startX,o=n.startY;t+=r,e+=o,i+=1}),t/=i,e/=i,{pageX:t,pageY:e}}function Q(a){var t=a.aspectRatio,e=a.height,i=a.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=be(i),o=be(e);if(r&&o){var s=e*t;n==="contain"&&s>i||n==="cover"&&s90?{width:l,height:s}:{width:s,height:l}}function Si(a,t,e,i){var n=t.aspectRatio,r=t.naturalWidth,o=t.naturalHeight,s=t.rotate,l=s===void 0?0:s,f=t.scaleX,h=f===void 0?1:f,c=t.scaleY,u=c===void 0?1:c,v=e.aspectRatio,g=e.naturalWidth,_=e.naturalHeight,m=i.fillColor,x=m===void 0?"transparent":m,T=i.imageSmoothingEnabled,O=T===void 0?!0:T,w=i.imageSmoothingQuality,M=w===void 0?"low":w,d=i.maxWidth,y=d===void 0?1/0:d,R=i.maxHeight,L=R===void 0?1/0:R,V=i.minWidth,J=V===void 0?0:V,$=i.minHeight,q=$===void 0?0:$,P=document.createElement("canvas"),N=P.getContext("2d"),tt=Q({aspectRatio:v,width:y,height:L}),_t=Q({aspectRatio:v,width:J,height:q},"cover"),At=Math.min(tt.width,Math.max(_t.width,g)),Nt=Math.min(tt.height,Math.max(_t.height,_)),te=Q({aspectRatio:n,width:y,height:L}),ee=Q({aspectRatio:n,width:J,height:q},"cover"),ie=Math.min(te.width,Math.max(ee.width,r)),ae=Math.min(te.height,Math.max(ee.height,o)),Xe=[-ie/2,-ae/2,ie,ae];return P.width=st(At),P.height=st(Nt),N.fillStyle=x,N.fillRect(0,0,At,Nt),N.save(),N.translate(At/2,Nt/2),N.rotate(l*Math.PI/180),N.scale(h,u),N.imageSmoothingEnabled=O,N.imageSmoothingQuality=M,N.drawImage.apply(N,[a].concat(De(Xe.map(function(Ue){return Math.floor(st(Ue))})))),N.restore(),P}var Be=String.fromCharCode;function ki(a,t,e){var i="";e+=t;for(var n=t;n0;)e.push(Be.apply(null,Se(n.subarray(0,i)))),n=n.subarray(i);return"data:".concat(t,";base64,").concat(btoa(e.join("")))}function zi(a){var t=new DataView(a),e;try{var i,n,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var o=t.byteLength,s=2;s+1=8&&(r=f+c)}}}if(r){var u=t.getUint16(r,i),v,g;for(g=0;g=0?r:Ae),height:Math.max(i.offsetHeight,o>=0?o:Ne)};this.containerData=s,K(n,{width:s.width,height:s.height}),A(t,k),Y(n,k)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,n=Math.abs(e.rotate)%180===90,r=n?e.naturalHeight:e.naturalWidth,o=n?e.naturalWidth:e.naturalHeight,s=r/o,l=t.width,f=t.height;t.height*s>t.width?i===3?l=t.height*s:f=t.width/s:i===3?f=t.width/s:l=t.height*s;var h={aspectRatio:s,naturalWidth:r,naturalHeight:o,width:l,height:f};this.canvasData=h,this.limited=i===1||i===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=D({},h)},limitCanvas:function(t,e){var i=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=i.viewMode,l=r.aspectRatio,f=this.cropped&&o;if(t){var h=Number(i.minCanvasWidth)||0,c=Number(i.minCanvasHeight)||0;s>1?(h=Math.max(h,n.width),c=Math.max(c,n.height),s===3&&(c*l>h?h=c*l:c=h/l)):s>0&&(h?h=Math.max(h,f?o.width:0):c?c=Math.max(c,f?o.height:0):f&&(h=o.width,c=o.height,c*l>h?h=c*l:c=h/l));var u=Q({aspectRatio:l,width:h,height:c});h=u.width,c=u.height,r.minWidth=h,r.minHeight=c,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(s>(f?0:1)){var v=n.width-r.width,g=n.height-r.height;r.minLeft=Math.min(0,v),r.minTop=Math.min(0,g),r.maxLeft=Math.max(0,v),r.maxTop=Math.max(0,g),f&&this.limited&&(r.minLeft=Math.min(o.left,o.left+(o.width-r.width)),r.minTop=Math.min(o.top,o.top+(o.height-r.height)),r.maxLeft=o.left,r.maxTop=o.top,s===2&&(r.width>=n.width&&(r.minLeft=Math.min(0,v),r.maxLeft=Math.max(0,v)),r.height>=n.height&&(r.minTop=Math.min(0,g),r.maxTop=Math.max(0,g))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=n.width,r.maxTop=n.height},renderCanvas:function(t,e){var i=this.canvasData,n=this.imageData;if(e){var r=Ni({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),o=r.width,s=r.height,l=i.width*(o/i.naturalWidth),f=i.height*(s/i.naturalHeight);i.left-=(l-i.width)/2,i.top-=(f-i.height)/2,i.width=l,i.height=f,i.aspectRatio=o/s,i.naturalWidth=o,i.naturalHeight=s,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.widthi.maxHeight||i.heighte.width?r.height=r.width/i:r.width=r.height*i),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*n),r.height=Math.max(r.minHeight,r.height*n),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=D({},r)},limitCropBox:function(t,e){var i=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=this.limited,l=i.aspectRatio;if(t){var f=Number(i.minCropBoxWidth)||0,h=Number(i.minCropBoxHeight)||0,c=s?Math.min(n.width,r.width,r.width+r.left,n.width-r.left):n.width,u=s?Math.min(n.height,r.height,r.height+r.top,n.height-r.top):n.height;f=Math.min(f,n.width),h=Math.min(h,n.height),l&&(f&&h?h*l>f?h=f/l:f=h*l:f?h=f/l:h&&(f=h*l),u*l>c?u=c/l:c=u*l),o.minWidth=Math.min(f,c),o.minHeight=Math.min(h,u),o.maxWidth=c,o.maxHeight=u}e&&(s?(o.minLeft=Math.max(0,r.left),o.minTop=Math.max(0,r.top),o.maxLeft=Math.min(n.width,r.left+r.width)-o.width,o.maxTop=Math.min(n.height,r.top+r.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=n.width-o.width,o.maxTop=n.height-o.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.widthi.maxHeight||i.height=e.width&&i.height>=e.height?Oe:Zt),K(this.cropBox,D({width:i.width,height:i.height},vt({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ht(this.element,zt,this.getData())}},Wi={initPreview:function(){var t=this.element,e=this.crossOrigin,i=this.options.preview,n=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",o=document.createElement("img");if(e&&(o.crossOrigin=e),o.src=n,o.alt=r,this.viewBox.appendChild(o),this.viewBoxImage=o,!!i){var s=i;typeof i=="string"?s=t.ownerDocument.querySelectorAll(i):i.querySelector&&(s=[i]),this.previews=s,C(s,function(l){var f=document.createElement("img");mt(l,xt,{width:l.offsetWidth,height:l.offsetHeight,html:l.innerHTML}),e&&(f.crossOrigin=e),f.src=n,f.alt=r,f.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',l.innerHTML="",l.appendChild(f)})}},resetPreview:function(){C(this.previews,function(t){var e=Xt(t,xt);K(t,{width:e.width,height:e.height}),t.innerHTML=e.html,Ti(t,xt)})},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,n=i.width,r=i.height,o=t.width,s=t.height,l=i.left-e.left-t.left,f=i.top-e.top-t.top;!this.cropped||this.disabled||(K(this.viewBoxImage,D({width:o,height:s},vt(D({translateX:-l,translateY:-f},t)))),C(this.previews,function(h){var c=Xt(h,xt),u=c.width,v=c.height,g=u,_=v,m=1;n&&(m=u/n,_=r*m),r&&_>v&&(m=v/r,g=n*m,_=v),K(h,{width:g,height:_}),K(h.getElementsByTagName("img")[0],D({width:o*m,height:s*m},vt(D({translateX:-l*m,translateY:-f*m},t))))}))}},Yi={bind:function(){var t=this.element,e=this.options,i=this.cropper;S(e.cropstart)&&B(t,Wt,e.cropstart),S(e.cropmove)&&B(t,Ht,e.cropmove),S(e.cropend)&&B(t,Pt,e.cropend),S(e.crop)&&B(t,zt,e.crop),S(e.zoom)&&B(t,Yt,e.zoom),B(i,le,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&B(i,ve,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&B(i,ce,this.onDblclick=this.dblclick.bind(this)),B(t.ownerDocument,fe,this.onCropMove=this.cropMove.bind(this)),B(t.ownerDocument,ue,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&B(window,pe,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;S(e.cropstart)&&z(t,Wt,e.cropstart),S(e.cropmove)&&z(t,Ht,e.cropmove),S(e.cropend)&&z(t,Pt,e.cropend),S(e.crop)&&z(t,zt,e.crop),S(e.zoom)&&z(t,Yt,e.zoom),z(i,le,this.onCropStart),e.zoomable&&e.zoomOnWheel&&z(i,ve,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&z(i,ce,this.onDblclick),z(t.ownerDocument,fe,this.onCropMove),z(t.ownerDocument,ue,this.onCropEnd),e.responsive&&z(window,pe,this.onResize)}},Xi={resize:function(){if(!this.disabled){var t=this.options,e=this.container,i=this.containerData,n=e.offsetWidth/i.width,r=e.offsetHeight/i.height,o=Math.abs(n-1)>Math.abs(r-1)?n:r;if(o!==1){var s,l;t.restore&&(s=this.getCanvasData(),l=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(C(s,function(f,h){s[h]=f*o})),this.setCropBoxData(C(l,function(f,h){l[h]=f*o})))}}},dblclick:function(){this.disabled||this.options.dragMode===Re||this.setDragMode(Mi(this.dragBox,Lt)?Ce:Jt)},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(b(e)&&e!==1||b(i)&&i!==0||t.ctrlKey))){var n=this.options,r=this.pointers,o;t.changedTouches?C(t.changedTouches,function(s){r[s.identifier]=Et(s)}):r[t.pointerId||0]=Et(t),Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?o=Te:o=Xt(t.target,gt),vi.test(o)&&ht(this.element,Wt,{originalEvent:t,action:o})!==!1&&(t.preventDefault(),this.action=o,this.cropping=!1,o===Me&&(this.cropping=!0,A(this.dragBox,Mt)))}},cropMove:function(t){var e=this.action;if(!(this.disabled||!e)){var i=this.pointers;t.preventDefault(),ht(this.element,Ht,{originalEvent:t,action:e})!==!1&&(t.changedTouches?C(t.changedTouches,function(n){D(i[n.identifier]||{},Et(n,!0))}):D(i[t.pointerId||0]||{},Et(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?C(t.changedTouches,function(n){delete i[n.identifier]}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,ot(this.dragBox,Mt,this.cropped&&this.options.modal)),ht(this.element,Pt,{originalEvent:t,action:e}))}}},Ui={change:function(t){var e=this.options,i=this.canvasData,n=this.containerData,r=this.cropBoxData,o=this.pointers,s=this.action,l=e.aspectRatio,f=r.left,h=r.top,c=r.width,u=r.height,v=f+c,g=h+u,_=0,m=0,x=n.width,T=n.height,O=!0,w;!l&&t.shiftKey&&(l=c&&u?c/u:1),this.limited&&(_=r.minLeft,m=r.minTop,x=_+Math.min(n.width,i.width,i.left+i.width),T=m+Math.min(n.height,i.height,i.top+i.height));var M=o[Object.keys(o)[0]],d={x:M.endX-M.startX,y:M.endY-M.startY},y=function(L){switch(L){case et:v+d.x>x&&(d.x=x-v);break;case it:f+d.x<_&&(d.x=_-f);break;case F:h+d.yT&&(d.y=T-g);break}};switch(s){case Zt:f+=d.x,h+=d.y;break;case et:if(d.x>=0&&(v>=x||l&&(h<=m||g>=T))){O=!1;break}y(et),c+=d.x,c<0&&(s=it,c=-c,f-=c),l&&(u=c/l,h+=(r.height-u)/2);break;case F:if(d.y<=0&&(h<=m||l&&(f<=_||v>=x))){O=!1;break}y(F),u-=d.y,h+=d.y,u<0&&(s=rt,u=-u,h-=u),l&&(c=u*l,f+=(r.width-c)/2);break;case it:if(d.x<=0&&(f<=_||l&&(h<=m||g>=T))){O=!1;break}y(it),c-=d.x,f+=d.x,c<0&&(s=et,c=-c,f-=c),l&&(u=c/l,h+=(r.height-u)/2);break;case rt:if(d.y>=0&&(g>=T||l&&(f<=_||v>=x))){O=!1;break}y(rt),u+=d.y,u<0&&(s=F,u=-u,h-=u),l&&(c=u*l,f+=(r.width-c)/2);break;case ft:if(l){if(d.y<=0&&(h<=m||v>=x)){O=!1;break}y(F),u-=d.y,h+=d.y,c=u*l}else y(F),y(et),d.x>=0?vm&&(u-=d.y,h+=d.y):(u-=d.y,h+=d.y);c<0&&u<0?(s=pt,u=-u,c=-c,h-=u,f-=c):c<0?(s=ut,c=-c,f-=c):u<0&&(s=dt,u=-u,h-=u);break;case ut:if(l){if(d.y<=0&&(h<=m||f<=_)){O=!1;break}y(F),u-=d.y,h+=d.y,c=u*l,f+=r.width-c}else y(F),y(it),d.x<=0?f>_?(c-=d.x,f+=d.x):d.y<=0&&h<=m&&(O=!1):(c-=d.x,f+=d.x),d.y<=0?h>m&&(u-=d.y,h+=d.y):(u-=d.y,h+=d.y);c<0&&u<0?(s=dt,u=-u,c=-c,h-=u,f-=c):c<0?(s=ft,c=-c,f-=c):u<0&&(s=pt,u=-u,h-=u);break;case pt:if(l){if(d.x<=0&&(f<=_||g>=T)){O=!1;break}y(it),c-=d.x,f+=d.x,u=c/l}else y(rt),y(it),d.x<=0?f>_?(c-=d.x,f+=d.x):d.y>=0&&g>=T&&(O=!1):(c-=d.x,f+=d.x),d.y>=0?g=0&&(v>=x||g>=T)){O=!1;break}y(et),c+=d.x,u=c/l}else y(rt),y(et),d.x>=0?v=0&&g>=T&&(O=!1):c+=d.x,d.y>=0?g0?s=d.y>0?dt:ft:d.x<0&&(f-=c,s=d.y>0?pt:ut),d.y<0&&(h-=u),this.cropped||(Y(this.cropBox,k),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}O&&(r.width=c,r.height=u,r.left=f,r.top=h,this.action=s,this.renderCropBox()),C(o,function(R){R.startX=R.endX,R.startY=R.endY})}},ji={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&A(this.dragBox,Mt),Y(this.cropBox,k),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=D({},this.initialImageData),this.canvasData=D({},this.initialCanvasData),this.cropBoxData=D({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(D(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Y(this.dragBox,Mt),A(this.cropBox,k)),this},replace:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,C(this.previews,function(i){i.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Y(this.cropper,se)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,A(this.cropper,se)),this},destroy:function(){var t=this.element;return t[E]?(t[E]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,n=i.left,r=i.top;return this.moveTo(St(t)?t:n+Number(t),St(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(b(t)&&(i.left=t,n=!0),b(e)&&(i.top=e,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(i.width*t/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var n=this.options,r=this.canvasData,o=r.width,s=r.height,l=r.naturalWidth,f=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var h=l*t,c=f*t;if(ht(this.element,Yt,{ratio:t,oldRatio:o/l,originalEvent:i})===!1)return this;if(i){var u=this.pointers,v=Le(this.cropper),g=u&&Object.keys(u).length?Ai(u):{pageX:i.pageX,pageY:i.pageY};r.left-=(h-o)*((g.pageX-v.left-r.left)/o),r.top-=(c-s)*((g.pageY-v.top-r.top)/s)}else nt(e)&&b(e.x)&&b(e.y)?(r.left-=(h-o)*((e.x-r.left)/o),r.top-=(c-s)*((e.y-r.top)/s)):(r.left-=(h-o)/2,r.top-=(c-s)/2);r.width=h,r.height=c,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),b(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,b(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(b(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.imageData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(b(t)&&(i.scaleX=t,n=!0),b(e)&&(i.scaleY=e,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.options,i=this.imageData,n=this.canvasData,r=this.cropBoxData,o;if(this.ready&&this.cropped){o={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var s=i.width/i.naturalWidth;if(C(o,function(h,c){o[c]=h/s}),t){var l=Math.round(o.y+o.height),f=Math.round(o.x+o.width);o.x=Math.round(o.x),o.y=Math.round(o.y),o.width=f-o.x,o.height=l-o.y}}else o={x:0,y:0,width:0,height:0};return e.rotatable&&(o.rotate=i.rotate||0),e.scalable&&(o.scaleX=i.scaleX||1,o.scaleY=i.scaleY||1),o},setData:function(t){var e=this.options,i=this.imageData,n=this.canvasData,r={};if(this.ready&&!this.disabled&&nt(t)){var o=!1;e.rotatable&&b(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,o=!0),e.scalable&&(b(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,o=!0),b(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var s=i.width/i.naturalWidth;b(t.x)&&(r.left=t.x*s+n.left),b(t.y)&&(r.top=t.y*s+n.top),b(t.width)&&(r.width=t.width*s),b(t.height)&&(r.height=t.height*s),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?D({},this.containerData):{}},getImageData:function(){return this.sized?D({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&C(["left","top","width","height","naturalWidth","naturalHeight"],function(i){e[i]=t[i]}),e},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&nt(t)&&(b(t.left)&&(e.left=t.left),b(t.top)&&(e.top=t.top),b(t.width)?(e.width=t.width,e.height=t.width/i):b(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,e;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(t){var e=this.cropBoxData,i=this.options.aspectRatio,n,r;return this.ready&&this.cropped&&!this.disabled&&nt(t)&&(b(t.left)&&(e.left=t.left),b(t.top)&&(e.top=t.top),b(t.width)&&t.width!==e.width&&(n=!0,e.width=t.width),b(t.height)&&t.height!==e.height&&(r=!0,e.height=t.height),i&&(n?e.height=e.width/i:r&&(e.width=e.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,i=Si(this.image,this.imageData,e,t);if(!this.cropped)return i;var n=this.getData(),r=n.x,o=n.y,s=n.width,l=n.height,f=i.width/Math.floor(e.naturalWidth);f!==1&&(r*=f,o*=f,s*=f,l*=f);var h=s/l,c=Q({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),u=Q({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),v=Q({aspectRatio:h,width:t.width||(f!==1?i.width:s),height:t.height||(f!==1?i.height:l)}),g=v.width,_=v.height;g=Math.min(c.width,Math.max(u.width,g)),_=Math.min(c.height,Math.max(u.height,_));var m=document.createElement("canvas"),x=m.getContext("2d");m.width=st(g),m.height=st(_),x.fillStyle=t.fillColor||"transparent",x.fillRect(0,0,g,_);var T=t.imageSmoothingEnabled,O=T===void 0?!0:T,w=t.imageSmoothingQuality;x.imageSmoothingEnabled=O,w&&(x.imageSmoothingQuality=w);var M=i.width,d=i.height,y=r,R=o,L,V,J,$,q,P;y<=-s||y>M?(y=0,L=0,J=0,q=0):y<=0?(J=-y,y=0,L=Math.min(M,s+y),q=L):y<=M&&(J=0,L=Math.min(s,M-y),q=L),L<=0||R<=-l||R>d?(R=0,V=0,$=0,P=0):R<=0?($=-R,R=0,V=Math.min(d,l+R),P=V):R<=d&&($=0,V=Math.min(l,d-R),P=V);var N=[y,R,L,V];if(q>0&&P>0){var tt=g/s;N.push(J*tt,$*tt,q*tt,P*tt)}return x.drawImage.apply(x,[i].concat(De(N.map(function(_t){return Math.floor(st(_t))})))),m},setAspectRatio:function(t){var e=this.options;return!this.disabled&&!St(t)&&(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,i=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var r=t===Jt,o=e.movable&&t===Ce;t=r||o?t:Re,e.dragMode=t,mt(i,gt,t),ot(i,Lt,r),ot(i,Bt,o),e.cropBoxMovable||(mt(n,gt,t),ot(n,Lt,r),ot(n,Bt,o))}return this}},Vi=X.Cropper,Gi=function(){function a(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ri(this,a),!t||!bi.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=D({},me,nt(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return ni(a,[{key:"init",value:function(){var e=this.element,i=e.tagName.toLowerCase(),n;if(!e[E]){if(e[E]=this,i==="img"){if(this.isImg=!0,n=e.getAttribute("src")||"",this.originalUrl=n,!n)return;n=e.src}else i==="canvas"&&window.HTMLCanvasElement&&(n=e.toDataURL());this.load(n)}}},{key:"load",value:function(e){var i=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(gi.test(e)){mi.test(e)?this.read(Li(e)):this.clone();return}var o=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=o,o.onabort=s,o.onerror=s,o.ontimeout=s,o.onprogress=function(){o.getResponseHeader("content-type")!==ge&&o.abort()},o.onload=function(){i.read(o.response)},o.onloadend=function(){i.reloading=!1,i.xhr=null},r.checkCrossOrigin&&we(e)&&n.crossOrigin&&(e=ye(e)),o.open("GET",e,!0),o.responseType="arraybuffer",o.withCredentials=n.crossOrigin==="use-credentials",o.send()}}},{key:"read",value:function(e){var i=this.options,n=this.imageData,r=zi(e),o=0,s=1,l=1;if(r>1){this.url=Bi(e,ge);var f=Pi(r);o=f.rotate,s=f.scaleX,l=f.scaleY}i.rotatable&&(n.rotate=o),i.scalable&&(n.scaleX=s,n.scaleY=l),this.clone()}},{key:"clone",value:function(){var e=this.element,i=this.url,n=e.crossOrigin,r=i;this.options.checkCrossOrigin&&we(i)&&(n||(n="anonymous"),r=ye(i)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||i,o.alt=e.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),A(o,he),e.parentNode.insertBefore(o,e.nextSibling)}},{key:"start",value:function(){var e=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var n=X.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(X.navigator.userAgent),r=function(f,h){D(e.imageData,{naturalWidth:f,naturalHeight:h,aspectRatio:f/h}),e.initialImageData=D({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(i.naturalWidth&&!n){r(i.naturalWidth,i.naturalHeight);return}var o=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||s.removeChild(o)},o.src=i.src,n||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(o))}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var e=this.element,i=this.options,n=this.image,r=e.parentNode,o=document.createElement("div");o.innerHTML=wi;var s=o.querySelector(".".concat(E,"-container")),l=s.querySelector(".".concat(E,"-canvas")),f=s.querySelector(".".concat(E,"-drag-box")),h=s.querySelector(".".concat(E,"-crop-box")),c=h.querySelector(".".concat(E,"-face"));this.container=r,this.cropper=s,this.canvas=l,this.dragBox=f,this.cropBox=h,this.viewBox=s.querySelector(".".concat(E,"-view-box")),this.face=c,l.appendChild(n),A(e,k),r.insertBefore(s,e.nextSibling),this.isImg||Y(n,he),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,A(h,k),i.guides||A(h.getElementsByClassName("".concat(E,"-dashed")),k),i.center||A(h.getElementsByClassName("".concat(E,"-center")),k),i.background&&A(s,"".concat(E,"-bg")),i.highlight||A(c,fi),i.cropBoxMovable&&(A(c,Bt),mt(c,gt,Zt)),i.cropBoxResizable||(A(h.getElementsByClassName("".concat(E,"-line")),k),A(h.getElementsByClassName("".concat(E,"-point")),k)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),S(i.ready)&&B(e,de,i.ready,{once:!0}),ht(e,de)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Y(this.element,k))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Vi,a}},{key:"setDefaults",value:function(e){D(me,nt(e)&&e)}}]),a}();D(Gi.prototype,Hi,Wi,Yi,Xi,Ui,ji);var ze=function(){if(typeof Map<"u")return Map;function a(t,e){var i=-1;return t.some(function(n,r){return n[0]===e?(i=r,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var i=a(this.__entries__,e),n=this.__entries__[i];return n&&n[1]},t.prototype.set=function(e,i){var n=a(this.__entries__,e);~n?this.__entries__[n][1]=i:this.__entries__.push([e,i])},t.prototype.delete=function(e){var i=this.__entries__,n=a(i,e);~n&&i.splice(n,1)},t.prototype.has=function(e){return!!~a(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,i){i===void 0&&(i=null);for(var n=0,r=this.__entries__;n0},a.prototype.connect_=function(){!Ut||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ji?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},a.prototype.disconnect_=function(){!Ut||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},a.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=e===void 0?"":e,n=Zi.some(function(r){return!!~i.indexOf(r)});n&&this.refresh()},a.getInstance=function(){return this.instance_||(this.instance_=new a),this.instance_},a.instance_=null,a}(),Pe=function(a,t){for(var e=0,i=Object.keys(t);e"u"||!(Element instanceof Object))){if(!(t instanceof lt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new sa(t)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof lt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(i){return new ha(i.target,i.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),We=typeof WeakMap<"u"?new WeakMap:new ze,Ye=function(){function a(t){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=$i.getInstance(),i=new ca(t,e,this);We.set(this,i)}return a}();["observe","unobserve","disconnect"].forEach(function(a){Ye.prototype[a]=function(){var t;return(t=We.get(this))[a].apply(t,arguments)}});var wa=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:Ye}();function xe(a){let t,e,i,n,r,o;const s=[fa,la],l=[];function f(h,c){return h[1]==="video"?0:1}return e=f(a),i=l[e]=s[e](a),{c(){t=ct("button"),i.c(),p(t,"class","svelte-425ent")},m(h,c){U(h,t,c),l[e].m(t,null),n=!0,r||(o=qe(t,"click",function(){Fe(a[1]==="image"?a[5]:a[6])&&(a[1]==="image"?a[5]:a[6]).apply(this,arguments)}),r=!0)},p(h,c){a=h;let u=e;e=f(a),e===u?l[e].p(a,c):(jt(),G(l[u],1,1,()=>{l[u]=null}),Vt(),i=l[e],i?i.p(a,c):(i=l[e]=s[e](a),i.c()),W(i,1),i.m(t,null))},i(h){n||(W(i),n=!0)},o(h){G(i),n=!1},d(h){h&&j(t),l[e].d(),r=!1,o()}}}function la(a){let t,e,i;return e=new Je({}),{c(){t=ct("div"),Gt(e.$$.fragment),p(t,"class","icon svelte-425ent")},m(n,r){U(n,t,r),qt(e,t,null),i=!0},p:I,i(n){i||(W(e.$$.fragment,n),i=!0)},o(n){G(e.$$.fragment,n),i=!1},d(n){n&&j(t),Ft(e)}}}function fa(a){let t,e,i,n;const r=[da,ua],o=[];function s(l,f){return l[4]?0:1}return t=s(a),e=o[t]=r[t](a),{c(){e.c(),i=Qe()},m(l,f){o[t].m(l,f),U(l,i,f),n=!0},p(l,f){let h=t;t=s(l),t!==h&&(jt(),G(o[h],1,1,()=>{o[h]=null}),Vt(),e=o[t],e||(e=o[t]=r[t](l),e.c()),W(e,1),e.m(i.parentNode,i))},i(l){n||(W(e),n=!0)},o(l){G(e),n=!1},d(l){l&&j(i),o[t].d(l)}}}function ua(a){let t,e,i;return e=new ti({}),{c(){t=ct("div"),Gt(e.$$.fragment),p(t,"class","icon svelte-425ent")},m(n,r){U(n,t,r),qt(e,t,null),i=!0},i(n){i||(W(e.$$.fragment,n),i=!0)},o(n){G(e.$$.fragment,n),i=!1},d(n){n&&j(t),Ft(e)}}}function da(a){let t,e,i;return e=new ii({}),{c(){t=ct("div"),Gt(e.$$.fragment),p(t,"class","icon svelte-425ent")},m(n,r){U(n,t,r),qt(e,t,null),i=!0},i(n){i||(W(e.$$.fragment,n),i=!0)},o(n){G(e.$$.fragment,n),i=!1},d(n){n&&j(t),Ft(e)}}}function pa(a){let t,e,i,n,r=!a[0]&&xe(a);return{c(){t=ct("div"),e=ct("video"),i=je(),r&&r.c(),p(e,"class","svelte-425ent"),re(e,"flip",a[2]),p(t,"class","wrap svelte-425ent")},m(o,s){U(o,t,s),Z(t,e),a[9](e),Z(t,i),r&&r.m(t,null),n=!0},p(o,[s]){(!n||s&4)&&re(e,"flip",o[2]),o[0]?r&&(jt(),G(r,1,1,()=>{r=null}),Vt()):r?(r.p(o,s),s&1&&W(r,1)):(r=xe(o),r.c(),W(r,1),r.m(t,null))},i(o){n||(W(r),n=!0)},o(o){G(r),n=!1},d(o){o&&j(t),a[9](null),r&&r.d()}}}function va(a,t,e){let i,n,{streaming:r=!1}=t,{pending:o=!1}=t,{mode:s="image"}=t,{mirror_webcam:l}=t,{include_audio:f}=t;const h=Ve();Ge(()=>n=document.createElement("canvas"));async function c(){try{_=await navigator.mediaDevices.getUserMedia({video:!0,audio:f}),e(3,i.srcObject=_,i),e(3,i.muted=!0,i),i.play()}catch(w){if(w instanceof DOMException&&w.name=="NotAllowedError")return h("error","Please allow access to the webcam for recording."),null;throw w}}function u(){var w=n.getContext("2d");if(i.videoWidth&&i.videoHeight){n.width=i.videoWidth,n.height=i.videoHeight,w.drawImage(i,0,0,i.videoWidth,i.videoHeight);var M=n.toDataURL("image/png");h(r?"stream":"capture",M)}}let v=!1,g=[],_,m,x;function T(){if(v){x.stop();let w=new Blob(g,{type:m}),M=new FileReader;M.onload=function(d){d.target&&(h("capture",{data:d.target.result,name:"sample."+m.substring(6),is_example:!1}),h("stop_recording"))},M.readAsDataURL(w)}else{h("start_recording"),g=[];let w=["video/webm","video/mp4"];for(let M of w)if(MediaRecorder.isTypeSupported(M)){m=M;break}if(m===null){console.error("No supported MediaRecorder mimeType");return}x=new MediaRecorder(_,{mimeType:m}),x.addEventListener("dataavailable",function(M){g.push(M.data)}),x.start(200)}e(4,v=!v)}c(),r&&s==="image"&&window.setInterval(()=>{i&&!o&&u()},500);function O(w){Ke[w?"unshift":"push"](()=>{i=w,e(3,i)})}return a.$$set=w=>{"streaming"in w&&e(0,r=w.streaming),"pending"in w&&e(7,o=w.pending),"mode"in w&&e(1,s=w.mode),"mirror_webcam"in w&&e(2,l=w.mirror_webcam),"include_audio"in w&&e(8,f=w.include_audio)},[r,s,l,i,v,u,T,o,f,O]}class ya extends bt{constructor(t){super(),wt(this,t,va,pa,yt,{streaming:0,pending:7,mode:1,mirror_webcam:2,include_audio:8})}}export{Gi as C,ba as U,ya as W,wa as i}; +//# sourceMappingURL=StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js.map diff --git a/gradio/templates/cdn/assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js.map b/gradio/templates/cdn/assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js.map new file mode 100644 index 0000000000000000000000000000000000000000..fbefaf5722cc17ff2e496df75306f0ef6ad08ef3 --- /dev/null +++ b/gradio/templates/cdn/assets/StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js","sources":["../../../../js/icons/src/Camera.svelte","../../../../js/icons/src/Circle.svelte","../../../../js/icons/src/Square.svelte","../../../../js/icons/src/Undo.svelte","../../../../node_modules/.pnpm/cropperjs@1.5.12/node_modules/cropperjs/dist/cropper.esm.js","../../../../node_modules/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","../../../../js/image/src/Webcam.svelte"],"sourcesContent":["\n\t\n\t\n\n","\n\t\n\n","\n\t\n\n","\n\t\n\t\n\n","/*!\n * Cropper.js v1.5.12\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2021-06-12T08:00:17.411Z\n */\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nvar WINDOW = IS_BROWSER ? window : {};\nvar IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false;\nvar HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;\nvar NAMESPACE = 'cropper'; // Actions\n\nvar ACTION_ALL = 'all';\nvar ACTION_CROP = 'crop';\nvar ACTION_MOVE = 'move';\nvar ACTION_ZOOM = 'zoom';\nvar ACTION_EAST = 'e';\nvar ACTION_WEST = 'w';\nvar ACTION_SOUTH = 's';\nvar ACTION_NORTH = 'n';\nvar ACTION_NORTH_EAST = 'ne';\nvar ACTION_NORTH_WEST = 'nw';\nvar ACTION_SOUTH_EAST = 'se';\nvar ACTION_SOUTH_WEST = 'sw'; // Classes\n\nvar CLASS_CROP = \"\".concat(NAMESPACE, \"-crop\");\nvar CLASS_DISABLED = \"\".concat(NAMESPACE, \"-disabled\");\nvar CLASS_HIDDEN = \"\".concat(NAMESPACE, \"-hidden\");\nvar CLASS_HIDE = \"\".concat(NAMESPACE, \"-hide\");\nvar CLASS_INVISIBLE = \"\".concat(NAMESPACE, \"-invisible\");\nvar CLASS_MODAL = \"\".concat(NAMESPACE, \"-modal\");\nvar CLASS_MOVE = \"\".concat(NAMESPACE, \"-move\"); // Data keys\n\nvar DATA_ACTION = \"\".concat(NAMESPACE, \"Action\");\nvar DATA_PREVIEW = \"\".concat(NAMESPACE, \"Preview\"); // Drag modes\n\nvar DRAG_MODE_CROP = 'crop';\nvar DRAG_MODE_MOVE = 'move';\nvar DRAG_MODE_NONE = 'none'; // Events\n\nvar EVENT_CROP = 'crop';\nvar EVENT_CROP_END = 'cropend';\nvar EVENT_CROP_MOVE = 'cropmove';\nvar EVENT_CROP_START = 'cropstart';\nvar EVENT_DBLCLICK = 'dblclick';\nvar EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';\nvar EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';\nvar EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';\nvar EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;\nvar EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;\nvar EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;\nvar EVENT_READY = 'ready';\nvar EVENT_RESIZE = 'resize';\nvar EVENT_WHEEL = 'wheel';\nvar EVENT_ZOOM = 'zoom'; // Mime types\n\nvar MIME_TYPE_JPEG = 'image/jpeg'; // RegExps\n\nvar REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;\nvar REGEXP_DATA_URL = /^data:/;\nvar REGEXP_DATA_URL_JPEG = /^data:image\\/jpeg;base64,/;\nvar REGEXP_TAG_NAME = /^img|canvas$/i; // Misc\n// Inspired by the default width and height of a canvas element.\n\nvar MIN_CONTAINER_WIDTH = 200;\nvar MIN_CONTAINER_HEIGHT = 100;\n\nvar DEFAULTS = {\n // Define the view mode of the cropper\n viewMode: 0,\n // 0, 1, 2, 3\n // Define the dragging mode of the cropper\n dragMode: DRAG_MODE_CROP,\n // 'crop', 'move' or 'none'\n // Define the initial aspect ratio of the crop box\n initialAspectRatio: NaN,\n // Define the aspect ratio of the crop box\n aspectRatio: NaN,\n // An object with the previous cropping result data\n data: null,\n // A selector for adding extra containers to preview\n preview: '',\n // Re-render the cropper when resize the window\n responsive: true,\n // Restore the cropped area after resize the window\n restore: true,\n // Check if the current image is a cross-origin image\n checkCrossOrigin: true,\n // Check the current image's Exif Orientation information\n checkOrientation: true,\n // Show the black modal\n modal: true,\n // Show the dashed lines for guiding\n guides: true,\n // Show the center indicator for guiding\n center: true,\n // Show the white modal to highlight the crop box\n highlight: true,\n // Show the grid background\n background: true,\n // Enable to crop the image automatically when initialize\n autoCrop: true,\n // Define the percentage of automatic cropping area when initializes\n autoCropArea: 0.8,\n // Enable to move the image\n movable: true,\n // Enable to rotate the image\n rotatable: true,\n // Enable to scale the image\n scalable: true,\n // Enable to zoom the image\n zoomable: true,\n // Enable to zoom the image by dragging touch\n zoomOnTouch: true,\n // Enable to zoom the image by wheeling mouse\n zoomOnWheel: true,\n // Define zoom ratio when zoom the image by wheeling mouse\n wheelZoomRatio: 0.1,\n // Enable to move the crop box\n cropBoxMovable: true,\n // Enable to resize the crop box\n cropBoxResizable: true,\n // Toggle drag mode between \"crop\" and \"move\" when click twice on the cropper\n toggleDragModeOnDblclick: true,\n // Size limitation\n minCanvasWidth: 0,\n minCanvasHeight: 0,\n minCropBoxWidth: 0,\n minCropBoxHeight: 0,\n minContainerWidth: MIN_CONTAINER_WIDTH,\n minContainerHeight: MIN_CONTAINER_HEIGHT,\n // Shortcuts of events\n ready: null,\n cropstart: null,\n cropmove: null,\n cropend: null,\n crop: null,\n zoom: null\n};\n\nvar TEMPLATE = '
' + '
' + '
' + '
' + '
' + '
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
' + '
';\n\n/**\n * Check if the given value is not a number.\n */\n\nvar isNaN = Number.isNaN || WINDOW.isNaN;\n/**\n * Check if the given value is a number.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a number, else `false`.\n */\n\nfunction isNumber(value) {\n return typeof value === 'number' && !isNaN(value);\n}\n/**\n * Check if the given value is a positive number.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.\n */\n\nvar isPositiveNumber = function isPositiveNumber(value) {\n return value > 0 && value < Infinity;\n};\n/**\n * Check if the given value is undefined.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is undefined, else `false`.\n */\n\nfunction isUndefined(value) {\n return typeof value === 'undefined';\n}\n/**\n * Check if the given value is an object.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is an object, else `false`.\n */\n\nfunction isObject(value) {\n return _typeof(value) === 'object' && value !== null;\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/**\n * Check if the given value is a plain object.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.\n */\n\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n try {\n var _constructor = value.constructor;\n var prototype = _constructor.prototype;\n return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');\n } catch (error) {\n return false;\n }\n}\n/**\n * Check if the given value is a function.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a function, else `false`.\n */\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nvar slice = Array.prototype.slice;\n/**\n * Convert array-like or iterable object to an array.\n * @param {*} value - The value to convert.\n * @returns {Array} Returns a new array.\n */\n\nfunction toArray(value) {\n return Array.from ? Array.from(value) : slice.call(value);\n}\n/**\n * Iterate the given data.\n * @param {*} data - The data to iterate.\n * @param {Function} callback - The process function for each element.\n * @returns {*} The original data.\n */\n\nfunction forEach(data, callback) {\n if (data && isFunction(callback)) {\n if (Array.isArray(data) || isNumber(data.length)\n /* array-like */\n ) {\n toArray(data).forEach(function (value, key) {\n callback.call(data, value, key, data);\n });\n } else if (isObject(data)) {\n Object.keys(data).forEach(function (key) {\n callback.call(data, data[key], key, data);\n });\n }\n }\n\n return data;\n}\n/**\n * Extend the given object.\n * @param {*} target - The target object to extend.\n * @param {*} args - The rest objects for merging to the target object.\n * @returns {Object} The extended object.\n */\n\nvar assign = Object.assign || function assign(target) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (isObject(target) && args.length > 0) {\n args.forEach(function (arg) {\n if (isObject(arg)) {\n Object.keys(arg).forEach(function (key) {\n target[key] = arg[key];\n });\n }\n });\n }\n\n return target;\n};\nvar REGEXP_DECIMALS = /\\.\\d*(?:0|9){12}\\d*$/;\n/**\n * Normalize decimal number.\n * Check out {@link https://0.30000000000000004.com/}\n * @param {number} value - The value to normalize.\n * @param {number} [times=100000000000] - The times for normalizing.\n * @returns {number} Returns the normalized number.\n */\n\nfunction normalizeDecimalNumber(value) {\n var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;\n return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;\n}\nvar REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;\n/**\n * Apply styles to the given element.\n * @param {Element} element - The target element.\n * @param {Object} styles - The styles for applying.\n */\n\nfunction setStyle(element, styles) {\n var style = element.style;\n forEach(styles, function (value, property) {\n if (REGEXP_SUFFIX.test(property) && isNumber(value)) {\n value = \"\".concat(value, \"px\");\n }\n\n style[property] = value;\n });\n}\n/**\n * Check if the given element has a special class.\n * @param {Element} element - The element to check.\n * @param {string} value - The class to search.\n * @returns {boolean} Returns `true` if the special class was found.\n */\n\nfunction hasClass(element, value) {\n return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;\n}\n/**\n * Add classes to the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be added.\n */\n\nfunction addClass(element, value) {\n if (!value) {\n return;\n }\n\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n addClass(elem, value);\n });\n return;\n }\n\n if (element.classList) {\n element.classList.add(value);\n return;\n }\n\n var className = element.className.trim();\n\n if (!className) {\n element.className = value;\n } else if (className.indexOf(value) < 0) {\n element.className = \"\".concat(className, \" \").concat(value);\n }\n}\n/**\n * Remove classes from the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be removed.\n */\n\nfunction removeClass(element, value) {\n if (!value) {\n return;\n }\n\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n removeClass(elem, value);\n });\n return;\n }\n\n if (element.classList) {\n element.classList.remove(value);\n return;\n }\n\n if (element.className.indexOf(value) >= 0) {\n element.className = element.className.replace(value, '');\n }\n}\n/**\n * Add or remove classes from the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be toggled.\n * @param {boolean} added - Add only.\n */\n\nfunction toggleClass(element, value, added) {\n if (!value) {\n return;\n }\n\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n toggleClass(elem, value, added);\n });\n return;\n } // IE10-11 doesn't support the second parameter of `classList.toggle`\n\n\n if (added) {\n addClass(element, value);\n } else {\n removeClass(element, value);\n }\n}\nvar REGEXP_CAMEL_CASE = /([a-z\\d])([A-Z])/g;\n/**\n * Transform the given string from camelCase to kebab-case\n * @param {string} value - The value to transform.\n * @returns {string} The transformed value.\n */\n\nfunction toParamCase(value) {\n return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();\n}\n/**\n * Get data from the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to get.\n * @returns {string} The data value.\n */\n\nfunction getData(element, name) {\n if (isObject(element[name])) {\n return element[name];\n }\n\n if (element.dataset) {\n return element.dataset[name];\n }\n\n return element.getAttribute(\"data-\".concat(toParamCase(name)));\n}\n/**\n * Set data to the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to set.\n * @param {string} data - The data value.\n */\n\nfunction setData(element, name, data) {\n if (isObject(data)) {\n element[name] = data;\n } else if (element.dataset) {\n element.dataset[name] = data;\n } else {\n element.setAttribute(\"data-\".concat(toParamCase(name)), data);\n }\n}\n/**\n * Remove data from the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to remove.\n */\n\nfunction removeData(element, name) {\n if (isObject(element[name])) {\n try {\n delete element[name];\n } catch (error) {\n element[name] = undefined;\n }\n } else if (element.dataset) {\n // #128 Safari not allows to delete dataset property\n try {\n delete element.dataset[name];\n } catch (error) {\n element.dataset[name] = undefined;\n }\n } else {\n element.removeAttribute(\"data-\".concat(toParamCase(name)));\n }\n}\nvar REGEXP_SPACES = /\\s\\s*/;\n\nvar onceSupported = function () {\n var supported = false;\n\n if (IS_BROWSER) {\n var once = false;\n\n var listener = function listener() {};\n\n var options = Object.defineProperty({}, 'once', {\n get: function get() {\n supported = true;\n return once;\n },\n\n /**\n * This setter can fix a `TypeError` in strict mode\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}\n * @param {boolean} value - The value to set\n */\n set: function set(value) {\n once = value;\n }\n });\n WINDOW.addEventListener('test', listener, options);\n WINDOW.removeEventListener('test', listener, options);\n }\n\n return supported;\n}();\n/**\n * Remove event listener from the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Function} listener - The event listener.\n * @param {Object} options - The event options.\n */\n\n\nfunction removeListener(element, type, listener) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var handler = listener;\n type.trim().split(REGEXP_SPACES).forEach(function (event) {\n if (!onceSupported) {\n var listeners = element.listeners;\n\n if (listeners && listeners[event] && listeners[event][listener]) {\n handler = listeners[event][listener];\n delete listeners[event][listener];\n\n if (Object.keys(listeners[event]).length === 0) {\n delete listeners[event];\n }\n\n if (Object.keys(listeners).length === 0) {\n delete element.listeners;\n }\n }\n }\n\n element.removeEventListener(event, handler, options);\n });\n}\n/**\n * Add event listener to the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Function} listener - The event listener.\n * @param {Object} options - The event options.\n */\n\nfunction addListener(element, type, listener) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var _handler = listener;\n type.trim().split(REGEXP_SPACES).forEach(function (event) {\n if (options.once && !onceSupported) {\n var _element$listeners = element.listeners,\n listeners = _element$listeners === void 0 ? {} : _element$listeners;\n\n _handler = function handler() {\n delete listeners[event][listener];\n element.removeEventListener(event, _handler, options);\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n listener.apply(element, args);\n };\n\n if (!listeners[event]) {\n listeners[event] = {};\n }\n\n if (listeners[event][listener]) {\n element.removeEventListener(event, listeners[event][listener], options);\n }\n\n listeners[event][listener] = _handler;\n element.listeners = listeners;\n }\n\n element.addEventListener(event, _handler, options);\n });\n}\n/**\n * Dispatch event on the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Object} data - The additional event data.\n * @returns {boolean} Indicate if the event is default prevented or not.\n */\n\nfunction dispatchEvent(element, type, data) {\n var event; // Event and CustomEvent on IE9-11 are global objects, not constructors\n\n if (isFunction(Event) && isFunction(CustomEvent)) {\n event = new CustomEvent(type, {\n detail: data,\n bubbles: true,\n cancelable: true\n });\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(type, true, true, data);\n }\n\n return element.dispatchEvent(event);\n}\n/**\n * Get the offset base on the document.\n * @param {Element} element - The target element.\n * @returns {Object} The offset data.\n */\n\nfunction getOffset(element) {\n var box = element.getBoundingClientRect();\n return {\n left: box.left + (window.pageXOffset - document.documentElement.clientLeft),\n top: box.top + (window.pageYOffset - document.documentElement.clientTop)\n };\n}\nvar location = WINDOW.location;\nvar REGEXP_ORIGINS = /^(\\w+:)\\/\\/([^:/?#]*):?(\\d*)/i;\n/**\n * Check if the given URL is a cross origin URL.\n * @param {string} url - The target URL.\n * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.\n */\n\nfunction isCrossOriginURL(url) {\n var parts = url.match(REGEXP_ORIGINS);\n return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);\n}\n/**\n * Add timestamp to the given URL.\n * @param {string} url - The target URL.\n * @returns {string} The result URL.\n */\n\nfunction addTimestamp(url) {\n var timestamp = \"timestamp=\".concat(new Date().getTime());\n return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;\n}\n/**\n * Get transforms base on the given object.\n * @param {Object} obj - The target object.\n * @returns {string} A string contains transform values.\n */\n\nfunction getTransforms(_ref) {\n var rotate = _ref.rotate,\n scaleX = _ref.scaleX,\n scaleY = _ref.scaleY,\n translateX = _ref.translateX,\n translateY = _ref.translateY;\n var values = [];\n\n if (isNumber(translateX) && translateX !== 0) {\n values.push(\"translateX(\".concat(translateX, \"px)\"));\n }\n\n if (isNumber(translateY) && translateY !== 0) {\n values.push(\"translateY(\".concat(translateY, \"px)\"));\n } // Rotate should come first before scale to match orientation transform\n\n\n if (isNumber(rotate) && rotate !== 0) {\n values.push(\"rotate(\".concat(rotate, \"deg)\"));\n }\n\n if (isNumber(scaleX) && scaleX !== 1) {\n values.push(\"scaleX(\".concat(scaleX, \")\"));\n }\n\n if (isNumber(scaleY) && scaleY !== 1) {\n values.push(\"scaleY(\".concat(scaleY, \")\"));\n }\n\n var transform = values.length ? values.join(' ') : 'none';\n return {\n WebkitTransform: transform,\n msTransform: transform,\n transform: transform\n };\n}\n/**\n * Get the max ratio of a group of pointers.\n * @param {string} pointers - The target pointers.\n * @returns {number} The result ratio.\n */\n\nfunction getMaxZoomRatio(pointers) {\n var pointers2 = _objectSpread2({}, pointers);\n\n var maxRatio = 0;\n forEach(pointers, function (pointer, pointerId) {\n delete pointers2[pointerId];\n forEach(pointers2, function (pointer2) {\n var x1 = Math.abs(pointer.startX - pointer2.startX);\n var y1 = Math.abs(pointer.startY - pointer2.startY);\n var x2 = Math.abs(pointer.endX - pointer2.endX);\n var y2 = Math.abs(pointer.endY - pointer2.endY);\n var z1 = Math.sqrt(x1 * x1 + y1 * y1);\n var z2 = Math.sqrt(x2 * x2 + y2 * y2);\n var ratio = (z2 - z1) / z1;\n\n if (Math.abs(ratio) > Math.abs(maxRatio)) {\n maxRatio = ratio;\n }\n });\n });\n return maxRatio;\n}\n/**\n * Get a pointer from an event object.\n * @param {Object} event - The target event object.\n * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.\n * @returns {Object} The result pointer contains start and/or end point coordinates.\n */\n\nfunction getPointer(_ref2, endOnly) {\n var pageX = _ref2.pageX,\n pageY = _ref2.pageY;\n var end = {\n endX: pageX,\n endY: pageY\n };\n return endOnly ? end : _objectSpread2({\n startX: pageX,\n startY: pageY\n }, end);\n}\n/**\n * Get the center point coordinate of a group of pointers.\n * @param {Object} pointers - The target pointers.\n * @returns {Object} The center point coordinate.\n */\n\nfunction getPointersCenter(pointers) {\n var pageX = 0;\n var pageY = 0;\n var count = 0;\n forEach(pointers, function (_ref3) {\n var startX = _ref3.startX,\n startY = _ref3.startY;\n pageX += startX;\n pageY += startY;\n count += 1;\n });\n pageX /= count;\n pageY /= count;\n return {\n pageX: pageX,\n pageY: pageY\n };\n}\n/**\n * Get the max sizes in a rectangle under the given aspect ratio.\n * @param {Object} data - The original sizes.\n * @param {string} [type='contain'] - The adjust type.\n * @returns {Object} The result sizes.\n */\n\nfunction getAdjustedSizes(_ref4) // or 'cover'\n{\n var aspectRatio = _ref4.aspectRatio,\n height = _ref4.height,\n width = _ref4.width;\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain';\n var isValidWidth = isPositiveNumber(width);\n var isValidHeight = isPositiveNumber(height);\n\n if (isValidWidth && isValidHeight) {\n var adjustedWidth = height * aspectRatio;\n\n if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {\n height = width / aspectRatio;\n } else {\n width = height * aspectRatio;\n }\n } else if (isValidWidth) {\n height = width / aspectRatio;\n } else if (isValidHeight) {\n width = height * aspectRatio;\n }\n\n return {\n width: width,\n height: height\n };\n}\n/**\n * Get the new sizes of a rectangle after rotated.\n * @param {Object} data - The original sizes.\n * @returns {Object} The result sizes.\n */\n\nfunction getRotatedSizes(_ref5) {\n var width = _ref5.width,\n height = _ref5.height,\n degree = _ref5.degree;\n degree = Math.abs(degree) % 180;\n\n if (degree === 90) {\n return {\n width: height,\n height: width\n };\n }\n\n var arc = degree % 90 * Math.PI / 180;\n var sinArc = Math.sin(arc);\n var cosArc = Math.cos(arc);\n var newWidth = width * cosArc + height * sinArc;\n var newHeight = width * sinArc + height * cosArc;\n return degree > 90 ? {\n width: newHeight,\n height: newWidth\n } : {\n width: newWidth,\n height: newHeight\n };\n}\n/**\n * Get a canvas which drew the given image.\n * @param {HTMLImageElement} image - The image for drawing.\n * @param {Object} imageData - The image data.\n * @param {Object} canvasData - The canvas data.\n * @param {Object} options - The options.\n * @returns {HTMLCanvasElement} The result canvas.\n */\n\nfunction getSourceCanvas(image, _ref6, _ref7, _ref8) {\n var imageAspectRatio = _ref6.aspectRatio,\n imageNaturalWidth = _ref6.naturalWidth,\n imageNaturalHeight = _ref6.naturalHeight,\n _ref6$rotate = _ref6.rotate,\n rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate,\n _ref6$scaleX = _ref6.scaleX,\n scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX,\n _ref6$scaleY = _ref6.scaleY,\n scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;\n var aspectRatio = _ref7.aspectRatio,\n naturalWidth = _ref7.naturalWidth,\n naturalHeight = _ref7.naturalHeight;\n var _ref8$fillColor = _ref8.fillColor,\n fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor,\n _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,\n imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE,\n _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,\n imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ,\n _ref8$maxWidth = _ref8.maxWidth,\n maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth,\n _ref8$maxHeight = _ref8.maxHeight,\n maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight,\n _ref8$minWidth = _ref8.minWidth,\n minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth,\n _ref8$minHeight = _ref8.minHeight,\n minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var maxSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: maxWidth,\n height: maxHeight\n });\n var minSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: minWidth,\n height: minHeight\n }, 'cover');\n var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));\n var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as\n // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90\n\n var destMaxSizes = getAdjustedSizes({\n aspectRatio: imageAspectRatio,\n width: maxWidth,\n height: maxHeight\n });\n var destMinSizes = getAdjustedSizes({\n aspectRatio: imageAspectRatio,\n width: minWidth,\n height: minHeight\n }, 'cover');\n var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));\n var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));\n var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];\n canvas.width = normalizeDecimalNumber(width);\n canvas.height = normalizeDecimalNumber(height);\n context.fillStyle = fillColor;\n context.fillRect(0, 0, width, height);\n context.save();\n context.translate(width / 2, height / 2);\n context.rotate(rotate * Math.PI / 180);\n context.scale(scaleX, scaleY);\n context.imageSmoothingEnabled = imageSmoothingEnabled;\n context.imageSmoothingQuality = imageSmoothingQuality;\n context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) {\n return Math.floor(normalizeDecimalNumber(param));\n }))));\n context.restore();\n return canvas;\n}\nvar fromCharCode = String.fromCharCode;\n/**\n * Get string from char code in data view.\n * @param {DataView} dataView - The data view for read.\n * @param {number} start - The start index.\n * @param {number} length - The read length.\n * @returns {string} The read result.\n */\n\nfunction getStringFromCharCode(dataView, start, length) {\n var str = '';\n length += start;\n\n for (var i = start; i < length; i += 1) {\n str += fromCharCode(dataView.getUint8(i));\n }\n\n return str;\n}\nvar REGEXP_DATA_URL_HEAD = /^data:.*,/;\n/**\n * Transform Data URL to array buffer.\n * @param {string} dataURL - The Data URL to transform.\n * @returns {ArrayBuffer} The result array buffer.\n */\n\nfunction dataURLToArrayBuffer(dataURL) {\n var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');\n var binary = atob(base64);\n var arrayBuffer = new ArrayBuffer(binary.length);\n var uint8 = new Uint8Array(arrayBuffer);\n forEach(uint8, function (value, i) {\n uint8[i] = binary.charCodeAt(i);\n });\n return arrayBuffer;\n}\n/**\n * Transform array buffer to Data URL.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.\n * @param {string} mimeType - The mime type of the Data URL.\n * @returns {string} The result Data URL.\n */\n\nfunction arrayBufferToDataURL(arrayBuffer, mimeType) {\n var chunks = []; // Chunk Typed Array for better performance (#435)\n\n var chunkSize = 8192;\n var uint8 = new Uint8Array(arrayBuffer);\n\n while (uint8.length > 0) {\n // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9\n // eslint-disable-next-line prefer-spread\n chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));\n uint8 = uint8.subarray(chunkSize);\n }\n\n return \"data:\".concat(mimeType, \";base64,\").concat(btoa(chunks.join('')));\n}\n/**\n * Get orientation value from given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to read.\n * @returns {number} The read orientation value.\n */\n\nfunction resetAndGetOrientation(arrayBuffer) {\n var dataView = new DataView(arrayBuffer);\n var orientation; // Ignores range error when the image does not have correct Exif information\n\n try {\n var littleEndian;\n var app1Start;\n var ifdStart; // Only handle JPEG image (start by 0xFFD8)\n\n if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {\n var length = dataView.byteLength;\n var offset = 2;\n\n while (offset + 1 < length) {\n if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {\n app1Start = offset;\n break;\n }\n\n offset += 1;\n }\n }\n\n if (app1Start) {\n var exifIDCode = app1Start + 4;\n var tiffOffset = app1Start + 10;\n\n if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {\n var endianness = dataView.getUint16(tiffOffset);\n littleEndian = endianness === 0x4949;\n\n if (littleEndian || endianness === 0x4D4D\n /* bigEndian */\n ) {\n if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {\n var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);\n\n if (firstIFDOffset >= 0x00000008) {\n ifdStart = tiffOffset + firstIFDOffset;\n }\n }\n }\n }\n }\n\n if (ifdStart) {\n var _length = dataView.getUint16(ifdStart, littleEndian);\n\n var _offset;\n\n var i;\n\n for (i = 0; i < _length; i += 1) {\n _offset = ifdStart + i * 12 + 2;\n\n if (dataView.getUint16(_offset, littleEndian) === 0x0112\n /* Orientation */\n ) {\n // 8 is the offset of the current tag's value\n _offset += 8; // Get the original orientation value\n\n orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value\n\n dataView.setUint16(_offset, 1, littleEndian);\n break;\n }\n }\n }\n } catch (error) {\n orientation = 1;\n }\n\n return orientation;\n}\n/**\n * Parse Exif Orientation value.\n * @param {number} orientation - The orientation to parse.\n * @returns {Object} The parsed result.\n */\n\nfunction parseOrientation(orientation) {\n var rotate = 0;\n var scaleX = 1;\n var scaleY = 1;\n\n switch (orientation) {\n // Flip horizontal\n case 2:\n scaleX = -1;\n break;\n // Rotate left 180°\n\n case 3:\n rotate = -180;\n break;\n // Flip vertical\n\n case 4:\n scaleY = -1;\n break;\n // Flip vertical and rotate right 90°\n\n case 5:\n rotate = 90;\n scaleY = -1;\n break;\n // Rotate right 90°\n\n case 6:\n rotate = 90;\n break;\n // Flip horizontal and rotate right 90°\n\n case 7:\n rotate = 90;\n scaleX = -1;\n break;\n // Rotate left 90°\n\n case 8:\n rotate = -90;\n break;\n }\n\n return {\n rotate: rotate,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n\nvar render = {\n render: function render() {\n this.initContainer();\n this.initCanvas();\n this.initCropBox();\n this.renderCanvas();\n\n if (this.cropped) {\n this.renderCropBox();\n }\n },\n initContainer: function initContainer() {\n var element = this.element,\n options = this.options,\n container = this.container,\n cropper = this.cropper;\n var minWidth = Number(options.minContainerWidth);\n var minHeight = Number(options.minContainerHeight);\n addClass(cropper, CLASS_HIDDEN);\n removeClass(element, CLASS_HIDDEN);\n var containerData = {\n width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH),\n height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT)\n };\n this.containerData = containerData;\n setStyle(cropper, {\n width: containerData.width,\n height: containerData.height\n });\n addClass(element, CLASS_HIDDEN);\n removeClass(cropper, CLASS_HIDDEN);\n },\n // Canvas (image wrapper)\n initCanvas: function initCanvas() {\n var containerData = this.containerData,\n imageData = this.imageData;\n var viewMode = this.options.viewMode;\n var rotated = Math.abs(imageData.rotate) % 180 === 90;\n var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;\n var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;\n var aspectRatio = naturalWidth / naturalHeight;\n var canvasWidth = containerData.width;\n var canvasHeight = containerData.height;\n\n if (containerData.height * aspectRatio > containerData.width) {\n if (viewMode === 3) {\n canvasWidth = containerData.height * aspectRatio;\n } else {\n canvasHeight = containerData.width / aspectRatio;\n }\n } else if (viewMode === 3) {\n canvasHeight = containerData.width / aspectRatio;\n } else {\n canvasWidth = containerData.height * aspectRatio;\n }\n\n var canvasData = {\n aspectRatio: aspectRatio,\n naturalWidth: naturalWidth,\n naturalHeight: naturalHeight,\n width: canvasWidth,\n height: canvasHeight\n };\n this.canvasData = canvasData;\n this.limited = viewMode === 1 || viewMode === 2;\n this.limitCanvas(true, true);\n canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);\n canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);\n canvasData.left = (containerData.width - canvasData.width) / 2;\n canvasData.top = (containerData.height - canvasData.height) / 2;\n canvasData.oldLeft = canvasData.left;\n canvasData.oldTop = canvasData.top;\n this.initialCanvasData = assign({}, canvasData);\n },\n limitCanvas: function limitCanvas(sizeLimited, positionLimited) {\n var options = this.options,\n containerData = this.containerData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData;\n var viewMode = options.viewMode;\n var aspectRatio = canvasData.aspectRatio;\n var cropped = this.cropped && cropBoxData;\n\n if (sizeLimited) {\n var minCanvasWidth = Number(options.minCanvasWidth) || 0;\n var minCanvasHeight = Number(options.minCanvasHeight) || 0;\n\n if (viewMode > 1) {\n minCanvasWidth = Math.max(minCanvasWidth, containerData.width);\n minCanvasHeight = Math.max(minCanvasHeight, containerData.height);\n\n if (viewMode === 3) {\n if (minCanvasHeight * aspectRatio > minCanvasWidth) {\n minCanvasWidth = minCanvasHeight * aspectRatio;\n } else {\n minCanvasHeight = minCanvasWidth / aspectRatio;\n }\n }\n } else if (viewMode > 0) {\n if (minCanvasWidth) {\n minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);\n } else if (minCanvasHeight) {\n minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);\n } else if (cropped) {\n minCanvasWidth = cropBoxData.width;\n minCanvasHeight = cropBoxData.height;\n\n if (minCanvasHeight * aspectRatio > minCanvasWidth) {\n minCanvasWidth = minCanvasHeight * aspectRatio;\n } else {\n minCanvasHeight = minCanvasWidth / aspectRatio;\n }\n }\n }\n\n var _getAdjustedSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: minCanvasWidth,\n height: minCanvasHeight\n });\n\n minCanvasWidth = _getAdjustedSizes.width;\n minCanvasHeight = _getAdjustedSizes.height;\n canvasData.minWidth = minCanvasWidth;\n canvasData.minHeight = minCanvasHeight;\n canvasData.maxWidth = Infinity;\n canvasData.maxHeight = Infinity;\n }\n\n if (positionLimited) {\n if (viewMode > (cropped ? 0 : 1)) {\n var newCanvasLeft = containerData.width - canvasData.width;\n var newCanvasTop = containerData.height - canvasData.height;\n canvasData.minLeft = Math.min(0, newCanvasLeft);\n canvasData.minTop = Math.min(0, newCanvasTop);\n canvasData.maxLeft = Math.max(0, newCanvasLeft);\n canvasData.maxTop = Math.max(0, newCanvasTop);\n\n if (cropped && this.limited) {\n canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));\n canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));\n canvasData.maxLeft = cropBoxData.left;\n canvasData.maxTop = cropBoxData.top;\n\n if (viewMode === 2) {\n if (canvasData.width >= containerData.width) {\n canvasData.minLeft = Math.min(0, newCanvasLeft);\n canvasData.maxLeft = Math.max(0, newCanvasLeft);\n }\n\n if (canvasData.height >= containerData.height) {\n canvasData.minTop = Math.min(0, newCanvasTop);\n canvasData.maxTop = Math.max(0, newCanvasTop);\n }\n }\n }\n } else {\n canvasData.minLeft = -canvasData.width;\n canvasData.minTop = -canvasData.height;\n canvasData.maxLeft = containerData.width;\n canvasData.maxTop = containerData.height;\n }\n }\n },\n renderCanvas: function renderCanvas(changed, transformed) {\n var canvasData = this.canvasData,\n imageData = this.imageData;\n\n if (transformed) {\n var _getRotatedSizes = getRotatedSizes({\n width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),\n height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),\n degree: imageData.rotate || 0\n }),\n naturalWidth = _getRotatedSizes.width,\n naturalHeight = _getRotatedSizes.height;\n\n var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);\n var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);\n canvasData.left -= (width - canvasData.width) / 2;\n canvasData.top -= (height - canvasData.height) / 2;\n canvasData.width = width;\n canvasData.height = height;\n canvasData.aspectRatio = naturalWidth / naturalHeight;\n canvasData.naturalWidth = naturalWidth;\n canvasData.naturalHeight = naturalHeight;\n this.limitCanvas(true, false);\n }\n\n if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {\n canvasData.left = canvasData.oldLeft;\n }\n\n if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {\n canvasData.top = canvasData.oldTop;\n }\n\n canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);\n canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);\n this.limitCanvas(false, true);\n canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);\n canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);\n canvasData.oldLeft = canvasData.left;\n canvasData.oldTop = canvasData.top;\n setStyle(this.canvas, assign({\n width: canvasData.width,\n height: canvasData.height\n }, getTransforms({\n translateX: canvasData.left,\n translateY: canvasData.top\n })));\n this.renderImage(changed);\n\n if (this.cropped && this.limited) {\n this.limitCropBox(true, true);\n }\n },\n renderImage: function renderImage(changed) {\n var canvasData = this.canvasData,\n imageData = this.imageData;\n var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);\n var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);\n assign(imageData, {\n width: width,\n height: height,\n left: (canvasData.width - width) / 2,\n top: (canvasData.height - height) / 2\n });\n setStyle(this.image, assign({\n width: imageData.width,\n height: imageData.height\n }, getTransforms(assign({\n translateX: imageData.left,\n translateY: imageData.top\n }, imageData))));\n\n if (changed) {\n this.output();\n }\n },\n initCropBox: function initCropBox() {\n var options = this.options,\n canvasData = this.canvasData;\n var aspectRatio = options.aspectRatio || options.initialAspectRatio;\n var autoCropArea = Number(options.autoCropArea) || 0.8;\n var cropBoxData = {\n width: canvasData.width,\n height: canvasData.height\n };\n\n if (aspectRatio) {\n if (canvasData.height * aspectRatio > canvasData.width) {\n cropBoxData.height = cropBoxData.width / aspectRatio;\n } else {\n cropBoxData.width = cropBoxData.height * aspectRatio;\n }\n }\n\n this.cropBoxData = cropBoxData;\n this.limitCropBox(true, true); // Initialize auto crop area\n\n cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);\n cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than \"minWidth/Height\"\n\n cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);\n cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);\n cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;\n cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;\n cropBoxData.oldLeft = cropBoxData.left;\n cropBoxData.oldTop = cropBoxData.top;\n this.initialCropBoxData = assign({}, cropBoxData);\n },\n limitCropBox: function limitCropBox(sizeLimited, positionLimited) {\n var options = this.options,\n containerData = this.containerData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData,\n limited = this.limited;\n var aspectRatio = options.aspectRatio;\n\n if (sizeLimited) {\n var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;\n var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;\n var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;\n var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height\n\n minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);\n minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);\n\n if (aspectRatio) {\n if (minCropBoxWidth && minCropBoxHeight) {\n if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {\n minCropBoxHeight = minCropBoxWidth / aspectRatio;\n } else {\n minCropBoxWidth = minCropBoxHeight * aspectRatio;\n }\n } else if (minCropBoxWidth) {\n minCropBoxHeight = minCropBoxWidth / aspectRatio;\n } else if (minCropBoxHeight) {\n minCropBoxWidth = minCropBoxHeight * aspectRatio;\n }\n\n if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {\n maxCropBoxHeight = maxCropBoxWidth / aspectRatio;\n } else {\n maxCropBoxWidth = maxCropBoxHeight * aspectRatio;\n }\n } // The minWidth/Height must be less than maxWidth/Height\n\n\n cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);\n cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);\n cropBoxData.maxWidth = maxCropBoxWidth;\n cropBoxData.maxHeight = maxCropBoxHeight;\n }\n\n if (positionLimited) {\n if (limited) {\n cropBoxData.minLeft = Math.max(0, canvasData.left);\n cropBoxData.minTop = Math.max(0, canvasData.top);\n cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;\n cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;\n } else {\n cropBoxData.minLeft = 0;\n cropBoxData.minTop = 0;\n cropBoxData.maxLeft = containerData.width - cropBoxData.width;\n cropBoxData.maxTop = containerData.height - cropBoxData.height;\n }\n }\n },\n renderCropBox: function renderCropBox() {\n var options = this.options,\n containerData = this.containerData,\n cropBoxData = this.cropBoxData;\n\n if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {\n cropBoxData.left = cropBoxData.oldLeft;\n }\n\n if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {\n cropBoxData.top = cropBoxData.oldTop;\n }\n\n cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);\n cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);\n this.limitCropBox(false, true);\n cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);\n cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);\n cropBoxData.oldLeft = cropBoxData.left;\n cropBoxData.oldTop = cropBoxData.top;\n\n if (options.movable && options.cropBoxMovable) {\n // Turn to move the canvas when the crop box is equal to the container\n setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);\n }\n\n setStyle(this.cropBox, assign({\n width: cropBoxData.width,\n height: cropBoxData.height\n }, getTransforms({\n translateX: cropBoxData.left,\n translateY: cropBoxData.top\n })));\n\n if (this.cropped && this.limited) {\n this.limitCanvas(true, true);\n }\n\n if (!this.disabled) {\n this.output();\n }\n },\n output: function output() {\n this.preview();\n dispatchEvent(this.element, EVENT_CROP, this.getData());\n }\n};\n\nvar preview = {\n initPreview: function initPreview() {\n var element = this.element,\n crossOrigin = this.crossOrigin;\n var preview = this.options.preview;\n var url = crossOrigin ? this.crossOriginUrl : this.url;\n var alt = element.alt || 'The image to preview';\n var image = document.createElement('img');\n\n if (crossOrigin) {\n image.crossOrigin = crossOrigin;\n }\n\n image.src = url;\n image.alt = alt;\n this.viewBox.appendChild(image);\n this.viewBoxImage = image;\n\n if (!preview) {\n return;\n }\n\n var previews = preview;\n\n if (typeof preview === 'string') {\n previews = element.ownerDocument.querySelectorAll(preview);\n } else if (preview.querySelector) {\n previews = [preview];\n }\n\n this.previews = previews;\n forEach(previews, function (el) {\n var img = document.createElement('img'); // Save the original size for recover\n\n setData(el, DATA_PREVIEW, {\n width: el.offsetWidth,\n height: el.offsetHeight,\n html: el.innerHTML\n });\n\n if (crossOrigin) {\n img.crossOrigin = crossOrigin;\n }\n\n img.src = url;\n img.alt = alt;\n /**\n * Override img element styles\n * Add `display:block` to avoid margin top issue\n * Add `height:auto` to override `height` attribute on IE8\n * (Occur only when margin-top <= -height)\n */\n\n img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;\"';\n el.innerHTML = '';\n el.appendChild(img);\n });\n },\n resetPreview: function resetPreview() {\n forEach(this.previews, function (element) {\n var data = getData(element, DATA_PREVIEW);\n setStyle(element, {\n width: data.width,\n height: data.height\n });\n element.innerHTML = data.html;\n removeData(element, DATA_PREVIEW);\n });\n },\n preview: function preview() {\n var imageData = this.imageData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData;\n var cropBoxWidth = cropBoxData.width,\n cropBoxHeight = cropBoxData.height;\n var width = imageData.width,\n height = imageData.height;\n var left = cropBoxData.left - canvasData.left - imageData.left;\n var top = cropBoxData.top - canvasData.top - imageData.top;\n\n if (!this.cropped || this.disabled) {\n return;\n }\n\n setStyle(this.viewBoxImage, assign({\n width: width,\n height: height\n }, getTransforms(assign({\n translateX: -left,\n translateY: -top\n }, imageData))));\n forEach(this.previews, function (element) {\n var data = getData(element, DATA_PREVIEW);\n var originalWidth = data.width;\n var originalHeight = data.height;\n var newWidth = originalWidth;\n var newHeight = originalHeight;\n var ratio = 1;\n\n if (cropBoxWidth) {\n ratio = originalWidth / cropBoxWidth;\n newHeight = cropBoxHeight * ratio;\n }\n\n if (cropBoxHeight && newHeight > originalHeight) {\n ratio = originalHeight / cropBoxHeight;\n newWidth = cropBoxWidth * ratio;\n newHeight = originalHeight;\n }\n\n setStyle(element, {\n width: newWidth,\n height: newHeight\n });\n setStyle(element.getElementsByTagName('img')[0], assign({\n width: width * ratio,\n height: height * ratio\n }, getTransforms(assign({\n translateX: -left * ratio,\n translateY: -top * ratio\n }, imageData))));\n });\n }\n};\n\nvar events = {\n bind: function bind() {\n var element = this.element,\n options = this.options,\n cropper = this.cropper;\n\n if (isFunction(options.cropstart)) {\n addListener(element, EVENT_CROP_START, options.cropstart);\n }\n\n if (isFunction(options.cropmove)) {\n addListener(element, EVENT_CROP_MOVE, options.cropmove);\n }\n\n if (isFunction(options.cropend)) {\n addListener(element, EVENT_CROP_END, options.cropend);\n }\n\n if (isFunction(options.crop)) {\n addListener(element, EVENT_CROP, options.crop);\n }\n\n if (isFunction(options.zoom)) {\n addListener(element, EVENT_ZOOM, options.zoom);\n }\n\n addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));\n\n if (options.zoomable && options.zoomOnWheel) {\n addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {\n passive: false,\n capture: true\n });\n }\n\n if (options.toggleDragModeOnDblclick) {\n addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));\n }\n\n addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));\n addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));\n\n if (options.responsive) {\n addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));\n }\n },\n unbind: function unbind() {\n var element = this.element,\n options = this.options,\n cropper = this.cropper;\n\n if (isFunction(options.cropstart)) {\n removeListener(element, EVENT_CROP_START, options.cropstart);\n }\n\n if (isFunction(options.cropmove)) {\n removeListener(element, EVENT_CROP_MOVE, options.cropmove);\n }\n\n if (isFunction(options.cropend)) {\n removeListener(element, EVENT_CROP_END, options.cropend);\n }\n\n if (isFunction(options.crop)) {\n removeListener(element, EVENT_CROP, options.crop);\n }\n\n if (isFunction(options.zoom)) {\n removeListener(element, EVENT_ZOOM, options.zoom);\n }\n\n removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);\n\n if (options.zoomable && options.zoomOnWheel) {\n removeListener(cropper, EVENT_WHEEL, this.onWheel, {\n passive: false,\n capture: true\n });\n }\n\n if (options.toggleDragModeOnDblclick) {\n removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);\n }\n\n removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);\n removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);\n\n if (options.responsive) {\n removeListener(window, EVENT_RESIZE, this.onResize);\n }\n }\n};\n\nvar handlers = {\n resize: function resize() {\n if (this.disabled) {\n return;\n }\n\n var options = this.options,\n container = this.container,\n containerData = this.containerData;\n var ratioX = container.offsetWidth / containerData.width;\n var ratioY = container.offsetHeight / containerData.height;\n var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; // Resize when width changed or height changed\n\n if (ratio !== 1) {\n var canvasData;\n var cropBoxData;\n\n if (options.restore) {\n canvasData = this.getCanvasData();\n cropBoxData = this.getCropBoxData();\n }\n\n this.render();\n\n if (options.restore) {\n this.setCanvasData(forEach(canvasData, function (n, i) {\n canvasData[i] = n * ratio;\n }));\n this.setCropBoxData(forEach(cropBoxData, function (n, i) {\n cropBoxData[i] = n * ratio;\n }));\n }\n }\n },\n dblclick: function dblclick() {\n if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {\n return;\n }\n\n this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);\n },\n wheel: function wheel(event) {\n var _this = this;\n\n var ratio = Number(this.options.wheelZoomRatio) || 0.1;\n var delta = 1;\n\n if (this.disabled) {\n return;\n }\n\n event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21)\n\n if (this.wheeling) {\n return;\n }\n\n this.wheeling = true;\n setTimeout(function () {\n _this.wheeling = false;\n }, 50);\n\n if (event.deltaY) {\n delta = event.deltaY > 0 ? 1 : -1;\n } else if (event.wheelDelta) {\n delta = -event.wheelDelta / 120;\n } else if (event.detail) {\n delta = event.detail > 0 ? 1 : -1;\n }\n\n this.zoom(-delta * ratio, event);\n },\n cropStart: function cropStart(event) {\n var buttons = event.buttons,\n button = event.button;\n\n if (this.disabled // Handle mouse event and pointer event and ignore touch event\n || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button)\n isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu\n || event.ctrlKey)) {\n return;\n }\n\n var options = this.options,\n pointers = this.pointers;\n var action;\n\n if (event.changedTouches) {\n // Handle touch event\n forEach(event.changedTouches, function (touch) {\n pointers[touch.identifier] = getPointer(touch);\n });\n } else {\n // Handle mouse event and pointer event\n pointers[event.pointerId || 0] = getPointer(event);\n }\n\n if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {\n action = ACTION_ZOOM;\n } else {\n action = getData(event.target, DATA_ACTION);\n }\n\n if (!REGEXP_ACTIONS.test(action)) {\n return;\n }\n\n if (dispatchEvent(this.element, EVENT_CROP_START, {\n originalEvent: event,\n action: action\n }) === false) {\n return;\n } // This line is required for preventing page zooming in iOS browsers\n\n\n event.preventDefault();\n this.action = action;\n this.cropping = false;\n\n if (action === ACTION_CROP) {\n this.cropping = true;\n addClass(this.dragBox, CLASS_MODAL);\n }\n },\n cropMove: function cropMove(event) {\n var action = this.action;\n\n if (this.disabled || !action) {\n return;\n }\n\n var pointers = this.pointers;\n event.preventDefault();\n\n if (dispatchEvent(this.element, EVENT_CROP_MOVE, {\n originalEvent: event,\n action: action\n }) === false) {\n return;\n }\n\n if (event.changedTouches) {\n forEach(event.changedTouches, function (touch) {\n // The first parameter should not be undefined (#432)\n assign(pointers[touch.identifier] || {}, getPointer(touch, true));\n });\n } else {\n assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));\n }\n\n this.change(event);\n },\n cropEnd: function cropEnd(event) {\n if (this.disabled) {\n return;\n }\n\n var action = this.action,\n pointers = this.pointers;\n\n if (event.changedTouches) {\n forEach(event.changedTouches, function (touch) {\n delete pointers[touch.identifier];\n });\n } else {\n delete pointers[event.pointerId || 0];\n }\n\n if (!action) {\n return;\n }\n\n event.preventDefault();\n\n if (!Object.keys(pointers).length) {\n this.action = '';\n }\n\n if (this.cropping) {\n this.cropping = false;\n toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);\n }\n\n dispatchEvent(this.element, EVENT_CROP_END, {\n originalEvent: event,\n action: action\n });\n }\n};\n\nvar change = {\n change: function change(event) {\n var options = this.options,\n canvasData = this.canvasData,\n containerData = this.containerData,\n cropBoxData = this.cropBoxData,\n pointers = this.pointers;\n var action = this.action;\n var aspectRatio = options.aspectRatio;\n var left = cropBoxData.left,\n top = cropBoxData.top,\n width = cropBoxData.width,\n height = cropBoxData.height;\n var right = left + width;\n var bottom = top + height;\n var minLeft = 0;\n var minTop = 0;\n var maxWidth = containerData.width;\n var maxHeight = containerData.height;\n var renderable = true;\n var offset; // Locking aspect ratio in \"free mode\" by holding shift key\n\n if (!aspectRatio && event.shiftKey) {\n aspectRatio = width && height ? width / height : 1;\n }\n\n if (this.limited) {\n minLeft = cropBoxData.minLeft;\n minTop = cropBoxData.minTop;\n maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);\n maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);\n }\n\n var pointer = pointers[Object.keys(pointers)[0]];\n var range = {\n x: pointer.endX - pointer.startX,\n y: pointer.endY - pointer.startY\n };\n\n var check = function check(side) {\n switch (side) {\n case ACTION_EAST:\n if (right + range.x > maxWidth) {\n range.x = maxWidth - right;\n }\n\n break;\n\n case ACTION_WEST:\n if (left + range.x < minLeft) {\n range.x = minLeft - left;\n }\n\n break;\n\n case ACTION_NORTH:\n if (top + range.y < minTop) {\n range.y = minTop - top;\n }\n\n break;\n\n case ACTION_SOUTH:\n if (bottom + range.y > maxHeight) {\n range.y = maxHeight - bottom;\n }\n\n break;\n }\n };\n\n switch (action) {\n // Move crop box\n case ACTION_ALL:\n left += range.x;\n top += range.y;\n break;\n // Resize crop box\n\n case ACTION_EAST:\n if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {\n renderable = false;\n break;\n }\n\n check(ACTION_EAST);\n width += range.x;\n\n if (width < 0) {\n action = ACTION_WEST;\n width = -width;\n left -= width;\n }\n\n if (aspectRatio) {\n height = width / aspectRatio;\n top += (cropBoxData.height - height) / 2;\n }\n\n break;\n\n case ACTION_NORTH:\n if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {\n renderable = false;\n break;\n }\n\n check(ACTION_NORTH);\n height -= range.y;\n top += range.y;\n\n if (height < 0) {\n action = ACTION_SOUTH;\n height = -height;\n top -= height;\n }\n\n if (aspectRatio) {\n width = height * aspectRatio;\n left += (cropBoxData.width - width) / 2;\n }\n\n break;\n\n case ACTION_WEST:\n if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {\n renderable = false;\n break;\n }\n\n check(ACTION_WEST);\n width -= range.x;\n left += range.x;\n\n if (width < 0) {\n action = ACTION_EAST;\n width = -width;\n left -= width;\n }\n\n if (aspectRatio) {\n height = width / aspectRatio;\n top += (cropBoxData.height - height) / 2;\n }\n\n break;\n\n case ACTION_SOUTH:\n if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {\n renderable = false;\n break;\n }\n\n check(ACTION_SOUTH);\n height += range.y;\n\n if (height < 0) {\n action = ACTION_NORTH;\n height = -height;\n top -= height;\n }\n\n if (aspectRatio) {\n width = height * aspectRatio;\n left += (cropBoxData.width - width) / 2;\n }\n\n break;\n\n case ACTION_NORTH_EAST:\n if (aspectRatio) {\n if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {\n renderable = false;\n break;\n }\n\n check(ACTION_NORTH);\n height -= range.y;\n top += range.y;\n width = height * aspectRatio;\n } else {\n check(ACTION_NORTH);\n check(ACTION_EAST);\n\n if (range.x >= 0) {\n if (right < maxWidth) {\n width += range.x;\n } else if (range.y <= 0 && top <= minTop) {\n renderable = false;\n }\n } else {\n width += range.x;\n }\n\n if (range.y <= 0) {\n if (top > minTop) {\n height -= range.y;\n top += range.y;\n }\n } else {\n height -= range.y;\n top += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_SOUTH_WEST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_NORTH_WEST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_SOUTH_EAST;\n height = -height;\n top -= height;\n }\n\n break;\n\n case ACTION_NORTH_WEST:\n if (aspectRatio) {\n if (range.y <= 0 && (top <= minTop || left <= minLeft)) {\n renderable = false;\n break;\n }\n\n check(ACTION_NORTH);\n height -= range.y;\n top += range.y;\n width = height * aspectRatio;\n left += cropBoxData.width - width;\n } else {\n check(ACTION_NORTH);\n check(ACTION_WEST);\n\n if (range.x <= 0) {\n if (left > minLeft) {\n width -= range.x;\n left += range.x;\n } else if (range.y <= 0 && top <= minTop) {\n renderable = false;\n }\n } else {\n width -= range.x;\n left += range.x;\n }\n\n if (range.y <= 0) {\n if (top > minTop) {\n height -= range.y;\n top += range.y;\n }\n } else {\n height -= range.y;\n top += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_SOUTH_EAST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_NORTH_EAST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_SOUTH_WEST;\n height = -height;\n top -= height;\n }\n\n break;\n\n case ACTION_SOUTH_WEST:\n if (aspectRatio) {\n if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {\n renderable = false;\n break;\n }\n\n check(ACTION_WEST);\n width -= range.x;\n left += range.x;\n height = width / aspectRatio;\n } else {\n check(ACTION_SOUTH);\n check(ACTION_WEST);\n\n if (range.x <= 0) {\n if (left > minLeft) {\n width -= range.x;\n left += range.x;\n } else if (range.y >= 0 && bottom >= maxHeight) {\n renderable = false;\n }\n } else {\n width -= range.x;\n left += range.x;\n }\n\n if (range.y >= 0) {\n if (bottom < maxHeight) {\n height += range.y;\n }\n } else {\n height += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_NORTH_EAST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_SOUTH_EAST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_NORTH_WEST;\n height = -height;\n top -= height;\n }\n\n break;\n\n case ACTION_SOUTH_EAST:\n if (aspectRatio) {\n if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {\n renderable = false;\n break;\n }\n\n check(ACTION_EAST);\n width += range.x;\n height = width / aspectRatio;\n } else {\n check(ACTION_SOUTH);\n check(ACTION_EAST);\n\n if (range.x >= 0) {\n if (right < maxWidth) {\n width += range.x;\n } else if (range.y >= 0 && bottom >= maxHeight) {\n renderable = false;\n }\n } else {\n width += range.x;\n }\n\n if (range.y >= 0) {\n if (bottom < maxHeight) {\n height += range.y;\n }\n } else {\n height += range.y;\n }\n }\n\n if (width < 0 && height < 0) {\n action = ACTION_NORTH_WEST;\n height = -height;\n width = -width;\n top -= height;\n left -= width;\n } else if (width < 0) {\n action = ACTION_SOUTH_WEST;\n width = -width;\n left -= width;\n } else if (height < 0) {\n action = ACTION_NORTH_EAST;\n height = -height;\n top -= height;\n }\n\n break;\n // Move canvas\n\n case ACTION_MOVE:\n this.move(range.x, range.y);\n renderable = false;\n break;\n // Zoom canvas\n\n case ACTION_ZOOM:\n this.zoom(getMaxZoomRatio(pointers), event);\n renderable = false;\n break;\n // Create crop box\n\n case ACTION_CROP:\n if (!range.x || !range.y) {\n renderable = false;\n break;\n }\n\n offset = getOffset(this.cropper);\n left = pointer.startX - offset.left;\n top = pointer.startY - offset.top;\n width = cropBoxData.minWidth;\n height = cropBoxData.minHeight;\n\n if (range.x > 0) {\n action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;\n } else if (range.x < 0) {\n left -= width;\n action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;\n }\n\n if (range.y < 0) {\n top -= height;\n } // Show the crop box if is hidden\n\n\n if (!this.cropped) {\n removeClass(this.cropBox, CLASS_HIDDEN);\n this.cropped = true;\n\n if (this.limited) {\n this.limitCropBox(true, true);\n }\n }\n\n break;\n }\n\n if (renderable) {\n cropBoxData.width = width;\n cropBoxData.height = height;\n cropBoxData.left = left;\n cropBoxData.top = top;\n this.action = action;\n this.renderCropBox();\n } // Override\n\n\n forEach(pointers, function (p) {\n p.startX = p.endX;\n p.startY = p.endY;\n });\n }\n};\n\nvar methods = {\n // Show the crop box manually\n crop: function crop() {\n if (this.ready && !this.cropped && !this.disabled) {\n this.cropped = true;\n this.limitCropBox(true, true);\n\n if (this.options.modal) {\n addClass(this.dragBox, CLASS_MODAL);\n }\n\n removeClass(this.cropBox, CLASS_HIDDEN);\n this.setCropBoxData(this.initialCropBoxData);\n }\n\n return this;\n },\n // Reset the image and crop box to their initial states\n reset: function reset() {\n if (this.ready && !this.disabled) {\n this.imageData = assign({}, this.initialImageData);\n this.canvasData = assign({}, this.initialCanvasData);\n this.cropBoxData = assign({}, this.initialCropBoxData);\n this.renderCanvas();\n\n if (this.cropped) {\n this.renderCropBox();\n }\n }\n\n return this;\n },\n // Clear the crop box\n clear: function clear() {\n if (this.cropped && !this.disabled) {\n assign(this.cropBoxData, {\n left: 0,\n top: 0,\n width: 0,\n height: 0\n });\n this.cropped = false;\n this.renderCropBox();\n this.limitCanvas(true, true); // Render canvas after crop box rendered\n\n this.renderCanvas();\n removeClass(this.dragBox, CLASS_MODAL);\n addClass(this.cropBox, CLASS_HIDDEN);\n }\n\n return this;\n },\n\n /**\n * Replace the image's src and rebuild the cropper\n * @param {string} url - The new URL.\n * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.\n * @returns {Cropper} this\n */\n replace: function replace(url) {\n var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!this.disabled && url) {\n if (this.isImg) {\n this.element.src = url;\n }\n\n if (hasSameSize) {\n this.url = url;\n this.image.src = url;\n\n if (this.ready) {\n this.viewBoxImage.src = url;\n forEach(this.previews, function (element) {\n element.getElementsByTagName('img')[0].src = url;\n });\n }\n } else {\n if (this.isImg) {\n this.replaced = true;\n }\n\n this.options.data = null;\n this.uncreate();\n this.load(url);\n }\n }\n\n return this;\n },\n // Enable (unfreeze) the cropper\n enable: function enable() {\n if (this.ready && this.disabled) {\n this.disabled = false;\n removeClass(this.cropper, CLASS_DISABLED);\n }\n\n return this;\n },\n // Disable (freeze) the cropper\n disable: function disable() {\n if (this.ready && !this.disabled) {\n this.disabled = true;\n addClass(this.cropper, CLASS_DISABLED);\n }\n\n return this;\n },\n\n /**\n * Destroy the cropper and remove the instance from the image\n * @returns {Cropper} this\n */\n destroy: function destroy() {\n var element = this.element;\n\n if (!element[NAMESPACE]) {\n return this;\n }\n\n element[NAMESPACE] = undefined;\n\n if (this.isImg && this.replaced) {\n element.src = this.originalUrl;\n }\n\n this.uncreate();\n return this;\n },\n\n /**\n * Move the canvas with relative offsets\n * @param {number} offsetX - The relative offset distance on the x-axis.\n * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.\n * @returns {Cropper} this\n */\n move: function move(offsetX) {\n var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX;\n var _this$canvasData = this.canvasData,\n left = _this$canvasData.left,\n top = _this$canvasData.top;\n return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));\n },\n\n /**\n * Move the canvas to an absolute point\n * @param {number} x - The x-axis coordinate.\n * @param {number} [y=x] - The y-axis coordinate.\n * @returns {Cropper} this\n */\n moveTo: function moveTo(x) {\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;\n var canvasData = this.canvasData;\n var changed = false;\n x = Number(x);\n y = Number(y);\n\n if (this.ready && !this.disabled && this.options.movable) {\n if (isNumber(x)) {\n canvasData.left = x;\n changed = true;\n }\n\n if (isNumber(y)) {\n canvasData.top = y;\n changed = true;\n }\n\n if (changed) {\n this.renderCanvas(true);\n }\n }\n\n return this;\n },\n\n /**\n * Zoom the canvas with a relative ratio\n * @param {number} ratio - The target ratio.\n * @param {Event} _originalEvent - The original event if any.\n * @returns {Cropper} this\n */\n zoom: function zoom(ratio, _originalEvent) {\n var canvasData = this.canvasData;\n ratio = Number(ratio);\n\n if (ratio < 0) {\n ratio = 1 / (1 - ratio);\n } else {\n ratio = 1 + ratio;\n }\n\n return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);\n },\n\n /**\n * Zoom the canvas to an absolute ratio\n * @param {number} ratio - The target ratio.\n * @param {Object} pivot - The zoom pivot point coordinate.\n * @param {Event} _originalEvent - The original event if any.\n * @returns {Cropper} this\n */\n zoomTo: function zoomTo(ratio, pivot, _originalEvent) {\n var options = this.options,\n canvasData = this.canvasData;\n var width = canvasData.width,\n height = canvasData.height,\n naturalWidth = canvasData.naturalWidth,\n naturalHeight = canvasData.naturalHeight;\n ratio = Number(ratio);\n\n if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {\n var newWidth = naturalWidth * ratio;\n var newHeight = naturalHeight * ratio;\n\n if (dispatchEvent(this.element, EVENT_ZOOM, {\n ratio: ratio,\n oldRatio: width / naturalWidth,\n originalEvent: _originalEvent\n }) === false) {\n return this;\n }\n\n if (_originalEvent) {\n var pointers = this.pointers;\n var offset = getOffset(this.cropper);\n var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {\n pageX: _originalEvent.pageX,\n pageY: _originalEvent.pageY\n }; // Zoom from the triggering point of the event\n\n canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);\n canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);\n } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {\n canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);\n canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);\n } else {\n // Zoom from the center of the canvas\n canvasData.left -= (newWidth - width) / 2;\n canvasData.top -= (newHeight - height) / 2;\n }\n\n canvasData.width = newWidth;\n canvasData.height = newHeight;\n this.renderCanvas(true);\n }\n\n return this;\n },\n\n /**\n * Rotate the canvas with a relative degree\n * @param {number} degree - The rotate degree.\n * @returns {Cropper} this\n */\n rotate: function rotate(degree) {\n return this.rotateTo((this.imageData.rotate || 0) + Number(degree));\n },\n\n /**\n * Rotate the canvas to an absolute degree\n * @param {number} degree - The rotate degree.\n * @returns {Cropper} this\n */\n rotateTo: function rotateTo(degree) {\n degree = Number(degree);\n\n if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {\n this.imageData.rotate = degree % 360;\n this.renderCanvas(true, true);\n }\n\n return this;\n },\n\n /**\n * Scale the image on the x-axis.\n * @param {number} scaleX - The scale ratio on the x-axis.\n * @returns {Cropper} this\n */\n scaleX: function scaleX(_scaleX) {\n var scaleY = this.imageData.scaleY;\n return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);\n },\n\n /**\n * Scale the image on the y-axis.\n * @param {number} scaleY - The scale ratio on the y-axis.\n * @returns {Cropper} this\n */\n scaleY: function scaleY(_scaleY) {\n var scaleX = this.imageData.scaleX;\n return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);\n },\n\n /**\n * Scale the image\n * @param {number} scaleX - The scale ratio on the x-axis.\n * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.\n * @returns {Cropper} this\n */\n scale: function scale(scaleX) {\n var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;\n var imageData = this.imageData;\n var transformed = false;\n scaleX = Number(scaleX);\n scaleY = Number(scaleY);\n\n if (this.ready && !this.disabled && this.options.scalable) {\n if (isNumber(scaleX)) {\n imageData.scaleX = scaleX;\n transformed = true;\n }\n\n if (isNumber(scaleY)) {\n imageData.scaleY = scaleY;\n transformed = true;\n }\n\n if (transformed) {\n this.renderCanvas(true, true);\n }\n }\n\n return this;\n },\n\n /**\n * Get the cropped area position and size data (base on the original image)\n * @param {boolean} [rounded=false] - Indicate if round the data values or not.\n * @returns {Object} The result cropped data.\n */\n getData: function getData() {\n var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var options = this.options,\n imageData = this.imageData,\n canvasData = this.canvasData,\n cropBoxData = this.cropBoxData;\n var data;\n\n if (this.ready && this.cropped) {\n data = {\n x: cropBoxData.left - canvasData.left,\n y: cropBoxData.top - canvasData.top,\n width: cropBoxData.width,\n height: cropBoxData.height\n };\n var ratio = imageData.width / imageData.naturalWidth;\n forEach(data, function (n, i) {\n data[i] = n / ratio;\n });\n\n if (rounded) {\n // In case rounding off leads to extra 1px in right or bottom border\n // we should round the top-left corner and the dimension (#343).\n var bottom = Math.round(data.y + data.height);\n var right = Math.round(data.x + data.width);\n data.x = Math.round(data.x);\n data.y = Math.round(data.y);\n data.width = right - data.x;\n data.height = bottom - data.y;\n }\n } else {\n data = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n }\n\n if (options.rotatable) {\n data.rotate = imageData.rotate || 0;\n }\n\n if (options.scalable) {\n data.scaleX = imageData.scaleX || 1;\n data.scaleY = imageData.scaleY || 1;\n }\n\n return data;\n },\n\n /**\n * Set the cropped area position and size with new data\n * @param {Object} data - The new data.\n * @returns {Cropper} this\n */\n setData: function setData(data) {\n var options = this.options,\n imageData = this.imageData,\n canvasData = this.canvasData;\n var cropBoxData = {};\n\n if (this.ready && !this.disabled && isPlainObject(data)) {\n var transformed = false;\n\n if (options.rotatable) {\n if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {\n imageData.rotate = data.rotate;\n transformed = true;\n }\n }\n\n if (options.scalable) {\n if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {\n imageData.scaleX = data.scaleX;\n transformed = true;\n }\n\n if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {\n imageData.scaleY = data.scaleY;\n transformed = true;\n }\n }\n\n if (transformed) {\n this.renderCanvas(true, true);\n }\n\n var ratio = imageData.width / imageData.naturalWidth;\n\n if (isNumber(data.x)) {\n cropBoxData.left = data.x * ratio + canvasData.left;\n }\n\n if (isNumber(data.y)) {\n cropBoxData.top = data.y * ratio + canvasData.top;\n }\n\n if (isNumber(data.width)) {\n cropBoxData.width = data.width * ratio;\n }\n\n if (isNumber(data.height)) {\n cropBoxData.height = data.height * ratio;\n }\n\n this.setCropBoxData(cropBoxData);\n }\n\n return this;\n },\n\n /**\n * Get the container size data.\n * @returns {Object} The result container data.\n */\n getContainerData: function getContainerData() {\n return this.ready ? assign({}, this.containerData) : {};\n },\n\n /**\n * Get the image position and size data.\n * @returns {Object} The result image data.\n */\n getImageData: function getImageData() {\n return this.sized ? assign({}, this.imageData) : {};\n },\n\n /**\n * Get the canvas position and size data.\n * @returns {Object} The result canvas data.\n */\n getCanvasData: function getCanvasData() {\n var canvasData = this.canvasData;\n var data = {};\n\n if (this.ready) {\n forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {\n data[n] = canvasData[n];\n });\n }\n\n return data;\n },\n\n /**\n * Set the canvas position and size with new data.\n * @param {Object} data - The new canvas data.\n * @returns {Cropper} this\n */\n setCanvasData: function setCanvasData(data) {\n var canvasData = this.canvasData;\n var aspectRatio = canvasData.aspectRatio;\n\n if (this.ready && !this.disabled && isPlainObject(data)) {\n if (isNumber(data.left)) {\n canvasData.left = data.left;\n }\n\n if (isNumber(data.top)) {\n canvasData.top = data.top;\n }\n\n if (isNumber(data.width)) {\n canvasData.width = data.width;\n canvasData.height = data.width / aspectRatio;\n } else if (isNumber(data.height)) {\n canvasData.height = data.height;\n canvasData.width = data.height * aspectRatio;\n }\n\n this.renderCanvas(true);\n }\n\n return this;\n },\n\n /**\n * Get the crop box position and size data.\n * @returns {Object} The result crop box data.\n */\n getCropBoxData: function getCropBoxData() {\n var cropBoxData = this.cropBoxData;\n var data;\n\n if (this.ready && this.cropped) {\n data = {\n left: cropBoxData.left,\n top: cropBoxData.top,\n width: cropBoxData.width,\n height: cropBoxData.height\n };\n }\n\n return data || {};\n },\n\n /**\n * Set the crop box position and size with new data.\n * @param {Object} data - The new crop box data.\n * @returns {Cropper} this\n */\n setCropBoxData: function setCropBoxData(data) {\n var cropBoxData = this.cropBoxData;\n var aspectRatio = this.options.aspectRatio;\n var widthChanged;\n var heightChanged;\n\n if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {\n if (isNumber(data.left)) {\n cropBoxData.left = data.left;\n }\n\n if (isNumber(data.top)) {\n cropBoxData.top = data.top;\n }\n\n if (isNumber(data.width) && data.width !== cropBoxData.width) {\n widthChanged = true;\n cropBoxData.width = data.width;\n }\n\n if (isNumber(data.height) && data.height !== cropBoxData.height) {\n heightChanged = true;\n cropBoxData.height = data.height;\n }\n\n if (aspectRatio) {\n if (widthChanged) {\n cropBoxData.height = cropBoxData.width / aspectRatio;\n } else if (heightChanged) {\n cropBoxData.width = cropBoxData.height * aspectRatio;\n }\n }\n\n this.renderCropBox();\n }\n\n return this;\n },\n\n /**\n * Get a canvas drawn the cropped image.\n * @param {Object} [options={}] - The config options.\n * @returns {HTMLCanvasElement} - The result canvas.\n */\n getCroppedCanvas: function getCroppedCanvas() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (!this.ready || !window.HTMLCanvasElement) {\n return null;\n }\n\n var canvasData = this.canvasData;\n var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped.\n\n if (!this.cropped) {\n return source;\n }\n\n var _this$getData = this.getData(),\n initialX = _this$getData.x,\n initialY = _this$getData.y,\n initialWidth = _this$getData.width,\n initialHeight = _this$getData.height;\n\n var ratio = source.width / Math.floor(canvasData.naturalWidth);\n\n if (ratio !== 1) {\n initialX *= ratio;\n initialY *= ratio;\n initialWidth *= ratio;\n initialHeight *= ratio;\n }\n\n var aspectRatio = initialWidth / initialHeight;\n var maxSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: options.maxWidth || Infinity,\n height: options.maxHeight || Infinity\n });\n var minSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: options.minWidth || 0,\n height: options.minHeight || 0\n }, 'cover');\n\n var _getAdjustedSizes = getAdjustedSizes({\n aspectRatio: aspectRatio,\n width: options.width || (ratio !== 1 ? source.width : initialWidth),\n height: options.height || (ratio !== 1 ? source.height : initialHeight)\n }),\n width = _getAdjustedSizes.width,\n height = _getAdjustedSizes.height;\n\n width = Math.min(maxSizes.width, Math.max(minSizes.width, width));\n height = Math.min(maxSizes.height, Math.max(minSizes.height, height));\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n canvas.width = normalizeDecimalNumber(width);\n canvas.height = normalizeDecimalNumber(height);\n context.fillStyle = options.fillColor || 'transparent';\n context.fillRect(0, 0, width, height);\n var _options$imageSmoothi = options.imageSmoothingEnabled,\n imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi,\n imageSmoothingQuality = options.imageSmoothingQuality;\n context.imageSmoothingEnabled = imageSmoothingEnabled;\n\n if (imageSmoothingQuality) {\n context.imageSmoothingQuality = imageSmoothingQuality;\n } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage\n\n\n var sourceWidth = source.width;\n var sourceHeight = source.height; // Source canvas parameters\n\n var srcX = initialX;\n var srcY = initialY;\n var srcWidth;\n var srcHeight; // Destination canvas parameters\n\n var dstX;\n var dstY;\n var dstWidth;\n var dstHeight;\n\n if (srcX <= -initialWidth || srcX > sourceWidth) {\n srcX = 0;\n srcWidth = 0;\n dstX = 0;\n dstWidth = 0;\n } else if (srcX <= 0) {\n dstX = -srcX;\n srcX = 0;\n srcWidth = Math.min(sourceWidth, initialWidth + srcX);\n dstWidth = srcWidth;\n } else if (srcX <= sourceWidth) {\n dstX = 0;\n srcWidth = Math.min(initialWidth, sourceWidth - srcX);\n dstWidth = srcWidth;\n }\n\n if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {\n srcY = 0;\n srcHeight = 0;\n dstY = 0;\n dstHeight = 0;\n } else if (srcY <= 0) {\n dstY = -srcY;\n srcY = 0;\n srcHeight = Math.min(sourceHeight, initialHeight + srcY);\n dstHeight = srcHeight;\n } else if (srcY <= sourceHeight) {\n dstY = 0;\n srcHeight = Math.min(initialHeight, sourceHeight - srcY);\n dstHeight = srcHeight;\n }\n\n var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid \"IndexSizeError\"\n\n if (dstWidth > 0 && dstHeight > 0) {\n var scale = width / initialWidth;\n params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);\n } // All the numerical parameters should be integer for `drawImage`\n // https://github.com/fengyuanchen/cropper/issues/476\n\n\n context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) {\n return Math.floor(normalizeDecimalNumber(param));\n }))));\n return canvas;\n },\n\n /**\n * Change the aspect ratio of the crop box.\n * @param {number} aspectRatio - The new aspect ratio.\n * @returns {Cropper} this\n */\n setAspectRatio: function setAspectRatio(aspectRatio) {\n var options = this.options;\n\n if (!this.disabled && !isUndefined(aspectRatio)) {\n // 0 -> NaN\n options.aspectRatio = Math.max(0, aspectRatio) || NaN;\n\n if (this.ready) {\n this.initCropBox();\n\n if (this.cropped) {\n this.renderCropBox();\n }\n }\n }\n\n return this;\n },\n\n /**\n * Change the drag mode.\n * @param {string} mode - The new drag mode.\n * @returns {Cropper} this\n */\n setDragMode: function setDragMode(mode) {\n var options = this.options,\n dragBox = this.dragBox,\n face = this.face;\n\n if (this.ready && !this.disabled) {\n var croppable = mode === DRAG_MODE_CROP;\n var movable = options.movable && mode === DRAG_MODE_MOVE;\n mode = croppable || movable ? mode : DRAG_MODE_NONE;\n options.dragMode = mode;\n setData(dragBox, DATA_ACTION, mode);\n toggleClass(dragBox, CLASS_CROP, croppable);\n toggleClass(dragBox, CLASS_MOVE, movable);\n\n if (!options.cropBoxMovable) {\n // Sync drag mode to crop box when it is not movable\n setData(face, DATA_ACTION, mode);\n toggleClass(face, CLASS_CROP, croppable);\n toggleClass(face, CLASS_MOVE, movable);\n }\n }\n\n return this;\n }\n};\n\nvar AnotherCropper = WINDOW.Cropper;\n\nvar Cropper = /*#__PURE__*/function () {\n /**\n * Create a new Cropper.\n * @param {Element} element - The target element for cropping.\n * @param {Object} [options={}] - The configuration options.\n */\n function Cropper(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Cropper);\n\n if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {\n throw new Error('The first argument is required and must be an or element.');\n }\n\n this.element = element;\n this.options = assign({}, DEFAULTS, isPlainObject(options) && options);\n this.cropped = false;\n this.disabled = false;\n this.pointers = {};\n this.ready = false;\n this.reloading = false;\n this.replaced = false;\n this.sized = false;\n this.sizing = false;\n this.init();\n }\n\n _createClass(Cropper, [{\n key: \"init\",\n value: function init() {\n var element = this.element;\n var tagName = element.tagName.toLowerCase();\n var url;\n\n if (element[NAMESPACE]) {\n return;\n }\n\n element[NAMESPACE] = this;\n\n if (tagName === 'img') {\n this.isImg = true; // e.g.: \"img/picture.jpg\"\n\n url = element.getAttribute('src') || '';\n this.originalUrl = url; // Stop when it's a blank image\n\n if (!url) {\n return;\n } // e.g.: \"https://example.com/img/picture.jpg\"\n\n\n url = element.src;\n } else if (tagName === 'canvas' && window.HTMLCanvasElement) {\n url = element.toDataURL();\n }\n\n this.load(url);\n }\n }, {\n key: \"load\",\n value: function load(url) {\n var _this = this;\n\n if (!url) {\n return;\n }\n\n this.url = url;\n this.imageData = {};\n var element = this.element,\n options = this.options;\n\n if (!options.rotatable && !options.scalable) {\n options.checkOrientation = false;\n } // Only IE10+ supports Typed Arrays\n\n\n if (!options.checkOrientation || !window.ArrayBuffer) {\n this.clone();\n return;\n } // Detect the mime type of the image directly if it is a Data URL\n\n\n if (REGEXP_DATA_URL.test(url)) {\n // Read ArrayBuffer from Data URL of JPEG images directly for better performance\n if (REGEXP_DATA_URL_JPEG.test(url)) {\n this.read(dataURLToArrayBuffer(url));\n } else {\n // Only a JPEG image may contains Exif Orientation information,\n // the rest types of Data URLs are not necessary to check orientation at all.\n this.clone();\n }\n\n return;\n } // 1. Detect the mime type of the image by a XMLHttpRequest.\n // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.\n\n\n var xhr = new XMLHttpRequest();\n var clone = this.clone.bind(this);\n this.reloading = true;\n this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes:\n // http, https, data, chrome, chrome-extension.\n // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy\n // in some browsers as IE11 and Safari.\n\n xhr.onabort = clone;\n xhr.onerror = clone;\n xhr.ontimeout = clone;\n\n xhr.onprogress = function () {\n // Abort the request directly if it not a JPEG image for better performance\n if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {\n xhr.abort();\n }\n };\n\n xhr.onload = function () {\n _this.read(xhr.response);\n };\n\n xhr.onloadend = function () {\n _this.reloading = false;\n _this.xhr = null;\n }; // Bust cache when there is a \"crossOrigin\" property to avoid browser cache error\n\n\n if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {\n url = addTimestamp(url);\n } // The third parameter is required for avoiding side-effect (#682)\n\n\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.withCredentials = element.crossOrigin === 'use-credentials';\n xhr.send();\n }\n }, {\n key: \"read\",\n value: function read(arrayBuffer) {\n var options = this.options,\n imageData = this.imageData; // Reset the orientation value to its default value 1\n // as some iOS browsers will render image with its orientation\n\n var orientation = resetAndGetOrientation(arrayBuffer);\n var rotate = 0;\n var scaleX = 1;\n var scaleY = 1;\n\n if (orientation > 1) {\n // Generate a new URL which has the default orientation value\n this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);\n\n var _parseOrientation = parseOrientation(orientation);\n\n rotate = _parseOrientation.rotate;\n scaleX = _parseOrientation.scaleX;\n scaleY = _parseOrientation.scaleY;\n }\n\n if (options.rotatable) {\n imageData.rotate = rotate;\n }\n\n if (options.scalable) {\n imageData.scaleX = scaleX;\n imageData.scaleY = scaleY;\n }\n\n this.clone();\n }\n }, {\n key: \"clone\",\n value: function clone() {\n var element = this.element,\n url = this.url;\n var crossOrigin = element.crossOrigin;\n var crossOriginUrl = url;\n\n if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {\n if (!crossOrigin) {\n crossOrigin = 'anonymous';\n } // Bust cache when there is not a \"crossOrigin\" property (#519)\n\n\n crossOriginUrl = addTimestamp(url);\n }\n\n this.crossOrigin = crossOrigin;\n this.crossOriginUrl = crossOriginUrl;\n var image = document.createElement('img');\n\n if (crossOrigin) {\n image.crossOrigin = crossOrigin;\n }\n\n image.src = crossOriginUrl || url;\n image.alt = element.alt || 'The image to crop';\n this.image = image;\n image.onload = this.start.bind(this);\n image.onerror = this.stop.bind(this);\n addClass(image, CLASS_HIDE);\n element.parentNode.insertBefore(image, element.nextSibling);\n }\n }, {\n key: \"start\",\n value: function start() {\n var _this2 = this;\n\n var image = this.image;\n image.onload = null;\n image.onerror = null;\n this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices,\n // such as Safari for iOS, Chrome for iOS, and in-app browsers.\n\n var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);\n\n var done = function done(naturalWidth, naturalHeight) {\n assign(_this2.imageData, {\n naturalWidth: naturalWidth,\n naturalHeight: naturalHeight,\n aspectRatio: naturalWidth / naturalHeight\n });\n _this2.initialImageData = assign({}, _this2.imageData);\n _this2.sizing = false;\n _this2.sized = true;\n\n _this2.build();\n }; // Most modern browsers (excepts iOS WebKit)\n\n\n if (image.naturalWidth && !isIOSWebKit) {\n done(image.naturalWidth, image.naturalHeight);\n return;\n }\n\n var sizingImage = document.createElement('img');\n var body = document.body || document.documentElement;\n this.sizingImage = sizingImage;\n\n sizingImage.onload = function () {\n done(sizingImage.width, sizingImage.height);\n\n if (!isIOSWebKit) {\n body.removeChild(sizingImage);\n }\n };\n\n sizingImage.src = image.src; // iOS WebKit will convert the image automatically\n // with its orientation once append it into DOM (#279)\n\n if (!isIOSWebKit) {\n sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';\n body.appendChild(sizingImage);\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n var image = this.image;\n image.onload = null;\n image.onerror = null;\n image.parentNode.removeChild(image);\n this.image = null;\n }\n }, {\n key: \"build\",\n value: function build() {\n if (!this.sized || this.ready) {\n return;\n }\n\n var element = this.element,\n options = this.options,\n image = this.image; // Create cropper elements\n\n var container = element.parentNode;\n var template = document.createElement('div');\n template.innerHTML = TEMPLATE;\n var cropper = template.querySelector(\".\".concat(NAMESPACE, \"-container\"));\n var canvas = cropper.querySelector(\".\".concat(NAMESPACE, \"-canvas\"));\n var dragBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-drag-box\"));\n var cropBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-crop-box\"));\n var face = cropBox.querySelector(\".\".concat(NAMESPACE, \"-face\"));\n this.container = container;\n this.cropper = cropper;\n this.canvas = canvas;\n this.dragBox = dragBox;\n this.cropBox = cropBox;\n this.viewBox = cropper.querySelector(\".\".concat(NAMESPACE, \"-view-box\"));\n this.face = face;\n canvas.appendChild(image); // Hide the original image\n\n addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image\n\n container.insertBefore(cropper, element.nextSibling); // Show the image if is hidden\n\n if (!this.isImg) {\n removeClass(image, CLASS_HIDE);\n }\n\n this.initPreview();\n this.bind();\n options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;\n options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;\n options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;\n addClass(cropBox, CLASS_HIDDEN);\n\n if (!options.guides) {\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-dashed\")), CLASS_HIDDEN);\n }\n\n if (!options.center) {\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-center\")), CLASS_HIDDEN);\n }\n\n if (options.background) {\n addClass(cropper, \"\".concat(NAMESPACE, \"-bg\"));\n }\n\n if (!options.highlight) {\n addClass(face, CLASS_INVISIBLE);\n }\n\n if (options.cropBoxMovable) {\n addClass(face, CLASS_MOVE);\n setData(face, DATA_ACTION, ACTION_ALL);\n }\n\n if (!options.cropBoxResizable) {\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-line\")), CLASS_HIDDEN);\n addClass(cropBox.getElementsByClassName(\"\".concat(NAMESPACE, \"-point\")), CLASS_HIDDEN);\n }\n\n this.render();\n this.ready = true;\n this.setDragMode(options.dragMode);\n\n if (options.autoCrop) {\n this.crop();\n }\n\n this.setData(options.data);\n\n if (isFunction(options.ready)) {\n addListener(element, EVENT_READY, options.ready, {\n once: true\n });\n }\n\n dispatchEvent(element, EVENT_READY);\n }\n }, {\n key: \"unbuild\",\n value: function unbuild() {\n if (!this.ready) {\n return;\n }\n\n this.ready = false;\n this.unbind();\n this.resetPreview();\n this.cropper.parentNode.removeChild(this.cropper);\n removeClass(this.element, CLASS_HIDDEN);\n }\n }, {\n key: \"uncreate\",\n value: function uncreate() {\n if (this.ready) {\n this.unbuild();\n this.ready = false;\n this.cropped = false;\n } else if (this.sizing) {\n this.sizingImage.onload = null;\n this.sizing = false;\n this.sized = false;\n } else if (this.reloading) {\n this.xhr.onabort = null;\n this.xhr.abort();\n } else if (this.image) {\n this.stop();\n }\n }\n /**\n * Get the no conflict cropper class.\n * @returns {Cropper} The cropper class.\n */\n\n }], [{\n key: \"noConflict\",\n value: function noConflict() {\n window.Cropper = AnotherCropper;\n return Cropper;\n }\n /**\n * Change the default options.\n * @param {Object} options - The new default options.\n */\n\n }, {\n key: \"setDefaults\",\n value: function setDefaults(options) {\n assign(DEFAULTS, isPlainObject(options) && options);\n }\n }]);\n\n return Cropper;\n}();\n\nassign(Cropper.prototype, render, preview, events, handlers, change, methods);\n\nexport default Cropper;\n","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","\n\n
\n\t\n\t
\n\n\n"],"names":["insert","target","svg","anchor","append","path","circle","rect","polyline","ownKeys","object","enumerableOnly","keys","symbols","sym","_objectSpread2","i","source","key","_defineProperty","_typeof","obj","_classCallCheck","instance","Constructor","_defineProperties","props","descriptor","_createClass","protoProps","staticProps","value","_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","_arrayLikeToArray","iter","o","minLen","n","len","arr2","IS_BROWSER","WINDOW","IS_TOUCH_DEVICE","HAS_POINTER_EVENT","NAMESPACE","ACTION_ALL","ACTION_CROP","ACTION_MOVE","ACTION_ZOOM","ACTION_EAST","ACTION_WEST","ACTION_SOUTH","ACTION_NORTH","ACTION_NORTH_EAST","ACTION_NORTH_WEST","ACTION_SOUTH_EAST","ACTION_SOUTH_WEST","CLASS_CROP","CLASS_DISABLED","CLASS_HIDDEN","CLASS_HIDE","CLASS_INVISIBLE","CLASS_MODAL","CLASS_MOVE","DATA_ACTION","DATA_PREVIEW","DRAG_MODE_CROP","DRAG_MODE_MOVE","DRAG_MODE_NONE","EVENT_CROP","EVENT_CROP_END","EVENT_CROP_MOVE","EVENT_CROP_START","EVENT_DBLCLICK","EVENT_TOUCH_START","EVENT_TOUCH_MOVE","EVENT_TOUCH_END","EVENT_POINTER_DOWN","EVENT_POINTER_MOVE","EVENT_POINTER_UP","EVENT_READY","EVENT_RESIZE","EVENT_WHEEL","EVENT_ZOOM","MIME_TYPE_JPEG","REGEXP_ACTIONS","REGEXP_DATA_URL","REGEXP_DATA_URL_JPEG","REGEXP_TAG_NAME","MIN_CONTAINER_WIDTH","MIN_CONTAINER_HEIGHT","DEFAULTS","TEMPLATE","isNaN","isNumber","isPositiveNumber","isUndefined","isObject","hasOwnProperty","isPlainObject","_constructor","prototype","isFunction","slice","toArray","forEach","data","callback","assign","_len","args","_key","arg","REGEXP_DECIMALS","normalizeDecimalNumber","times","REGEXP_SUFFIX","setStyle","element","styles","style","property","hasClass","addClass","elem","className","removeClass","toggleClass","added","REGEXP_CAMEL_CASE","toParamCase","getData","name","setData","removeData","REGEXP_SPACES","onceSupported","supported","once","listener","options","removeListener","type","handler","event","listeners","addListener","_handler","_element$listeners","_len2","_key2","dispatchEvent","getOffset","box","location","REGEXP_ORIGINS","isCrossOriginURL","url","parts","addTimestamp","timestamp","getTransforms","_ref","rotate","scaleX","scaleY","translateX","translateY","values","transform","getMaxZoomRatio","pointers","pointers2","maxRatio","pointer","pointerId","pointer2","x1","y1","x2","y2","z1","z2","ratio","getPointer","_ref2","endOnly","pageX","pageY","end","getPointersCenter","count","_ref3","startX","startY","getAdjustedSizes","_ref4","aspectRatio","height","width","isValidWidth","isValidHeight","adjustedWidth","getRotatedSizes","_ref5","degree","arc","sinArc","cosArc","newWidth","newHeight","getSourceCanvas","image","_ref6","_ref7","_ref8","imageAspectRatio","imageNaturalWidth","imageNaturalHeight","_ref6$rotate","_ref6$scaleX","_ref6$scaleY","naturalWidth","naturalHeight","_ref8$fillColor","fillColor","_ref8$imageSmoothingE","imageSmoothingEnabled","_ref8$imageSmoothingQ","imageSmoothingQuality","_ref8$maxWidth","maxWidth","_ref8$maxHeight","maxHeight","_ref8$minWidth","minWidth","_ref8$minHeight","minHeight","canvas","context","maxSizes","minSizes","destMaxSizes","destMinSizes","destWidth","destHeight","params","param","fromCharCode","getStringFromCharCode","dataView","start","length","str","REGEXP_DATA_URL_HEAD","dataURLToArrayBuffer","dataURL","base64","binary","arrayBuffer","uint8","arrayBufferToDataURL","mimeType","chunks","chunkSize","resetAndGetOrientation","orientation","littleEndian","app1Start","ifdStart","offset","exifIDCode","tiffOffset","endianness","firstIFDOffset","_length","_offset","parseOrientation","render","container","cropper","containerData","imageData","viewMode","rotated","canvasWidth","canvasHeight","canvasData","sizeLimited","positionLimited","cropBoxData","cropped","minCanvasWidth","minCanvasHeight","_getAdjustedSizes","newCanvasLeft","newCanvasTop","changed","transformed","_getRotatedSizes","autoCropArea","limited","minCropBoxWidth","minCropBoxHeight","maxCropBoxWidth","maxCropBoxHeight","preview","crossOrigin","alt","previews","el","img","cropBoxWidth","cropBoxHeight","left","top","originalWidth","originalHeight","events","handlers","ratioX","ratioY","_this","delta","buttons","button","action","touch","change","right","bottom","minLeft","minTop","renderable","range","check","side","p","methods","hasSameSize","offsetX","offsetY","_this$canvasData","x","y","_originalEvent","pivot","center","_scaleX","_scaleY","rounded","widthChanged","heightChanged","_this$getData","initialX","initialY","initialWidth","initialHeight","_options$imageSmoothi","sourceWidth","sourceHeight","srcX","srcY","srcWidth","srcHeight","dstX","dstY","dstWidth","dstHeight","scale","mode","dragBox","face","croppable","movable","AnotherCropper","Cropper","tagName","xhr","clone","_parseOrientation","crossOriginUrl","_this2","isIOSWebKit","done","sizingImage","body","template","cropBox","MapShim","getIndex","result","entry","index","class_1","entries","ctx","_i","_a","isBrowser","global$1","requestAnimationFrame$1","trailingTimeout","throttle","delay","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","REFRESH_DELAY","transitionKeys","mutationObserverSupported","ResizeObserverController","observer","observers","changesDetected","activeObservers","_b","propertyName","isReflowProperty","defineConfigurable","getWindowOf","ownerGlobal","emptyRect","createRectInit","toFloat","getBordersSize","positions","size","position","getPaddings","paddings","positions_1","getSVGContentRect","bbox","getHTMLElementContentRect","clientWidth","clientHeight","horizPad","vertPad","isDocumentElement","vertScrollbar","horizScrollbar","isSVGGraphicsElement","getContentRect","createReadOnlyRect","Constr","ResizeObservation","ResizeObserverEntry","rectInit","contentRect","ResizeObserverSPI","controller","callbackCtx","observations","observation","ResizeObserver","method","is_function","div","create_if_block","video","video_source","streaming","$$props","pending","mirror_webcam","include_audio","dispatch","createEventDispatcher","onMount","access_webcam","stream","err","take_picture","recording","recorded_blobs","media_recorder","take_recording","video_blob","ReaderObj","e","validMimeTypes","validMimeType","$$invalidate","$$value"],"mappings":"kvBAAAA,EAgBKC,EAAAC,EAAAC,CAAA,EAJJC,EAECF,EAAAG,CAAA,EACDD,EAA+BF,EAAAI,CAAA,meCfhCN,EAaKC,EAAAC,EAAAC,CAAA,EADJC,EAAgCF,EAAAI,CAAA,ghBCZjCN,EAaKC,EAAAC,EAAAC,CAAA,EADJC,EAAwDF,EAAAK,CAAA,giBCZzDP,EAcKC,EAAAC,EAAAC,CAAA,EAFJC,EAAkCF,EAAAM,CAAA,EAClCJ,EAA6CF,EAAAG,CAAA,mGCb9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUA,SAASI,GAAQC,EAAQC,EAAgB,CACvC,IAAIC,EAAO,OAAO,KAAKF,CAAM,EAE7B,GAAI,OAAO,sBAAuB,CAChC,IAAIG,EAAU,OAAO,sBAAsBH,CAAM,EAE7CC,IACFE,EAAUA,EAAQ,OAAO,SAAUC,EAAK,CACtC,OAAO,OAAO,yBAAyBJ,EAAQI,CAAG,EAAE,UAC5D,CA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b,EAAS,UAAS,CACjB,KAAMa,EAAE,OAAO,OACf,KAAM,UAAY9N,EAAS,UAAU,CAAC,EACtC,WAAY,KAEbiN,EAAS,gBAAgB,IAG3BY,EAAU,cAAcD,CAAU,OAElCX,EAAS,iBAAiB,EAC1BQ,EAAc,CAAA,MACVM,EAAc,CAAI,aAAc,WAAW,EACtC,QAAAC,KAAiBD,KACrB,cAAc,gBAAgBC,CAAa,EAAA,CAC9ChO,EAAWgO,QAIT,GAAAhO,IAAa,KAAI,CACpB,QAAQ,MAAM,qCAAqC,SAGpD0N,EAAqB,IAAA,cAAcL,EACxB,CAAA,SAAArN,CAAA,CAAA,EAEX0N,EAAe,iBAAiB,yBAA2BI,EAAC,CAC3DL,EAAe,KAAKK,EAAE,IAAI,IAE3BJ,EAAe,MAAM,GAAG,EAEzBO,EAAA,EAAAT,GAAaA,CAAS,EAGvBJ,IAEIR,GAAahG,IAAS,SACzB,OAAO,iBACF+F,IAAiBG,GACpBS,KAEC,+CAMcZ,EAAYuB","x_google_ignoreList":[4,5]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/TabItem-e9c69a3d.css b/gradio/templates/cdn/assets/TabItem-e9c69a3d.css new file mode 100644 index 0000000000000000000000000000000000000000..1266dd6e2b9efeaca97a25766a6f89ae745aca0e --- /dev/null +++ b/gradio/templates/cdn/assets/TabItem-e9c69a3d.css @@ -0,0 +1 @@ +.tabs.svelte-kqij2n{position:relative}.hide.svelte-kqij2n{display:none}.tab-nav.svelte-kqij2n{display:flex;position:relative;flex-wrap:wrap;border-bottom:1px solid var(--border-color-primary)}button.svelte-kqij2n{margin-bottom:-1px;border:1px solid transparent;border-color:transparent;border-bottom:none;border-top-right-radius:var(--container-radius);border-top-left-radius:var(--container-radius);padding:var(--size-1) var(--size-4);color:var(--body-text-color-subdued);font-weight:var(--section-header-text-weight);font-size:var(--section-header-text-size)}button.svelte-kqij2n:hover{color:var(--body-text-color)}.selected.svelte-kqij2n{border-color:var(--border-color-primary);background:var(--background-fill-primary);color:var(--body-text-color)}.bar.svelte-kqij2n{display:block;position:absolute;bottom:-2px;left:0;z-index:999;background:var(--background-fill-primary);width:100%;height:2px;content:""}div.svelte-19hvt5v{display:flex;position:relative;border:1px solid var(--border-color-primary);border-top:none;border-bottom-right-radius:var(--container-radius);border-bottom-left-radius:var(--container-radius);padding:var(--block-padding)} diff --git a/gradio/templates/cdn/assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js b/gradio/templates/cdn/assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js new file mode 100644 index 0000000000000000000000000000000000000000..a639ed08e7a14829955b45854645935b8f8d99a2 --- /dev/null +++ b/gradio/templates/cdn/assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js @@ -0,0 +1,2 @@ +import{S as G,e as H,s as K,G as w,a9 as O,N as j,O as T,K as k,U as A,p as g,M as v,H as P,ay as Q,ab as R,ac as U,ad as F,z as J,v as L,A as p,w as I,a4 as S,B as V,D as W,m as B,aA as C,P as N,Q as X,R as z}from"./index-fda37c89.js";function D(n,e,l){const s=n.slice();return s[14]=e[l],s[16]=l,s}function Y(n){let e,l=n[14].name+"",s,f,d,_;function i(){return n[12](n[14],n[16])}return{c(){e=j("button"),s=N(l),f=T(),k(e,"class","svelte-kqij2n")},m(u,m){g(u,e,m),v(e,s),v(e,f),d||(_=X(e,"click",i),d=!0)},p(u,m){n=u,m&8&&l!==(l=n[14].name+"")&&z(s,l)},d(u){u&&p(e),d=!1,_()}}}function Z(n){let e,l=n[14].name+"",s,f;return{c(){e=j("button"),s=N(l),f=T(),k(e,"class","selected svelte-kqij2n")},m(d,_){g(d,e,_),v(e,s),v(e,f)},p(d,_){_&8&&l!==(l=d[14].name+"")&&z(s,l)},d(d){d&&p(e)}}}function M(n,e){let l,s;function f(i,u){return i[14].id===i[4]?Z:Y}let d=f(e),_=d(e);return{key:n,first:null,c(){l=B(),_.c(),s=B(),this.first=l},m(i,u){g(i,l,u),_.m(i,u),g(i,s,u)},p(i,u){e=i,d===(d=f(e))&&_?_.p(e,u):(_.d(1),_=d(e),_&&(_.c(),_.m(s.parentNode,s)))},d(i){i&&(p(l),p(s)),_.d(i)}}}function x(n){let e,l,s=[],f=new Map,d,_,i,u=w(n[3]);const m=t=>t[14].id;for(let t=0;tl(4,f=a));const o=I(0);S(n,o,a=>l(13,s=a));const r=V();W($,{register_tab:a=>(c.push({name:a.name,id:a.id}),t.update(h=>h??a.id),l(3,c),c.length-1),unregister_tab:a=>{const h=c.findIndex(y=>y.id===a.id);c.splice(h,1),t.update(y=>y===a.id?c[h]?.id||c[c.length-1]?.id:y)},selected_tab:t,selected_tab_index:o});function q(a){l(9,b=a),C(t,f=a,f),C(o,s=c.findIndex(h=>h.id===a),s),r("change")}const E=(a,h)=>{q(a.id),r("select",{value:a.name,index:h})};return n.$$set=a=>{"visible"in a&&l(0,i=a.visible),"elem_id"in a&&l(1,u=a.elem_id),"elem_classes"in a&&l(2,m=a.elem_classes),"selected"in a&&l(9,b=a.selected),"$$scope"in a&&l(10,_=a.$$scope)},n.$$.update=()=>{n.$$.dirty&512&&b!==null&&q(b)},[i,u,m,c,f,t,o,r,q,b,_,d,E]}class le extends G{constructor(e){super(),H(this,e,ee,x,K,{visible:0,elem_id:1,elem_classes:2,selected:9})}}export{le as T,$ as a}; +//# sourceMappingURL=TabItem.svelte_svelte_type_style_lang-6b891bc7.js.map diff --git a/gradio/templates/cdn/assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js.map b/gradio/templates/cdn/assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js.map new file mode 100644 index 0000000000000000000000000000000000000000..128452986d4db8f052a55d7dbc24387cbc744622 --- /dev/null +++ b/gradio/templates/cdn/assets/TabItem.svelte_svelte_type_style_lang-6b891bc7.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TabItem.svelte_svelte_type_style_lang-6b891bc7.js","sources":["../../../../js/tabs/src/Tabs.svelte"],"sourcesContent":["\n\n\n\n
\n\t
\n\t\t{#each tabs as t, i (t.id)}\n\t\t\t{#if t.id === $selected_tab}\n\t\t\t\t\n\t\t\t{:else}\n\t\t\t\t {\n\t\t\t\t\t\tchange_tab(t.id);\n\t\t\t\t\t\tdispatch(\"select\", { value: t.name, index: i });\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{t.name}\n\t\t\t\t\n\t\t\t{/if}\n\t\t{/each}\n\t
\n\t\n
\n\n\n"],"names":["t0_value","ctx","insert","target","button","anchor","dirty","set_data","t0","create_if_block","get_key","i","div1","append","div0","TABS","visible","$$props","elem_id","elem_classes","selected","tabs","selected_tab","writable","selected_tab_index","dispatch","createEventDispatcher","setContext","tab","current","t","change_tab","id","$$invalidate","set_store_value","$selected_tab","$selected_tab_index"],"mappings":"gUAsEMA,EAAAC,MAAE,KAAI,6HANRC,EAOQC,EAAAC,EAAAC,CAAA,uDADNC,EAAA,GAAAN,KAAAA,EAAAC,MAAE,KAAI,KAAAM,EAAAC,EAAAR,CAAA,+CATNA,EAAAC,MAAE,KAAI,2FADRC,EAEQC,EAAAC,EAAAC,CAAA,wBADNC,EAAA,GAAAN,KAAAA,EAAAC,MAAE,KAAI,KAAAM,EAAAC,EAAAR,CAAA,iEAFJC,EAAC,EAAA,EAAC,KAAOA,EAAa,CAAA,EAAAQ,qRADrBR,EAAI,CAAA,CAAA,EAAU,MAAAS,EAAAT,GAAAA,MAAE,mBAArB,OAAIU,GAAA,EAAA,kPAFUV,EAAY,CAAA,EAAC,KAAK,GAAG,EAAA,gBAAA,WAA8BA,EAAO,CAAA,CAAA,cAApBA,EAAO,CAAA,CAAA,UAA/DC,EAoBKC,EAAAS,EAAAP,CAAA,EAnBJQ,EAiBKD,EAAAE,CAAA,oGAhBGb,EAAI,CAAA,CAAA,mIAFKA,EAAY,CAAA,EAAC,KAAK,GAAG,EAAA,uDAA8BA,EAAO,CAAA,CAAA,yBAApBA,EAAO,CAAA,CAAA,gHAvDjDc,EAAI,CAAA,wDAaN,CAAA,QAAAC,EAAmB,EAAI,EAAAC,EACvB,CAAA,QAAAC,EAAkB,IAAI,EAAAD,GACtB,aAAAE,EAAY,EAAA,EAAAF,GACZ,SAAAG,CAAkC,EAAAH,EAEzCI,EAAI,CAAA,QAEFC,EAAeC,EAA2C,EAAK,2BAC/DC,EAAqBD,EAAiB,CAAC,sBACvC,MAAAE,EAAWC,IAKjBC,EAAWZ,EAAI,CACd,aAAea,IACdP,EAAK,KAAO,CAAA,KAAMO,EAAI,KAAM,GAAIA,EAAI,EAAE,CAAA,EACtCN,EAAa,OAAQO,GAAYA,GAAWD,EAAI,EAAE,SAE3CP,EAAK,OAAS,GAEtB,eAAiBO,GAAQ,CAClB,MAAAjB,EAAIU,EAAK,UAAWS,GAAMA,EAAE,KAAOF,EAAI,EAAE,EAC/CP,EAAK,OAAOV,EAAG,CAAC,EAChBW,EAAa,OAAQO,GACpBA,IAAYD,EAAI,GAAKP,EAAKV,CAAC,GAAG,IAAMU,EAAKA,EAAK,OAAS,CAAC,GAAG,GAAKQ,CAAO,GAGzE,aAAAP,EACA,mBAAAE,IAGQ,SAAAO,EAAWC,EAA4B,CAC/CC,EAAA,EAAAb,EAAWY,CAAE,EACbE,EAAAZ,EAAAa,EAAgBH,EAAEG,CAAA,MAClBC,EAAsBf,EAAK,UAAWS,GAAMA,EAAE,KAAOE,CAAE,EAAAI,CAAA,EACvDX,EAAS,QAAQ,kBAgBbM,EAAWD,EAAE,EAAE,EACfL,EAAS,SAAQ,CAAI,MAAOK,EAAE,KAAM,MAAOnB,CAAC,CAAA,qOAd9CS,IAAa,MAAQW,EAAWX,CAAQ"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Textbox-f5959df8.js b/gradio/templates/cdn/assets/Textbox-f5959df8.js new file mode 100644 index 0000000000000000000000000000000000000000..3a7f229aea8b35283b1f8bf9d8f1fd60046a367a --- /dev/null +++ b/gradio/templates/cdn/assets/Textbox-f5959df8.js @@ -0,0 +1,2 @@ +import{S as fe,e as oe,s as _e,N as S,k as K,O as te,K as b,U as le,p as y,o as L,M as ke,u as G,v,y as I,z as k,A as T,x as U,B as we,am as ve,P as ye,R as Te,a7 as ie,h as H,ap as C,aj as qe,Q as g,X as Ee,a1 as J,m as re,n as Z,Z as Be,$ as Ne,ak as d,j as ne,t as se,F as P,E as ze,ae as Ce,q as Se,r as je}from"./index-fda37c89.js";/* empty css */import{f as De,B as He}from"./Button-e3640f74.js";import{B as Ke}from"./BlockTitle-44d14959.js";import{C as Le,a as Ue}from"./Copy-be466f7f.js";function Ae(l){let e;return{c(){e=ye(l[3])},m(t,u){y(t,e,u)},p(t,u){u[0]&8&&Te(e,t[3])},d(t){t&&T(e)}}}function Fe(l){let e,t,u,n,i,a,m,c,r=l[6]&&l[10]&&ue(l);return{c(){r&&r.c(),e=te(),t=S("textarea"),b(t,"data-testid","textbox"),b(t,"class","scroll-hide svelte-1kcgrqr"),b(t,"dir",u=l[11]?"rtl":"ltr"),b(t,"placeholder",l[2]),b(t,"rows",l[1]),t.disabled=l[5],t.autofocus=l[12],b(t,"style",n=l[13]?"text-align: "+l[13]:"")},m(s,_){r&&r.m(s,_),y(s,e,_),y(s,t,_),C(t,l[0]),l[29](t),a=!0,l[12]&&t.focus(),m||(c=[qe(i=l[20].call(null,t,l[0])),g(t,"input",l[28]),g(t,"keypress",l[19]),g(t,"blur",l[16]),g(t,"select",l[18])],m=!0)},p(s,_){s[6]&&s[10]?r?(r.p(s,_),_[0]&1088&&k(r,1)):(r=ue(s),r.c(),k(r,1),r.m(e.parentNode,e)):r&&(G(),v(r,1,1,()=>{r=null}),I()),(!a||_[0]&2048&&u!==(u=s[11]?"rtl":"ltr"))&&b(t,"dir",u),(!a||_[0]&4)&&b(t,"placeholder",s[2]),(!a||_[0]&2)&&b(t,"rows",s[1]),(!a||_[0]&32)&&(t.disabled=s[5]),(!a||_[0]&4096)&&(t.autofocus=s[12]),(!a||_[0]&8192&&n!==(n=s[13]?"text-align: "+s[13]:""))&&b(t,"style",n),i&&Ee(i.update)&&_[0]&1&&i.update.call(null,s[0]),_[0]&1&&C(t,s[0])},i(s){a||(k(r),a=!0)},o(s){v(r),a=!1},d(s){s&&(T(e),T(t)),r&&r.d(s),l[29](null),m=!1,J(c)}}}function Me(l){let e;function t(i,a){if(i[9]==="text")return Xe;if(i[9]==="password")return Re;if(i[9]==="email")return Qe}let u=t(l),n=u&&u(l);return{c(){n&&n.c(),e=re()},m(i,a){n&&n.m(i,a),y(i,e,a)},p(i,a){u===(u=t(i))&&n?n.p(i,a):(n&&n.d(1),n=u&&u(i),n&&(n.c(),n.m(e.parentNode,e)))},i:Z,o:Z,d(i){i&&T(e),n&&n.d(i)}}}function ue(l){let e,t,u,n;const i=[Pe,Oe],a=[];function m(c,r){return c[15]?0:1}return e=m(l),t=a[e]=i[e](l),{c(){t.c(),u=re()},m(c,r){a[e].m(c,r),y(c,u,r),n=!0},p(c,r){let s=e;e=m(c),e===s?a[e].p(c,r):(G(),v(a[s],1,1,()=>{a[s]=null}),I(),t=a[e],t?t.p(c,r):(t=a[e]=i[e](c),t.c()),k(t,1),t.m(u.parentNode,u))},i(c){n||(k(t),n=!0)},o(c){v(t),n=!1},d(c){c&&T(u),a[e].d(c)}}}function Oe(l){let e,t,u,n,i;return t=new Le({}),{c(){e=S("button"),K(t.$$.fragment),b(e,"class","copy-text svelte-1kcgrqr")},m(a,m){y(a,e,m),L(t,e,null),u=!0,n||(i=g(e,"click",l[17]),n=!0)},p:Z,i(a){u||(k(t.$$.fragment,a),u=!0)},o(a){v(t.$$.fragment,a),u=!1},d(a){a&&T(e),U(t),n=!1,i()}}}function Pe(l){let e,t,u,n;return t=new Ue({}),{c(){e=S("button"),K(t.$$.fragment),b(e,"class","svelte-1kcgrqr")},m(i,a){y(i,e,a),L(t,e,null),n=!0},p:Z,i(i){n||(k(t.$$.fragment,i),i&&(u||Be(()=>{u=Ne(e,De,{duration:300}),u.start()})),n=!0)},o(i){v(t.$$.fragment,i),n=!1},d(i){i&&T(e),U(t)}}}function Qe(l){let e,t,u;return{c(){e=S("input"),b(e,"data-testid","textbox"),b(e,"type","email"),b(e,"class","scroll-hide svelte-1kcgrqr"),b(e,"placeholder",l[2]),e.disabled=l[5],e.autofocus=l[12],b(e,"autocomplete","email")},m(n,i){y(n,e,i),C(e,l[0]),l[27](e),l[12]&&e.focus(),t||(u=[g(e,"input",l[26]),g(e,"keypress",l[19]),g(e,"blur",l[16]),g(e,"select",l[18])],t=!0)},p(n,i){i[0]&4&&b(e,"placeholder",n[2]),i[0]&32&&(e.disabled=n[5]),i[0]&4096&&(e.autofocus=n[12]),i[0]&1&&e.value!==n[0]&&C(e,n[0])},d(n){n&&T(e),l[27](null),t=!1,J(u)}}}function Re(l){let e,t,u;return{c(){e=S("input"),b(e,"data-testid","password"),b(e,"type","password"),b(e,"class","scroll-hide svelte-1kcgrqr"),b(e,"placeholder",l[2]),e.disabled=l[5],e.autofocus=l[12],b(e,"autocomplete","")},m(n,i){y(n,e,i),C(e,l[0]),l[25](e),l[12]&&e.focus(),t||(u=[g(e,"input",l[24]),g(e,"keypress",l[19]),g(e,"blur",l[16]),g(e,"select",l[18])],t=!0)},p(n,i){i[0]&4&&b(e,"placeholder",n[2]),i[0]&32&&(e.disabled=n[5]),i[0]&4096&&(e.autofocus=n[12]),i[0]&1&&e.value!==n[0]&&C(e,n[0])},d(n){n&&T(e),l[25](null),t=!1,J(u)}}}function Xe(l){let e,t,u,n,i;return{c(){e=S("input"),b(e,"data-testid","textbox"),b(e,"type","text"),b(e,"class","scroll-hide svelte-1kcgrqr"),b(e,"dir",t=l[11]?"rtl":"ltr"),b(e,"placeholder",l[2]),e.disabled=l[5],e.autofocus=l[12],b(e,"style",u=l[13]?"text-align: "+l[13]:"")},m(a,m){y(a,e,m),C(e,l[0]),l[23](e),l[12]&&e.focus(),n||(i=[g(e,"input",l[22]),g(e,"keypress",l[19]),g(e,"blur",l[16]),g(e,"select",l[18])],n=!0)},p(a,m){m[0]&2048&&t!==(t=a[11]?"rtl":"ltr")&&b(e,"dir",t),m[0]&4&&b(e,"placeholder",a[2]),m[0]&32&&(e.disabled=a[5]),m[0]&4096&&(e.autofocus=a[12]),m[0]&8192&&u!==(u=a[13]?"text-align: "+a[13]:"")&&b(e,"style",u),m[0]&1&&e.value!==a[0]&&C(e,a[0])},d(a){a&&T(e),l[23](null),n=!1,J(i)}}}function Ye(l){let e,t,u,n,i,a;t=new Ke({props:{show_label:l[6],info:l[4],$$slots:{default:[Ae]},$$scope:{ctx:l}}});const m=[Me,Fe],c=[];function r(s,_){return s[1]===1&&s[8]===1?0:1}return n=r(l),i=c[n]=m[n](l),{c(){e=S("label"),K(t.$$.fragment),u=te(),i.c(),b(e,"class","svelte-1kcgrqr"),le(e,"container",l[7])},m(s,_){y(s,e,_),L(t,e,null),ke(e,u),c[n].m(e,null),a=!0},p(s,_){const h={};_[0]&64&&(h.show_label=s[6]),_[0]&16&&(h.info=s[4]),_[0]&8|_[1]&16&&(h.$$scope={dirty:_,ctx:s}),t.$set(h);let q=n;n=r(s),n===q?c[n].p(s,_):(G(),v(c[q],1,1,()=>{c[q]=null}),I(),i=c[n],i?i.p(s,_):(i=c[n]=m[n](s),i.c()),k(i,1),i.m(e,null)),(!a||_[0]&128)&&le(e,"container",s[7])},i(s){a||(k(t.$$.fragment,s),k(i),a=!0)},o(s){v(t.$$.fragment,s),v(i),a=!1},d(s){s&&T(e),U(t),c[n].d()}}}function Ze(l,e,t){let{value:u=""}=e,{value_is_output:n=!1}=e,{lines:i=1}=e,{placeholder:a="Type here..."}=e,{label:m}=e,{info:c=void 0}=e,{disabled:r=!1}=e,{show_label:s=!0}=e,{container:_=!0}=e,{max_lines:h}=e,{type:q="text"}=e,{show_copy_button:A=!1}=e,{rtl:F=!1}=e,{autofocus:M=!1}=e,{text_align:O=void 0}=e,w,j=!1,N;const E=we();function Q(){E("change",u),n||E("input")}ve(()=>{t(21,n=!1)});function R(){E("blur")}async function V(){"clipboard"in navigator&&(await navigator.clipboard.writeText(u),W())}function W(){t(15,j=!0),N&&clearTimeout(N),N=setTimeout(()=>{t(15,j=!1)},1e3)}function p(o){const B=o.target,X=B.value,z=[B.selectionStart,B.selectionEnd];E("select",{value:X.substring(...z),index:z})}async function x(o){await ie(),(o.key==="Enter"&&o.shiftKey&&i>1||o.key==="Enter"&&!o.shiftKey&&i===1&&h>=1)&&(o.preventDefault(),E("submit"))}async function D(o){if(await ie(),i===h||!_)return;let B=h===void 0?!1:h===void 0?21*11:21*(h+1),X=21*(i+1);const z=o.target;z.style.height="1px";let Y;B&&z.scrollHeight>B?Y=B:z.scrollHeighto.removeEventListener("input",D)}}function ee(){u=this.value,t(0,u)}function f(o){H[o?"unshift":"push"](()=>{w=o,t(14,w)})}function ce(){u=this.value,t(0,u)}function he(o){H[o?"unshift":"push"](()=>{w=o,t(14,w)})}function be(){u=this.value,t(0,u)}function me(o){H[o?"unshift":"push"](()=>{w=o,t(14,w)})}function de(){u=this.value,t(0,u)}function ge(o){H[o?"unshift":"push"](()=>{w=o,t(14,w)})}return l.$$set=o=>{"value"in o&&t(0,u=o.value),"value_is_output"in o&&t(21,n=o.value_is_output),"lines"in o&&t(1,i=o.lines),"placeholder"in o&&t(2,a=o.placeholder),"label"in o&&t(3,m=o.label),"info"in o&&t(4,c=o.info),"disabled"in o&&t(5,r=o.disabled),"show_label"in o&&t(6,s=o.show_label),"container"in o&&t(7,_=o.container),"max_lines"in o&&t(8,h=o.max_lines),"type"in o&&t(9,q=o.type),"show_copy_button"in o&&t(10,A=o.show_copy_button),"rtl"in o&&t(11,F=o.rtl),"autofocus"in o&&t(12,M=o.autofocus),"text_align"in o&&t(13,O=o.text_align)},l.$$.update=()=>{l.$$.dirty[0]&16643&&w&&i!==h&&D({target:w}),l.$$.dirty[0]&1&&Q()},[u,i,a,m,c,r,s,_,h,q,A,F,M,O,w,j,R,V,p,x,$,n,ee,f,ce,he,be,me,de,ge]}let Ge=class extends fe{constructor(e){super(),oe(this,e,Ze,Ye,_e,{value:0,value_is_output:21,lines:1,placeholder:2,label:3,info:4,disabled:5,show_label:6,container:7,max_lines:8,type:9,show_copy_button:10,rtl:11,autofocus:12,text_align:13},null,[-1,-1])}};function ae(l){let e,t;const u=[l[16]];let n={};for(let i=0;ine(t,"value",m)),H.push(()=>ne(t,"value_is_output",c)),t.$on("change",l[23]),t.$on("input",l[24]),t.$on("submit",l[25]),t.$on("blur",l[26]),t.$on("select",l[27]),{c(){a&&a.c(),e=te(),K(t.$$.fragment)},m(s,_){a&&a.m(s,_),y(s,e,_),L(t,s,_),i=!0},p(s,_){s[16]?a?(a.p(s,_),_&65536&&k(a,1)):(a=ae(s),a.c(),k(a,1),a.m(e.parentNode,e)):a&&(G(),v(a,1,1,()=>{a=null}),I());const h={};_&4&&(h.label=s[2]),_&8&&(h.info=s[3]),_&512&&(h.show_label=s[9]),_&128&&(h.lines=s[7]),_&2048&&(h.type=s[11]),_&262144&&(h.rtl=s[18]),_&524288&&(h.text_align=s[19]),_&132224&&(h.max_lines=!s[10]&&s[17]==="static"?s[7]+1:s[10]),_&256&&(h.placeholder=s[8]),_&32768&&(h.show_copy_button=s[15]),_&1048576&&(h.autofocus=s[20]),_&4096&&(h.container=s[12]),_&131072&&(h.disabled=s[17]==="static"),!u&&_&1&&(u=!0,h.value=s[0],se(()=>u=!1)),!n&&_&2&&(n=!0,h.value_is_output=s[1],se(()=>n=!1)),t.$set(h)},i(s){i||(k(a),k(t.$$.fragment,s),i=!0)},o(s){v(a),v(t.$$.fragment,s),i=!1},d(s){s&&T(e),a&&a.d(s),U(t,s)}}}function Je(l){let e,t;return e=new He({props:{visible:l[6],elem_id:l[4],elem_classes:l[5],scale:l[13],min_width:l[14],allow_overflow:!1,padding:l[12],$$slots:{default:[Ie]},$$scope:{ctx:l}}}),{c(){K(e.$$.fragment)},m(u,n){L(e,u,n),t=!0},p(u,[n]){const i={};n&64&&(i.visible=u[6]),n&16&&(i.elem_id=u[4]),n&32&&(i.elem_classes=u[5]),n&8192&&(i.scale=u[13]),n&16384&&(i.min_width=u[14]),n&4096&&(i.padding=u[12]),n&270507919&&(i.$$scope={dirty:n,ctx:u}),e.$set(i)},i(u){t||(k(e.$$.fragment,u),t=!0)},o(u){v(e.$$.fragment,u),t=!1},d(u){U(e,u)}}}function Ve(l,e,t){let{label:u="Textbox"}=e,{info:n=void 0}=e,{elem_id:i=""}=e,{elem_classes:a=[]}=e,{visible:m=!0}=e,{value:c=""}=e,{lines:r}=e,{placeholder:s=""}=e,{show_label:_}=e,{max_lines:h}=e,{type:q="text"}=e,{container:A=!0}=e,{scale:F=null}=e,{min_width:M=void 0}=e,{show_copy_button:O=!1}=e,{loading_status:w=void 0}=e,{mode:j}=e,{value_is_output:N=!1}=e,{rtl:E=!1}=e,{text_align:Q=void 0}=e,{autofocus:R=!1}=e;function V(f){c=f,t(0,c)}function W(f){N=f,t(1,N)}function p(f){P.call(this,l,f)}function x(f){P.call(this,l,f)}function D(f){P.call(this,l,f)}function $(f){P.call(this,l,f)}function ee(f){P.call(this,l,f)}return l.$$set=f=>{"label"in f&&t(2,u=f.label),"info"in f&&t(3,n=f.info),"elem_id"in f&&t(4,i=f.elem_id),"elem_classes"in f&&t(5,a=f.elem_classes),"visible"in f&&t(6,m=f.visible),"value"in f&&t(0,c=f.value),"lines"in f&&t(7,r=f.lines),"placeholder"in f&&t(8,s=f.placeholder),"show_label"in f&&t(9,_=f.show_label),"max_lines"in f&&t(10,h=f.max_lines),"type"in f&&t(11,q=f.type),"container"in f&&t(12,A=f.container),"scale"in f&&t(13,F=f.scale),"min_width"in f&&t(14,M=f.min_width),"show_copy_button"in f&&t(15,O=f.show_copy_button),"loading_status"in f&&t(16,w=f.loading_status),"mode"in f&&t(17,j=f.mode),"value_is_output"in f&&t(1,N=f.value_is_output),"rtl"in f&&t(18,E=f.rtl),"text_align"in f&&t(19,Q=f.text_align),"autofocus"in f&&t(20,R=f.autofocus)},[c,N,u,n,i,a,m,r,s,_,h,q,A,F,M,O,w,j,E,Q,R,V,W,p,x,D,$,ee]}class lt extends fe{constructor(e){super(),oe(this,e,Ve,Je,_e,{label:2,info:3,elem_id:4,elem_classes:5,visible:6,value:0,lines:7,placeholder:8,show_label:9,max_lines:10,type:11,container:12,scale:13,min_width:14,show_copy_button:15,loading_status:16,mode:17,value_is_output:1,rtl:18,text_align:19,autofocus:20})}get label(){return this.$$.ctx[2]}set label(e){this.$$set({label:e}),d()}get info(){return this.$$.ctx[3]}set info(e){this.$$set({info:e}),d()}get elem_id(){return this.$$.ctx[4]}set elem_id(e){this.$$set({elem_id:e}),d()}get elem_classes(){return this.$$.ctx[5]}set elem_classes(e){this.$$set({elem_classes:e}),d()}get visible(){return this.$$.ctx[6]}set visible(e){this.$$set({visible:e}),d()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),d()}get lines(){return this.$$.ctx[7]}set lines(e){this.$$set({lines:e}),d()}get placeholder(){return this.$$.ctx[8]}set placeholder(e){this.$$set({placeholder:e}),d()}get show_label(){return this.$$.ctx[9]}set show_label(e){this.$$set({show_label:e}),d()}get max_lines(){return this.$$.ctx[10]}set max_lines(e){this.$$set({max_lines:e}),d()}get type(){return this.$$.ctx[11]}set type(e){this.$$set({type:e}),d()}get container(){return this.$$.ctx[12]}set container(e){this.$$set({container:e}),d()}get scale(){return this.$$.ctx[13]}set scale(e){this.$$set({scale:e}),d()}get min_width(){return this.$$.ctx[14]}set min_width(e){this.$$set({min_width:e}),d()}get show_copy_button(){return this.$$.ctx[15]}set show_copy_button(e){this.$$set({show_copy_button:e}),d()}get loading_status(){return this.$$.ctx[16]}set loading_status(e){this.$$set({loading_status:e}),d()}get mode(){return this.$$.ctx[17]}set mode(e){this.$$set({mode:e}),d()}get value_is_output(){return this.$$.ctx[1]}set value_is_output(e){this.$$set({value_is_output:e}),d()}get rtl(){return this.$$.ctx[18]}set rtl(e){this.$$set({rtl:e}),d()}get text_align(){return this.$$.ctx[19]}set text_align(e){this.$$set({text_align:e}),d()}get autofocus(){return this.$$.ctx[20]}set autofocus(e){this.$$set({autofocus:e}),d()}}export{lt as T}; +//# sourceMappingURL=Textbox-f5959df8.js.map diff --git a/gradio/templates/cdn/assets/Textbox-f5959df8.js.map b/gradio/templates/cdn/assets/Textbox-f5959df8.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e08e62ce2fe8d6abc5c78e4d5910f8d585cd49c8 --- /dev/null +++ b/gradio/templates/cdn/assets/Textbox-f5959df8.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Textbox-f5959df8.js","sources":["../../../../js/form/src/Textbox.svelte","../../../../js/app/src/components/Textbox/Textbox.svelte"],"sourcesContent":["\n\n\n\n\n\n","\n\n\n\n\n\t{#if loading_status}\n\t\t\n\t{/if}\n\n\t\n\n"],"names":["ctx","if_block","create_if_block_4","insert","target","textarea","anchor","create_if_block_1","create_if_block_2","create_if_block_3","button","button_intro","create_in_transition","fade","input","label_1","value","$$props","value_is_output","lines","placeholder","label","info","disabled","show_label","container","max_lines","type","show_copy_button","rtl","autofocus","text_align","el","copied","timer","dispatch","createEventDispatcher","handle_change","afterUpdate","$$invalidate","handle_blur","handle_copy","copy_feedback","handle_select","event","text","index","handle_keypress","e","tick","resize","max","min","scroll_height","text_area_resize","$$value","create_if_block","dirty","textbox_changes","elem_id","elem_classes","visible","scale","min_width","loading_status","mode"],"mappings":"skBA4IkCA,EAAK,CAAA,CAAA,wCAALA,EAAK,CAAA,CAAA,qDAmDhCC,EAAAD,MAAcA,EAAgB,EAAA,GAAAE,GAAAF,CAAA,gIAW7BA,EAAG,EAAA,EAAG,MAAQ,KAAK,qCAIlBA,EAAK,CAAA,CAAA,kDAMJA,EAAU,EAAA,EAAG,eAAiBA,EAAU,EAAA,EAAG,EAAE,+BAdrDG,EAeEC,EAAAC,EAAAC,CAAA,yEAbqBN,EAAK,CAAA,CAAA,CAAA,oCASdA,EAAe,EAAA,CAAA,aACnBA,EAAW,EAAA,CAAA,eACTA,EAAa,EAAA,CAAA,iBApBpBA,MAAcA,EAAgB,EAAA,sIAW7BA,EAAG,EAAA,EAAG,MAAQ,qF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2C,EAAY,EAAA,EAAA3C,EACZ,CAAA,QAAA4C,EAAmB,EAAI,EAAA5C,EACvB,CAAA,MAAAD,EAAgB,EAAE,EAAAC,GAClB,MAAAE,CAAa,EAAAF,EACb,CAAA,YAAAG,EAAsB,EAAE,EAAAH,GACxB,WAAAO,CAAmB,EAAAP,GACnB,UAAAS,CAAiB,EAAAT,EACjB,CAAA,KAAAU,EAAsC,MAAM,EAAAV,EAC5C,CAAA,UAAAQ,EAAqB,EAAI,EAAAR,EACzB,CAAA,MAAA6C,EAAuB,IAAI,EAAA7C,EAC3B,CAAA,UAAA8C,EAAgC,MAAS,EAAA9C,EACzC,CAAA,iBAAAW,EAA4B,EAAK,EAAAX,EACjC,CAAA,eAAA+C,EAA4C,MAAS,EAAA/C,GACrD,KAAAgD,CAA0B,EAAAhD,EAC1B,CAAA,gBAAAC,EAA2B,EAAK,EAAAD,EAChC,CAAA,IAAAY,EAAM,EAAK,EAAAZ,EACX,CAAA,WAAAc,EAA2C,MAAS,EAAAd,EACpD,CAAA,UAAAa,EAAqB,EAAK,EAAAb"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/Upload-34ce8178.js b/gradio/templates/cdn/assets/Upload-34ce8178.js new file mode 100644 index 0000000000000000000000000000000000000000..6c43cb55f0cdbc67e15afcbd4c11758d06b29f0f --- /dev/null +++ b/gradio/templates/cdn/assets/Upload-34ce8178.js @@ -0,0 +1,2 @@ +import{S as H,e as I,s as J,a9 as L,N as A,O as V,K as o,U as F,p as W,M as B,Q as f,Y as m,af as b,ab as X,ac as Z,ad as x,z as $,v as ee,A as ae,a1 as le,B as te,F as y,h as ie}from"./index-fda37c89.js";import{b as ne}from"./ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js";function re(l){let a,n,r,c,g,u,i,k,z;const v=l[15].default,d=L(v,l,l[14],null);return{c(){a=A("div"),d&&d.c(),n=V(),r=A("input"),o(r,"type","file"),o(r,"accept",l[0]),r.multiple=c=l[4]==="multiple"||void 0,o(r,"webkitdirectory",g=l[4]==="directory"||void 0),o(r,"mozdirectory",u=l[4]==="directory"||void 0),o(r,"class","svelte-116rqfv"),o(a,"class","svelte-116rqfv"),F(a,"center",l[2]),F(a,"boundedheight",l[1]),F(a,"flex",l[3])},m(t,s){W(t,a,s),d&&d.m(a,null),B(a,n),B(a,r),l[23](r),i=!0,k||(z=[f(r,"change",l[8]),f(a,"drag",m(b(l[16]))),f(a,"dragstart",m(b(l[17]))),f(a,"dragend",m(b(l[18]))),f(a,"dragover",m(b(l[19]))),f(a,"dragenter",m(b(l[20]))),f(a,"dragleave",m(b(l[21]))),f(a,"drop",m(b(l[22]))),f(a,"click",l[7]),f(a,"drop",l[9]),f(a,"dragenter",l[6]),f(a,"dragleave",l[6])],k=!0)},p(t,[s]){d&&d.p&&(!i||s&16384)&&X(d,v,t,t[14],i?x(v,t[14],s,null):Z(t[14]),null),(!i||s&1)&&o(r,"accept",t[0]),(!i||s&16&&c!==(c=t[4]==="multiple"||void 0))&&(r.multiple=c),(!i||s&16&&g!==(g=t[4]==="directory"||void 0))&&o(r,"webkitdirectory",g),(!i||s&16&&u!==(u=t[4]==="directory"||void 0))&&o(r,"mozdirectory",u),(!i||s&4)&&F(a,"center",t[2]),(!i||s&2)&&F(a,"boundedheight",t[1]),(!i||s&8)&&F(a,"flex",t[3])},i(t){i||($(d,t),i=!0)},o(t){ee(d,t),i=!1},d(t){t&&ae(a),d&&d.d(t),l[23](null),k=!1,le(z)}}}function de(l,a,n){let{$$slots:r={},$$scope:c}=a,{filetype:g=null}=a,{include_file_metadata:u=!0}=a,{dragging:i=!1}=a,{boundedheight:k=!0}=a,{center:z=!0}=a,{flex:v=!0}=a,{file_count:d="single"}=a,{disable_click:t=!1}=a,{parse_to_data_url:s=!0}=a,w;const S=te(),C=()=>{n(10,i=!i)},E=()=>{t||(n(5,w.value="",w),w.click())},D=async e=>{let h=Array.from(e);if(!(!e.length||!window.FileReader)){if(d==="single"&&(h=[e[0]]),u)var T=h.map(_=>({name:_.name,size:_.size}));var p=[],U=[];s?U=await Promise.all(h.map(_=>ne(_))):U=h,u?s?p=U.map((_,q)=>({data:_,...T[q]})):p=U.map((_,q)=>({data:"",blob:_,...T[q]})):p=U,S("load",d==="single"?p[0]:p)}},K=async e=>{const h=e.target;h.files&&await D(h.files)},M=async e=>{n(10,i=!1),e.dataTransfer?.files&&await D(e.dataTransfer.files)};function N(e){y.call(this,l,e)}function O(e){y.call(this,l,e)}function P(e){y.call(this,l,e)}function Q(e){y.call(this,l,e)}function R(e){y.call(this,l,e)}function Y(e){y.call(this,l,e)}function j(e){y.call(this,l,e)}function G(e){ie[e?"unshift":"push"](()=>{w=e,n(5,w)})}return l.$$set=e=>{"filetype"in e&&n(0,g=e.filetype),"include_file_metadata"in e&&n(11,u=e.include_file_metadata),"dragging"in e&&n(10,i=e.dragging),"boundedheight"in e&&n(1,k=e.boundedheight),"center"in e&&n(2,z=e.center),"flex"in e&&n(3,v=e.flex),"file_count"in e&&n(4,d=e.file_count),"disable_click"in e&&n(12,t=e.disable_click),"parse_to_data_url"in e&&n(13,s=e.parse_to_data_url),"$$scope"in e&&n(14,c=e.$$scope)},[g,k,z,v,d,w,C,E,K,M,i,u,t,s,c,r,N,O,P,Q,R,Y,j,G]}class ue extends H{constructor(a){super(),I(this,a,de,re,J,{filetype:0,include_file_metadata:11,dragging:10,boundedheight:1,center:2,flex:3,file_count:4,disable_click:12,parse_to_data_url:13})}}export{ue as U}; +//# sourceMappingURL=Upload-34ce8178.js.map diff --git a/gradio/templates/cdn/assets/Upload-34ce8178.js.map b/gradio/templates/cdn/assets/Upload-34ce8178.js.map new file mode 100644 index 0000000000000000000000000000000000000000..9e9ba247a8718d7267c0624be0d07ff6c60efd58 --- /dev/null +++ b/gradio/templates/cdn/assets/Upload-34ce8178.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Upload-34ce8178.js","sources":["../../../../js/upload/src/Upload.svelte"],"sourcesContent":["\n\n\n\t\n\t\n\n\n\n"],"names":["ctx","insert","target","div","anchor","append","input","filetype","$$props","include_file_metadata","dragging","boundedheight","center","flex","file_count","disable_click","parse_to_data_url","hidden_upload","dispatch","createEventDispatcher","updateDragging","$$invalidate","openFileUpload","loadFiles","files","_files","file_metadata","f","load_file_data","file_data","blobToBase64","data","i","loadFilesFromUpload","loadFilesFromDrop","$$value"],"mappings":"4bA4GUA,EAAQ,CAAA,CAAA,eACNA,EAAU,CAAA,IAAK,YAAc,+BACtBA,EAAU,CAAA,IAAK,aAAe,MAAS,uBAC1CA,EAAU,CAAA,IAAK,aAAe,MAAS,oIAxBvDC,EA0BKC,EAAAC,EAAAC,CAAA,wBATJC,EAQCF,EAAAG,CAAA,oCALWN,EAAmB,CAAA,CAAA,4MATrBA,EAAc,CAAA,CAAA,aACfA,EAAiB,CAAA,CAAA,kBACZA,EAAc,CAAA,CAAA,kBACdA,EAAc,CAAA,CAAA,mHAOnBA,EAAQ,CAAA,CAAA,oBACNA,EAAU,CAAA,IAAK,YAAc,2CACtBA,EAAU,CAAA,IAAK,aAAe,qDACjCA,EAAU,CAAA,IAAK,aAAe,4QA1GlC,CAAA,SAAAO,EAA0B,IAAI,EAAAC,EAC9B,CAAA,sBAAAC,EAAwB,EAAI,EAAAD,EAC5B,CAAA,SAAAE,EAAW,EAAK,EAAAF,EAChB,CAAA,cAAAG,EAAgB,EAAI,EAAAH,EACpB,CAAA,OAAAI,EAAS,EAAI,EAAAJ,EACb,CAAA,KAAAK,EAAO,EAAI,EAAAL,EACX,CAAA,WAAAM,EAAa,QAAQ,EAAAN,EACrB,CAAA,cAAAO,EAAgB,EAAK,EAAAP,EACrB,CAAA,kBAAAQ,EAAoB,EAAI,EAAAR,EAE/BS,EAEE,MAAAC,EAAWC,KAEXC,EAAc,IAAA,CACnBC,EAAA,GAAAX,GAAYA,CAAQ,GAGfY,EAAc,IAAA,CACfP,QACJE,EAAc,MAAQ,GAAEA,CAAA,EACxBA,EAAc,MAAK,IAGdM,QAAmBC,GAAe,CACnC,IAAAC,EAAiB,MAAM,KAAKD,CAAK,EAChC,GAAA,GAAAA,EAAM,QAAW,CAAA,OAAO,gBAGzBV,IAAe,WAClBW,EAAM,CAAID,EAAM,CAAC,CAAA,GAGdf,EACC,IAAAiB,EAAkDD,EAAO,IAAKE,IACjE,CAAA,KAAMA,EAAE,KACR,KAAMA,EAAE,IAAA,EAAA,MAGNC,EAAc,CAAA,EACdC,EAAS,CAAA,EACTb,EACHa,EAAkB,MAAA,QAAQ,IAAIJ,EAAO,IAAKE,GAAMG,GAAaH,CAAC,CAAA,CAAA,EAE9DE,EAAYJ,EAEThB,EACCO,EACHY,EAAiBC,EAAU,IAAK,CAAAE,EAAMC,KACrC,CAAA,KAAAD,EACG,GAAAL,EAAcM,CAAC,CAAA,EAAA,EAGnBJ,EAAiBC,EAAU,IAAK,CAAAE,EAAMC,KAAC,CACtC,KAAM,GACN,KAAMD,EACH,GAAAL,EAAcM,CAAC,KAIpBJ,EAAiBC,EAElBX,EACC,OACAJ,IAAe,SAAWc,EAAe,CAAC,EAAIA,CAAc,IAIxDK,QAA6B,GAAQ,OACpC/B,EAAS,EAAE,OAEZA,EAAO,aACNqB,EAAUrB,EAAO,KAAK,GAGvBgC,QAA2B,GAAY,CAC5Cb,EAAA,GAAAX,EAAW,EAAK,EACX,EAAE,cAAc,OACf,MAAAa,EAAU,EAAE,aAAa,KAAK,sQAuBzBN,EAAakB"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/UploadText-690664d1.css b/gradio/templates/cdn/assets/UploadText-690664d1.css new file mode 100644 index 0000000000000000000000000000000000000000..858fdcc04577128b4960af9c51ca8c41e2fd69e4 --- /dev/null +++ b/gradio/templates/cdn/assets/UploadText-690664d1.css @@ -0,0 +1 @@ +.wrap.svelte-1ck5uk8{display:flex;flex-direction:column;justify-content:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md)}.or.svelte-1ck5uk8{color:var(--body-text-color-subdued)}@media (min-width: 768px){.wrap.svelte-1ck5uk8{font-size:var(--text-lg)}} diff --git a/gradio/templates/cdn/assets/UploadText-df690b17.js b/gradio/templates/cdn/assets/UploadText-df690b17.js new file mode 100644 index 0000000000000000000000000000000000000000..f35621adee9a219dc2c2413002cce120e3fe80d3 --- /dev/null +++ b/gradio/templates/cdn/assets/UploadText-df690b17.js @@ -0,0 +1,2 @@ +import{S as h,e as S,s as T,N as g,P as c,O as y,K as U,p as q,M as l,R as v,n as b,A as w,a4 as A}from"./index-fda37c89.js";import{X as C}from"./Blocks-53d5f72d.js";function K(t){let e,o=t[1](t[2][t[0]])+"",i,r,s,n,_=t[1]("or")+"",d,m,k,f=t[1]("interface.click_to_upload")+"",u;return{c(){e=g("div"),i=c(o),r=y(),s=g("span"),n=c("- "),d=c(_),m=c(" -"),k=y(),u=c(f),U(s,"class","or svelte-1ck5uk8"),U(e,"class","wrap svelte-1ck5uk8")},m(a,p){q(a,e,p),l(e,i),l(e,r),l(e,s),l(s,n),l(s,d),l(s,m),l(e,k),l(e,u)},p(a,[p]){p&3&&o!==(o=a[1](a[2][a[0]])+"")&&v(i,o),p&2&&_!==(_=a[1]("or")+"")&&v(d,_),p&2&&f!==(f=a[1]("interface.click_to_upload")+"")&&v(u,f)},i:b,o:b,d(a){a&&w(e)}}}function M(t,e,o){let i;A(t,C,n=>o(1,i=n));let{type:r="file"}=e;const s={image:"interface.drop_image",video:"interface.drop_video",audio:"interface.drop_audio",file:"interface.drop_file",csv:"interface.drop_csv"};return t.$$set=n=>{"type"in n&&o(0,r=n.type)},[r,i,s]}class P extends h{constructor(e){super(),S(this,e,M,K,T,{type:0})}}export{P as U}; +//# sourceMappingURL=UploadText-df690b17.js.map diff --git a/gradio/templates/cdn/assets/UploadText-df690b17.js.map b/gradio/templates/cdn/assets/UploadText-df690b17.js.map new file mode 100644 index 0000000000000000000000000000000000000000..9f5106a5f11a17cc5a621a92cff0c0e7e6e76eeb --- /dev/null +++ b/gradio/templates/cdn/assets/UploadText-df690b17.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UploadText-df690b17.js","sources":["../../../../js/app/src/components/UploadText.svelte"],"sourcesContent":["\n\n
\n\t{$_(defs[type])}\n\t- {$_(\"or\")} -\n\t{$_(\"interface.click_to_upload\")}\n
\n\n\n"],"names":["ctx","t3_value","t6_value","insert","target","div","anchor","append","span","set_data","t0","t0_value","dirty","t3","t6","type","$$props","defs"],"mappings":"4LAeEA,EAAE,CAAA,EAACA,EAAI,CAAA,EAACA,EAAI,CAAA,CAAA,CAAA,EAAA,WACOC,EAAAD,KAAG,IAAI,EAAA,SAC1BE,EAAAF,KAAG,2BAA2B,EAAA,wDADd,IAAE,aAAU,IAAE,2FAFhCG,EAIKC,EAAAC,EAAAC,CAAA,gBAFJC,EAAqCF,EAAAG,CAAA,2DADpCR,EAAE,CAAA,EAACA,EAAI,CAAA,EAACA,EAAI,CAAA,CAAA,CAAA,EAAA,KAAAS,EAAAC,EAAAC,CAAA,EACOC,EAAA,GAAAX,KAAAA,EAAAD,KAAG,IAAI,EAAA,KAAAS,EAAAI,EAAAZ,CAAA,EAC1BW,EAAA,GAAAV,KAAAA,EAAAF,KAAG,2BAA2B,EAAA,KAAAS,EAAAK,EAAAZ,CAAA,qEAdpB,GAAA,CAAA,KAAAa,EAAqD,MAAM,EAAAC,QAEhEC,EAAI,CACT,MAAO,uBACP,MAAO,uBACP,MAAO,uBACP,KAAM,sBACN,IAAK"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/__vite-browser-external-b25bb000.js b/gradio/templates/cdn/assets/__vite-browser-external-b25bb000.js new file mode 100644 index 0000000000000000000000000000000000000000..efa8971d2172dd2c1924c07a4e2b2bc18871ccd9 --- /dev/null +++ b/gradio/templates/cdn/assets/__vite-browser-external-b25bb000.js @@ -0,0 +1,2 @@ +const e={};export{e as default}; +//# sourceMappingURL=__vite-browser-external-b25bb000.js.map diff --git a/gradio/templates/cdn/assets/__vite-browser-external-b25bb000.js.map b/gradio/templates/cdn/assets/__vite-browser-external-b25bb000.js.map new file mode 100644 index 0000000000000000000000000000000000000000..915d1d5f440bd869c874a44de9bae330ff668526 --- /dev/null +++ b/gradio/templates/cdn/assets/__vite-browser-external-b25bb000.js.map @@ -0,0 +1 @@ +{"version":3,"file":"__vite-browser-external-b25bb000.js","sources":["../../../../js/app/__vite-browser-external"],"sourcesContent":["export default {}"],"names":["require$$5"],"mappings":"AAAA,MAAeA,EAAA,CAAA"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/api-logo-5346f193.svg b/gradio/templates/cdn/assets/api-logo-5346f193.svg new file mode 100644 index 0000000000000000000000000000000000000000..bce49a58f0e8a89980e96b8f3bb99f7da48e6254 --- /dev/null +++ b/gradio/templates/cdn/assets/api-logo-5346f193.svg @@ -0,0 +1,4 @@ + + + + diff --git a/gradio/templates/cdn/assets/color-22b563e6.js b/gradio/templates/cdn/assets/color-22b563e6.js new file mode 100644 index 0000000000000000000000000000000000000000..4825b5d494d7805386fdf8d2996eaec773d1a6f6 --- /dev/null +++ b/gradio/templates/cdn/assets/color-22b563e6.js @@ -0,0 +1,2 @@ +import{ax as o}from"./index-fda37c89.js";const t=r=>o[r%o.length];export{t as g}; +//# sourceMappingURL=color-22b563e6.js.map diff --git a/gradio/templates/cdn/assets/color-22b563e6.js.map b/gradio/templates/cdn/assets/color-22b563e6.js.map new file mode 100644 index 0000000000000000000000000000000000000000..9a2fbfca3c472ed86616a83ebcda4c1b67da381b --- /dev/null +++ b/gradio/templates/cdn/assets/color-22b563e6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"color-22b563e6.js","sources":["../../../../js/utils/src/color.ts"],"sourcesContent":["import { colors, ordered_colors } from \"@gradio/theme\";\n\nexport const get_next_color = (index: number): keyof typeof colors => {\n\treturn ordered_colors[index % ordered_colors.length];\n};\n"],"names":["get_next_color","index","ordered_colors"],"mappings":"yCAEa,MAAAA,EAAkBC,GACvBC,EAAeD,EAAQC,EAAe,MAAM"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/csv-b0b7514a.js b/gradio/templates/cdn/assets/csv-b0b7514a.js new file mode 100644 index 0000000000000000000000000000000000000000..511b34b2aed1552447a6605d45d0760eccb992ab --- /dev/null +++ b/gradio/templates/cdn/assets/csv-b0b7514a.js @@ -0,0 +1,2 @@ +import{d as a}from"./dsv-576afacd.js";var s=a(","),v=s.parse,o=s.parseRows;export{v as a,o as c}; +//# sourceMappingURL=csv-b0b7514a.js.map diff --git a/gradio/templates/cdn/assets/csv-b0b7514a.js.map b/gradio/templates/cdn/assets/csv-b0b7514a.js.map new file mode 100644 index 0000000000000000000000000000000000000000..38da3fdeed03bf1be244216b0035570f7f605f9c --- /dev/null +++ b/gradio/templates/cdn/assets/csv-b0b7514a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"csv-b0b7514a.js","sources":["../../../../node_modules/.pnpm/d3-dsv@3.0.1/node_modules/d3-dsv/src/csv.js"],"sourcesContent":["import dsv from \"./dsv.js\";\n\nvar csv = dsv(\",\");\n\nexport var csvParse = csv.parse;\nexport var csvParseRows = csv.parseRows;\nexport var csvFormat = csv.format;\nexport var csvFormatBody = csv.formatBody;\nexport var csvFormatRows = csv.formatRows;\nexport var csvFormatRow = csv.formatRow;\nexport var csvFormatValue = csv.formatValue;\n"],"names":["csv","dsv","csvParse","csvParseRows"],"mappings":"sCAEA,IAAIA,EAAMC,EAAI,GAAG,EAENC,EAAWF,EAAI,MACfG,EAAeH,EAAI","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/dockerfile-d67bbd50.js b/gradio/templates/cdn/assets/dockerfile-d67bbd50.js new file mode 100644 index 0000000000000000000000000000000000000000..5405cd3af19be5d8cb56dbb55aefa442653e888a --- /dev/null +++ b/gradio/templates/cdn/assets/dockerfile-d67bbd50.js @@ -0,0 +1,2 @@ +function c(n){a(n,"start");var t={},e=n.languageData||{},s=!1;for(var l in n)if(l!=e&&n.hasOwnProperty(l))for(var u=t[l]=[],o=n[l],r=0;r2&&o.token&&typeof o.token!="string"){e.pending=[];for(var g=2;g-1)return null;var l=e.indent.length-1,u=n[e.state];n:for(;;){for(var o=0;o 2 && rule.token && typeof rule.token != \"string\") {\n state.pending = [];\n for (var j = 2; j < matches.length; j++)\n if (matches[j])\n state.pending.push({text: matches[j], token: rule.token[j - 1]});\n stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0));\n return token[0];\n } else if (token && token.join) {\n return token[0];\n } else {\n return token;\n }\n }\n }\n stream.next();\n return null;\n };\n}\n\nfunction indentFunction(states, meta) {\n return function(state, textAfter) {\n if (state.indent == null || meta.dontIndentStates && meta.doneIndentState.indexOf(state.state) > -1)\n return null\n\n var pos = state.indent.length - 1, rules = states[state.state];\n scan: for (;;) {\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n if (rule.data.dedent && rule.data.dedentIfLineStart !== false) {\n var m = rule.regex.exec(textAfter);\n if (m && m[0]) {\n pos--;\n if (rule.next || rule.push) rules = states[rule.next || rule.push];\n textAfter = textAfter.slice(m[0].length);\n continue scan;\n }\n }\n }\n break;\n }\n return pos < 0 ? 0 : state.indent[pos];\n };\n}\n","import {simpleMode} from \"./simple-mode.js\"\n\nvar from = \"from\";\nvar fromRegex = new RegExp(\"^(\\\\s*)\\\\b(\" + from + \")\\\\b\", \"i\");\n\nvar shells = [\"run\", \"cmd\", \"entrypoint\", \"shell\"];\nvar shellsAsArrayRegex = new RegExp(\"^(\\\\s*)(\" + shells.join('|') + \")(\\\\s+\\\\[)\", \"i\");\n\nvar expose = \"expose\";\nvar exposeRegex = new RegExp(\"^(\\\\s*)(\" + expose + \")(\\\\s+)\", \"i\");\n\nvar others = [\n \"arg\", \"from\", \"maintainer\", \"label\", \"env\",\n \"add\", \"copy\", \"volume\", \"user\",\n \"workdir\", \"onbuild\", \"stopsignal\", \"healthcheck\", \"shell\"\n];\n\n// Collect all Dockerfile directives\nvar instructions = [from, expose].concat(shells).concat(others),\n instructionRegex = \"(\" + instructions.join('|') + \")\",\n instructionOnlyLine = new RegExp(\"^(\\\\s*)\" + instructionRegex + \"(\\\\s*)(#.*)?$\", \"i\"),\n instructionWithArguments = new RegExp(\"^(\\\\s*)\" + instructionRegex + \"(\\\\s+)\", \"i\");\n\nexport const dockerFile = simpleMode({\n start: [\n // Block comment: This is a line starting with a comment\n {\n regex: /^\\s*#.*$/,\n sol: true,\n token: \"comment\"\n },\n {\n regex: fromRegex,\n token: [null, \"keyword\"],\n sol: true,\n next: \"from\"\n },\n // Highlight an instruction without any arguments (for convenience)\n {\n regex: instructionOnlyLine,\n token: [null, \"keyword\", null, \"error\"],\n sol: true\n },\n {\n regex: shellsAsArrayRegex,\n token: [null, \"keyword\", null],\n sol: true,\n next: \"array\"\n },\n {\n regex: exposeRegex,\n token: [null, \"keyword\", null],\n sol: true,\n next: \"expose\"\n },\n // Highlight an instruction followed by arguments\n {\n regex: instructionWithArguments,\n token: [null, \"keyword\", null],\n sol: true,\n next: \"arguments\"\n },\n {\n regex: /./,\n token: null\n }\n ],\n from: [\n {\n regex: /\\s*$/,\n token: null,\n next: \"start\"\n },\n {\n // Line comment without instruction arguments is an error\n regex: /(\\s*)(#.*)$/,\n token: [null, \"error\"],\n next: \"start\"\n },\n {\n regex: /(\\s*\\S+\\s+)(as)/i,\n token: [null, \"keyword\"],\n next: \"start\"\n },\n // Fail safe return to start\n {\n token: null,\n next: \"start\"\n }\n ],\n single: [\n {\n regex: /(?:[^\\\\']|\\\\.)/,\n token: \"string\"\n },\n {\n regex: /'/,\n token: \"string\",\n pop: true\n }\n ],\n double: [\n {\n regex: /(?:[^\\\\\"]|\\\\.)/,\n token: \"string\"\n },\n {\n regex: /\"/,\n token: \"string\",\n pop: true\n }\n ],\n array: [\n {\n regex: /\\]/,\n token: null,\n next: \"start\"\n },\n {\n regex: /\"(?:[^\\\\\"]|\\\\.)*\"?/,\n token: \"string\"\n }\n ],\n expose: [\n {\n regex: /\\d+$/,\n token: \"number\",\n next: \"start\"\n },\n {\n regex: /[^\\d]+$/,\n token: null,\n next: \"start\"\n },\n {\n regex: /\\d+/,\n token: \"number\"\n },\n {\n regex: /[^\\d]+/,\n token: null\n },\n // Fail safe return to start\n {\n token: null,\n next: \"start\"\n }\n ],\n arguments: [\n {\n regex: /^\\s*#.*$/,\n sol: true,\n token: \"comment\"\n },\n {\n regex: /\"(?:[^\\\\\"]|\\\\.)*\"?$/,\n token: \"string\",\n next: \"start\"\n },\n {\n regex: /\"/,\n token: \"string\",\n push: \"double\"\n },\n {\n regex: /'(?:[^\\\\']|\\\\.)*'?$/,\n token: \"string\",\n next: \"start\"\n },\n {\n regex: /'/,\n token: \"string\",\n push: \"single\"\n },\n {\n regex: /[^#\"']+[\\\\`]$/,\n token: null\n },\n {\n regex: /[^#\"']+$/,\n token: null,\n next: \"start\"\n },\n {\n regex: /[^#\"']+/,\n token: null\n },\n // Fail safe return to start\n {\n token: null,\n next: \"start\"\n }\n ],\n languageData: {\n commentTokens: {line: \"#\"}\n }\n});\n\n"],"names":["simpleMode","states","ensureState","states_","meta","hasIndentation","state","list","orig","i","data","Rule","s","tokenFunction","indentFunction","name","toRegex","val","caret","flags","asToken","result","stream","pend","curState","rule","matches","token","j","textAfter","pos","rules","scan","m","from","fromRegex","shells","shellsAsArrayRegex","expose","exposeRegex","others","instructions","instructionRegex","instructionOnlyLine","instructionWithArguments","dockerFile"],"mappings":"AAAO,SAASA,EAAWC,EAAQ,CACjCC,EAAYD,EAAQ,OAAO,EAC3B,IAAIE,EAAU,CAAE,EAAEC,EAAOH,EAAO,cAAgB,CAAE,EAAEI,EAAiB,GACrE,QAASC,KAASL,EAAQ,GAAIK,GAASF,GAAQH,EAAO,eAAeK,CAAK,EAExE,QADIC,EAAOJ,EAAQG,CAAK,EAAI,CAAE,EAAEE,EAAOP,EAAOK,CAAK,EAC1CG,EAAI,EAAGA,EAAID,EAAK,OAAQC,IAAK,CACpC,IAAIC,EAAOF,EAAKC,CAAC,EACjBF,EAAK,KAAK,IAAII,EAAKD,EAAMT,CAAM,CAAC,GAC5BS,EAAK,QAAUA,EAAK,UAAQL,EA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,EACD,MAAO,CACL,CACE,MAAO,KACP,MAAO,KACP,KAAM,OACP,EACD,CACE,MAAO,qBACP,MAAO,QACR,CACF,EACD,OAAQ,CACN,CACE,MAAO,OACP,MAAO,SACP,KAAM,OACP,EACD,CACE,MAAO,UACP,MAAO,KACP,KAAM,OACP,EACD,CACE,MAAO,MACP,MAAO,QACR,EACD,CACE,MAAO,SACP,MAAO,IACR,EAED,CACE,MAAO,KACP,KAAM,OACP,CACF,EACD,UAAW,CACT,CACE,MAAO,WACP,IAAK,GACL,MAAO,SACR,EACD,CACE,MAAO,sBACP,MAAO,SACP,KAAM,OACP,EACD,CACE,MAAO,IACP,MAAO,SACP,KAAM,QACP,EACD,CACE,MAAO,sBACP,MAAO,SACP,KAAM,OACP,EACD,CACE,MAAO,IACP,MAAO,SACP,KAAM,QACP,EACD,CACE,MAAO,gBACP,MAAO,IACR,EACD,CACE,MAAO,WACP,MAAO,KACP,KAAM,OACP,EACD,CACE,MAAO,UACP,MAAO,IACR,EAED,CACE,MAAO,KACP,KAAM,OACP,CACF,EACD,aAAc,CACZ,cAAe,CAAC,KAAM,GAAG,CAC1B,CACH,CAAC","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/dsv-576afacd.js b/gradio/templates/cdn/assets/dsv-576afacd.js new file mode 100644 index 0000000000000000000000000000000000000000..832d450961d23fb14b577c045f0c24c61e74c4e6 --- /dev/null +++ b/gradio/templates/cdn/assets/dsv-576afacd.js @@ -0,0 +1,6 @@ +var D={},A={},E=34,m=10,R=13;function I(r){return new Function("d","return {"+r.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function B(r,t){var e=I(r);return function(a,c){return t(e(a),c,r)}}function F(r){var t=Object.create(null),e=[];return r.forEach(function(a){for(var c in a)c in t||e.push(t[c]=c)}),e}function f(r,t){var e=r+"",a=e.length;return a9999?"+"+f(r,6):f(r,4)}function S(r){var t=r.getUTCHours(),e=r.getUTCMinutes(),a=r.getUTCSeconds(),c=r.getUTCMilliseconds();return isNaN(r)?"Invalid Date":L(r.getUTCFullYear())+"-"+f(r.getUTCMonth()+1,2)+"-"+f(r.getUTCDate(),2)+(c?"T"+f(t,2)+":"+f(e,2)+":"+f(a,2)+"."+f(c,3)+"Z":a?"T"+f(t,2)+":"+f(e,2)+":"+f(a,2)+"Z":e||t?"T"+f(t,2)+":"+f(e,2)+"Z":"")}function Z(r){var t=new RegExp('["'+r+` +\r]`),e=r.charCodeAt(0);function a(n,o){var s,i,u=c(n,function(h,l){if(s)return s(h,l-1);i=h,s=o?B(h,o):I(h)});return u.columns=i||[],u}function c(n,o){var s=[],i=n.length,u=0,h=0,l,v=i<=0,C=!1;n.charCodeAt(i-1)===m&&--i,n.charCodeAt(i-1)===R&&--i;function w(){if(v)return A;if(C)return C=!1,D;var j,d=u,p;if(n.charCodeAt(d)===E){for(;u++=i?v=!0:(p=n.charCodeAt(u++))===m?C=!0:p===R&&(C=!0,n.charCodeAt(u)===m&&++u),n.slice(d+1,j-1).replace(/""/g,'"')}for(;u 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n"],"names":["EOL","EOF","QUOTE","NEWLINE","RETURN","objectConverter","columns","name","i","customConverter","f","object","row","inferColumns","rows","columnSet","column","pad","value","width","s","length","formatYear","year","formatDate","date","hours","minutes","seconds","milliseconds","dsvFormat","delimiter","reFormat","DELIMITER","parse","text","convert","parseRows","N","I","n","t","eof","eol","token","j","c","preformatBody","formatValue","format","formatBody","formatRows","formatRow"],"mappings":"AAAA,IAAIA,EAAM,CAAE,EACRC,EAAM,CAAE,EACRC,EAAQ,GACRC,EAAU,GACVC,EAAS,GAEb,SAASC,EAAgBC,EAAS,CAChC,OAAO,IAAI,SAAS,IAAK,WAAaA,EAAQ,IAAI,SAASC,EAAMC,EAAG,CAClE,OAAO,KAAK,UAAUD,CAAI,EAAI,OAASC,EAAI,SAC5C,CAAA,EAAE,KAAK,GAAG,EAAI,GAAG,CACpB,CAEA,SAASC,EAAgBH,EAASI,EAAG,CACnC,IAAIC,EAASN,EAAgBC,CAAO,EACpC,OAAO,SAASM,EAAKJ,EAAG,CACtB,OAAOE,EAAEC,EAAOC,CAAG,EAAGJ,EAAGF,CAAO,CACpC,CACA,CAGA,SAASO,EAAaC,EAAM,CAC1B,IAAIC,EAAY,OAAO,OAAO,IAAI,EAC9BT,EAAU,CAAA,EAEd,OAAAQ,EAAK,QAAQ,SAASF,EAAK,CACzB,QAASI,KAAUJ,EACXI,KAAUD,GACdT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,IAClEA,CACP,CAED,MAAO,CACL,MAAOgB,EACP,UAAWG,EACX,OAAQY,EACR,WAAYC,EACZ,WAAYC,EACZ,UAAWC,EACX,YAAaJ,CACjB,CACA","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/frontmatter-c3666c1e.js b/gradio/templates/cdn/assets/frontmatter-c3666c1e.js new file mode 100644 index 0000000000000000000000000000000000000000..9bf07b889f476780541ba662d236065eb2f009dc --- /dev/null +++ b/gradio/templates/cdn/assets/frontmatter-c3666c1e.js @@ -0,0 +1,2 @@ +import{s as m,f as s,a as i,p as l,t as o,S as p}from"./index-ea4e155c.js";import{yaml as f}from"./yaml-95012b83.js";import"./index-fda37c89.js";import"./Blocks-53d5f72d.js";import"./Button-e3640f74.js";import"./BlockLabel-fe40816b.js";import"./Empty-85ccd7df.js";import"./Copy-be466f7f.js";import"./Download-6021cc15.js";const n=/^---\s*$/m,S={defineNodes:[{name:"Frontmatter",block:!0},"FrontmatterMark"],props:[m({Frontmatter:[o.documentMeta,o.monospace],FrontmatterMark:o.processingInstruction}),s.add({Frontmatter:i,FrontmatterMark:()=>null})],wrap:l(t=>{const{parser:e}=p.define(f);return t.type.name==="Frontmatter"?{parser:e,overlay:[{from:t.from+4,to:t.to-4}]}:null}),parseBlock:[{name:"Frontmatter",before:"HorizontalRule",parse:(t,e)=>{let r;const a=new Array;if(t.lineStart===0&&n.test(e.text)){for(a.push(t.elt("FrontmatterMark",0,4));t.nextLine();)if(n.test(e.text)){r=t.lineStart+4;break}return r!==void 0&&(a.push(t.elt("FrontmatterMark",r-4,r)),t.addElement(t.elt("Frontmatter",0,r,a))),!0}else return!1}}]};export{S as frontmatter}; +//# sourceMappingURL=frontmatter-c3666c1e.js.map diff --git a/gradio/templates/cdn/assets/frontmatter-c3666c1e.js.map b/gradio/templates/cdn/assets/frontmatter-c3666c1e.js.map new file mode 100644 index 0000000000000000000000000000000000000000..c285b7a1999c286613e821667389988d790f0b02 --- /dev/null +++ b/gradio/templates/cdn/assets/frontmatter-c3666c1e.js.map @@ -0,0 +1 @@ +{"version":3,"file":"frontmatter-c3666c1e.js","sources":["../../../../js/code/interactive/frontmatter.ts"],"sourcesContent":["import type {\n\tElement,\n\tMarkdownExtension,\n\tBlockContext,\n\tLine\n} from \"@lezer/markdown\";\nimport { parseMixed } from \"@lezer/common\";\nimport { yaml } from \"@codemirror/legacy-modes/mode/yaml\";\nimport { foldInside, foldNodeProp, StreamLanguage } from \"@codemirror/language\";\nimport { styleTags, tags } from \"@lezer/highlight\";\n\nconst frontMatterFence = /^---\\s*$/m;\n\nexport const frontmatter: MarkdownExtension = {\n\tdefineNodes: [{ name: \"Frontmatter\", block: true }, \"FrontmatterMark\"],\n\tprops: [\n\t\tstyleTags({\n\t\t\tFrontmatter: [tags.documentMeta, tags.monospace],\n\t\t\tFrontmatterMark: tags.processingInstruction\n\t\t}),\n\t\tfoldNodeProp.add({\n\t\t\tFrontmatter: foldInside,\n\t\t\tFrontmatterMark: () => null\n\t\t})\n\t],\n\twrap: parseMixed((node) => {\n\t\tconst { parser } = StreamLanguage.define(yaml);\n\t\tif (node.type.name === \"Frontmatter\") {\n\t\t\treturn {\n\t\t\t\tparser,\n\t\t\t\toverlay: [{ from: node.from + 4, to: node.to - 4 }]\n\t\t\t};\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}),\n\tparseBlock: [\n\t\t{\n\t\t\tname: \"Frontmatter\",\n\t\t\tbefore: \"HorizontalRule\",\n\t\t\tparse: (cx: BlockContext, line: Line): boolean => {\n\t\t\t\tlet end: number | undefined = undefined;\n\t\t\t\tconst children = new Array();\n\t\t\t\tif (cx.lineStart === 0 && frontMatterFence.test(line.text)) {\n\t\t\t\t\tchildren.push(cx.elt(\"FrontmatterMark\", 0, 4));\n\t\t\t\t\twhile (cx.nextLine()) {\n\t\t\t\t\t\tif (frontMatterFence.test(line.text)) {\n\t\t\t\t\t\t\tend = cx.lineStart + 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (end !== undefined) {\n\t\t\t\t\t\tchildren.push(cx.elt(\"FrontmatterMark\", end - 4, end));\n\t\t\t\t\t\tcx.addElement(cx.elt(\"Frontmatter\", 0, end, children));\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]\n};\n"],"names":["frontMatterFence","frontmatter","styleTags","tags","foldNodeProp","foldInside","parseMixed","node","parser","StreamLanguage","yaml","cx","line","end","children"],"mappings":"kUAWA,MAAMA,EAAmB,YAEZC,EAAiC,CAC7C,YAAa,CAAC,CAAE,KAAM,cAAe,MAAO,IAAQ,iBAAiB,EACrE,MAAO,CACNC,EAAU,CACT,YAAa,CAACC,EAAK,aAAcA,EAAK,SAAS,EAC/C,gBAAiBA,EAAK,qBAAA,CACtB,EACDC,EAAa,IAAI,CAChB,YAAaC,EACb,gBAAiB,IAAM,IAAA,CACvB,CACF,EACA,KAAMC,EAAYC,GAAS,CAC1B,KAAM,CAAE,OAAAC,CAAW,EAAAC,EAAe,OAAOC,CAAI,EACzC,OAAAH,EAAK,KAAK,OAAS,cACf,CACN,OAAAC,EACA,QAAS,CAAC,CAAE,KAAMD,EAAK,KAAO,EAAG,GAAIA,EAAK,GAAK,EAAG,CAAA,EAG5C,IACR,CACA,EACD,WAAY,CACX,CACC,KAAM,cACN,OAAQ,iBACR,MAAO,CAACI,EAAkBC,IAAwB,CACjD,IAAIC,EACE,MAAAC,EAAW,IAAI,MACrB,GAAIH,EAAG,YAAc,GAAKX,EAAiB,KAAKY,EAAK,IAAI,EAAG,CAEpD,IADPE,EAAS,KAAKH,EAAG,IAAI,kBAAmB,EAAG,CAAC,CAAC,EACtCA,EAAG,YACT,GAAIX,EAAiB,KAAKY,EAAK,IAAI,EAAG,CACrCC,EAAMF,EAAG,UAAY,EACrB,MAGF,OAAIE,IAAQ,SACXC,EAAS,KAAKH,EAAG,IAAI,kBAAmBE,EAAM,EAAGA,CAAG,CAAC,EACrDF,EAAG,WAAWA,EAAG,IAAI,cAAe,EAAGE,EAAKC,CAAQ,CAAC,GAE/C,OAEA,OAAA,EAET,CACD,CACD,CACD"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-025d1662.js b/gradio/templates/cdn/assets/index-025d1662.js new file mode 100644 index 0000000000000000000000000000000000000000..e3008dfc24ff3184bd158d9e04024dd323ac20fc --- /dev/null +++ b/gradio/templates/cdn/assets/index-025d1662.js @@ -0,0 +1,2 @@ +import{E as u,L as v}from"./index-10e05757.js";import{s as k,t,h as S,L as w,i as z,w as x,f as R,a as U,b as _,I as T,x as V}from"./index-ea4e155c.js";import"./index-fda37c89.js";import"./Blocks-53d5f72d.js";import"./Button-e3640f74.js";import"./BlockLabel-fe40816b.js";import"./Empty-85ccd7df.js";import"./Copy-be466f7f.js";import"./Download-6021cc15.js";const Y=94,g=1,C=95,Z=96,f=2,$=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],G=58,N=40,X=95,q=91,c=45,E=46,j=35,D=37;function p(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function I(e){return e>=48&&e<=57}const B=new u((e,o)=>{for(let r=!1,a=0,O=0;;O++){let{next:l}=e;if(p(l)||l==c||l==X||r&&I(l))!r&&(l!=c||O>0)&&(r=!0),a===O&&l==c&&a++,e.advance();else{r&&e.acceptToken(l==N?C:a==2&&o.canShift(f)?f:Z);break}}}),A=new u(e=>{if($.includes(e.peek(-1))){let{next:o}=e;(p(o)||o==X||o==j||o==E||o==q||o==G||o==c)&&e.acceptToken(Y)}}),F=new u(e=>{if(!$.includes(e.peek(-1))){let{next:o}=e;if(o==D&&(e.advance(),e.acceptToken(g)),p(o)){do e.advance();while(p(e.next));e.acceptToken(g)}}}),L=k({"AtKeyword import charset namespace keyframes media supports":t.definitionKeyword,"from to selector":t.keyword,NamespaceName:t.namespace,KeyframeName:t.labelName,TagName:t.tagName,ClassName:t.className,PseudoClassName:t.constant(t.className),IdName:t.labelName,"FeatureName PropertyName":t.propertyName,AttributeName:t.attributeName,NumberLiteral:t.number,KeywordQuery:t.keyword,UnaryQueryOp:t.operatorKeyword,"CallTag ValueName":t.atom,VariableName:t.variableName,Callee:t.operatorKeyword,Unit:t.unit,"UniversalSelector NestingSelector":t.definitionOperator,MatchOp:t.compareOperator,"ChildOp SiblingOp, LogicOp":t.logicOperator,BinOp:t.arithmeticOperator,Important:t.modifier,Comment:t.blockComment,ParenthesizedContent:t.special(t.name),ColorLiteral:t.color,StringLiteral:t.string,":":t.punctuation,"PseudoOp #":t.derefOperator,"; ,":t.separator,"( )":t.paren,"[ ]":t.squareBracket,"{ }":t.brace}),K={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},J={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},H={__proto__:null,not:128,only:128,from:158,to:160},M=v.deserialize({version:14,states:"7WQYQ[OOO#_Q[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO#fQ[O'#CfO$YQXO'#CaO$aQ[O'#ChO$lQ[O'#DPO$qQ[O'#DTOOQP'#Ed'#EdO$vQdO'#DeO%bQ[O'#DrO$vQdO'#DtO%sQ[O'#DvO&OQ[O'#DyO&TQ[O'#EPO&cQ[O'#EROOQS'#Ec'#EcOOQS'#ET'#ETQYQ[OOO&jQXO'#CdO'_QWO'#DaO'dQWO'#EjO'oQ[O'#EjQOQWOOOOQP'#Cg'#CgOOQP,59Q,59QO#fQ[O,59QO'yQ[O'#EWO(eQWO,58{O(mQ[O,59SO$lQ[O,59kO$qQ[O,59oO'yQ[O,59sO'yQ[O,59uO'yQ[O,59vO(xQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OO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XGOS|PoWOy%^z;'S%^;'S;=`%o<%lO%^XG_WOy%^z!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHO[!YPoWOy%^z}%^}!OGw!O!Q%^!Q![Gw![!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHySxPOy%^z;'S%^;'S;=`%o<%lO%^^I[SvUOy%^z;'S%^;'S;=`%o<%lO%^XIkUOy%^z#b%^#b#cI}#c;'S%^;'S;=`%o<%lO%^XJSUoWOy%^z#W%^#W#XJf#X;'S%^;'S;=`%o<%lO%^XJmS!`PoWOy%^z;'S%^;'S;=`%o<%lO%^XJ|UOy%^z#f%^#f#gJf#g;'S%^;'S;=`%o<%lO%^XKeS!RPOy%^z;'S%^;'S;=`%o<%lO%^_KvS!QVOy%^z;'S%^;'S;=`%o<%lO%^ZLXU!PPOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^WLnP;=`<%l$}",tokenizers:[A,F,B,0,1,2,3],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:95,get:e=>K[e]||-1},{term:56,get:e=>J[e]||-1},{term:96,get:e=>H[e]||-1}],tokenPrec:1123});let Q=null;function m(){if(!Q&&typeof document=="object"&&document.body){let{style:e}=document.body,o=[],r=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,O=>"-"+O.toLowerCase())),r.has(a)||(o.push(a),r.add(a)));Q=o.sort().map(a=>({type:"property",label:a}))}return Q||[]}const h=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),b=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),ee=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),n=/^(\w[\w-]*|-\w[\w-]*|)$/,ae=/^-(-[\w-]*)?$/;function Oe(e,o){var r;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(r=e.parent)===null||r===void 0?void 0:r.firstChild;return a?.name!="Callee"?!1:o.sliceString(a.from,a.to)=="var"}const y=new V,te=["Declaration"];function W(e,o){if(o.to-o.from>4096){let r=y.get(o);if(r)return r;let a=[],O=new Set,l=o.cursor(T.IncludeAnonymous);if(l.firstChild())do for(let i of W(e,l.node))O.has(i.label)||(O.add(i.label),a.push(i));while(l.nextSibling());return y.set(o,a),a}else{let r=[],a=new Set;return o.cursor().iterate(O=>{var l;if(O.name=="VariableName"&&O.matchContext(te)&&((l=O.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let i=e.sliceString(O.from,O.to);a.has(i)||(a.add(i),r.push({label:i,type:"variable"}))}}),r}}const oe=e=>{var o;let{state:r,pos:a}=e,O=S(r).resolveInner(a,-1),l=O.type.isError&&O.from==O.to-1&&r.doc.sliceString(O.from,O.to)=="-";if(O.name=="PropertyName"||l&&((o=O.parent)===null||o===void 0?void 0:o.name)=="Block")return{from:O.from,options:m(),validFor:n};if(O.name=="ValueName")return{from:O.from,options:b,validFor:n};if(O.name=="PseudoClassName")return{from:O.from,options:h,validFor:n};if(O.name=="VariableName"||(e.explicit||l)&&Oe(O,r.doc))return{from:O.name=="VariableName"?O.from:a,options:W(r.doc,S(r).topNode),validFor:ae};if(O.name=="TagName"){for(let{parent:d}=O;d;d=d.parent)if(d.name=="Block")return{from:O.from,options:m(),validFor:n};return{from:O.from,options:ee,validFor:n}}if(!e.explicit)return null;let i=O.resolve(a),s=i.childBefore(a);return s&&s.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:h,validFor:n}:s&&s.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:b,validFor:n}:i.name=="Block"?{from:a,options:m(),validFor:n}:null},P=w.define({name:"css",parser:M.configure({props:[z.add({Declaration:x()}),R.add({Block:U})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function me(){return new _(P,P.data.of({autocomplete:oe}))}export{me as css,oe as cssCompletionSource,P as cssLanguage}; +//# sourceMappingURL=index-025d1662.js.map diff --git a/gradio/templates/cdn/assets/index-025d1662.js.map b/gradio/templates/cdn/assets/index-025d1662.js.map new file mode 100644 index 0000000000000000000000000000000000000000..23a9af29eb7065dde547eda9a588f5754fc6131d --- /dev/null +++ b/gradio/templates/cdn/assets/index-025d1662.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-025d1662.js","sources":["../../../../node_modules/.pnpm/@lezer+css@1.1.1/node_modules/@lezer/css/dist/index.es.js","../../../../node_modules/.pnpm/@codemirror+lang-css@6.1.0_@codemirror+view@6.4.1_@lezer+common@1.0.2/node_modules/@codemirror/lang-css/dist/index.js"],"sourcesContent":["import { ExternalTokenizer, LRParser } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst descendantOp = 94,\n Unit = 1,\n callee = 95,\n identifier = 96,\n VariableName = 2;\n\n/* Hand-written tokenizers for CSS tokens that can't be\n expressed by Lezer's built-in tokenizer. */\n\nconst space = [9, 10, 11, 12, 13, 32, 133, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197,\n 8198, 8199, 8200, 8201, 8202, 8232, 8233, 8239, 8287, 12288];\nconst colon = 58, parenL = 40, underscore = 95, bracketL = 91, dash = 45, period = 46,\n hash = 35, percent = 37;\n\nfunction isAlpha(ch) { return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 161 }\n\nfunction isDigit(ch) { return ch >= 48 && ch <= 57 }\n\nconst identifiers = new ExternalTokenizer((input, stack) => {\n for (let inside = false, dashes = 0, i = 0;; i++) {\n let {next} = input;\n if (isAlpha(next) || next == dash || next == underscore || (inside && isDigit(next))) {\n if (!inside && (next != dash || i > 0)) inside = true;\n if (dashes === i && next == dash) dashes++;\n input.advance();\n } else {\n if (inside)\n input.acceptToken(next == parenL ? callee : dashes == 2 && stack.canShift(VariableName) ? VariableName : identifier);\n break\n }\n }\n});\n\nconst descendant = new ExternalTokenizer(input => {\n if (space.includes(input.peek(-1))) {\n let {next} = input;\n if (isAlpha(next) || next == underscore || next == hash || next == period ||\n next == bracketL || next == colon || next == dash)\n input.acceptToken(descendantOp);\n }\n});\n\nconst unitToken = new ExternalTokenizer(input => {\n if (!space.includes(input.peek(-1))) {\n let {next} = input;\n if (next == percent) { input.advance(); input.acceptToken(Unit); }\n if (isAlpha(next)) {\n do { input.advance(); } while (isAlpha(input.next))\n input.acceptToken(Unit);\n }\n }\n});\n\nconst cssHighlighting = styleTags({\n \"AtKeyword import charset namespace keyframes media supports\": tags.definitionKeyword,\n \"from to selector\": tags.keyword,\n NamespaceName: tags.namespace,\n KeyframeName: tags.labelName,\n TagName: tags.tagName,\n ClassName: tags.className,\n PseudoClassName: tags.constant(tags.className),\n IdName: tags.labelName,\n \"FeatureName PropertyName\": tags.propertyName,\n AttributeName: tags.attributeName,\n NumberLiteral: tags.number,\n KeywordQuery: tags.keyword,\n UnaryQueryOp: tags.operatorKeyword,\n \"CallTag ValueName\": tags.atom,\n VariableName: tags.variableName,\n Callee: tags.operatorKeyword,\n Unit: tags.unit,\n \"UniversalSelector NestingSelector\": tags.definitionOperator,\n MatchOp: tags.compareOperator,\n \"ChildOp SiblingOp, LogicOp\": tags.logicOperator,\n BinOp: tags.arithmeticOperator,\n Important: tags.modifier,\n Comment: tags.blockComment,\n ParenthesizedContent: tags.special(tags.name),\n ColorLiteral: tags.color,\n StringLiteral: tags.string,\n \":\": tags.punctuation,\n \"PseudoOp #\": tags.derefOperator,\n \"; ,\": tags.separator,\n \"( )\": tags.paren,\n \"[ ]\": tags.squareBracket,\n \"{ }\": tags.brace\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst spec_callee = {__proto__:null,lang:32, \"nth-child\":32, \"nth-last-child\":32, \"nth-of-type\":32, \"nth-last-of-type\":32, dir:32, \"host-context\":32, url:60, \"url-prefix\":60, domain:60, regexp:60, selector:134};\nconst spec_AtKeyword = {__proto__:null,\"@import\":114, \"@media\":138, \"@charset\":142, \"@namespace\":146, \"@keyframes\":152, \"@supports\":164};\nconst spec_identifier = {__proto__:null,not:128, only:128, from:158, to:160};\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"7WQYQ[OOO#_Q[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO#fQ[O'#CfO$YQXO'#CaO$aQ[O'#ChO$lQ[O'#DPO$qQ[O'#DTOOQP'#Ed'#EdO$vQdO'#DeO%bQ[O'#DrO$vQdO'#DtO%sQ[O'#DvO&OQ[O'#DyO&TQ[O'#EPO&cQ[O'#EROOQS'#Ec'#EcOOQS'#ET'#ETQYQ[OOO&jQXO'#CdO'_QWO'#DaO'dQWO'#EjO'oQ[O'#EjQOQWOOOOQP'#Cg'#CgOOQP,59Q,59QO#fQ[O,59QO'yQ[O'#EWO(eQWO,58{O(mQ[O,59SO$lQ[O,59kO$qQ[O,59oO'yQ[O,59sO'yQ[O,59uO'yQ[O,59vO(xQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)PQWO,59SO)UQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)ZQ`O,59oOOQS'#Cp'#CpO$vQdO'#CqO)cQvO'#CsO*pQtO,5:POOQO'#Cx'#CxO)UQWO'#CwO+UQWO'#CyOOQS'#Eg'#EgOOQO'#Dh'#DhO+ZQ[O'#DoO+iQWO'#EkO&TQ[O'#DmO+wQWO'#DpOOQO'#El'#ElO(hQWO,5:^O+|QpO,5:`OOQS'#Dx'#DxO,UQWO,5:bO,ZQ[O,5:bOOQO'#D{'#D{O,cQWO,5:eO,hQWO,5:kO,pQWO,5:mOOQS-E8R-E8RO$vQdO,59{O,xQ[O'#EYO-VQWO,5;UO-VQWO,5;UOOQP1G.l1G.lO-|QXO,5:rOOQO-E8U-E8UOOQS1G.g1G.gOOQP1G.n1G.nO)PQWO1G.nO)UQ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XU!PPOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^WLnP;=`<%l$}\",\n tokenizers: [descendant, unitToken, identifiers, 0, 1, 2, 3],\n topRules: {\"StyleSheet\":[0,4],\"Styles\":[1,84]},\n specialized: [{term: 95, get: value => spec_callee[value] || -1},{term: 56, get: value => spec_AtKeyword[value] || -1},{term: 96, get: value => spec_identifier[value] || -1}],\n tokenPrec: 1123\n});\n\nexport { parser };\n","import { parser } from '@lezer/css';\nimport { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';\nimport { NodeWeakMap, IterMode } from '@lezer/common';\n\nlet _properties = null;\nfunction properties() {\n if (!_properties && typeof document == \"object\" && document.body) {\n let { style } = document.body, names = [], seen = new Set;\n for (let prop in style)\n if (prop != \"cssText\" && prop != \"cssFloat\") {\n if (typeof style[prop] == \"string\") {\n if (/[A-Z]/.test(prop))\n prop = prop.replace(/[A-Z]/g, ch => \"-\" + ch.toLowerCase());\n if (!seen.has(prop)) {\n names.push(prop);\n seen.add(prop);\n }\n }\n }\n _properties = names.sort().map(name => ({ type: \"property\", label: name }));\n }\n return _properties || [];\n}\nconst pseudoClasses = /*@__PURE__*/[\n \"active\", \"after\", \"any-link\", \"autofill\", \"backdrop\", \"before\",\n \"checked\", \"cue\", \"default\", \"defined\", \"disabled\", \"empty\",\n \"enabled\", \"file-selector-button\", \"first\", \"first-child\",\n \"first-letter\", \"first-line\", \"first-of-type\", \"focus\",\n \"focus-visible\", \"focus-within\", \"fullscreen\", \"has\", \"host\",\n \"host-context\", \"hover\", \"in-range\", \"indeterminate\", \"invalid\",\n \"is\", \"lang\", \"last-child\", \"last-of-type\", \"left\", \"link\", \"marker\",\n \"modal\", \"not\", \"nth-child\", \"nth-last-child\", \"nth-last-of-type\",\n \"nth-of-type\", \"only-child\", \"only-of-type\", \"optional\", \"out-of-range\",\n \"part\", \"placeholder\", \"placeholder-shown\", \"read-only\", \"read-write\",\n \"required\", \"right\", \"root\", \"scope\", \"selection\", \"slotted\", \"target\",\n \"target-text\", \"valid\", \"visited\", \"where\"\n].map(name => ({ type: \"class\", label: name }));\nconst values = /*@__PURE__*/[\n \"above\", \"absolute\", \"activeborder\", \"additive\", \"activecaption\", \"after-white-space\",\n \"ahead\", \"alias\", \"all\", \"all-scroll\", \"alphabetic\", \"alternate\", \"always\",\n \"antialiased\", \"appworkspace\", \"asterisks\", \"attr\", \"auto\", \"auto-flow\", \"avoid\", \"avoid-column\",\n \"avoid-page\", \"avoid-region\", \"axis-pan\", \"background\", \"backwards\", \"baseline\", \"below\",\n \"bidi-override\", \"blink\", \"block\", \"block-axis\", \"bold\", \"bolder\", \"border\", \"border-box\",\n \"both\", \"bottom\", \"break\", \"break-all\", \"break-word\", \"bullets\", \"button\", \"button-bevel\",\n \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"calc\", \"capitalize\",\n \"caps-lock-indicator\", \"caption\", \"captiontext\", \"caret\", \"cell\", \"center\", \"checkbox\", \"circle\",\n \"cjk-decimal\", \"clear\", \"clip\", \"close-quote\", \"col-resize\", \"collapse\", \"color\", \"color-burn\",\n \"color-dodge\", \"column\", \"column-reverse\", \"compact\", \"condensed\", \"contain\", \"content\",\n \"contents\", \"content-box\", \"context-menu\", \"continuous\", \"copy\", \"counter\", \"counters\", \"cover\",\n \"crop\", \"cross\", \"crosshair\", \"currentcolor\", \"cursive\", \"cyclic\", \"darken\", \"dashed\", \"decimal\",\n \"decimal-leading-zero\", \"default\", \"default-button\", \"dense\", \"destination-atop\", \"destination-in\",\n \"destination-out\", \"destination-over\", \"difference\", \"disc\", \"discard\", \"disclosure-closed\",\n \"disclosure-open\", \"document\", \"dot-dash\", \"dot-dot-dash\", \"dotted\", \"double\", \"down\", \"e-resize\",\n \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\", \"element\", \"ellipse\", \"ellipsis\", \"embed\", \"end\",\n \"ethiopic-abegede-gez\", \"ethiopic-halehame-aa-er\", \"ethiopic-halehame-gez\", \"ew-resize\", \"exclusion\",\n \"expanded\", \"extends\", \"extra-condensed\", \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fill-box\",\n \"fixed\", \"flat\", \"flex\", \"flex-end\", \"flex-start\", \"footnotes\", \"forwards\", \"from\",\n \"geometricPrecision\", \"graytext\", \"grid\", \"groove\", \"hand\", \"hard-light\", \"help\", \"hidden\", \"hide\",\n \"higher\", \"highlight\", \"highlighttext\", \"horizontal\", \"hsl\", \"hsla\", \"hue\", \"icon\", \"ignore\",\n \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\", \"infobackground\", \"infotext\",\n \"inherit\", \"initial\", \"inline\", \"inline-axis\", \"inline-block\", \"inline-flex\", \"inline-grid\",\n \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\", \"italic\", \"justify\", \"keep-all\",\n \"landscape\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lighten\", \"line-through\", \"linear\",\n \"linear-gradient\", \"lines\", \"list-item\", \"listbox\", \"listitem\", \"local\", \"logical\", \"loud\", \"lower\",\n \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\", \"lowercase\", \"ltr\", \"luminosity\", \"manipulation\",\n \"match\", \"matrix\", \"matrix3d\", \"medium\", \"menu\", \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\",\n \"mix\", \"monospace\", \"move\", \"multiple\", \"multiple_mask_images\", \"multiply\", \"n-resize\", \"narrower\",\n \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\", \"no-open-quote\", \"no-repeat\", \"none\",\n \"normal\", \"not-allowed\", \"nowrap\", \"ns-resize\", \"numbers\", \"numeric\", \"nw-resize\", \"nwse-resize\",\n \"oblique\", \"opacity\", \"open-quote\", \"optimizeLegibility\", \"optimizeSpeed\", \"outset\", \"outside\",\n \"outside-shape\", \"overlay\", \"overline\", \"padding\", \"padding-box\", \"painted\", \"page\", \"paused\",\n \"perspective\", \"pinch-zoom\", \"plus-darker\", \"plus-lighter\", \"pointer\", \"polygon\", \"portrait\",\n \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\", \"progress\", \"push-button\", \"radial-gradient\", \"radio\",\n \"read-only\", \"read-write\", \"read-write-plaintext-only\", \"rectangle\", \"region\", \"relative\", \"repeat\",\n \"repeating-linear-gradient\", \"repeating-radial-gradient\", \"repeat-x\", \"repeat-y\", \"reset\", \"reverse\",\n \"rgb\", \"rgba\", \"ridge\", \"right\", \"rotate\", \"rotate3d\", \"rotateX\", \"rotateY\", \"rotateZ\", \"round\",\n \"row\", \"row-resize\", \"row-reverse\", \"rtl\", \"run-in\", \"running\", \"s-resize\", \"sans-serif\", \"saturation\",\n \"scale\", \"scale3d\", \"scaleX\", \"scaleY\", \"scaleZ\", \"screen\", \"scroll\", \"scrollbar\", \"scroll-position\",\n \"se-resize\", \"self-start\", \"self-end\", \"semi-condensed\", \"semi-expanded\", \"separate\", \"serif\", \"show\",\n \"single\", \"skew\", \"skewX\", \"skewY\", \"skip-white-space\", \"slide\", \"slider-horizontal\",\n \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\", \"small\", \"small-caps\",\n \"small-caption\", \"smaller\", \"soft-light\", \"solid\", \"source-atop\", \"source-in\", \"source-out\",\n \"source-over\", \"space\", \"space-around\", \"space-between\", \"space-evenly\", \"spell-out\", \"square\", \"start\",\n \"static\", \"status-bar\", \"stretch\", \"stroke\", \"stroke-box\", \"sub\", \"subpixel-antialiased\", \"svg_masks\",\n \"super\", \"sw-resize\", \"symbolic\", \"symbols\", \"system-ui\", \"table\", \"table-caption\", \"table-cell\",\n \"table-column\", \"table-column-group\", \"table-footer-group\", \"table-header-group\", \"table-row\",\n \"table-row-group\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thick\", \"thin\",\n \"threeddarkshadow\", \"threedface\", \"threedhighlight\", \"threedlightshadow\", \"threedshadow\", \"to\", \"top\",\n \"transform\", \"translate\", \"translate3d\", \"translateX\", \"translateY\", \"translateZ\", \"transparent\",\n \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"unidirectional-pan\", \"unset\", \"up\", \"upper-latin\",\n \"uppercase\", \"url\", \"var\", \"vertical\", \"vertical-text\", \"view-box\", \"visible\", \"visibleFill\",\n \"visiblePainted\", \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"wider\", \"window\", \"windowframe\",\n \"windowtext\", \"words\", \"wrap\", \"wrap-reverse\", \"x-large\", \"x-small\", \"xor\", \"xx-large\", \"xx-small\"\n].map(name => ({ type: \"keyword\", label: name })).concat(/*@__PURE__*/[\n \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\",\n \"bisque\", \"black\", \"blanchedalmond\", \"blue\", \"blueviolet\", \"brown\",\n \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\",\n \"darkgray\", \"darkgreen\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\",\n \"darkorange\", \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n \"darkslateblue\", \"darkslategray\", \"darkturquoise\", \"darkviolet\",\n \"deeppink\", \"deepskyblue\", \"dimgray\", \"dodgerblue\", \"firebrick\",\n \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\", \"ghostwhite\",\n \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\", \"greenyellow\", \"honeydew\",\n \"hotpink\", \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\",\n \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\n \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightpink\",\n \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\",\n \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\",\n \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\",\n \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\n \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\", \"palevioletred\",\n \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\n \"purple\", \"rebeccapurple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\",\n \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\", \"skyblue\",\n \"slateblue\", \"slategray\", \"snow\", \"springgreen\", \"steelblue\", \"tan\",\n \"teal\", \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\",\n \"whitesmoke\", \"yellow\", \"yellowgreen\"\n].map(name => ({ type: \"constant\", label: name })));\nconst tags = /*@__PURE__*/[\n \"a\", \"abbr\", \"address\", \"article\", \"aside\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"body\",\n \"br\", \"button\", \"canvas\", \"caption\", \"cite\", \"code\", \"col\", \"colgroup\", \"dd\", \"del\",\n \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"dt\", \"em\", \"figcaption\", \"figure\", \"footer\",\n \"form\", \"header\", \"hgroup\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"html\", \"i\", \"iframe\",\n \"img\", \"input\", \"ins\", \"kbd\", \"label\", \"legend\", \"li\", \"main\", \"meter\", \"nav\", \"ol\", \"output\",\n \"p\", \"pre\", \"ruby\", \"section\", \"select\", \"small\", \"source\", \"span\", \"strong\", \"sub\", \"summary\",\n \"sup\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"tr\", \"u\", \"ul\"\n].map(name => ({ type: \"type\", label: name }));\nconst identifier = /^(\\w[\\w-]*|-\\w[\\w-]*|)$/, variable = /^-(-[\\w-]*)?$/;\nfunction isVarArg(node, doc) {\n var _a;\n if (node.name == \"(\" || node.type.isError)\n node = node.parent || node;\n if (node.name != \"ArgList\")\n return false;\n let callee = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.firstChild;\n if ((callee === null || callee === void 0 ? void 0 : callee.name) != \"Callee\")\n return false;\n return doc.sliceString(callee.from, callee.to) == \"var\";\n}\nconst VariablesByNode = /*@__PURE__*/new NodeWeakMap();\nconst declSelector = [\"Declaration\"];\nfunction variableNames(doc, node) {\n if (node.to - node.from > 4096) {\n let known = VariablesByNode.get(node);\n if (known)\n return known;\n let result = [], seen = new Set, cursor = node.cursor(IterMode.IncludeAnonymous);\n if (cursor.firstChild())\n do {\n for (let option of variableNames(doc, cursor.node))\n if (!seen.has(option.label)) {\n seen.add(option.label);\n result.push(option);\n }\n } while (cursor.nextSibling());\n VariablesByNode.set(node, result);\n return result;\n }\n else {\n let result = [], seen = new Set;\n node.cursor().iterate(node => {\n var _a;\n if (node.name == \"VariableName\" && node.matchContext(declSelector) && ((_a = node.node.nextSibling) === null || _a === void 0 ? void 0 : _a.name) == \":\") {\n let name = doc.sliceString(node.from, node.to);\n if (!seen.has(name)) {\n seen.add(name);\n result.push({ label: name, type: \"variable\" });\n }\n }\n });\n return result;\n }\n}\n/**\nCSS property, variable, and value keyword completion source.\n*/\nconst cssCompletionSource = context => {\n var _a;\n let { state, pos } = context, node = syntaxTree(state).resolveInner(pos, -1);\n let isDash = node.type.isError && node.from == node.to - 1 && state.doc.sliceString(node.from, node.to) == \"-\";\n if (node.name == \"PropertyName\" || isDash && ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.name) == \"Block\")\n return { from: node.from, options: properties(), validFor: identifier };\n if (node.name == \"ValueName\")\n return { from: node.from, options: values, validFor: identifier };\n if (node.name == \"PseudoClassName\")\n return { from: node.from, options: pseudoClasses, validFor: identifier };\n if (node.name == \"VariableName\" || (context.explicit || isDash) && isVarArg(node, state.doc))\n return { from: node.name == \"VariableName\" ? node.from : pos,\n options: variableNames(state.doc, syntaxTree(state).topNode),\n validFor: variable };\n if (node.name == \"TagName\") {\n for (let { parent } = node; parent; parent = parent.parent)\n if (parent.name == \"Block\")\n return { from: node.from, options: properties(), validFor: identifier };\n return { from: node.from, options: tags, validFor: identifier };\n }\n if (!context.explicit)\n return null;\n let above = node.resolve(pos), before = above.childBefore(pos);\n if (before && before.name == \":\" && above.name == \"PseudoClassSelector\")\n return { from: pos, options: pseudoClasses, validFor: identifier };\n if (before && before.name == \":\" && above.name == \"Declaration\" || above.name == \"ArgList\")\n return { from: pos, options: values, validFor: identifier };\n if (above.name == \"Block\")\n return { from: pos, options: properties(), validFor: identifier };\n return null;\n};\n\n/**\nA language provider based on the [Lezer CSS\nparser](https://github.com/lezer-parser/css), extended with\nhighlighting and indentation information.\n*/\nconst cssLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"css\",\n parser: /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n Declaration: /*@__PURE__*/continuedIndent()\n }),\n /*@__PURE__*/foldNodeProp.add({\n Block: foldInside\n })\n ]\n }),\n languageData: {\n commentTokens: { block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*\\}$/,\n wordChars: \"-\"\n }\n});\n/**\nLanguage support for CSS.\n*/\nfunction css() {\n return new LanguageSupport(cssLanguage, cssLanguage.data.of({ autocomplete: cssCompletionSource }));\n}\n\nexport { css, cssCompletionSource, cssLanguage };\n"],"names":["descendantOp","Unit","callee","identifier","VariableName","space","colon","parenL","underscore","bracketL","dash","period","hash","percent","isAlpha","ch","isDigit","identifiers","ExternalTokenizer","input","stack","inside","dashes","i","next","descendant","unitToken","cssHighlighting","styleTags","tags","spec_callee","spec_AtKeyword","spec_identifier","parser","LRParser","value","_properties","properties","style","names","seen","prop","name","pseudoClasses","values","variable","isVarArg","node","doc","_a","VariablesByNode","NodeWeakMap","declSelector","variableNames","known","result","cursor","IterMode","option","cssCompletionSource","context","state","pos","syntaxTree","isDash","parent","above","before","cssLanguage","LRLanguage","indentNodeProp","continuedIndent","foldNodeProp","foldInside","css","LanguageSupport"],"mappings":"qWAIA,MAAMA,EAAe,GACnBC,EAAO,EACPC,EAAS,GACTC,EAAa,GACbC,EAAe,EAKXC,EAAQ,CAAC,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KACrE,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAK,EACpEC,EAAQ,GAAIC,EAAS,GAAIC,EAAa,GAAIC,EAAW,GAAIC,EAAO,GAAIC,EAAS,GAC7EC,EAAO,GAAIC,EAAU,GAE3B,SAASC,EAAQC,EAAI,CAAE,OAAOA,GAAM,IAAMA,GAAM,IAAMA,GAAM,IAAMA,GAAM,KAAOA,GAAM,GAAK,CAE1F,SAASC,EAAQD,EAAI,CAAE,OAAOA,GAAM,IAAMA,GAAM,EAAI,CAEpD,MAAME,EAAc,IAAIC,EAAkB,CAACC,EAAOC,IAAU,CAC1D,QAASC,EAAS,GAAOC,EAAS,EAAGC,EAAI,GAAIA,IAAK,CAChD,GAAI,CAAC,KAAAC,CAAI,EAAIL,EACb,GAAIL,EAAQU,CAAI,GAAKA,GAAQd,GAAQc,GAAQhB,GAAea,GAAUL,EAAQQ,CAAI,EAC5E,CAACH,IAAWG,GAAQd,GAAQa,EAAI,KAAIF,EAAS,IAC7CC,IAAWC,GAAKC,GAAQd,GAAMY,IAClCH,EAAM,QAAO,MACR,CACDE,GACFF,EAAM,YAAYK,GAAQjB,EAASL,EAASoB,GAAU,GAAKF,EAAM,SAAShB,CAAY,EAAIA,EAAeD,CAAU,EACrH,OAGN,CAAC,EAEKsB,EAAa,IAAIP,EAAkBC,G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EAC3D,SAAUhB,EAAQ,EAC1B,GAAIE,EAAK,MAAQ,UAAW,CACxB,OAAS,CAAE,OAAAkB,GAAWlB,EAAMkB,EAAQA,EAASA,EAAO,OAChD,GAAIA,EAAO,MAAQ,QACf,MAAO,CAAE,KAAMlB,EAAK,KAAM,QAASV,EAAY,EAAE,SAAUlC,GACnE,MAAO,CAAE,KAAM4C,EAAK,KAAM,QAASlB,GAAM,SAAU1B,GAEvD,GAAI,CAACyD,EAAQ,SACT,OAAO,KACX,IAAIM,EAAQnB,EAAK,QAAQe,CAAG,EAAGK,EAASD,EAAM,YAAYJ,CAAG,EAC7D,OAAIK,GAAUA,EAAO,MAAQ,KAAOD,EAAM,MAAQ,sBACvC,CAAE,KAAMJ,EAAK,QAASnB,EAAe,SAAUxC,GACtDgE,GAAUA,EAAO,MAAQ,KAAOD,EAAM,MAAQ,eAAiBA,EAAM,MAAQ,UACtE,CAAE,KAAMJ,EAAK,QAASlB,EAAQ,SAAUzC,GAC/C+D,EAAM,MAAQ,QACP,CAAE,KAAMJ,EAAK,QAASzB,IAAc,SAAUlC,GAClD,IACX,EAOMiE,EAA2BC,EAAW,OAAO,CAC/C,KAAM,MACN,OAAqBpC,EAAO,UAAU,CAClC,MAAO,CACUqC,EAAe,IAAI,CAC5B,YAA0BC,EAAiB,CAC3D,CAAa,EACYC,EAAa,IAAI,CAC1B,MAAOC,CACvB,CAAa,CACJ,CACT,CAAK,EACD,aAAc,CACV,cAAe,CAAE,MAAO,CAAE,KAAM,KAAM,MAAO,KAAQ,EACrD,cAAe,UACf,UAAW,GACd,CACL,CAAC,EAID,SAASC,IAAM,CACX,OAAO,IAAIC,EAAgBP,EAAaA,EAAY,KAAK,GAAG,CAAE,aAAcT,EAAqB,CAAA,CAAC,CACtG","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-03d58ab8.css b/gradio/templates/cdn/assets/index-03d58ab8.css new file mode 100644 index 0000000000000000000000000000000000000000..c02568c42d3cf011dc008a256fdece5721dbccab --- /dev/null +++ b/gradio/templates/cdn/assets/index-03d58ab8.css @@ -0,0 +1 @@ +.hide.svelte-ydeks8{display:none} diff --git a/gradio/templates/cdn/assets/index-0ab8b910.js b/gradio/templates/cdn/assets/index-0ab8b910.js new file mode 100644 index 0000000000000000000000000000000000000000..98c87a8fecf349f98bc801a68ad5e06e1ce75827 --- /dev/null +++ b/gradio/templates/cdn/assets/index-0ab8b910.js @@ -0,0 +1,2 @@ +import{S as v,e as T,s as S,N as K,k as j,K as _,L as C,p as L,o as w,z as r,v as d,A as M,x as A,B as N,at as G,a4 as k,C as H,a7 as J,a9 as B,ab as q,ac as z,ad as D,F as O}from"./index-fda37c89.js";import{a as P}from"./TabItem.svelte_svelte_type_style_lang-6b891bc7.js";import{C as Q}from"./Column-6dff4b07.js";/* empty css */function R(a){let e;const n=a[8].default,t=B(n,a,a[9],null);return{c(){t&&t.c()},m(s,l){t&&t.m(s,l),e=!0},p(s,l){t&&t.p&&(!e||l&512)&&q(t,n,s,s[9],e?D(n,s[9],l,null):z(s[9]),null)},i(s){e||(r(t,s),e=!0)},o(s){d(t,s),e=!1},d(s){t&&t.d(s)}}}function U(a){let e,n,t,s;return n=new Q({props:{$$slots:{default:[R]},$$scope:{ctx:a}}}),{c(){e=K("div"),j(n.$$.fragment),_(e,"id",a[0]),_(e,"class",t="tabitem "+a[1].join(" ")+" svelte-19hvt5v"),C(e,"display",a[3]===a[2]?"block":"none")},m(l,m){L(l,e,m),w(n,e,null),s=!0},p(l,[m]){const c={};m&512&&(c.$$scope={dirty:m,ctx:l}),n.$set(c),(!s||m&1)&&_(e,"id",l[0]),(!s||m&2&&t!==(t="tabitem "+l[1].join(" ")+" svelte-19hvt5v"))&&_(e,"class",t),m&12&&C(e,"display",l[3]===l[2]?"block":"none")},i(l){s||(r(n.$$.fragment,l),s=!0)},o(l){d(n.$$.fragment,l),s=!1},d(l){l&&M(e),A(n)}}}function V(a,e,n){let t,s,{$$slots:l={},$$scope:m}=e,{elem_id:c=""}=e,{elem_classes:f=[]}=e,{name:u}=e,{id:i={}}=e;const E=N(),{register_tab:F,unregister_tab:I,selected_tab:b,selected_tab_index:g}=G(P);k(a,b,o=>n(3,s=o)),k(a,g,o=>n(7,t=o));let h=F({name:u,id:i});return H(()=>()=>I({name:u,id:i})),a.$$set=o=>{"elem_id"in o&&n(0,c=o.elem_id),"elem_classes"in o&&n(1,f=o.elem_classes),"name"in o&&n(6,u=o.name),"id"in o&&n(2,i=o.id),"$$scope"in o&&n(9,m=o.$$scope)},a.$$.update=()=>{a.$$.dirty&192&&t===h&&J().then(()=>E("select",{value:u,index:h}))},[c,f,i,s,b,g,u,t,l,m]}class W extends v{constructor(e){super(),T(this,e,V,U,S,{elem_id:0,elem_classes:1,name:6,id:2})}}function X(a){let e;const n=a[4].default,t=B(n,a,a[6],null);return{c(){t&&t.c()},m(s,l){t&&t.m(s,l),e=!0},p(s,l){t&&t.p&&(!e||l&64)&&q(t,n,s,s[6],e?D(n,s[6],l,null):z(s[6]),null)},i(s){e||(r(t,s),e=!0)},o(s){d(t,s),e=!1},d(s){t&&t.d(s)}}}function Y(a){let e,n;return e=new W({props:{elem_id:a[0],elem_classes:a[1],name:a[2],id:a[3],$$slots:{default:[X]},$$scope:{ctx:a}}}),e.$on("select",a[5]),{c(){j(e.$$.fragment)},m(t,s){w(e,t,s),n=!0},p(t,[s]){const l={};s&1&&(l.elem_id=t[0]),s&2&&(l.elem_classes=t[1]),s&4&&(l.name=t[2]),s&8&&(l.id=t[3]),s&64&&(l.$$scope={dirty:s,ctx:t}),e.$set(l)},i(t){n||(r(e.$$.fragment,t),n=!0)},o(t){d(e.$$.fragment,t),n=!1},d(t){A(e,t)}}}function Z(a,e,n){let{$$slots:t={},$$scope:s}=e,{elem_id:l=""}=e,{elem_classes:m=[]}=e,{label:c}=e,{id:f}=e;function u(i){O.call(this,a,i)}return a.$$set=i=>{"elem_id"in i&&n(0,l=i.elem_id),"elem_classes"in i&&n(1,m=i.elem_classes),"label"in i&&n(2,c=i.label),"id"in i&&n(3,f=i.id),"$$scope"in i&&n(6,s=i.$$scope)},[l,m,c,f,t,u,s]}class y extends v{constructor(e){super(),T(this,e,Z,Y,S,{elem_id:0,elem_classes:1,label:2,id:3})}}const te=y,se=["static"];export{te as Component,se as modes}; +//# sourceMappingURL=index-0ab8b910.js.map diff --git a/gradio/templates/cdn/assets/index-0ab8b910.js.map b/gradio/templates/cdn/assets/index-0ab8b910.js.map new file mode 100644 index 0000000000000000000000000000000000000000..d1e2982d2ed665426a0e0d5636010c49cd55280b --- /dev/null +++ b/gradio/templates/cdn/assets/index-0ab8b910.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-0ab8b910.js","sources":["../../../../js/tabs/src/TabItem.svelte","../../../../js/app/src/components/TabItem/Tabs.svelte","../../../../js/app/src/components/TabItem/index.ts"],"sourcesContent":["\n\n\n\t\n\t\t\n\t\n\n\n\n","\n\n\n\t\n\n","export { default as Component } from \"./Tabs.svelte\";\nexport const modes = [\"static\"];\n"],"names":["ctx","set_style","div","insert","target","anchor","elem_id","$$props","elem_classes","name","id","dispatch","createEventDispatcher","register_tab","unregister_tab","selected_tab","selected_tab_index","getContext","TABS","tab_index","onMount","$selected_tab_index","tick","label","modes"],"mappings":"wuBA2BKA,EAAO,CAAA,CAAA,2BACKA,EAAY,CAAA,EAAC,KAAK,GAAG,EAAA,iBAAA,EACtBC,EAAAC,EAAA,UAAAF,OAAkBA,EAAE,CAAA,EAAG,QAAU,MAAM,UAHvDG,EAQKC,EAAAF,EAAAG,CAAA,yGAPAL,EAAO,CAAA,CAAA,8BACKA,EAAY,CAAA,EAAC,KAAK,GAAG,EAAA,0CACtBC,EAAAC,EAAA,UAAAF,OAAkBA,EAAE,CAAA,EAAG,QAAU,MAAM,6IAvB3C,CAAA,QAAAM,EAAkB,EAAE,EAAAC,GACpB,aAAAC,EAAY,EAAA,EAAAD,GACZ,KAAAE,CAAY,EAAAF,GACZ,GAAAG,EAAE,EAAA,EAAAH,EAEP,MAAAI,EAAWC,KAET,aAAAC,EAAc,eAAAC,EAAgB,aAAAC,EAAc,mBAAAC,GACnDC,EAAWC,CAAI,wCAEZ,IAAAC,EAAYN,EAAe,CAAA,KAAAJ,EAAM,GAAAC,CAAE,CAAA,EAEvC,OAAAU,EAAO,QACON,EAAc,CAAG,KAAAL,EAAM,GAAAC,CAAE,CAAA,2MAGpCW,IAAwBF,GAC1BG,IAAO,KAAI,IAAOX,EAAS,UAAY,MAAOF,EAAM,MAAOU,CAAS,CAAA,CAAA,ybCd9BnB,EAAK,CAAA,uMAALA,EAAK,CAAA,gMANjC,CAAA,QAAAM,EAAkB,EAAE,EAAAC,GACpB,aAAAC,EAAY,EAAA,EAAAD,GACZ,MAAAgB,CAAa,EAAAhB,GACb,GAAAG,CAAmB,EAAAH,8UCLlBiB,GAAQ,CAAC,QAAQ"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-0c7e5d30.js b/gradio/templates/cdn/assets/index-0c7e5d30.js new file mode 100644 index 0000000000000000000000000000000000000000..0c8cfd9c0e7ffe65ea882c5b988ae5dbde0aba44 --- /dev/null +++ b/gradio/templates/cdn/assets/index-0c7e5d30.js @@ -0,0 +1,2 @@ +import{S as Q,e as Z,s as W,J as Y,K as g,p as L,M as C,n as G,A as M,Z as me,N as z,O as U,m as ge,Q as q,z as N,u as ne,v as R,y as te,a1 as we,B as be,G as x,L as H,af as ve,ao as oe,V as ke,P as ie,U as E,R as se,h as P,j as ee,k as I,o as K,ap as ue,t as le,x as V,am as Se,E as Ee,ae as Ne,q as ye,r as Re,F as X}from"./index-fda37c89.js";/* empty css */import{b as fe,B as Te}from"./Button-e3640f74.js";import{B as ze}from"./BlockTitle-44d14959.js";import"./Info-ff627956.js";function Je(n){let e,l;return{c(){e=Y("svg"),l=Y("path"),g(l,"d","M5 8l4 4 4-4z"),g(e,"class","dropdown-arrow svelte-p5edak"),g(e,"xmlns","http://www.w3.org/2000/svg"),g(e,"width","18"),g(e,"height","18"),g(e,"viewBox","0 0 18 18")},m(i,o){L(i,e,o),C(e,l)},p:G,i:G,o:G,d(i){i&&M(e)}}}class Le extends Q{constructor(e){super(),Z(this,e,null,Je,W,{})}}function Me(n){let e,l;return{c(){e=Y("svg"),l=Y("path"),g(l,"d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"),g(e,"xmlns","http://www.w3.org/2000/svg"),g(e,"width","16"),g(e,"height","16"),g(e,"viewBox","0 0 24 24")},m(i,o){L(i,e,o),C(e,l)},p:G,i:G,o:G,d(i){i&&M(e)}}}class Oe extends Q{constructor(e){super(),Z(this,e,null,Me,W,{})}}function ae(n,e,l){const i=n.slice();return i[24]=e[l],i}function re(n){let e,l,i,o,d,t=x(n[0]),u=[];for(let s=0;s{i&&(l||(l=oe(e,fe,{duration:200,y:5},!0)),l.run(1))}),i=!0)},o(s){s&&(l||(l=oe(e,fe,{duration:200,y:5},!1)),l.run(0)),i=!1},d(s){s&&M(e),ke(u,s),n[21](null),s&&l&&l.end(),o=!1,d()}}}function _e(n){let e,l,i,o=n[24]+"",d,t,u,s;return{c(){e=z("li"),l=z("span"),l.textContent="✓",i=U(),d=ie(o),t=U(),g(l,"class","inner-item svelte-1aonegi"),E(l,"hide",!n[11].includes(n[24])),g(e,"class","item svelte-1aonegi"),g(e,"role","button"),g(e,"data-value",u=n[24]),g(e,"aria-label",s=n[24]),E(e,"selected",n[11].includes(n[24])),E(e,"active",n[2]===n[24]),E(e,"bg-gray-100",n[2]===n[24]),E(e,"dark:bg-gray-600",n[2]===n[24])},m(f,a){L(f,e,a),C(e,l),C(e,i),C(e,d),C(e,t)},p(f,a){a&2049&&E(l,"hide",!f[11].includes(f[24])),a&1&&o!==(o=f[24]+"")&&se(d,o),a&1&&u!==(u=f[24])&&g(e,"data-value",u),a&1&&s!==(s=f[24])&&g(e,"aria-label",s),a&2049&&E(e,"selected",f[11].includes(f[24])),a&5&&E(e,"active",f[2]===f[24]),a&5&&E(e,"bg-gray-100",f[2]===f[24]),a&5&&E(e,"dark:bg-gray-600",f[2]===f[24])},d(f){f&&M(e)}}}function Ue(n){let e,l,i,o,d;me(n[18]);let t=n[1]&&!n[3]&&re(n);return{c(){e=z("div"),l=U(),t&&t.c(),i=ge(),g(e,"class","reference")},m(u,s){L(u,e,s),n[19](e),L(u,l,s),t&&t.m(u,s),L(u,i,s),o||(d=[q(window,"scroll",n[12]),q(window,"resize",n[18])],o=!0)},p(u,[s]){u[1]&&!u[3]?t?(t.p(u,s),s&10&&N(t,1)):(t=re(u),t.c(),N(t,1),t.m(i.parentNode,i)):t&&(ne(),R(t,1,1,()=>{t=null}),te())},i(u){N(t)},o(u){R(t)},d(u){u&&(M(e),M(l),M(i)),n[19](null),t&&t.d(u),o=!1,we(d)}}}function qe(n,e,l){let i,{value:o=void 0}=e,{filtered:d}=e,{showOptions:t=!1}=e,{activeOption:u}=e,{disabled:s=!1}=e,f,a,m,_,w,A,b,B,v,k;const S=()=>{const{top:O,bottom:F}=w.getBoundingClientRect();l(15,f=O),l(16,a=k-F)};let y=null;const D=()=>{t&&(y!==null&&clearTimeout(y),y=setTimeout(()=>{S(),y=null},10))},j=be();function J(){l(10,k=window.innerHeight)}function h(O){P[O?"unshift":"push"](()=>{w=O,l(4,w)})}const p=O=>j("change",O);function r(O){P[O?"unshift":"push"](()=>{A=O,l(5,A)})}return n.$$set=O=>{"value"in O&&l(14,o=O.value),"filtered"in O&&l(0,d=O.filtered),"showOptions"in O&&l(1,t=O.showOptions),"activeOption"in O&&l(2,u=O.activeOption),"disabled"in O&&l(3,s=O.disabled)},n.$$.update=()=>{if(n.$$.dirty&245810){if(t&&w){if(A&&typeof o=="string"){let F=document.querySelector(`li[data-value="${o}"]`);F&&A.scrollTo(0,F.offsetTop)}S();const O=w.parentElement?.getBoundingClientRect();l(17,m=O?.height||0),l(6,_=O?.width||0)}a>f?(l(7,b=`${f}px`),l(9,v=a),l(8,B=null)):(l(8,B=`${a+m}px`),l(9,v=f-m),l(7,b=null))}n.$$.dirty&16384&&l(11,i=Array.isArray(o)?o:[o])},[d,t,u,s,w,A,_,b,B,v,k,i,D,j,o,f,a,m,J,h,p,r]}class je extends Q{constructor(e){super(),Z(this,e,qe,Ue,W,{value:14,filtered:0,showOptions:1,activeOption:2,disabled:3})}}function ce(n,e,l){const i=n.slice();return i[31]=e[l],i}function He(n){let e;return{c(){e=ie(n[1])},m(l,i){L(l,e,i)},p(l,i){i[0]&2&&se(e,l[1])},d(l){l&&M(e)}}}function de(n){let e,l,i=x(n[0]),o=[];for(let t=0;tR(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;tee(B,"value",j)),B.$on("change",n[15]),{c(){e=z("label"),I(l.$$.fragment),i=U(),o=z("div"),d=z("div"),D&&D.c(),u=U(),s=z("div"),f=z("input"),a=U(),m=z("div"),I(_.$$.fragment),w=U(),I(A.$$.fragment),b=U(),I(B.$$.fragment),g(f,"class","border-none svelte-c0u3f0"),f.disabled=n[4],g(f,"autocomplete","off"),E(f,"subdued",n[0]!==n[8]&&!n[7]),g(m,"class","token-remove remove-all svelte-c0u3f0"),g(m,"title","Clear"),E(m,"hide",!n[3]||!n[0]?.length||n[4]),g(s,"class","secondary-wrap svelte-c0u3f0"),g(d,"class","wrap-inner svelte-c0u3f0"),E(d,"showOptions",n[11]),g(o,"class","wrap svelte-c0u3f0"),g(e,"class","svelte-c0u3f0"),E(e,"container",n[6])},m(h,p){L(h,e,p),K(l,e,null),C(e,i),C(e,o),C(o,d),D&&D.m(d,null),C(d,u),C(d,s),C(s,f),ue(f,n[8]),n[23](f),C(s,a),C(s,m),K(_,m,null),C(s,w),K(A,s,null),C(o,b),K(B,o,null),k=!0,S||(y=[q(f,"input",n[22]),q(f,"focus",n[24]),q(f,"keydown",n[16]),q(f,"keyup",n[25]),q(f,"blur",n[26]),q(m,"click",n[14])],S=!0)},p(h,p){const r={};p[0]&32&&(r.show_label=h[5]),p[0]&4&&(r.info=h[2]),p[0]&2|p[1]&8&&(r.$$scope={dirty:p,ctx:h}),l.$set(r),p[0]&9&&(t=h[3]&&Array.isArray(h[0])),t?D?(D.p(h,p),p[0]&9&&N(D,1)):(D=de(h),D.c(),N(D,1),D.m(d,u)):D&&(ne(),R(D,1,1,()=>{D=null}),te()),(!k||p[0]&16)&&(f.disabled=h[4]),p[0]&256&&f.value!==h[8]&&ue(f,h[8]),(!k||p[0]&385)&&E(f,"subdued",h[0]!==h[8]&&!h[7]),(!k||p[0]&25)&&E(m,"hide",!h[3]||!h[0]?.length||h[4]),(!k||p[0]&2048)&&E(d,"showOptions",h[11]);const O={};p[0]&2048&&(O.showOptions=h[11]),p[0]&1024&&(O.filtered=h[10]),p[0]&512&&(O.activeOption=h[9]),p[0]&16&&(O.disabled=h[4]),!v&&p[0]&1&&(v=!0,O.value=h[0],le(()=>v=!1)),B.$set(O),(!k||p[0]&64)&&E(e,"container",h[6])},i(h){k||(N(l.$$.fragment,h),N(D),N(_.$$.fragment,h),N(A.$$.fragment,h),N(B.$$.fragment,h),k=!0)},o(h){R(l.$$.fragment,h),R(D),R(_.$$.fragment,h),R(A.$$.fragment,h),R(B.$$.fragment,h),k=!1},d(h){h&&M(e),V(l),D&&D.d(),n[23](null),V(_),V(A),V(B),S=!1,we(y)}}}function Ke(n,e,l){let i,{label:o}=e,{info:d=void 0}=e,{value:t}=e,u=Array.isArray(t)?t.slice():t,{value_is_output:s=!1}=e,{multiselect:f=!1}=e,{max_choices:a}=e,{choices:m}=e,{disabled:_=!1}=e,{show_label:w}=e,{container:A=!0}=e,{allow_custom_value:b=!1}=e;const B=be();let v,k,S=!1,y;function D(){B("change",t),s||B("input")}Se(()=>{l(17,s=!1)});function j(c){l(0,t),(!a||t.lengthT!==c)),B("select",{index:m.indexOf(c),value:c,selected:!1})}function h(c){l(0,t=[]),l(8,v=""),c.preventDefault()}function p(c){const T=c.detail.target.dataset.value;if(b&&l(8,v=T),T!==void 0)if(f)t?.includes(T)?J(T):j(T),l(8,v="");else{l(0,t=T),l(8,v=T),l(11,S=!1),B("select",{index:m.indexOf(T),value:T,selected:!0});return}}function r(c){if(c.key==="Enter"&&k!=null)f?f&&Array.isArray(t)&&(t.includes(k)?J(k):j(k),l(8,v="")):(t!==k&&(l(0,t=k),B("select",{index:m.indexOf(t),value:t,selected:!0})),l(8,v=k),l(11,S=!1));else if(l(11,S=!0),c.key==="ArrowUp"||c.key==="ArrowDown"){k===null&&l(9,k=i[0]);const T=c.key==="ArrowUp"?-1:1,$=i.indexOf(k)+T;l(9,k=$<0?i[i.length-1]:$===i.length?i[0]:i[$]),c.preventDefault()}else c.key==="Escape"?l(11,S=!1):c.key==="Backspace"?f&&(!v||v==="")&&Array.isArray(t)&&t.length>0&&(J(t[t.length-1]),l(8,v="")):l(11,S=!0)}const O=c=>J(c);function F(){v=this.value,l(8,v),l(0,t)}function Ae(c){P[c?"unshift":"push"](()=>{y=c,l(12,y)})}const pe=()=>{l(11,S=!S),S?l(8,v=""):y.blur()},Be=()=>{b&&l(0,t=v)},De=()=>{f?l(8,v=""):b||t!==v&&(typeof t=="string"&&v==""?l(8,v=t):(l(0,t=void 0),l(8,v=""))),l(11,S=!1)};function Ce(c){t=c,l(0,t)}return n.$$set=c=>{"label"in c&&l(1,o=c.label),"info"in c&&l(2,d=c.info),"value"in c&&l(0,t=c.value),"value_is_output"in c&&l(17,s=c.value_is_output),"multiselect"in c&&l(3,f=c.multiselect),"max_choices"in c&&l(18,a=c.max_choices),"choices"in c&&l(19,m=c.choices),"disabled"in c&&l(4,_=c.disabled),"show_label"in c&&l(5,w=c.show_label),"container"in c&&l(6,A=c.container),"allow_custom_value"in c&&l(7,b=c.allow_custom_value)},n.$$.update=()=>{n.$$.dirty[0]&1&&(typeof t=="string"||t===null)&&l(8,v=t),n.$$.dirty[0]&524544&&l(10,i=m.filter(c=>v?c.toLowerCase().includes(v.toLowerCase()):c)),n.$$.dirty[0]&1536&&(!k||!i.includes(k))&&l(9,k=i.length?i[0]:null),n.$$.dirty[0]&1048577&&JSON.stringify(t)!=JSON.stringify(u)&&(l(20,u=Array.isArray(t)?t.slice():t),D()),n.$$.dirty[0]&1048577&&JSON.stringify(t)!=JSON.stringify(u)&&(B("change",t),l(20,u=Array.isArray(t)?t.slice():t))},[t,o,d,f,_,w,A,b,v,k,i,S,y,J,h,p,r,s,a,m,u,O,F,Ae,pe,Be,De,Ce]}class Ve extends Q{constructor(e){super(),Z(this,e,Ke,Ie,W,{label:1,info:2,value:0,value_is_output:17,multiselect:3,max_choices:18,choices:19,disabled:4,show_label:5,container:6,allow_custom_value:7},null,[-1,-1])}}function Fe(n){let e,l,i,o,d,t;const u=[n[14]];let s={};for(let _=0;_ee(i,"value",f)),P.push(()=>ee(i,"value_is_output",a)),i.$on("change",n[19]),i.$on("input",n[20]),i.$on("select",n[21]),i.$on("blur",n[22]),{c(){I(e.$$.fragment),l=U(),I(i.$$.fragment)},m(_,w){K(e,_,w),L(_,l,w),K(i,_,w),t=!0},p(_,w){const A=w&16384?ye(u,[Re(_[14])]):{};e.$set(A);const b={};w&512&&(b.choices=_[9]),w&128&&(b.multiselect=_[7]),w&256&&(b.max_choices=_[8]),w&4&&(b.label=_[2]),w&8&&(b.info=_[3]),w&1024&&(b.show_label=_[10]),w&32768&&(b.allow_custom_value=_[15]),w&2048&&(b.container=_[11]),w&65536&&(b.disabled=_[16]==="static"),!o&&w&1&&(o=!0,b.value=_[0],le(()=>o=!1)),!d&&w&2&&(d=!0,b.value_is_output=_[1],le(()=>d=!1)),i.$set(b)},i(_){t||(N(e.$$.fragment,_),N(i.$$.fragment,_),t=!0)},o(_){R(e.$$.fragment,_),R(i.$$.fragment,_),t=!1},d(_){_&&M(l),V(e,_),V(i,_)}}}function Ge(n){let e,l;return e=new Te({props:{visible:n[6],elem_id:n[4],elem_classes:n[5],padding:n[11],allow_overflow:!1,scale:n[12],min_width:n[13],$$slots:{default:[Fe]},$$scope:{ctx:n}}}),{c(){I(e.$$.fragment)},m(i,o){K(e,i,o),l=!0},p(i,[o]){const d={};o&64&&(d.visible=i[6]),o&16&&(d.elem_id=i[4]),o&32&&(d.elem_classes=i[5]),o&2048&&(d.padding=i[11]),o&4096&&(d.scale=i[12]),o&8192&&(d.min_width=i[13]),o&8507279&&(d.$$scope={dirty:o,ctx:i}),e.$set(d)},i(i){l||(N(e.$$.fragment,i),l=!0)},o(i){R(e.$$.fragment,i),l=!1},d(i){V(e,i)}}}function Pe(n,e,l){let{label:i="Dropdown"}=e,{info:o=void 0}=e,{elem_id:d=""}=e,{elem_classes:t=[]}=e,{visible:u=!0}=e,{value:s}=e,{value_is_output:f=!1}=e,{multiselect:a=!1}=e,{max_choices:m}=e,{choices:_}=e,{show_label:w}=e,{container:A=!0}=e,{scale:b=null}=e,{min_width:B=void 0}=e,{loading_status:v}=e,{allow_custom_value:k=!1}=e,{mode:S}=e;a&&!s?s=[]:s||(s="");function y(r){s=r,l(0,s)}function D(r){f=r,l(1,f)}function j(r){X.call(this,n,r)}function J(r){X.call(this,n,r)}function h(r){X.call(this,n,r)}function p(r){X.call(this,n,r)}return n.$$set=r=>{"label"in r&&l(2,i=r.label),"info"in r&&l(3,o=r.info),"elem_id"in r&&l(4,d=r.elem_id),"elem_classes"in r&&l(5,t=r.elem_classes),"visible"in r&&l(6,u=r.visible),"value"in r&&l(0,s=r.value),"value_is_output"in r&&l(1,f=r.value_is_output),"multiselect"in r&&l(7,a=r.multiselect),"max_choices"in r&&l(8,m=r.max_choices),"choices"in r&&l(9,_=r.choices),"show_label"in r&&l(10,w=r.show_label),"container"in r&&l(11,A=r.container),"scale"in r&&l(12,b=r.scale),"min_width"in r&&l(13,B=r.min_width),"loading_status"in r&&l(14,v=r.loading_status),"allow_custom_value"in r&&l(15,k=r.allow_custom_value),"mode"in r&&l(16,S=r.mode)},[s,f,i,o,d,t,u,a,m,_,w,A,b,B,v,k,S,y,D,j,J,h,p]}class Qe extends Q{constructor(e){super(),Z(this,e,Pe,Ge,W,{label:2,info:3,elem_id:4,elem_classes:5,visible:6,value:0,value_is_output:1,multiselect:7,max_choices:8,choices:9,show_label:10,container:11,scale:12,min_width:13,loading_status:14,allow_custom_value:15,mode:16})}}const $e=Qe,el=["static","dynamic"],ll=n=>({type:{payload:"string"},description:{payload:"selected choice"},example_data:n.choices.length?n.choices[0]:""});export{$e as Component,ll as document,el as modes}; +//# sourceMappingURL=index-0c7e5d30.js.map diff --git a/gradio/templates/cdn/assets/index-0c7e5d30.js.map b/gradio/templates/cdn/assets/index-0c7e5d30.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5e7699f425643d0dfb55f456fc214b0a91ee6cd7 --- /dev/null +++ b/gradio/templates/cdn/assets/index-0c7e5d30.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-0c7e5d30.js","sources":["../../../../js/icons/src/DropdownArrow.svelte","../../../../js/icons/src/Remove.svelte","../../../../js/form/src/DropdownOptions.svelte","../../../../js/form/src/Dropdown.svelte","../../../../js/app/src/components/Dropdown/Dropdown.svelte","../../../../js/app/src/components/Dropdown/index.ts"],"sourcesContent":["\n\t\n\n\n\n","\n\t\n\n","\n\n\n\n
\n{#if showOptions && !disabled}\n\t dispatch(\"change\", e)}\n\t\tstyle:top\n\t\tstyle:bottom\n\t\tstyle:max-height={`calc(${max_height}px - var(--window-padding))`}\n\t\tstyle:width={input_width + \"px\"}\n\t\tbind:this={listElement}\n\t>\n\t\t{#each filtered as choice}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t✓\n\t\t\t\t\n\t\t\t\t{choice}\n\t\t\t\n\t\t{/each}\n\t\n{/if}\n\n\n","\n\n
\n\t\t\n\t\n\n\n\n","\n\n\n\t\n\n\t\n\n","export { default as Component } from \"./Dropdown.svelte\";\nexport const modes = [\"static\", \"dynamic\"];\n\nexport const document = (config: Record) => ({\n\ttype: {\n\t\tpayload: \"string\"\n\t},\n\tdescription: {\n\t\tpayload: \"selected choice\"\n\t},\n\texample_data: config.choices.length ? config.choices[0] : \"\"\n});\n"],"names":["insert","target","svg","anchor","append","path","ctx","i","set_style","ul","ul_transition","create_bidirectional_transition","fly","toggle_class","li","span","set_data","t2","t2_value","if_block","create_if_block","div","value","$$props","filtered","showOptions","activeOption","disabled","distance_from_top","distance_from_bottom","input_height","input_width","refElement","listElement","top","bottom","max_height","innerHeight","calculate_window_distance","ref_top","ref_bottom","$$invalidate","scroll_timeout","scroll_listener","dispatch","createEventDispatcher","$$value","mousedown_handler","e","el","rect","_value","each_blocks","div1","div0","t0","t0_value","show_if","label_1","div3","div2","input","dirty","label","info","old_value","value_is_output","multiselect","max_choices","choices","show_label","container","allow_custom_value","inputValue","filterInput","handle_change","afterUpdate","add","option","remove","v","remove_all","handleOptionMousedown","handleKeydown","increment","calcIndex","click_handler","s","o","dropdown_changes","elem_id","elem_classes","visible","scale","min_width","loading_status","mode","modes","document","config"],"mappings":"owBAAAA,EAQKC,EAAAC,EAAAC,CAAA,EADJC,EAAyBF,EAAAG,CAAA,4XCP1BL,EASKC,EAAAC,EAAAC,CAAA,EAHJC,EAECF,EAAAG,CAAA,0LC2EOC,EAAQ,CAAA,CAAA,uBAAb,OAAIC,GAAA,yIATSD,EAAW,CAAA,CAAA,8DAKAA,EAAU,CAAA,8BAAA,EACvBE,EAAAC,EAAA,QAAAH,KAAc,IAAI,UARhCN,EA4BIC,EAAAQ,EAAAN,CAAA,+HAjBIG,EAAQ,CAAA,CAAA,oBAAb,OAAIC,GAAA,EAAA,mHAAJ,sCATaD,EAAW,CAAA,CAAA,mFAKAA,EAAU,CAAA,8BAAA,QACvBE,EAAAC,EAAA,QAAAH,KAAc,IAAI,2BALbI,IAAAA,EAAAC,GAAAF,EAAAG,GAAA,CAAA,SAAU,IAAK,EAAG,CAAC,EAAA,EAAA,+BAAnBF,IAAAA,EAAAC,GAAAF,EAAAG,GAAA,CAAA,SAAU,IAAK,EAAG,CAAC,EAAA,EAAA,wGAsBlCN,EAAM,EAAA,EAAA,uIAHYA,EAAM,EAAA,EAAC,SAASA,EAAM,EAAA,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pC,CAAA,QAAAmE,EAAkB,EAAE,EAAAnE,GACpB,aAAAoE,EAAY,EAAA,EAAApE,EACZ,CAAA,QAAAqE,EAAmB,EAAI,EAAArE,GACvB,MAAAD,CAA6B,EAAAC,EAC7B,CAAA,gBAAA2C,EAA2B,EAAK,EAAA3C,EAChC,CAAA,YAAA4C,EAAuB,EAAK,EAAA5C,GAC5B,YAAA6C,CAAmB,EAAA7C,GACnB,QAAA8C,CAAsB,EAAA9C,GACtB,WAAA+C,CAAmB,EAAA/C,EACnB,CAAA,UAAAgD,EAAqB,EAAI,EAAAhD,EACzB,CAAA,MAAAsE,EAAuB,IAAI,EAAAtE,EAC3B,CAAA,UAAAuE,EAAgC,MAAS,EAAAvE,GACzC,eAAAwE,CAA6B,EAAAxE,EAC7B,CAAA,mBAAAiD,EAA8B,EAAK,EAAAjD,GAEnC,KAAAyE,CAA0B,EAAAzE,EAEjC4C,IAAgB7C,EACnBA,EAAK,CAAA,EACMA,IACXA,EAAQ,+nCC3BG2E,GAAQ,CAAC,SAAU,SAAS,EAE5BC,GAAYC,IAAiC,CACzD,KAAM,CACL,QAAS,QACV,EACA,YAAa,CACZ,QAAS,iBACV,EACA,aAAcA,EAAO,QAAQ,OAASA,EAAO,QAAQ,CAAC,EAAI,EAC3D"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-10e05757.js b/gradio/templates/cdn/assets/index-10e05757.js new file mode 100644 index 0000000000000000000000000000000000000000..72c8f6c02b2dc3f6d202e48024594bae349b876d --- /dev/null +++ b/gradio/templates/cdn/assets/index-10e05757.js @@ -0,0 +1,2 @@ +import{P as j,N as G,c as E,D as U,e as w,T as b,I as H}from"./index-ea4e155c.js";class P{constructor(t,e,s,i,h,r,n,a,l,f=0,u){this.p=t,this.stack=e,this.state=s,this.reducePos=i,this.pos=h,this.score=r,this.buffer=n,this.bufferBase=a,this.curContext=l,this.lookAhead=f,this.parent=u}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,s=0){let i=t.parser.context;return new P(t,[],e,s,s,0,[],0,i?new y(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let s=t>>19,i=t&65535,{parser:h}=this.p,r=h.dynamicPrecedence(i);if(r&&(this.score+=r),s==0){this.pushState(h.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((e=this.p.parser.nodeSet.types[i])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=l):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(i,a)}storeNode(t,e,s,i=4,h=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&r.buffer[n-4]==0&&r.buffer[n-1]>-1){if(e==s)return;if(r.buffer[n-2]>=e){r.buffer[n-2]=s;return}}}if(!h||this.pos==s)this.buffer.push(t,e,s,i);else{let r=this.buffer.length;if(r>0&&this.buffer[r-4]!=0)for(;r>0&&this.buffer[r-2]>s;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4);this.buffer[r]=t,this.buffer[r+1]=e,this.buffer[r+2]=s,this.buffer[r+3]=i}}shift(t,e,s){let i=this.pos;if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=s,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,s,4);else{let h=t,{parser:r}=this.p;(s>this.pos||e<=r.maxNode)&&(this.pos=s,r.stateFlag(h,1)||(this.reducePos=s)),this.pushState(h,i),this.shiftContext(e,i),e<=r.maxNode&&this.buffer.push(e,i,s,4)}}apply(t,e,s){t&65536?this.reduce(t):this.shift(t,e,s)}useNode(t,e){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=t)&&(this.p.reused.push(t),s++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let s=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new P(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let s=t<=this.p.parser.maxNode;s&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,s?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new W(this);;){let s=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(s==0)return!1;if(!(s&65536))return!0;e.reduce(s)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>4<<1||this.stack.length>=120){let i=[];for(let h=0,r;ha&1&&n==r)||i.push(e[h],r)}e=i}let s=[];for(let i=0;i>19,i=t&65535,h=this.stack.length-s*3;if(h<0||e.getGoto(this.stack[h],i,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;ethis.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class y{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}var N;(function(o){o[o.Insert=200]="Insert",o[o.Delete=190]="Delete",o[o.Reduce=100]="Reduce",o[o.MaxNext=4]="MaxNext",o[o.MaxInsertStackDepth=300]="MaxInsertStackDepth",o[o.DampenInsertStackDepth=120]="DampenInsertStackDepth",o[o.MinBigReduction=2e3]="MinBigReduction"})(N||(N={}));class W{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,s=t>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class C{constructor(t,e,s){this.stack=t,this.pos=e,this.index=s,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new C(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new C(this.stack,this.pos,this.index)}}function x(o,t=Uint16Array){if(typeof o!="string")return o;let e=null;for(let s=0,i=0;s=92&&r--,r>=34&&r--;let a=r-32;if(a>=46&&(a-=46,n=!0),h+=a,n)break;h*=46}e?e[i++]=h:e=new t(h)}return e}class S{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const D=new S;class q{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=D,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let s=this.range,i=this.rangeIndex,h=this.pos+t;for(;hs.to:h>=s.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];h+=r.from-s.to,s=r}return h}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,s,i;if(e>=0&&e=this.chunk2Pos&&sn.to&&(this.chunk2=this.chunk2.slice(0,n.to-s)),i=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),i}acceptToken(t,e=0){let s=e?this.resolveOffset(e,-1):this.pos;if(s==null||s=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=D,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let s="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(s+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return s}}class m{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:s}=e.p;F(this.data,t,e,this.id,s.data,s.tokenPrecTable)}}m.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class J{constructor(t,e,s){this.precTable=e,this.elseToken=s,this.data=typeof t=="string"?x(t):t}token(t,e){let s=t.pos,i;for(;i=t.pos,F(this.data,t,e,0,this.data,this.precTable),!(t.token.value>-1);){if(this.elseToken==null)return;if(t.next<0)break;t.advance(),t.reset(i+1,t.token)}i>s&&(t.reset(s,t.token),t.acceptToken(this.elseToken,i-s))}}J.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class tt{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function F(o,t,e,s,i,h){let r=0,n=1<0){let d=o[p];if(a.allows(d)&&(t.token.value==-1||t.token.value==d||K(d,t.token.value,i,h))){t.acceptToken(d);break}}let f=t.next,u=0,c=o[r+2];if(t.next<0&&c>u&&o[l+c*3-3]==65535&&o[l+c*3-3]==65535){r=o[l+c*3-1];continue t}for(;u>1,d=l+p+(p<<1),L=o[d],$=o[d+1]||65536;if(f=$)u=p+1;else{r=o[d+2],t.advance();continue t}}break}}function I(o,t,e){for(let s=t,i;(i=o[s])!=65535;s++)if(i==e)return s-t;return-1}function K(o,t,e,s){let i=I(e,s,t);return i<0||I(e,s,o)t)&&!s.type.isError)return e<0?Math.max(0,Math.min(s.to-1,t-25)):Math.min(o.length,Math.max(s.from+1,t+25));if(e<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return e<0?0:o.length}}class Q{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?B(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?B(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=r,null;if(h instanceof b){if(r==t){if(r=Math.max(this.safeFrom,t)&&(this.trees.push(h),this.start.push(r),this.index.push(0))}else this.index[e]++,this.nextStart=r+h.length}}}class V{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(s=>new S)}getActions(t){let e=0,s=null,{parser:i}=t.p,{tokenizers:h}=i,r=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,a=0;for(let l=0;lu.end+25&&(a=Math.max(u.lookAhead,a)),u.value!=0)){let c=e;if(u.extended>-1&&(e=this.addActions(t,u.extended,u.end,e)),e=this.addActions(t,u.value,u.end,e),!f.extend&&(s=u,e>c))break}}for(;this.actions.length>e;)this.actions.pop();return a&&t.setLookAhead(a),!s&&t.pos==this.stream.end&&(s=new S,s.value=t.p.parser.eofTerm,s.start=s.end=t.pos,e=this.addActions(t,s.value,s.end,e)),this.mainToken=s,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new S,{pos:s,p:i}=t;return e.start=s,e.end=Math.min(s+1,i.stream.end),e.value=s==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,s){let i=this.stream.clipPos(s.pos);if(e.token(this.stream.reset(i,t),s),t.value>-1){let{parser:h}=s.p;for(let r=0;r=0&&s.p.parser.dialect.allows(n>>1)){n&1?t.extended=n>>1:t.value=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,s,i){for(let h=0;ht.bufferLength*4?new Q(s,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,s=this.stacks=[],i,h;if(this.bigReductionCount>300&&t.length==1){let[r]=t;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;re)s.push(n);else{if(this.advanceStack(n,s,t))continue;{i||(i=[],h=[]),i.push(n);let a=this.tokens.getMainToken(n);h.push(a.value,a.end)}}break}}if(!s.length){let r=i&&Z(i);if(r)return this.stackToTree(r);if(this.parser.strict)throw g&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,h,s);if(r)return this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(s.length>r)for(s.sort((n,a)=>a.score-n.score);s.length>r;)s.pop();s.some(n=>n.reducePos>e)&&this.recovering--}else if(s.length>1){t:for(let r=0;r500&&l.buffer.length>500)if((n.score-l.score||n.buffer.length-l.buffer.length)>0)s.splice(a--,1);else{s.splice(r--,1);continue t}}}s.length>12&&s.splice(12,s.length-12)}this.minStackPos=s[0].pos;for(let r=1;r ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let l=t.curContext&&t.curContext.tracker.strict,f=l?t.curContext.hash:0;for(let u=this.fragments.nodeAt(i);u;){let c=this.parser.nodeSet.types[u.type.id]==u.type?h.getGoto(t.state,u.type.id):-1;if(c>-1&&u.length&&(!l||(u.prop(w.contextHash)||0)==f))return t.useNode(u,c),g&&console.log(r+this.stackID(t)+` (via reuse of ${h.getName(u.type.id)})`),!0;if(!(u instanceof b)||u.children.length==0||u.positions[0]>0)break;let p=u.children[0];if(p instanceof b&&u.positions[0]==0)u=p;else break}}let n=h.stateSlot(t.state,4);if(n>0)return t.reduce(n),g&&console.log(r+this.stackID(t)+` (via always-reduce ${h.getName(n&65535)})`),!0;if(t.stack.length>=15e3)for(;t.stack.length>9e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let l=0;li?e.push(d):s.push(d)}return!1}advanceFully(t,e){let s=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>s)return R(t,e),!0}}runRecovery(t,e,s){let i=null,h=!1;for(let r=0;r ":"";if(n.deadEnd&&(h||(h=!0,n.restart(),g&&console.log(f+this.stackID(n)+" (restarted)"),this.advanceFully(n,s))))continue;let u=n.split(),c=f;for(let p=0;u.forceReduce()&&p<10&&(g&&console.log(c+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,s));p++)g&&(c=this.stackID(u)+" -> ");for(let p of n.recoverByInsert(a))g&&console.log(f+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,s);this.stream.end>n.pos?(l==n.pos&&(l++,a=0),n.recoverByDelete(a,l),g&&console.log(f+this.stackID(n)+` (via recover-delete ${this.parser.getName(a)})`),R(n,s)):(!i||i.scoreo;class et{constructor(t){this.start=t.start,this.shift=t.shift||T,this.reduce=t.reduce||T,this.reuse=t.reuse||T,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class v extends j{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;nt.topRules[n][1]),i=[];for(let n=0;n=0)h(f,a,n[l++]);else{let u=n[l+-f];for(let c=-f;c>0;c--)h(n[l++],a,u);l++}}}this.nodeSet=new G(e.map((n,a)=>E.define({name:a>=this.minRepeatTerm?void 0:n,id:a,props:i[a],top:s.indexOf(a)>-1,error:a==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(a)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=U;let r=x(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new m(r,n):n),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,s){let i=new X(this,t,e,s);for(let h of this.wrappers)i=h(i,t,e,s);return i}getGoto(t,e,s=!1){let i=this.goto;if(e>=i[0])return-1;for(let h=i[e+1];;){let r=i[h++],n=r&1,a=i[h++];if(n&&s)return a;for(let l=h+(r>>1);h0}validAction(t,e){if(e==this.stateSlot(t,4))return!0;for(let s=this.stateSlot(t,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else return!1;if(e==k(this.data,s+1))return!0}}nextStates(t){let e=[];for(let s=this.stateSlot(t,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;if(!(this.data[s+2]&1)){let i=this.data[s+1];e.some((h,r)=>r&1&&h==i)||e.push(this.data[s],i)}}return e}configure(t){let e=Object.assign(Object.create(v.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let s=this.topRules[t.top];if(!s)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=s}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(s=>{let i=t.tokenizers.find(h=>h.from==s);return i?i.to:s})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((s,i)=>{let h=t.specializers.find(n=>n.from==s.external);if(!h)return s;let r=Object.assign(Object.assign({},s),{external:h.to});return e.specializers[i]=O(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),s=e.map(()=>!1);if(t)for(let h of t.split(" ")){let r=e.indexOf(h);r>=0&&(s[r]=!0)}let i=null;for(let h=0;hs)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.scoreo.external(e,s)<<1|t}return o.get}export{et as C,tt as E,v as L,J as a}; +//# sourceMappingURL=index-10e05757.js.map diff --git a/gradio/templates/cdn/assets/index-10e05757.js.map b/gradio/templates/cdn/assets/index-10e05757.js.map new file mode 100644 index 0000000000000000000000000000000000000000..17bb971362e7f0ef4ba26d961c8b1754a29cdf72 --- /dev/null +++ b/gradio/templates/cdn/assets/index-10e05757.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-10e05757.js","sources":["../../../../node_modules/.pnpm/@lezer+lr@1.3.3/node_modules/@lezer/lr/dist/index.js"],"sourcesContent":["import { Parser, NodeProp, NodeSet, NodeType, DefaultBufferLength, Tree, IterMode } from '@lezer/common';\n\n/// A parse stack. These are used internally by the parser to track\n/// parsing progress. They also provide some properties and methods\n/// that external code such as a tokenizer can use to get information\n/// about the parse state.\nclass Stack {\n /// @internal\n constructor(\n /// The parse that this stack is part of @internal\n p, \n /// Holds state, input pos, buffer index triplets for all but the\n /// top state @internal\n stack, \n /// The current parse state @internal\n state, \n // The position at which the next reduce should take place. This\n // can be less than `this.pos` when skipped expressions have been\n // added to the stack (which should be moved outside of the next\n // reduction)\n /// @internal\n reducePos, \n /// The input position up to which this stack has parsed.\n pos, \n /// The dynamic score of the stack, including dynamic precedence\n /// and error-recovery penalties\n /// @internal\n score, \n // The output buffer. Holds (type, start, end, size) quads\n // representing nodes created by the parser, where `size` is\n // amount of buffer array entries covered by this node.\n /// @internal\n buffer, \n // The base offset of the buffer. When stacks are split, the split\n // instance shared the buffer history with its parent up to\n // `bufferBase`, which is the absolute offset (including the\n // offset of previous splits) into the buffer at which this stack\n // starts writing.\n /// @internal\n bufferBase, \n /// @internal\n curContext, \n /// @internal\n lookAhead = 0, \n // A parent stack from which this was split off, if any. This is\n // set up so that it always points to a stack that has some\n // additional buffer content, never to a stack with an equal\n // `bufferBase`.\n /// @internal\n parent) {\n this.p = p;\n this.stack = stack;\n this.state = state;\n this.reducePos = reducePos;\n this.pos = pos;\n this.score = score;\n this.buffer = buffer;\n this.bufferBase = bufferBase;\n this.curContext = curContext;\n this.lookAhead = lookAhead;\n this.parent = parent;\n }\n /// @internal\n toString() {\n return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? \"!\" + this.score : \"\"}`;\n }\n // Start an empty stack\n /// @internal\n static start(p, state, pos = 0) {\n let cx = p.parser.context;\n return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);\n }\n /// The stack's current [context](#lr.ContextTracker) value, if\n /// any. Its type will depend on the context tracker's type\n /// parameter, or it will be `null` if there is no context\n /// tracker.\n get context() { return this.curContext ? this.curContext.context : null; }\n // Push a state onto the stack, tracking its start position as well\n // as the buffer base at that point.\n /// @internal\n pushState(state, start) {\n this.stack.push(this.state, start, this.bufferBase + this.buffer.length);\n this.state = state;\n }\n // Apply a reduce action\n /// @internal\n reduce(action) {\n var _a;\n let depth = action >> 19 /* Action.ReduceDepthShift */, type = action & 65535 /* Action.ValueMask */;\n let { parser } = this.p;\n let dPrec = parser.dynamicPrecedence(type);\n if (dPrec)\n this.score += dPrec;\n if (depth == 0) {\n this.pushState(parser.getGoto(this.state, type, true), this.reducePos);\n // Zero-depth reductions are a special case—they add stuff to\n // the stack without popping anything off.\n if (type < parser.minRepeatTerm)\n this.storeNode(type, this.reducePos, this.reducePos, 4, true);\n this.reduceContext(type, this.reducePos);\n return;\n }\n // Find the base index into `this.stack`, content after which will\n // be dropped. Note that with `StayFlag` reductions we need to\n // consume two extra frames (the dummy parent node for the skipped\n // expression and the state that we'll be staying in, which should\n // be moved to `this.state`).\n let base = this.stack.length - ((depth - 1) * 3) - (action & 262144 /* Action.StayFlag */ ? 6 : 0);\n let start = base ? this.stack[base - 2] : this.p.ranges[0].from, size = this.reducePos - start;\n // This is a kludge to try and detect overly deep left-associative\n // trees, which will not increase the parse stack depth and thus\n // won't be caught by the regular stack-depth limit check.\n if (size >= 2000 /* Recover.MinBigReduction */ && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === void 0 ? void 0 : _a.isAnonymous)) {\n if (start == this.p.lastBigReductionStart) {\n this.p.bigReductionCount++;\n this.p.lastBigReductionSize = size;\n }\n else if (this.p.lastBigReductionSize < size) {\n this.p.bigReductionCount = 1;\n this.p.lastBigReductionStart = start;\n this.p.lastBigReductionSize = size;\n }\n }\n let bufferBase = base ? this.stack[base - 1] : 0, count = this.bufferBase + this.buffer.length - bufferBase;\n // Store normal terms or `R -> R R` repeat reductions\n if (type < parser.minRepeatTerm || (action & 131072 /* Action.RepeatFlag */)) {\n let pos = parser.stateFlag(this.state, 1 /* StateFlag.Skipped */) ? this.pos : this.reducePos;\n this.storeNode(type, start, pos, count + 4, true);\n }\n if (action & 262144 /* Action.StayFlag */) {\n this.state = this.stack[base];\n }\n else {\n let baseStateID = this.stack[base - 3];\n this.state = parser.getGoto(baseStateID, type, true);\n }\n while (this.stack.length > base)\n this.stack.pop();\n this.reduceContext(type, start);\n }\n // Shift a value into the buffer\n /// @internal\n storeNode(term, start, end, size = 4, isReduce = false) {\n if (term == 0 /* Term.Err */ &&\n (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {\n // Try to omit/merge adjacent error nodes\n let cur = this, top = this.buffer.length;\n if (top == 0 && cur.parent) {\n top = cur.bufferBase - cur.parent.bufferBase;\n cur = cur.parent;\n }\n if (top > 0 && cur.buffer[top - 4] == 0 /* Term.Err */ && cur.buffer[top - 1] > -1) {\n if (start == end)\n return;\n if (cur.buffer[top - 2] >= start) {\n cur.buffer[top - 2] = end;\n return;\n }\n }\n }\n if (!isReduce || this.pos == end) { // Simple case, just append\n this.buffer.push(term, start, end, size);\n }\n else { // There may be skipped nodes that have to be moved forward\n let index = this.buffer.length;\n if (index > 0 && this.buffer[index - 4] != 0 /* Term.Err */)\n while (index > 0 && this.buffer[index - 2] > end) {\n // Move this record forward\n this.buffer[index] = this.buffer[index - 4];\n this.buffer[index + 1] = this.buffer[index - 3];\n this.buffer[index + 2] = this.buffer[index - 2];\n this.buffer[index + 3] = this.buffer[index - 1];\n index -= 4;\n if (size > 4)\n size -= 4;\n }\n this.buffer[index] = term;\n this.buffer[index + 1] = start;\n this.buffer[index + 2] = end;\n this.buffer[index + 3] = size;\n }\n }\n // Apply a shift action\n /// @internal\n shift(action, next, nextEnd) {\n let start = this.pos;\n if (action & 131072 /* Action.GotoFlag */) {\n this.pushState(action & 65535 /* Action.ValueMask */, this.pos);\n }\n else if ((action & 262144 /* Action.StayFlag */) == 0) { // Regular shift\n let nextState = action, { parser } = this.p;\n if (nextEnd > this.pos || next <= parser.maxNode) {\n this.pos = nextEnd;\n if (!parser.stateFlag(nextState, 1 /* StateFlag.Skipped */))\n this.reducePos = nextEnd;\n }\n this.pushState(nextState, start);\n this.shiftContext(next, start);\n if (next <= parser.maxNode)\n this.buffer.push(next, start, nextEnd, 4);\n }\n else { // Shift-and-stay, which means this is a skipped token\n this.pos = nextEnd;\n this.shiftContext(next, start);\n if (next <= this.p.parser.maxNode)\n this.buffer.push(next, start, nextEnd, 4);\n }\n }\n // Apply an action\n /// @internal\n apply(action, next, nextEnd) {\n if (action & 65536 /* Action.ReduceFlag */)\n this.reduce(action);\n else\n this.shift(action, next, nextEnd);\n }\n // Add a prebuilt (reused) node into the buffer.\n /// @internal\n useNode(value, next) {\n let index = this.p.reused.length - 1;\n if (index < 0 || this.p.reused[index] != value) {\n this.p.reused.push(value);\n index++;\n }\n let start = this.pos;\n this.reducePos = this.pos = start + value.length;\n this.pushState(next, start);\n this.buffer.push(index, start, this.reducePos, -1 /* size == -1 means this is a reused value */);\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length)));\n }\n // Split the stack. Due to the buffer sharing and the fact\n // that `this.stack` tends to stay quite shallow, this isn't very\n // expensive.\n /// @internal\n split() {\n let parent = this;\n let off = parent.buffer.length;\n // Because the top of the buffer (after this.pos) may be mutated\n // to reorder reductions and skipped tokens, and shared buffers\n // should be immutable, this copies any outstanding skipped tokens\n // to the new buffer, and puts the base pointer before them.\n while (off > 0 && parent.buffer[off - 2] > parent.reducePos)\n off -= 4;\n let buffer = parent.buffer.slice(off), base = parent.bufferBase + off;\n // Make sure parent points to an actual parent with content, if there is such a parent.\n while (parent && base == parent.bufferBase)\n parent = parent.parent;\n return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);\n }\n // Try to recover from an error by 'deleting' (ignoring) one token.\n /// @internal\n recoverByDelete(next, nextEnd) {\n let isNode = next <= this.p.parser.maxNode;\n if (isNode)\n this.storeNode(next, this.pos, nextEnd, 4);\n this.storeNode(0 /* Term.Err */, this.pos, nextEnd, isNode ? 8 : 4);\n this.pos = this.reducePos = nextEnd;\n this.score -= 190 /* Recover.Delete */;\n }\n /// Check if the given term would be able to be shifted (optionally\n /// after some reductions) on this stack. This can be useful for\n /// external tokenizers that want to make sure they only provide a\n /// given token when it applies.\n canShift(term) {\n for (let sim = new SimulatedStack(this);;) {\n let action = this.p.parser.stateSlot(sim.state, 4 /* ParseState.DefaultReduce */) || this.p.parser.hasAction(sim.state, term);\n if (action == 0)\n return false;\n if ((action & 65536 /* Action.ReduceFlag */) == 0)\n return true;\n sim.reduce(action);\n }\n }\n // Apply up to Recover.MaxNext recovery actions that conceptually\n // inserts some missing token or rule.\n /// @internal\n recoverByInsert(next) {\n if (this.stack.length >= 300 /* Recover.MaxInsertStackDepth */)\n return [];\n let nextStates = this.p.parser.nextStates(this.state);\n if (nextStates.length > 4 /* Recover.MaxNext */ << 1 || this.stack.length >= 120 /* Recover.DampenInsertStackDepth */) {\n let best = [];\n for (let i = 0, s; i < nextStates.length; i += 2) {\n if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next))\n best.push(nextStates[i], s);\n }\n if (this.stack.length < 120 /* Recover.DampenInsertStackDepth */)\n for (let i = 0; best.length < 4 /* Recover.MaxNext */ << 1 && i < nextStates.length; i += 2) {\n let s = nextStates[i + 1];\n if (!best.some((v, i) => (i & 1) && v == s))\n best.push(nextStates[i], s);\n }\n nextStates = best;\n }\n let result = [];\n for (let i = 0; i < nextStates.length && result.length < 4 /* Recover.MaxNext */; i += 2) {\n let s = nextStates[i + 1];\n if (s == this.state)\n continue;\n let stack = this.split();\n stack.pushState(s, this.pos);\n stack.storeNode(0 /* Term.Err */, stack.pos, stack.pos, 4, true);\n stack.shiftContext(nextStates[i], this.pos);\n stack.score -= 200 /* Recover.Insert */;\n result.push(stack);\n }\n return result;\n }\n // Force a reduce, if possible. Return false if that can't\n // be done.\n /// @internal\n forceReduce() {\n let reduce = this.p.parser.stateSlot(this.state, 5 /* ParseState.ForcedReduce */);\n if ((reduce & 65536 /* Action.ReduceFlag */) == 0)\n return false;\n let { parser } = this.p;\n if (!parser.validAction(this.state, reduce)) {\n let depth = reduce >> 19 /* Action.ReduceDepthShift */, term = reduce & 65535 /* Action.ValueMask */;\n let target = this.stack.length - depth * 3;\n if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0)\n return false;\n this.storeNode(0 /* Term.Err */, this.reducePos, this.reducePos, 4, true);\n this.score -= 100 /* Recover.Reduce */;\n }\n this.reducePos = this.pos;\n this.reduce(reduce);\n return true;\n }\n /// @internal\n forceAll() {\n while (!this.p.parser.stateFlag(this.state, 2 /* StateFlag.Accepting */)) {\n if (!this.forceReduce()) {\n this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);\n break;\n }\n }\n return this;\n }\n /// Check whether this state has no further actions (assumed to be a direct descendant of the\n /// top state, since any other states must be able to continue\n /// somehow). @internal\n get deadEnd() {\n if (this.stack.length != 3)\n return false;\n let { parser } = this.p;\n return parser.data[parser.stateSlot(this.state, 1 /* ParseState.Actions */)] == 65535 /* Seq.End */ &&\n !parser.stateSlot(this.state, 4 /* ParseState.DefaultReduce */);\n }\n /// Restart the stack (put it back in its start state). Only safe\n /// when this.stack.length == 3 (state is directly below the top\n /// state). @internal\n restart() {\n this.state = this.stack[0];\n this.stack.length = 0;\n }\n /// @internal\n sameState(other) {\n if (this.state != other.state || this.stack.length != other.stack.length)\n return false;\n for (let i = 0; i < this.stack.length; i += 3)\n if (this.stack[i] != other.stack[i])\n return false;\n return true;\n }\n /// Get the parser used by this stack.\n get parser() { return this.p.parser; }\n /// Test whether a given dialect (by numeric ID, as exported from\n /// the terms file) is enabled.\n dialectEnabled(dialectID) { return this.p.parser.dialect.flags[dialectID]; }\n shiftContext(term, start) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));\n }\n reduceContext(term, start) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));\n }\n /// @internal\n emitContext() {\n let last = this.buffer.length - 1;\n if (last < 0 || this.buffer[last] != -3)\n this.buffer.push(this.curContext.hash, this.reducePos, this.reducePos, -3);\n }\n /// @internal\n emitLookAhead() {\n let last = this.buffer.length - 1;\n if (last < 0 || this.buffer[last] != -4)\n this.buffer.push(this.lookAhead, this.reducePos, this.reducePos, -4);\n }\n updateContext(context) {\n if (context != this.curContext.context) {\n let newCx = new StackContext(this.curContext.tracker, context);\n if (newCx.hash != this.curContext.hash)\n this.emitContext();\n this.curContext = newCx;\n }\n }\n /// @internal\n setLookAhead(lookAhead) {\n if (lookAhead > this.lookAhead) {\n this.emitLookAhead();\n this.lookAhead = lookAhead;\n }\n }\n /// @internal\n close() {\n if (this.curContext && this.curContext.tracker.strict)\n this.emitContext();\n if (this.lookAhead > 0)\n this.emitLookAhead();\n }\n}\nclass StackContext {\n constructor(tracker, context) {\n this.tracker = tracker;\n this.context = context;\n this.hash = tracker.strict ? tracker.hash(context) : 0;\n }\n}\nvar Recover;\n(function (Recover) {\n Recover[Recover[\"Insert\"] = 200] = \"Insert\";\n Recover[Recover[\"Delete\"] = 190] = \"Delete\";\n Recover[Recover[\"Reduce\"] = 100] = \"Reduce\";\n Recover[Recover[\"MaxNext\"] = 4] = \"MaxNext\";\n Recover[Recover[\"MaxInsertStackDepth\"] = 300] = \"MaxInsertStackDepth\";\n Recover[Recover[\"DampenInsertStackDepth\"] = 120] = \"DampenInsertStackDepth\";\n Recover[Recover[\"MinBigReduction\"] = 2000] = \"MinBigReduction\";\n})(Recover || (Recover = {}));\n// Used to cheaply run some reductions to scan ahead without mutating\n// an entire stack\nclass SimulatedStack {\n constructor(start) {\n this.start = start;\n this.state = start.state;\n this.stack = start.stack;\n this.base = this.stack.length;\n }\n reduce(action) {\n let term = action & 65535 /* Action.ValueMask */, depth = action >> 19 /* Action.ReduceDepthShift */;\n if (depth == 0) {\n if (this.stack == this.start.stack)\n this.stack = this.stack.slice();\n this.stack.push(this.state, 0, 0);\n this.base += 3;\n }\n else {\n this.base -= (depth - 1) * 3;\n }\n let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);\n this.state = goto;\n }\n}\n// This is given to `Tree.build` to build a buffer, and encapsulates\n// the parent-stack-walking necessary to read the nodes.\nclass StackBufferCursor {\n constructor(stack, pos, index) {\n this.stack = stack;\n this.pos = pos;\n this.index = index;\n this.buffer = stack.buffer;\n if (this.index == 0)\n this.maybeNext();\n }\n static create(stack, pos = stack.bufferBase + stack.buffer.length) {\n return new StackBufferCursor(stack, pos, pos - stack.bufferBase);\n }\n maybeNext() {\n let next = this.stack.parent;\n if (next != null) {\n this.index = this.stack.bufferBase - next.bufferBase;\n this.stack = next;\n this.buffer = next.buffer;\n }\n }\n get id() { return this.buffer[this.index - 4]; }\n get start() { return this.buffer[this.index - 3]; }\n get end() { return this.buffer[this.index - 2]; }\n get size() { return this.buffer[this.index - 1]; }\n next() {\n this.index -= 4;\n this.pos -= 4;\n if (this.index == 0)\n this.maybeNext();\n }\n fork() {\n return new StackBufferCursor(this.stack, this.pos, this.index);\n }\n}\n\n// See lezer-generator/src/encode.ts for comments about the encoding\n// used here\nfunction decodeArray(input, Type = Uint16Array) {\n if (typeof input != \"string\")\n return input;\n let array = null;\n for (let pos = 0, out = 0; pos < input.length;) {\n let value = 0;\n for (;;) {\n let next = input.charCodeAt(pos++), stop = false;\n if (next == 126 /* Encode.BigValCode */) {\n value = 65535 /* Encode.BigVal */;\n break;\n }\n if (next >= 92 /* Encode.Gap2 */)\n next--;\n if (next >= 34 /* Encode.Gap1 */)\n next--;\n let digit = next - 32 /* Encode.Start */;\n if (digit >= 46 /* Encode.Base */) {\n digit -= 46 /* Encode.Base */;\n stop = true;\n }\n value += digit;\n if (stop)\n break;\n value *= 46 /* Encode.Base */;\n }\n if (array)\n array[out++] = value;\n else\n array = new Type(value);\n }\n return array;\n}\n\nclass CachedToken {\n constructor() {\n this.start = -1;\n this.value = -1;\n this.end = -1;\n this.extended = -1;\n this.lookAhead = 0;\n this.mask = 0;\n this.context = 0;\n }\n}\nconst nullToken = new CachedToken;\n/// [Tokenizers](#lr.ExternalTokenizer) interact with the input\n/// through this interface. It presents the input as a stream of\n/// characters, tracking lookahead and hiding the complexity of\n/// [ranges](#common.Parser.parse^ranges) from tokenizer code.\nclass InputStream {\n /// @internal\n constructor(\n /// @internal\n input, \n /// @internal\n ranges) {\n this.input = input;\n this.ranges = ranges;\n /// @internal\n this.chunk = \"\";\n /// @internal\n this.chunkOff = 0;\n /// Backup chunk\n this.chunk2 = \"\";\n this.chunk2Pos = 0;\n /// The character code of the next code unit in the input, or -1\n /// when the stream is at the end of the input.\n this.next = -1;\n /// @internal\n this.token = nullToken;\n this.rangeIndex = 0;\n this.pos = this.chunkPos = ranges[0].from;\n this.range = ranges[0];\n this.end = ranges[ranges.length - 1].to;\n this.readNext();\n }\n /// @internal\n resolveOffset(offset, assoc) {\n let range = this.range, index = this.rangeIndex;\n let pos = this.pos + offset;\n while (pos < range.from) {\n if (!index)\n return null;\n let next = this.ranges[--index];\n pos -= range.from - next.to;\n range = next;\n }\n while (assoc < 0 ? pos > range.to : pos >= range.to) {\n if (index == this.ranges.length - 1)\n return null;\n let next = this.ranges[++index];\n pos += next.from - range.to;\n range = next;\n }\n return pos;\n }\n /// @internal\n clipPos(pos) {\n if (pos >= this.range.from && pos < this.range.to)\n return pos;\n for (let range of this.ranges)\n if (range.to > pos)\n return Math.max(pos, range.from);\n return this.end;\n }\n /// Look at a code unit near the stream position. `.peek(0)` equals\n /// `.next`, `.peek(-1)` gives you the previous character, and so\n /// on.\n ///\n /// Note that looking around during tokenizing creates dependencies\n /// on potentially far-away content, which may reduce the\n /// effectiveness incremental parsing—when looking forward—or even\n /// cause invalid reparses when looking backward more than 25 code\n /// units, since the library does not track lookbehind.\n peek(offset) {\n let idx = this.chunkOff + offset, pos, result;\n if (idx >= 0 && idx < this.chunk.length) {\n pos = this.pos + offset;\n result = this.chunk.charCodeAt(idx);\n }\n else {\n let resolved = this.resolveOffset(offset, 1);\n if (resolved == null)\n return -1;\n pos = resolved;\n if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {\n result = this.chunk2.charCodeAt(pos - this.chunk2Pos);\n }\n else {\n let i = this.rangeIndex, range = this.range;\n while (range.to <= pos)\n range = this.ranges[++i];\n this.chunk2 = this.input.chunk(this.chunk2Pos = pos);\n if (pos + this.chunk2.length > range.to)\n this.chunk2 = this.chunk2.slice(0, range.to - pos);\n result = this.chunk2.charCodeAt(0);\n }\n }\n if (pos >= this.token.lookAhead)\n this.token.lookAhead = pos + 1;\n return result;\n }\n /// Accept a token. By default, the end of the token is set to the\n /// current stream position, but you can pass an offset (relative to\n /// the stream position) to change that.\n acceptToken(token, endOffset = 0) {\n let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;\n if (end == null || end < this.token.start)\n throw new RangeError(\"Token end out of bounds\");\n this.token.value = token;\n this.token.end = end;\n }\n getChunk() {\n if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {\n let { chunk, chunkPos } = this;\n this.chunk = this.chunk2;\n this.chunkPos = this.chunk2Pos;\n this.chunk2 = chunk;\n this.chunk2Pos = chunkPos;\n this.chunkOff = this.pos - this.chunkPos;\n }\n else {\n this.chunk2 = this.chunk;\n this.chunk2Pos = this.chunkPos;\n let nextChunk = this.input.chunk(this.pos);\n let end = this.pos + nextChunk.length;\n this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;\n this.chunkPos = this.pos;\n this.chunkOff = 0;\n }\n }\n readNext() {\n if (this.chunkOff >= this.chunk.length) {\n this.getChunk();\n if (this.chunkOff == this.chunk.length)\n return this.next = -1;\n }\n return this.next = this.chunk.charCodeAt(this.chunkOff);\n }\n /// Move the stream forward N (defaults to 1) code units. Returns\n /// the new value of [`next`](#lr.InputStream.next).\n advance(n = 1) {\n this.chunkOff += n;\n while (this.pos + n >= this.range.to) {\n if (this.rangeIndex == this.ranges.length - 1)\n return this.setDone();\n n -= this.range.to - this.pos;\n this.range = this.ranges[++this.rangeIndex];\n this.pos = this.range.from;\n }\n this.pos += n;\n if (this.pos >= this.token.lookAhead)\n this.token.lookAhead = this.pos + 1;\n return this.readNext();\n }\n setDone() {\n this.pos = this.chunkPos = this.end;\n this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];\n this.chunk = \"\";\n return this.next = -1;\n }\n /// @internal\n reset(pos, token) {\n if (token) {\n this.token = token;\n token.start = pos;\n token.lookAhead = pos + 1;\n token.value = token.extended = -1;\n }\n else {\n this.token = nullToken;\n }\n if (this.pos != pos) {\n this.pos = pos;\n if (pos == this.end) {\n this.setDone();\n return this;\n }\n while (pos < this.range.from)\n this.range = this.ranges[--this.rangeIndex];\n while (pos >= this.range.to)\n this.range = this.ranges[++this.rangeIndex];\n if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {\n this.chunkOff = pos - this.chunkPos;\n }\n else {\n this.chunk = \"\";\n this.chunkOff = 0;\n }\n this.readNext();\n }\n return this;\n }\n /// @internal\n read(from, to) {\n if (from >= this.chunkPos && to <= this.chunkPos + this.chunk.length)\n return this.chunk.slice(from - this.chunkPos, to - this.chunkPos);\n if (from >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)\n return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);\n if (from >= this.range.from && to <= this.range.to)\n return this.input.read(from, to);\n let result = \"\";\n for (let r of this.ranges) {\n if (r.from >= to)\n break;\n if (r.to > from)\n result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));\n }\n return result;\n }\n}\n/// @internal\nclass TokenGroup {\n constructor(data, id) {\n this.data = data;\n this.id = id;\n }\n token(input, stack) {\n let { parser } = stack.p;\n readToken(this.data, input, stack, this.id, parser.data, parser.tokenPrecTable);\n }\n}\nTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;\n/// @hide\nclass LocalTokenGroup {\n constructor(data, precTable, elseToken) {\n this.precTable = precTable;\n this.elseToken = elseToken;\n this.data = typeof data == \"string\" ? decodeArray(data) : data;\n }\n token(input, stack) {\n let start = input.pos, cur;\n for (;;) {\n cur = input.pos;\n readToken(this.data, input, stack, 0, this.data, this.precTable);\n if (input.token.value > -1)\n break;\n if (this.elseToken == null)\n return;\n if (input.next < 0)\n break;\n input.advance();\n input.reset(cur + 1, input.token);\n }\n if (cur > start) {\n input.reset(start, input.token);\n input.acceptToken(this.elseToken, cur - start);\n }\n }\n}\nLocalTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;\n/// `@external tokens` declarations in the grammar should resolve to\n/// an instance of this class.\nclass ExternalTokenizer {\n /// Create a tokenizer. The first argument is the function that,\n /// given an input stream, scans for the types of tokens it\n /// recognizes at the stream's position, and calls\n /// [`acceptToken`](#lr.InputStream.acceptToken) when it finds\n /// one.\n constructor(\n /// @internal\n token, options = {}) {\n this.token = token;\n this.contextual = !!options.contextual;\n this.fallback = !!options.fallback;\n this.extend = !!options.extend;\n }\n}\n// Tokenizer data is stored a big uint16 array containing, for each\n// state:\n//\n// - A group bitmask, indicating what token groups are reachable from\n// this state, so that paths that can only lead to tokens not in\n// any of the current groups can be cut off early.\n//\n// - The position of the end of the state's sequence of accepting\n// tokens\n//\n// - The number of outgoing edges for the state\n//\n// - The accepting tokens, as (token id, group mask) pairs\n//\n// - The outgoing edges, as (start character, end character, state\n// index) triples, with end character being exclusive\n//\n// This function interprets that data, running through a stream as\n// long as new states with the a matching group mask can be reached,\n// and updating `input.token` when it matches a token.\nfunction readToken(data, input, stack, group, precTable, precOffset) {\n let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;\n scan: for (;;) {\n if ((groupMask & data[state]) == 0)\n break;\n let accEnd = data[state + 1];\n // Check whether this state can lead to a token in the current group\n // Accept tokens in this state, possibly overwriting\n // lower-precedence / shorter tokens\n for (let i = state + 3; i < accEnd; i += 2)\n if ((data[i + 1] & groupMask) > 0) {\n let term = data[i];\n if (dialect.allows(term) &&\n (input.token.value == -1 || input.token.value == term ||\n overrides(term, input.token.value, precTable, precOffset))) {\n input.acceptToken(term);\n break;\n }\n }\n let next = input.next, low = 0, high = data[state + 2];\n // Special case for EOF\n if (input.next < 0 && high > low && data[accEnd + high * 3 - 3] == 65535 /* Seq.End */ && data[accEnd + high * 3 - 3] == 65535 /* Seq.End */) {\n state = data[accEnd + high * 3 - 1];\n continue scan;\n }\n // Do a binary search on the state's edges\n for (; low < high;) {\n let mid = (low + high) >> 1;\n let index = accEnd + mid + (mid << 1);\n let from = data[index], to = data[index + 1] || 0x10000;\n if (next < from)\n high = mid;\n else if (next >= to)\n low = mid + 1;\n else {\n state = data[index + 2];\n input.advance();\n continue scan;\n }\n }\n break;\n }\n}\nfunction findOffset(data, start, term) {\n for (let i = start, next; (next = data[i]) != 65535 /* Seq.End */; i++)\n if (next == term)\n return i - start;\n return -1;\n}\nfunction overrides(token, prev, tableData, tableOffset) {\n let iPrev = findOffset(tableData, tableOffset, prev);\n return iPrev < 0 || findOffset(tableData, tableOffset, token) < iPrev;\n}\n\n// Environment variable used to control console output\nconst verbose = typeof process != \"undefined\" && process.env && /\\bparse\\b/.test(process.env.LOG);\nlet stackIDs = null;\nvar Safety;\n(function (Safety) {\n Safety[Safety[\"Margin\"] = 25] = \"Margin\";\n})(Safety || (Safety = {}));\nfunction cutAt(tree, pos, side) {\n let cursor = tree.cursor(IterMode.IncludeAnonymous);\n cursor.moveTo(pos);\n for (;;) {\n if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))\n for (;;) {\n if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)\n return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Safety.Margin */))\n : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Safety.Margin */));\n if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())\n break;\n if (!cursor.parent())\n return side < 0 ? 0 : tree.length;\n }\n }\n}\nclass FragmentCursor {\n constructor(fragments, nodeSet) {\n this.fragments = fragments;\n this.nodeSet = nodeSet;\n this.i = 0;\n this.fragment = null;\n this.safeFrom = -1;\n this.safeTo = -1;\n this.trees = [];\n this.start = [];\n this.index = [];\n this.nextFragment();\n }\n nextFragment() {\n let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];\n if (fr) {\n this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;\n this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;\n while (this.trees.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n }\n this.trees.push(fr.tree);\n this.start.push(-fr.offset);\n this.index.push(0);\n this.nextStart = this.safeFrom;\n }\n else {\n this.nextStart = 1e9;\n }\n }\n // `pos` must be >= any previously given `pos` for this cursor\n nodeAt(pos) {\n if (pos < this.nextStart)\n return null;\n while (this.fragment && this.safeTo <= pos)\n this.nextFragment();\n if (!this.fragment)\n return null;\n for (;;) {\n let last = this.trees.length - 1;\n if (last < 0) { // End of tree\n this.nextFragment();\n return null;\n }\n let top = this.trees[last], index = this.index[last];\n if (index == top.children.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n continue;\n }\n let next = top.children[index];\n let start = this.start[last] + top.positions[index];\n if (start > pos) {\n this.nextStart = start;\n return null;\n }\n if (next instanceof Tree) {\n if (start == pos) {\n if (start < this.safeFrom)\n return null;\n let end = start + next.length;\n if (end <= this.safeTo) {\n let lookAhead = next.prop(NodeProp.lookAhead);\n if (!lookAhead || end + lookAhead < this.fragment.to)\n return next;\n }\n }\n this.index[last]++;\n if (start + next.length >= Math.max(this.safeFrom, pos)) { // Enter this node\n this.trees.push(next);\n this.start.push(start);\n this.index.push(0);\n }\n }\n else {\n this.index[last]++;\n this.nextStart = start + next.length;\n }\n }\n }\n}\nclass TokenCache {\n constructor(parser, stream) {\n this.stream = stream;\n this.tokens = [];\n this.mainToken = null;\n this.actions = [];\n this.tokens = parser.tokenizers.map(_ => new CachedToken);\n }\n getActions(stack) {\n let actionIndex = 0;\n let main = null;\n let { parser } = stack.p, { tokenizers } = parser;\n let mask = parser.stateSlot(stack.state, 3 /* ParseState.TokenizerMask */);\n let context = stack.curContext ? stack.curContext.hash : 0;\n let lookAhead = 0;\n for (let i = 0; i < tokenizers.length; i++) {\n if (((1 << i) & mask) == 0)\n continue;\n let tokenizer = tokenizers[i], token = this.tokens[i];\n if (main && !tokenizer.fallback)\n continue;\n if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {\n this.updateCachedToken(token, tokenizer, stack);\n token.mask = mask;\n token.context = context;\n }\n if (token.lookAhead > token.end + 25 /* Safety.Margin */)\n lookAhead = Math.max(token.lookAhead, lookAhead);\n if (token.value != 0 /* Term.Err */) {\n let startIndex = actionIndex;\n if (token.extended > -1)\n actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);\n actionIndex = this.addActions(stack, token.value, token.end, actionIndex);\n if (!tokenizer.extend) {\n main = token;\n if (actionIndex > startIndex)\n break;\n }\n }\n }\n while (this.actions.length > actionIndex)\n this.actions.pop();\n if (lookAhead)\n stack.setLookAhead(lookAhead);\n if (!main && stack.pos == this.stream.end) {\n main = new CachedToken;\n main.value = stack.p.parser.eofTerm;\n main.start = main.end = stack.pos;\n actionIndex = this.addActions(stack, main.value, main.end, actionIndex);\n }\n this.mainToken = main;\n return this.actions;\n }\n getMainToken(stack) {\n if (this.mainToken)\n return this.mainToken;\n let main = new CachedToken, { pos, p } = stack;\n main.start = pos;\n main.end = Math.min(pos + 1, p.stream.end);\n main.value = pos == p.stream.end ? p.parser.eofTerm : 0 /* Term.Err */;\n return main;\n }\n updateCachedToken(token, tokenizer, stack) {\n let start = this.stream.clipPos(stack.pos);\n tokenizer.token(this.stream.reset(start, token), stack);\n if (token.value > -1) {\n let { parser } = stack.p;\n for (let i = 0; i < parser.specialized.length; i++)\n if (parser.specialized[i] == token.value) {\n let result = parser.specializers[i](this.stream.read(token.start, token.end), stack);\n if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {\n if ((result & 1) == 0 /* Specialize.Specialize */)\n token.value = result >> 1;\n else\n token.extended = result >> 1;\n break;\n }\n }\n }\n else {\n token.value = 0 /* Term.Err */;\n token.end = this.stream.clipPos(start + 1);\n }\n }\n putAction(action, token, end, index) {\n // Don't add duplicate actions\n for (let i = 0; i < index; i += 3)\n if (this.actions[i] == action)\n return index;\n this.actions[index++] = action;\n this.actions[index++] = token;\n this.actions[index++] = end;\n return index;\n }\n addActions(stack, token, end, index) {\n let { state } = stack, { parser } = stack.p, { data } = parser;\n for (let set = 0; set < 2; set++) {\n for (let i = parser.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */);; i += 3) {\n if (data[i] == 65535 /* Seq.End */) {\n if (data[i + 1] == 1 /* Seq.Next */) {\n i = pair(data, i + 2);\n }\n else {\n if (index == 0 && data[i + 1] == 2 /* Seq.Other */)\n index = this.putAction(pair(data, i + 2), token, end, index);\n break;\n }\n }\n if (data[i] == token)\n index = this.putAction(pair(data, i + 1), token, end, index);\n }\n }\n return index;\n }\n}\nvar Rec;\n(function (Rec) {\n Rec[Rec[\"Distance\"] = 5] = \"Distance\";\n Rec[Rec[\"MaxRemainingPerStep\"] = 3] = \"MaxRemainingPerStep\";\n // When two stacks have been running independently long enough to\n // add this many elements to their buffers, prune one.\n Rec[Rec[\"MinBufferLengthPrune\"] = 500] = \"MinBufferLengthPrune\";\n Rec[Rec[\"ForceReduceLimit\"] = 10] = \"ForceReduceLimit\";\n // Once a stack reaches this depth (in .stack.length) force-reduce\n // it back to CutTo to avoid creating trees that overflow the stack\n // on recursive traversal.\n Rec[Rec[\"CutDepth\"] = 15000] = \"CutDepth\";\n Rec[Rec[\"CutTo\"] = 9000] = \"CutTo\";\n Rec[Rec[\"MaxLeftAssociativeReductionCount\"] = 300] = \"MaxLeftAssociativeReductionCount\";\n // The maximum number of non-recovering stacks to explore (to avoid\n // getting bogged down with exponentially multiplying stacks in\n // ambiguous content)\n Rec[Rec[\"MaxStackCount\"] = 12] = \"MaxStackCount\";\n})(Rec || (Rec = {}));\nclass Parse {\n constructor(parser, input, fragments, ranges) {\n this.parser = parser;\n this.input = input;\n this.ranges = ranges;\n this.recovering = 0;\n this.nextStackID = 0x2654; // ♔, ♕, ♖, ♗, ♘, ♙, ♠, ♡, ♢, ♣, ♤, ♥, ♦, ♧\n this.minStackPos = 0;\n this.reused = [];\n this.stoppedAt = null;\n this.lastBigReductionStart = -1;\n this.lastBigReductionSize = 0;\n this.bigReductionCount = 0;\n this.stream = new InputStream(input, ranges);\n this.tokens = new TokenCache(parser, this.stream);\n this.topTerm = parser.top[1];\n let { from } = ranges[0];\n this.stacks = [Stack.start(this, parser.top[0], from)];\n this.fragments = fragments.length && this.stream.end - from > parser.bufferLength * 4\n ? new FragmentCursor(fragments, parser.nodeSet) : null;\n }\n get parsedPos() {\n return this.minStackPos;\n }\n // Move the parser forward. This will process all parse stacks at\n // `this.pos` and try to advance them to a further position. If no\n // stack for such a position is found, it'll start error-recovery.\n //\n // When the parse is finished, this will return a syntax tree. When\n // not, it returns `null`.\n advance() {\n let stacks = this.stacks, pos = this.minStackPos;\n // This will hold stacks beyond `pos`.\n let newStacks = this.stacks = [];\n let stopped, stoppedTokens;\n // If a large amount of reductions happened with the same start\n // position, force the stack out of that production in order to\n // avoid creating a tree too deep to recurse through.\n // (This is an ugly kludge, because unfortunately there is no\n // straightforward, cheap way to check for this happening, due to\n // the history of reductions only being available in an\n // expensive-to-access format in the stack buffers.)\n if (this.bigReductionCount > 300 /* Rec.MaxLeftAssociativeReductionCount */ && stacks.length == 1) {\n let [s] = stacks;\n while (s.forceReduce() && s.stack.length && s.stack[s.stack.length - 2] >= this.lastBigReductionStart) { }\n this.bigReductionCount = this.lastBigReductionSize = 0;\n }\n // Keep advancing any stacks at `pos` until they either move\n // forward or can't be advanced. Gather stacks that can't be\n // advanced further in `stopped`.\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i];\n for (;;) {\n this.tokens.mainToken = null;\n if (stack.pos > pos) {\n newStacks.push(stack);\n }\n else if (this.advanceStack(stack, newStacks, stacks)) {\n continue;\n }\n else {\n if (!stopped) {\n stopped = [];\n stoppedTokens = [];\n }\n stopped.push(stack);\n let tok = this.tokens.getMainToken(stack);\n stoppedTokens.push(tok.value, tok.end);\n }\n break;\n }\n }\n if (!newStacks.length) {\n let finished = stopped && findFinished(stopped);\n if (finished)\n return this.stackToTree(finished);\n if (this.parser.strict) {\n if (verbose && stopped)\n console.log(\"Stuck with token \" + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : \"none\"));\n throw new SyntaxError(\"No parse at \" + pos);\n }\n if (!this.recovering)\n this.recovering = 5 /* Rec.Distance */;\n }\n if (this.recovering && stopped) {\n let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0]\n : this.runRecovery(stopped, stoppedTokens, newStacks);\n if (finished)\n return this.stackToTree(finished.forceAll());\n }\n if (this.recovering) {\n let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3 /* Rec.MaxRemainingPerStep */;\n if (newStacks.length > maxRemaining) {\n newStacks.sort((a, b) => b.score - a.score);\n while (newStacks.length > maxRemaining)\n newStacks.pop();\n }\n if (newStacks.some(s => s.reducePos > pos))\n this.recovering--;\n }\n else if (newStacks.length > 1) {\n // Prune stacks that are in the same state, or that have been\n // running without splitting for a while, to avoid getting stuck\n // with multiple successful stacks running endlessly on.\n outer: for (let i = 0; i < newStacks.length - 1; i++) {\n let stack = newStacks[i];\n for (let j = i + 1; j < newStacks.length; j++) {\n let other = newStacks[j];\n if (stack.sameState(other) ||\n stack.buffer.length > 500 /* Rec.MinBufferLengthPrune */ && other.buffer.length > 500 /* Rec.MinBufferLengthPrune */) {\n if (((stack.score - other.score) || (stack.buffer.length - other.buffer.length)) > 0) {\n newStacks.splice(j--, 1);\n }\n else {\n newStacks.splice(i--, 1);\n continue outer;\n }\n }\n }\n }\n if (newStacks.length > 12 /* Rec.MaxStackCount */)\n newStacks.splice(12 /* Rec.MaxStackCount */, newStacks.length - 12 /* Rec.MaxStackCount */);\n }\n this.minStackPos = newStacks[0].pos;\n for (let i = 1; i < newStacks.length; i++)\n if (newStacks[i].pos < this.minStackPos)\n this.minStackPos = newStacks[i].pos;\n return null;\n }\n stopAt(pos) {\n if (this.stoppedAt != null && this.stoppedAt < pos)\n throw new RangeError(\"Can't move stoppedAt forward\");\n this.stoppedAt = pos;\n }\n // Returns an updated version of the given stack, or null if the\n // stack can't advance normally. When `split` and `stacks` are\n // given, stacks split off by ambiguous operations will be pushed to\n // `split`, or added to `stacks` if they move `pos` forward.\n advanceStack(stack, stacks, split) {\n let start = stack.pos, { parser } = this;\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (this.stoppedAt != null && start > this.stoppedAt)\n return stack.forceReduce() ? stack : null;\n if (this.fragments) {\n let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;\n for (let cached = this.fragments.nodeAt(start); cached;) {\n let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser.getGoto(stack.state, cached.type.id) : -1;\n if (match > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {\n stack.useNode(cached, match);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via reuse of ${parser.getName(cached.type.id)})`);\n return true;\n }\n if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)\n break;\n let inner = cached.children[0];\n if (inner instanceof Tree && cached.positions[0] == 0)\n cached = inner;\n else\n break;\n }\n }\n let defaultReduce = parser.stateSlot(stack.state, 4 /* ParseState.DefaultReduce */);\n if (defaultReduce > 0) {\n stack.reduce(defaultReduce);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via always-reduce ${parser.getName(defaultReduce & 65535 /* Action.ValueMask */)})`);\n return true;\n }\n if (stack.stack.length >= 15000 /* Rec.CutDepth */) {\n while (stack.stack.length > 9000 /* Rec.CutTo */ && stack.forceReduce()) { }\n }\n let actions = this.tokens.getActions(stack);\n for (let i = 0; i < actions.length;) {\n let action = actions[i++], term = actions[i++], end = actions[i++];\n let last = i == actions.length || !split;\n let localStack = last ? stack : stack.split();\n localStack.apply(action, term, end);\n if (verbose)\n console.log(base + this.stackID(localStack) + ` (via ${(action & 65536 /* Action.ReduceFlag */) == 0 ? \"shift\"\n : `reduce of ${parser.getName(action & 65535 /* Action.ValueMask */)}`} for ${parser.getName(term)} @ ${start}${localStack == stack ? \"\" : \", split\"})`);\n if (last)\n return true;\n else if (localStack.pos > start)\n stacks.push(localStack);\n else\n split.push(localStack);\n }\n return false;\n }\n // Advance a given stack forward as far as it will go. Returns the\n // (possibly updated) stack if it got stuck, or null if it moved\n // forward and was given to `pushStackDedup`.\n advanceFully(stack, newStacks) {\n let pos = stack.pos;\n for (;;) {\n if (!this.advanceStack(stack, null, null))\n return false;\n if (stack.pos > pos) {\n pushStackDedup(stack, newStacks);\n return true;\n }\n }\n }\n runRecovery(stacks, tokens, newStacks) {\n let finished = null, restarted = false;\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1];\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (stack.deadEnd) {\n if (restarted)\n continue;\n restarted = true;\n stack.restart();\n if (verbose)\n console.log(base + this.stackID(stack) + \" (restarted)\");\n let done = this.advanceFully(stack, newStacks);\n if (done)\n continue;\n }\n let force = stack.split(), forceBase = base;\n for (let j = 0; force.forceReduce() && j < 10 /* Rec.ForceReduceLimit */; j++) {\n if (verbose)\n console.log(forceBase + this.stackID(force) + \" (via force-reduce)\");\n let done = this.advanceFully(force, newStacks);\n if (done)\n break;\n if (verbose)\n forceBase = this.stackID(force) + \" -> \";\n }\n for (let insert of stack.recoverByInsert(token)) {\n if (verbose)\n console.log(base + this.stackID(insert) + \" (via recover-insert)\");\n this.advanceFully(insert, newStacks);\n }\n if (this.stream.end > stack.pos) {\n if (tokenEnd == stack.pos) {\n tokenEnd++;\n token = 0 /* Term.Err */;\n }\n stack.recoverByDelete(token, tokenEnd);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);\n pushStackDedup(stack, newStacks);\n }\n else if (!finished || finished.score < stack.score) {\n finished = stack;\n }\n }\n return finished;\n }\n // Convert the stack's buffer to a syntax tree.\n stackToTree(stack) {\n stack.close();\n return Tree.build({ buffer: StackBufferCursor.create(stack),\n nodeSet: this.parser.nodeSet,\n topID: this.topTerm,\n maxBufferLength: this.parser.bufferLength,\n reused: this.reused,\n start: this.ranges[0].from,\n length: stack.pos - this.ranges[0].from,\n minRepeatType: this.parser.minRepeatTerm });\n }\n stackID(stack) {\n let id = (stackIDs || (stackIDs = new WeakMap)).get(stack);\n if (!id)\n stackIDs.set(stack, id = String.fromCodePoint(this.nextStackID++));\n return id + stack;\n }\n}\nfunction pushStackDedup(stack, newStacks) {\n for (let i = 0; i < newStacks.length; i++) {\n let other = newStacks[i];\n if (other.pos == stack.pos && other.sameState(stack)) {\n if (newStacks[i].score < stack.score)\n newStacks[i] = stack;\n return;\n }\n }\n newStacks.push(stack);\n}\nclass Dialect {\n constructor(source, flags, disabled) {\n this.source = source;\n this.flags = flags;\n this.disabled = disabled;\n }\n allows(term) { return !this.disabled || this.disabled[term] == 0; }\n}\nconst id = x => x;\n/// Context trackers are used to track stateful context (such as\n/// indentation in the Python grammar, or parent elements in the XML\n/// grammar) needed by external tokenizers. You declare them in a\n/// grammar file as `@context exportName from \"module\"`.\n///\n/// Context values should be immutable, and can be updated (replaced)\n/// on shift or reduce actions.\n///\n/// The export used in a `@context` declaration should be of this\n/// type.\nclass ContextTracker {\n /// Define a context tracker.\n constructor(spec) {\n this.start = spec.start;\n this.shift = spec.shift || id;\n this.reduce = spec.reduce || id;\n this.reuse = spec.reuse || id;\n this.hash = spec.hash || (() => 0);\n this.strict = spec.strict !== false;\n }\n}\n/// Holds the parse tables for a given grammar, as generated by\n/// `lezer-generator`, and provides [methods](#common.Parser) to parse\n/// content with.\nclass LRParser extends Parser {\n /// @internal\n constructor(spec) {\n super();\n /// @internal\n this.wrappers = [];\n if (spec.version != 14 /* File.Version */)\n throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14 /* File.Version */})`);\n let nodeNames = spec.nodeNames.split(\" \");\n this.minRepeatTerm = nodeNames.length;\n for (let i = 0; i < spec.repeatNodeCount; i++)\n nodeNames.push(\"\");\n let topTerms = Object.keys(spec.topRules).map(r => spec.topRules[r][1]);\n let nodeProps = [];\n for (let i = 0; i < nodeNames.length; i++)\n nodeProps.push([]);\n function setProp(nodeID, prop, value) {\n nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);\n }\n if (spec.nodeProps)\n for (let propSpec of spec.nodeProps) {\n let prop = propSpec[0];\n if (typeof prop == \"string\")\n prop = NodeProp[prop];\n for (let i = 1; i < propSpec.length;) {\n let next = propSpec[i++];\n if (next >= 0) {\n setProp(next, prop, propSpec[i++]);\n }\n else {\n let value = propSpec[i + -next];\n for (let j = -next; j > 0; j--)\n setProp(propSpec[i++], prop, value);\n i++;\n }\n }\n }\n this.nodeSet = new NodeSet(nodeNames.map((name, i) => NodeType.define({\n name: i >= this.minRepeatTerm ? undefined : name,\n id: i,\n props: nodeProps[i],\n top: topTerms.indexOf(i) > -1,\n error: i == 0,\n skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1\n })));\n if (spec.propSources)\n this.nodeSet = this.nodeSet.extend(...spec.propSources);\n this.strict = false;\n this.bufferLength = DefaultBufferLength;\n let tokenArray = decodeArray(spec.tokenData);\n this.context = spec.context;\n this.specializerSpecs = spec.specialized || [];\n this.specialized = new Uint16Array(this.specializerSpecs.length);\n for (let i = 0; i < this.specializerSpecs.length; i++)\n this.specialized[i] = this.specializerSpecs[i].term;\n this.specializers = this.specializerSpecs.map(getSpecializer);\n this.states = decodeArray(spec.states, Uint32Array);\n this.data = decodeArray(spec.stateData);\n this.goto = decodeArray(spec.goto);\n this.maxTerm = spec.maxTerm;\n this.tokenizers = spec.tokenizers.map(value => typeof value == \"number\" ? new TokenGroup(tokenArray, value) : value);\n this.topRules = spec.topRules;\n this.dialects = spec.dialects || {};\n this.dynamicPrecedences = spec.dynamicPrecedences || null;\n this.tokenPrecTable = spec.tokenPrec;\n this.termNames = spec.termNames || null;\n this.maxNode = this.nodeSet.types.length - 1;\n this.dialect = this.parseDialect();\n this.top = this.topRules[Object.keys(this.topRules)[0]];\n }\n createParse(input, fragments, ranges) {\n let parse = new Parse(this, input, fragments, ranges);\n for (let w of this.wrappers)\n parse = w(parse, input, fragments, ranges);\n return parse;\n }\n /// Get a goto table entry @internal\n getGoto(state, term, loose = false) {\n let table = this.goto;\n if (term >= table[0])\n return -1;\n for (let pos = table[term + 1];;) {\n let groupTag = table[pos++], last = groupTag & 1;\n let target = table[pos++];\n if (last && loose)\n return target;\n for (let end = pos + (groupTag >> 1); pos < end; pos++)\n if (table[pos] == state)\n return target;\n if (last)\n return -1;\n }\n }\n /// Check if this state has an action for a given terminal @internal\n hasAction(state, terminal) {\n let data = this.data;\n for (let set = 0; set < 2; set++) {\n for (let i = this.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */), next;; i += 3) {\n if ((next = data[i]) == 65535 /* Seq.End */) {\n if (data[i + 1] == 1 /* Seq.Next */)\n next = data[i = pair(data, i + 2)];\n else if (data[i + 1] == 2 /* Seq.Other */)\n return pair(data, i + 2);\n else\n break;\n }\n if (next == terminal || next == 0 /* Term.Err */)\n return pair(data, i + 1);\n }\n }\n return 0;\n }\n /// @internal\n stateSlot(state, slot) {\n return this.states[(state * 6 /* ParseState.Size */) + slot];\n }\n /// @internal\n stateFlag(state, flag) {\n return (this.stateSlot(state, 0 /* ParseState.Flags */) & flag) > 0;\n }\n /// @internal\n validAction(state, action) {\n if (action == this.stateSlot(state, 4 /* ParseState.DefaultReduce */))\n return true;\n for (let i = this.stateSlot(state, 1 /* ParseState.Actions */);; i += 3) {\n if (this.data[i] == 65535 /* Seq.End */) {\n if (this.data[i + 1] == 1 /* Seq.Next */)\n i = pair(this.data, i + 2);\n else\n return false;\n }\n if (action == pair(this.data, i + 1))\n return true;\n }\n }\n /// Get the states that can follow this one through shift actions or\n /// goto jumps. @internal\n nextStates(state) {\n let result = [];\n for (let i = this.stateSlot(state, 1 /* ParseState.Actions */);; i += 3) {\n if (this.data[i] == 65535 /* Seq.End */) {\n if (this.data[i + 1] == 1 /* Seq.Next */)\n i = pair(this.data, i + 2);\n else\n break;\n }\n if ((this.data[i + 2] & (65536 /* Action.ReduceFlag */ >> 16)) == 0) {\n let value = this.data[i + 1];\n if (!result.some((v, i) => (i & 1) && v == value))\n result.push(this.data[i], value);\n }\n }\n return result;\n }\n /// Configure the parser. Returns a new parser instance that has the\n /// given settings modified. Settings not provided in `config` are\n /// kept from the original parser.\n configure(config) {\n // Hideous reflection-based kludge to make it easy to create a\n // slightly modified copy of a parser.\n let copy = Object.assign(Object.create(LRParser.prototype), this);\n if (config.props)\n copy.nodeSet = this.nodeSet.extend(...config.props);\n if (config.top) {\n let info = this.topRules[config.top];\n if (!info)\n throw new RangeError(`Invalid top rule name ${config.top}`);\n copy.top = info;\n }\n if (config.tokenizers)\n copy.tokenizers = this.tokenizers.map(t => {\n let found = config.tokenizers.find(r => r.from == t);\n return found ? found.to : t;\n });\n if (config.specializers) {\n copy.specializers = this.specializers.slice();\n copy.specializerSpecs = this.specializerSpecs.map((s, i) => {\n let found = config.specializers.find(r => r.from == s.external);\n if (!found)\n return s;\n let spec = Object.assign(Object.assign({}, s), { external: found.to });\n copy.specializers[i] = getSpecializer(spec);\n return spec;\n });\n }\n if (config.contextTracker)\n copy.context = config.contextTracker;\n if (config.dialect)\n copy.dialect = this.parseDialect(config.dialect);\n if (config.strict != null)\n copy.strict = config.strict;\n if (config.wrap)\n copy.wrappers = copy.wrappers.concat(config.wrap);\n if (config.bufferLength != null)\n copy.bufferLength = config.bufferLength;\n return copy;\n }\n /// Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)\n /// are registered for this parser.\n hasWrappers() {\n return this.wrappers.length > 0;\n }\n /// Returns the name associated with a given term. This will only\n /// work for all terms when the parser was generated with the\n /// `--names` option. By default, only the names of tagged terms are\n /// stored.\n getName(term) {\n return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);\n }\n /// The eof term id is always allocated directly after the node\n /// types. @internal\n get eofTerm() { return this.maxNode + 1; }\n /// The type of top node produced by the parser.\n get topNode() { return this.nodeSet.types[this.top[1]]; }\n /// @internal\n dynamicPrecedence(term) {\n let prec = this.dynamicPrecedences;\n return prec == null ? 0 : prec[term] || 0;\n }\n /// @internal\n parseDialect(dialect) {\n let values = Object.keys(this.dialects), flags = values.map(() => false);\n if (dialect)\n for (let part of dialect.split(\" \")) {\n let id = values.indexOf(part);\n if (id >= 0)\n flags[id] = true;\n }\n let disabled = null;\n for (let i = 0; i < values.length; i++)\n if (!flags[i]) {\n for (let j = this.dialects[values[i]], id; (id = this.data[j++]) != 65535 /* Seq.End */;)\n (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id] = 1;\n }\n return new Dialect(dialect, flags, disabled);\n }\n /// Used by the output of the parser generator. Not available to\n /// user code. @hide\n static deserialize(spec) {\n return new LRParser(spec);\n }\n}\nfunction pair(data, off) { return data[off] | (data[off + 1] << 16); }\nfunction findFinished(stacks) {\n let best = null;\n for (let stack of stacks) {\n let stopped = stack.p.stoppedAt;\n if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) &&\n stack.p.parser.stateFlag(stack.state, 2 /* StateFlag.Accepting */) &&\n (!best || best.score < stack.score))\n best = stack;\n }\n return best;\n}\nfunction getSpecializer(spec) {\n if (spec.external) {\n let mask = spec.extend ? 1 /* Specialize.Extend */ : 0 /* Specialize.Specialize */;\n return (value, stack) => (spec.external(value, stack) << 1) | mask;\n }\n return spec.get;\n}\n\nexport { ContextTracker, ExternalTokenizer, InputStream, LRParser, LocalTokenGroup, Stack };\n"],"names":["Stack","p","stack","state","reducePos","pos","score","buffer","bufferBase","curContext","lookAhead","parent","_","i","cx","StackContext","start","action","_a","depth","type","parser","dPrec","base","size","count","baseStateID","term","end","isReduce","cur","top","index","next","nextEnd","nextState","value","off","isNode","sim","SimulatedStack","nextStates","best","s","v","result","reduce","target","other","dialectID","last","context","newCx","tracker","Recover","goto","StackBufferCursor","decodeArray","input","Type","array","out","stop","digit","CachedToken","nullToken","InputStream","ranges","offset","assoc","range","idx","resolved","token","endOffset","chunk","chunkPos","nextChunk","n","from","to","r","TokenGroup","data","id","readToken","LocalTokenGroup","precTable","elseToken","ExternalTokenizer","options","group","precOffset","groupMask","dialect","scan","accEnd","overrides","low","high","mid","findOffset","prev","tableData","tableOffset","iPrev","verbose","stackIDs","Safety","cutAt","tree","side","cursor","IterMode","FragmentCursor","fragments","nodeSet","fr","Tree","NodeProp","TokenCache","stream","actionIndex","main","tokenizers","mask","tokenizer","startIndex","set","pair","Rec","Parse","stacks","newStacks","stopped","stoppedTokens","tok","finished","findFinished","maxRemaining","a","b","outer","j","split","strictCx","cxHash","cached","match","inner","defaultReduce","actions","localStack","pushStackDedup","tokens","restarted","tokenEnd","force","forceBase","insert","Dialect","source","flags","disabled","x","ContextTracker","spec","LRParser","Parser","nodeNames","topTerms","nodeProps","setProp","nodeID","prop","propSpec","NodeSet","name","NodeType","DefaultBufferLength","tokenArray","getSpecializer","parse","w","loose","table","groupTag","terminal","slot","flag","config","copy","info","t","found","prec","values","part"],"mappings":"kFAMA,MAAMA,CAAM,CAER,YAEAC,EAGAC,EAEAC,EAMAC,EAEAC,EAIAC,EAKAC,EAOAC,EAEAC,EAEAC,EAAY,EAMZC,EAAQ,CACJ,KAAK,EAAIV,EACT,KAAK,MAAQC,EACb,KAAK,MAAQC,EACb,KAAK,UAAYC,EACjB,KAAK,IAAMC,EACX,KAAK,MAAQC,EACb,KAAK,OAASC,EACd,KAAK,WAAaC,EAClB,KAAK,WAAaC,EAClB,KAAK,UAAYC,EACjB,KAAK,OAASC,CACjB,CAED,UAAW,CACP,MAAO,IAAI,KAAK,MAAM,OAAO,CAACC,EAAGC,IAAMA,EAAI,GAAK,CAAC,EAAE,OAAO,KAAK,KAAK,MAAM,KAAK,MAAM,KAAK,MAAQ,IAAM,KAAK,MAAQ,IACxH,CAGD,OAAO,MAAMZ,EAAGE,EAAOE,EAAM,EAAG,CAC5B,IAAIS,EAAKb,EAAE,OAAO,QAClB,OAAO,IAAID,EAAMC,EAAG,CAAE,EAAEE,EAAOE,EAAKA,EAAK,EAAG,GAAI,EAAGS,EAAK,IAAIC,EAAaD,EAAIA,EAAG,KAAK,EAAI,KAAM,EAAG,IAAI,CACzG,CAKD,IAAI,SAAU,CAAE,OAAO,K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CACjC,IAAIV,EAAKgH,EAAO,QAAQC,CAAI,EACxBjH,GAAM,IACN8E,EAAM9E,CAAE,EAAI,IAExB,IAAI+E,EAAW,KACf,QAAStJ,EAAI,EAAGA,EAAIuL,EAAO,OAAQvL,IAC/B,GAAI,CAACqJ,EAAMrJ,CAAC,EACR,QAASkI,EAAI,KAAK,SAASqD,EAAOvL,CAAC,CAAC,EAAGuE,GAAKA,EAAK,KAAK,KAAK2D,GAAG,IAAM,QAC/DoB,IAAaA,EAAW,IAAI,WAAW,KAAK,QAAU,CAAC,IAAI/E,CAAE,EAAI,EAE9E,OAAO,IAAI4E,EAAQlE,EAASoE,EAAOC,CAAQ,CAC9C,CAGD,OAAO,YAAYG,EAAM,CACrB,OAAO,IAAIC,EAASD,CAAI,CAC3B,CACL,CACA,SAASrC,EAAK9C,EAAM9C,EAAK,CAAE,OAAO8C,EAAK9C,CAAG,EAAK8C,EAAK9C,EAAM,CAAC,GAAK,EAAM,CACtE,SAASqG,EAAaN,EAAQ,CAC1B,IAAI1F,EAAO,KACX,QAASxC,KAASkI,EAAQ,CACtB,IAAIE,EAAUpI,EAAM,EAAE,WACjBA,EAAM,KAAOA,EAAM,EAAE,OAAO,KAAOoI,GAAW,MAAQpI,EAAM,IAAMoI,IACnEpI,EAAM,EAAE,OAAO,UAAUA,EAAM,MAAO,CAA4B,IACjE,CAACwC,GAAQA,EAAK,MAAQxC,EAAM,SAC7BwC,EAAOxC,GAEf,OAAOwC,CACX,CACA,SAAS2I,EAAef,EAAM,CAC1B,GAAIA,EAAK,SAAU,CACf,IAAIzC,EAAOyC,EAAK,OAAS,EAA4B,EACrD,MAAO,CAAClI,EAAOlC,IAAWoK,EAAK,SAASlI,EAAOlC,CAAK,GAAK,EAAK2H,EAElE,OAAOyC,EAAK,GAChB","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-1508c6c1.js b/gradio/templates/cdn/assets/index-1508c6c1.js new file mode 100644 index 0000000000000000000000000000000000000000..11fa45ce11e87ab974ae6d36d9ea427012850eb3 --- /dev/null +++ b/gradio/templates/cdn/assets/index-1508c6c1.js @@ -0,0 +1,346 @@ +import{S as Or,e as qr,s as Pr,J as _n,K as de,p as Xe,M as Gt,n as ut,A as $e,al as Ir,g as Gi,N as ht,B as Vi,am as Wi,a7 as Is,h as Yi,O as O0,aj as Ls,z as Re,u as y0,v as Ye,y as x0,an as Os,k as H0,o as U0,x as G0,G as q0,m as Pn,V as Hn,_ as ui,F as At,U as I0,Q as b0,P as ji,R as Xi,T as P0,a1 as $i,E as qs,ae as Ps,q as Hs,r as Us}from"./index-fda37c89.js";import{u as Gs,S as Vs}from"./ShareButton-50e150a5.js";import{B as Ws}from"./Button-e3640f74.js";import{B as Ys}from"./BlockLabel-fe40816b.js";import{n as hi}from"./ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js";import"./IconButton-9e1f47e2.js";function js(v){let i,s,o;return{c(){i=_n("svg"),s=_n("path"),o=_n("path"),de(s,"fill","currentColor"),de(s,"d","M17.74 30L16 29l4-7h6a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h20a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-4.84Z"),de(o,"fill","currentColor"),de(o,"d","M8 10h16v2H8zm0 6h10v2H8z"),de(i,"xmlns","http://www.w3.org/2000/svg"),de(i,"xmlns:xlink","http://www.w3.org/1999/xlink"),de(i,"aria-hidden","true"),de(i,"role","img"),de(i,"class","iconify iconify--carbon"),de(i,"width","100%"),de(i,"height","100%"),de(i,"preserveAspectRatio","xMidYMid meet"),de(i,"viewBox","0 0 32 32")},m(m,p){Xe(m,i,p),Gt(i,s),Gt(i,o)},p:ut,i:ut,o:ut,d(m){m&&$e(i)}}}class Xs extends Or{constructor(i){super(),qr(this,i,null,js,Pr,{})}}function Zi(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let w0=Zi();function $s(v){w0=v}const Ki=/[&<>"']/,Zs=new RegExp(Ki.source,"g"),Qi=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ks=new RegExp(Qi.source,"g"),Qs={"&":"&","<":"<",">":">",'"':""","'":"'"},ci=v=>Qs[v];function et(v,i){if(i){if(Ki.test(v))return v.replace(Zs,ci)}else if(Qi.test(v))return v.replace(Ks,ci);return v}const Js=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Ji(v){return v.replace(Js,(i,s)=>(s=s.toLowerCase(),s==="colon"?":":s.charAt(0)==="#"?s.charAt(1)==="x"?String.fromCharCode(parseInt(s.substring(2),16)):String.fromCharCode(+s.substring(1)):""))}const eo=/(^|[^\[])\^/g;function De(v,i){v=typeof v=="string"?v:v.source,i=i||"";const s={replace:(o,m)=>(m=m.source||m,m=m.replace(eo,"$1"),v=v.replace(o,m),s),getRegex:()=>new RegExp(v,i)};return s}const to=/[^\w:]/g,ro=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function mi(v,i,s){if(v){let o;try{o=decodeURIComponent(Ji(s)).replace(to,"").toLowerCase()}catch{return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}i&&!ro.test(s)&&(s=lo(i,s));try{s=encodeURI(s).replace(/%25/g,"%")}catch{return null}return s}const Cr={},no=/^[^:]+:\/*[^/]*$/,ao=/^([^:]+:)[\s\S]*$/,io=/^([^:]+:\/*[^/]*)[\s\S]*$/;function lo(v,i){Cr[" "+v]||(no.test(v)?Cr[" "+v]=v+"/":Cr[" "+v]=Rr(v,"/",!0)),v=Cr[" "+v];const s=v.indexOf(":")===-1;return i.substring(0,2)==="//"?s?i:v.replace(ao,"$1")+i:i.charAt(0)==="/"?s?i:v.replace(io,"$1")+i:v+i}const Lr={exec:function(){}};function di(v,i){const s=v.replace(/\|/g,(p,x,w)=>{let z=!1,L=x;for(;--L>=0&&w[L]==="\\";)z=!z;return z?"|":" |"}),o=s.split(/ \|/);let m=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),o.length>i)o.splice(i);else for(;o.length1;)i&1&&(s+=v),i>>=1,v+=v;return s+v}function pi(v,i,s,o){const m=i.href,p=i.title?et(i.title):null,x=v[1].replace(/\\([\[\]])/g,"$1");if(v[0].charAt(0)!=="!"){o.state.inLink=!0;const w={type:"link",raw:s,href:m,title:p,text:x,tokens:o.inlineTokens(x)};return o.state.inLink=!1,w}return{type:"image",raw:s,href:m,title:p,text:et(x)}}function uo(v,i){const s=v.match(/^(\s+)(?:```)/);if(s===null)return i;const o=s[1];return i.split(` +`).map(m=>{const p=m.match(/^\s+/);if(p===null)return m;const[x]=p;return x.length>=o.length?m.slice(o.length):m}).join(` +`)}class Un{constructor(i){this.options=i||w0}space(i){const s=this.rules.block.newline.exec(i);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(i){const s=this.rules.block.code.exec(i);if(s){const o=s[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Rr(o,` +`)}}}fences(i){const s=this.rules.block.fences.exec(i);if(s){const o=s[0],m=uo(o,s[3]||"");return{type:"code",raw:o,lang:s[2]?s[2].trim().replace(this.rules.inline._escapes,"$1"):s[2],text:m}}}heading(i){const s=this.rules.block.heading.exec(i);if(s){let o=s[2].trim();if(/#$/.test(o)){const m=Rr(o,"#");(this.options.pedantic||!m||/ $/.test(m))&&(o=m.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(i){const s=this.rules.block.hr.exec(i);if(s)return{type:"hr",raw:s[0]}}blockquote(i){const s=this.rules.block.blockquote.exec(i);if(s){const o=s[0].replace(/^ *>[ \t]?/gm,""),m=this.lexer.state.top;this.lexer.state.top=!0;const p=this.lexer.blockTokens(o);return this.lexer.state.top=m,{type:"blockquote",raw:s[0],tokens:p,text:o}}}list(i){let s=this.rules.block.list.exec(i);if(s){let o,m,p,x,w,z,L,G,K,ne,V,xe,ge=s[1].trim();const le=ge.length>1,q={type:"list",raw:"",ordered:le,start:le?+ge.slice(0,-1):"",loose:!1,items:[]};ge=le?`\\d{1,9}\\${ge.slice(-1)}`:`\\${ge}`,this.options.pedantic&&(ge=le?ge:"[*+-]");const C=new RegExp(`^( {0,3}${ge})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;i&&(xe=!1,!(!(s=C.exec(i))||this.rules.block.hr.test(i)));){if(o=s[0],i=i.substring(o.length),G=s[2].split(` +`,1)[0].replace(/^\t+/,N=>" ".repeat(3*N.length)),K=i.split(` +`,1)[0],this.options.pedantic?(x=2,V=G.trimLeft()):(x=s[2].search(/[^ ]/),x=x>4?1:x,V=G.slice(x),x+=s[1].length),z=!1,!G&&/^ *$/.test(K)&&(o+=K+` +`,i=i.substring(K.length+1),xe=!0),!xe){const N=new RegExp(`^ {0,${Math.min(3,x-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),D=new RegExp(`^ {0,${Math.min(3,x-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),I=new RegExp(`^ {0,${Math.min(3,x-1)}}(?:\`\`\`|~~~)`),j=new RegExp(`^ {0,${Math.min(3,x-1)}}#`);for(;i&&(ne=i.split(` +`,1)[0],K=ne,this.options.pedantic&&(K=K.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(I.test(K)||j.test(K)||N.test(K)||D.test(i)));){if(K.search(/[^ ]/)>=x||!K.trim())V+=` +`+K.slice(x);else{if(z||G.search(/[^ ]/)>=4||I.test(G)||j.test(G)||D.test(G))break;V+=` +`+K}!z&&!K.trim()&&(z=!0),o+=ne+` +`,i=i.substring(ne.length+1),G=K.slice(x)}}q.loose||(L?q.loose=!0:/\n *\n *$/.test(o)&&(L=!0)),this.options.gfm&&(m=/^\[[ xX]\] /.exec(V),m&&(p=m[0]!=="[ ] ",V=V.replace(/^\[[ xX]\] +/,""))),q.items.push({type:"list_item",raw:o,task:!!m,checked:p,loose:!1,text:V}),q.raw+=o}q.items[q.items.length-1].raw=o.trimRight(),q.items[q.items.length-1].text=V.trimRight(),q.raw=q.raw.trimRight();const _=q.items.length;for(w=0;w<_;w++)if(this.lexer.state.top=!1,q.items[w].tokens=this.lexer.blockTokens(q.items[w].text,[]),!q.loose){const N=q.items[w].tokens.filter(I=>I.type==="space"),D=N.length>0&&N.some(I=>/\n.*\n/.test(I.raw));q.loose=D}if(q.loose)for(w=0;w<_;w++)q.items[w].loose=!0;return q}}html(i){const s=this.rules.block.html.exec(i);if(s){const o={type:"html",block:!0,raw:s[0],pre:!this.options.sanitizer&&(s[1]==="pre"||s[1]==="script"||s[1]==="style"),text:s[0]};if(this.options.sanitize){const m=this.options.sanitizer?this.options.sanitizer(s[0]):et(s[0]);o.type="paragraph",o.text=m,o.tokens=this.lexer.inline(m)}return o}}def(i){const s=this.rules.block.def.exec(i);if(s){const o=s[1].toLowerCase().replace(/\s+/g," "),m=s[2]?s[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",p=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline._escapes,"$1"):s[3];return{type:"def",tag:o,raw:s[0],href:m,title:p}}}table(i){const s=this.rules.block.table.exec(i);if(s){const o={type:"table",header:di(s[1]).map(m=>({text:m})),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:s[3]&&s[3].trim()?s[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(o.header.length===o.align.length){o.raw=s[0];let m=o.align.length,p,x,w,z;for(p=0;p({text:L}));for(m=o.header.length,x=0;x/i.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):et(s[0]):s[0]}}link(i){const s=this.rules.inline.link.exec(i);if(s){const o=s[2].trim();if(!this.options.pedantic&&/^$/.test(o))return;const x=Rr(o.slice(0,-1),"\\");if((o.length-x.length)%2===0)return}else{const x=so(s[2],"()");if(x>-1){const z=(s[0].indexOf("!")===0?5:4)+s[1].length+x;s[2]=s[2].substring(0,x),s[0]=s[0].substring(0,z).trim(),s[3]=""}}let m=s[2],p="";if(this.options.pedantic){const x=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(m);x&&(m=x[1],p=x[3])}else p=s[3]?s[3].slice(1,-1):"";return m=m.trim(),/^$/.test(o)?m=m.slice(1):m=m.slice(1,-1)),pi(s,{href:m&&m.replace(this.rules.inline._escapes,"$1"),title:p&&p.replace(this.rules.inline._escapes,"$1")},s[0],this.lexer)}}reflink(i,s){let o;if((o=this.rules.inline.reflink.exec(i))||(o=this.rules.inline.nolink.exec(i))){let m=(o[2]||o[1]).replace(/\s+/g," ");if(m=s[m.toLowerCase()],!m){const p=o[0].charAt(0);return{type:"text",raw:p,text:p}}return pi(o,m,o[0],this.lexer)}}emStrong(i,s,o=""){let m=this.rules.inline.emStrong.lDelim.exec(i);if(!m||m[3]&&o.match(/[\p{L}\p{N}]/u))return;const p=m[1]||m[2]||"";if(!p||p&&(o===""||this.rules.inline.punctuation.exec(o))){const x=m[0].length-1;let w,z,L=x,G=0;const K=m[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(K.lastIndex=0,s=s.slice(-1*i.length+x);(m=K.exec(s))!=null;){if(w=m[1]||m[2]||m[3]||m[4]||m[5]||m[6],!w)continue;if(z=w.length,m[3]||m[4]){L+=z;continue}else if((m[5]||m[6])&&x%3&&!((x+z)%3)){G+=z;continue}if(L-=z,L>0)continue;z=Math.min(z,z+L+G);const ne=i.slice(0,x+m.index+(m[0].length-w.length)+z);if(Math.min(x,z)%2){const xe=ne.slice(1,-1);return{type:"em",raw:ne,text:xe,tokens:this.lexer.inlineTokens(xe)}}const V=ne.slice(2,-2);return{type:"strong",raw:ne,text:V,tokens:this.lexer.inlineTokens(V)}}}}codespan(i){const s=this.rules.inline.code.exec(i);if(s){let o=s[2].replace(/\n/g," ");const m=/[^ ]/.test(o),p=/^ /.test(o)&&/ $/.test(o);return m&&p&&(o=o.substring(1,o.length-1)),o=et(o,!0),{type:"codespan",raw:s[0],text:o}}}br(i){const s=this.rules.inline.br.exec(i);if(s)return{type:"br",raw:s[0]}}del(i){const s=this.rules.inline.del.exec(i);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(i,s){const o=this.rules.inline.autolink.exec(i);if(o){let m,p;return o[2]==="@"?(m=et(this.options.mangle?s(o[1]):o[1]),p="mailto:"+m):(m=et(o[1]),p=m),{type:"link",raw:o[0],text:m,href:p,tokens:[{type:"text",raw:m,text:m}]}}}url(i,s){let o;if(o=this.rules.inline.url.exec(i)){let m,p;if(o[2]==="@")m=et(this.options.mangle?s(o[0]):o[0]),p="mailto:"+m;else{let x;do x=o[0],o[0]=this.rules.inline._backpedal.exec(o[0])[0];while(x!==o[0]);m=et(o[0]),o[1]==="www."?p="http://"+o[0]:p=o[0]}return{type:"link",raw:o[0],text:m,href:p,tokens:[{type:"text",raw:m,text:m}]}}}inlineText(i,s){const o=this.rules.inline.text.exec(i);if(o){let m;return this.lexer.state.inRawBlock?m=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):et(o[0]):o[0]:m=et(this.options.smartypants?s(o[0]):o[0]),{type:"text",raw:o[0],text:m}}}}const me={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Lr,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;me.def=De(me.def).replace("label",me._label).replace("title",me._title).getRegex();me.bullet=/(?:[*+-]|\d{1,9}[.)])/;me.listItemStart=De(/^( *)(bull) */).replace("bull",me.bullet).getRegex();me.list=De(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex();me._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";me._comment=/|$)/;me.html=De(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();me.paragraph=De(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.blockquote=De(me.blockquote).replace("paragraph",me.paragraph).getRegex();me.normal={...me};me.gfm={...me.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};me.gfm.table=De(me.gfm.table).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.gfm.paragraph=De(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",me.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex();me.pedantic={...me.normal,html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Lr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:De(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Lr,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Lr,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";ie.punctuation=De(ie.punctuation).replace(/punctuation/g,ie._punctuation).getRegex();ie.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;ie.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;ie._comment=De(me._comment).replace("(?:-->|$)","-->").getRegex();ie.emStrong.lDelim=De(ie.emStrong.lDelim).replace(/punct/g,ie._punctuation).getRegex();ie.emStrong.rDelimAst=De(ie.emStrong.rDelimAst,"g").replace(/punct/g,ie._punctuation).getRegex();ie.emStrong.rDelimUnd=De(ie.emStrong.rDelimUnd,"g").replace(/punct/g,ie._punctuation).getRegex();ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ie._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;ie.autolink=De(ie.autolink).replace("scheme",ie._scheme).replace("email",ie._email).getRegex();ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ie.tag=De(ie.tag).replace("comment",ie._comment).replace("attribute",ie._attribute).getRegex();ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ie._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ie.link=De(ie.link).replace("label",ie._label).replace("href",ie._href).replace("title",ie._title).getRegex();ie.reflink=De(ie.reflink).replace("label",ie._label).replace("ref",me._label).getRegex();ie.nolink=De(ie.nolink).replace("ref",me._label).getRegex();ie.reflinkSearch=De(ie.reflinkSearch,"g").replace("reflink",ie.reflink).replace("nolink",ie.nolink).getRegex();ie.normal={...ie};ie.pedantic={...ie.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:De(/^!?\[(label)\]\((.*?)\)/).replace("label",ie._label).getRegex(),reflink:De(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie._label).getRegex()};ie.gfm={...ie.normal,escape:De(ie.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(o="x"+o.toString(16)),i+="&#"+o+";";return i}class l0{constructor(i){this.tokens=[],this.tokens.links=Object.create(null),this.options=i||w0,this.options.tokenizer=this.options.tokenizer||new Un,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={block:me.normal,inline:ie.normal};this.options.pedantic?(s.block=me.pedantic,s.inline=ie.pedantic):this.options.gfm&&(s.block=me.gfm,this.options.breaks?s.inline=ie.breaks:s.inline=ie.gfm),this.tokenizer.rules=s}static get rules(){return{block:me,inline:ie}}static lex(i,s){return new l0(s).lex(i)}static lexInline(i,s){return new l0(s).inlineTokens(i)}lex(i){i=i.replace(/\r\n|\r/g,` +`),this.blockTokens(i,this.tokens);let s;for(;s=this.inlineQueue.shift();)this.inlineTokens(s.src,s.tokens);return this.tokens}blockTokens(i,s=[]){this.options.pedantic?i=i.replace(/\t/g," ").replace(/^ +$/gm,""):i=i.replace(/^( *)(\t+)/gm,(w,z,L)=>z+" ".repeat(L.length));let o,m,p,x;for(;i;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(w=>(o=w.call({lexer:this},i,s))?(i=i.substring(o.raw.length),s.push(o),!0):!1))){if(o=this.tokenizer.space(i)){i=i.substring(o.raw.length),o.raw.length===1&&s.length>0?s[s.length-1].raw+=` +`:s.push(o);continue}if(o=this.tokenizer.code(i)){i=i.substring(o.raw.length),m=s[s.length-1],m&&(m.type==="paragraph"||m.type==="text")?(m.raw+=` +`+o.raw,m.text+=` +`+o.text,this.inlineQueue[this.inlineQueue.length-1].src=m.text):s.push(o);continue}if(o=this.tokenizer.fences(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.heading(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.hr(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.blockquote(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.list(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.html(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.def(i)){i=i.substring(o.raw.length),m=s[s.length-1],m&&(m.type==="paragraph"||m.type==="text")?(m.raw+=` +`+o.raw,m.text+=` +`+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=m.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.lheading(i)){i=i.substring(o.raw.length),s.push(o);continue}if(p=i,this.options.extensions&&this.options.extensions.startBlock){let w=1/0;const z=i.slice(1);let L;this.options.extensions.startBlock.forEach(function(G){L=G.call({lexer:this},z),typeof L=="number"&&L>=0&&(w=Math.min(w,L))}),w<1/0&&w>=0&&(p=i.substring(0,w+1))}if(this.state.top&&(o=this.tokenizer.paragraph(p))){m=s[s.length-1],x&&m.type==="paragraph"?(m.raw+=` +`+o.raw,m.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=m.text):s.push(o),x=p.length!==i.length,i=i.substring(o.raw.length);continue}if(o=this.tokenizer.text(i)){i=i.substring(o.raw.length),m=s[s.length-1],m&&m.type==="text"?(m.raw+=` +`+o.raw,m.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=m.text):s.push(o);continue}if(i){const w="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(w);break}else throw new Error(w)}}return this.state.top=!0,s}inline(i,s=[]){return this.inlineQueue.push({src:i,tokens:s}),s}inlineTokens(i,s=[]){let o,m,p,x=i,w,z,L;if(this.tokens.links){const G=Object.keys(this.tokens.links);if(G.length>0)for(;(w=this.tokenizer.rules.inline.reflinkSearch.exec(x))!=null;)G.includes(w[0].slice(w[0].lastIndexOf("[")+1,-1))&&(x=x.slice(0,w.index)+"["+fi("a",w[0].length-2)+"]"+x.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(w=this.tokenizer.rules.inline.blockSkip.exec(x))!=null;)x=x.slice(0,w.index)+"["+fi("a",w[0].length-2)+"]"+x.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(w=this.tokenizer.rules.inline.escapedEmSt.exec(x))!=null;)x=x.slice(0,w.index+w[0].length-2)+"++"+x.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;i;)if(z||(L=""),z=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(G=>(o=G.call({lexer:this},i,s))?(i=i.substring(o.raw.length),s.push(o),!0):!1))){if(o=this.tokenizer.escape(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(i)){i=i.substring(o.raw.length),m=s[s.length-1],m&&o.type==="text"&&m.type==="text"?(m.raw+=o.raw,m.text+=o.text):s.push(o);continue}if(o=this.tokenizer.link(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(o.raw.length),m=s[s.length-1],m&&o.type==="text"&&m.type==="text"?(m.raw+=o.raw,m.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(i,x,L)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(i)){i=i.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(i,gi)){i=i.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(i,gi))){i=i.substring(o.raw.length),s.push(o);continue}if(p=i,this.options.extensions&&this.options.extensions.startInline){let G=1/0;const K=i.slice(1);let ne;this.options.extensions.startInline.forEach(function(V){ne=V.call({lexer:this},K),typeof ne=="number"&&ne>=0&&(G=Math.min(G,ne))}),G<1/0&&G>=0&&(p=i.substring(0,G+1))}if(o=this.tokenizer.inlineText(p,ho)){i=i.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(L=o.raw.slice(-1)),z=!0,m=s[s.length-1],m&&m.type==="text"?(m.raw+=o.raw,m.text+=o.text):s.push(o);continue}if(i){const G="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(G);break}else throw new Error(G)}}return s}}class Gn{constructor(i){this.options=i||w0}code(i,s,o){const m=(s||"").match(/\S*/)[0];if(this.options.highlight){const p=this.options.highlight(i,m);p!=null&&p!==i&&(o=!0,i=p)}return i=i.replace(/\n$/,"")+` +`,m?'
'+(o?i:et(i,!0))+`
+`:"
"+(o?i:et(i,!0))+`
+`}blockquote(i){return`
+${i}
+`}html(i,s){return i}heading(i,s,o,m){if(this.options.headerIds){const p=this.options.headerPrefix+m.slug(o);return`${i} +`}return`${i} +`}hr(){return this.options.xhtml?`
+`:`
+`}list(i,s,o){const m=s?"ol":"ul",p=s&&o!==1?' start="'+o+'"':"";return"<"+m+p+`> +`+i+" +`}listitem(i){return`
  • ${i}
  • +`}checkbox(i){return" "}paragraph(i){return`

    ${i}

    +`}table(i,s){return s&&(s=`${s}`),` + +`+i+` +`+s+`
    +`}tablerow(i){return` +${i} +`}tablecell(i,s){const o=s.header?"th":"td";return(s.align?`<${o} align="${s.align}">`:`<${o}>`)+i+` +`}strong(i){return`${i}`}em(i){return`${i}`}codespan(i){return`${i}`}br(){return this.options.xhtml?"
    ":"
    "}del(i){return`${i}`}link(i,s,o){if(i=mi(this.options.sanitize,this.options.baseUrl,i),i===null)return o;let m='",m}image(i,s,o){if(i=mi(this.options.sanitize,this.options.baseUrl,i),i===null)return o;let m=`${o}":">",m}text(i){return i}}class el{strong(i){return i}em(i){return i}codespan(i){return i}del(i){return i}html(i){return i}text(i){return i}link(i,s,o){return""+o}image(i,s,o){return""+o}br(){return""}}class tl{constructor(){this.seen={}}serialize(i){return i.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(i,s){let o=i,m=0;if(this.seen.hasOwnProperty(o)){m=this.seen[i];do m++,o=i+"-"+m;while(this.seen.hasOwnProperty(o))}return s||(this.seen[i]=m,this.seen[o]=0),o}slug(i,s={}){const o=this.serialize(i);return this.getNextSafeSlug(o,s.dryrun)}}class s0{constructor(i){this.options=i||w0,this.options.renderer=this.options.renderer||new Gn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new el,this.slugger=new tl}static parse(i,s){return new s0(s).parse(i)}static parseInline(i,s){return new s0(s).parseInline(i)}parse(i,s=!0){let o="",m,p,x,w,z,L,G,K,ne,V,xe,ge,le,q,C,_,N,D,I;const j=i.length;for(m=0;m0&&C.tokens[0].type==="paragraph"?(C.tokens[0].text=D+" "+C.tokens[0].text,C.tokens[0].tokens&&C.tokens[0].tokens.length>0&&C.tokens[0].tokens[0].type==="text"&&(C.tokens[0].tokens[0].text=D+" "+C.tokens[0].tokens[0].text)):C.tokens.unshift({type:"text",text:D}):q+=D),q+=this.parse(C.tokens,le),ne+=this.renderer.listitem(q,N,_);o+=this.renderer.list(ne,xe,ge);continue}case"html":{o+=this.renderer.html(V.text,V.block);continue}case"paragraph":{o+=this.renderer.paragraph(this.parseInline(V.tokens));continue}case"text":{for(ne=V.tokens?this.parseInline(V.tokens):V.text;m+1{if(o.message+=` +Please report this to https://github.com/markedjs/marked.`,v){const m="

    An error occurred:

    "+et(o.message+"",!0)+"
    ";if(i)return Promise.resolve(m);if(s){s(null,m);return}return m}if(i)return Promise.reject(o);if(s){s(o);return}throw o}}function rl(v,i){return(s,o,m)=>{typeof o=="function"&&(m=o,o=null);const p={...o};o={...ce.defaults,...p};const x=co(o.silent,o.async,m);if(typeof s>"u"||s===null)return x(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return x(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(oo(o,m),o.hooks&&(o.hooks.options=o),m){const w=o.highlight;let z;try{o.hooks&&(s=o.hooks.preprocess(s)),z=v(s,o)}catch(K){return x(K)}const L=function(K){let ne;if(!K)try{o.walkTokens&&ce.walkTokens(z,o.walkTokens),ne=i(z,o),o.hooks&&(ne=o.hooks.postprocess(ne))}catch(V){K=V}return o.highlight=w,K?x(K):m(null,ne)};if(!w||w.length<3||(delete o.highlight,!z.length))return L();let G=0;ce.walkTokens(z,function(K){K.type==="code"&&(G++,setTimeout(()=>{w(K.text,K.lang,function(ne,V){if(ne)return L(ne);V!=null&&V!==K.text&&(K.text=V,K.escaped=!0),G--,G===0&&L()})},0))}),G===0&&L();return}if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(s):s).then(w=>v(w,o)).then(w=>o.walkTokens?Promise.all(ce.walkTokens(w,o.walkTokens)).then(()=>w):w).then(w=>i(w,o)).then(w=>o.hooks?o.hooks.postprocess(w):w).catch(x);try{o.hooks&&(s=o.hooks.preprocess(s));const w=v(s,o);o.walkTokens&&ce.walkTokens(w,o.walkTokens);let z=i(w,o);return o.hooks&&(z=o.hooks.postprocess(z)),z}catch(w){return x(w)}}}function ce(v,i,s){return rl(l0.lex,s0.parse)(v,i,s)}ce.options=ce.setOptions=function(v){return ce.defaults={...ce.defaults,...v},$s(ce.defaults),ce};ce.getDefaults=Zi;ce.defaults=w0;ce.use=function(...v){const i=ce.defaults.extensions||{renderers:{},childTokens:{}};v.forEach(s=>{const o={...s};if(o.async=ce.defaults.async||o.async||!1,s.extensions&&(s.extensions.forEach(m=>{if(!m.name)throw new Error("extension name required");if(m.renderer){const p=i.renderers[m.name];p?i.renderers[m.name]=function(...x){let w=m.renderer.apply(this,x);return w===!1&&(w=p.apply(this,x)),w}:i.renderers[m.name]=m.renderer}if(m.tokenizer){if(!m.level||m.level!=="block"&&m.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");i[m.level]?i[m.level].unshift(m.tokenizer):i[m.level]=[m.tokenizer],m.start&&(m.level==="block"?i.startBlock?i.startBlock.push(m.start):i.startBlock=[m.start]:m.level==="inline"&&(i.startInline?i.startInline.push(m.start):i.startInline=[m.start]))}m.childTokens&&(i.childTokens[m.name]=m.childTokens)}),o.extensions=i),s.renderer){const m=ce.defaults.renderer||new Gn;for(const p in s.renderer){const x=m[p];m[p]=(...w)=>{let z=s.renderer[p].apply(m,w);return z===!1&&(z=x.apply(m,w)),z}}o.renderer=m}if(s.tokenizer){const m=ce.defaults.tokenizer||new Un;for(const p in s.tokenizer){const x=m[p];m[p]=(...w)=>{let z=s.tokenizer[p].apply(m,w);return z===!1&&(z=x.apply(m,w)),z}}o.tokenizer=m}if(s.hooks){const m=ce.defaults.hooks||new Ln;for(const p in s.hooks){const x=m[p];Ln.passThroughHooks.has(p)?m[p]=w=>{if(ce.defaults.async)return Promise.resolve(s.hooks[p].call(m,w)).then(L=>x.call(m,L));const z=s.hooks[p].call(m,w);return x.call(m,z)}:m[p]=(...w)=>{let z=s.hooks[p].apply(m,w);return z===!1&&(z=x.apply(m,w)),z}}o.hooks=m}if(s.walkTokens){const m=ce.defaults.walkTokens;o.walkTokens=function(p){let x=[];return x.push(s.walkTokens.call(this,p)),m&&(x=x.concat(m.call(this,p))),x}}ce.setOptions(o)})};ce.walkTokens=function(v,i){let s=[];for(const o of v)switch(s=s.concat(i.call(ce,o)),o.type){case"table":{for(const m of o.header)s=s.concat(ce.walkTokens(m.tokens,i));for(const m of o.rows)for(const p of m)s=s.concat(ce.walkTokens(p.tokens,i));break}case"list":{s=s.concat(ce.walkTokens(o.items,i));break}default:ce.defaults.extensions&&ce.defaults.extensions.childTokens&&ce.defaults.extensions.childTokens[o.type]?ce.defaults.extensions.childTokens[o.type].forEach(function(m){s=s.concat(ce.walkTokens(o[m],i))}):o.tokens&&(s=s.concat(ce.walkTokens(o.tokens,i)))}return s};ce.parseInline=rl(l0.lexInline,s0.parseInline);ce.Parser=s0;ce.parser=s0.parse;ce.Renderer=Gn;ce.TextRenderer=el;ce.Lexer=l0;ce.lexer=l0.lex;ce.Tokenizer=Un;ce.Slugger=tl;ce.Hooks=Ln;ce.parse=ce;ce.options;ce.setOptions;ce.use;ce.walkTokens;ce.parseInline;s0.parse;l0.lex;function mo(v){if(typeof v=="function"&&(v={highlight:v}),!v||typeof v.highlight!="function")throw new Error("Must provide highlight function");return typeof v.langPrefix!="string"&&(v.langPrefix="language-"),{async:!!v.async,walkTokens(i){if(i.type!=="code")return;const s=fo(i);if(v.async)return Promise.resolve(v.highlight(i.text,s)).then(vi(i));const o=v.highlight(i.text,s);vi(i)(o)},renderer:{code(i,s,o){const m=(s||"").match(/\S*/)[0],p=m?` class="${v.langPrefix}${yi(m)}"`:"";return i=i.replace(/\n$/,""),`
    ${o?i:yi(i,!0)}
    +
    `}}}}function fo(v){return(v.lang||"").match(/\S*/)[0]}function vi(v){return i=>{typeof i=="string"&&i!==v.text&&(v.escaped=!0,v.text=i)}}const nl=/[&<>"']/,po=new RegExp(nl.source,"g"),al=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,go=new RegExp(al.source,"g"),vo={"&":"&","<":"<",">":">",'"':""","'":"'"},bi=v=>vo[v];function yi(v,i){if(i){if(nl.test(v))return v.replace(po,bi)}else if(al.test(v))return v.replace(go,bi);return v}var il={exports:{}};(function(v){var i=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */var s=function(o){var m=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,p=0,x={},w={manual:o.Prism&&o.Prism.manual,disableWorkerMessageHandler:o.Prism&&o.Prism.disableWorkerMessageHandler,util:{encode:function C(_){return _ instanceof z?new z(_.type,C(_.content),_.alias):Array.isArray(_)?_.map(C):_.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(D){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(D.stack)||[])[1];if(C){var _=document.getElementsByTagName("script");for(var N in _)if(_[N].src==C)return _[N]}return null}},isActive:function(C,_,N){for(var D="no-"+_;C;){var I=C.classList;if(I.contains(_))return!0;if(I.contains(D))return!1;C=C.parentElement}return!!N}},languages:{plain:x,plaintext:x,text:x,txt:x,extend:function(C,_){var N=w.util.clone(w.languages[C]);for(var D in _)N[D]=_[D];return N},insertBefore:function(C,_,N,D){D=D||w.languages;var I=D[C],j={};for(var re in I)if(I.hasOwnProperty(re)){if(re==_)for(var Z in N)N.hasOwnProperty(Z)&&(j[Z]=N[Z]);N.hasOwnProperty(re)||(j[re]=I[re])}var U=D[C];return D[C]=j,w.languages.DFS(w.languages,function(fe,se){se===U&&fe!=C&&(this[fe]=j)}),j},DFS:function C(_,N,D,I){I=I||{};var j=w.util.objId;for(var re in _)if(_.hasOwnProperty(re)){N.call(_,re,_[re],D||re);var Z=_[re],U=w.util.type(Z);U==="Object"&&!I[j(Z)]?(I[j(Z)]=!0,C(Z,N,null,I)):U==="Array"&&!I[j(Z)]&&(I[j(Z)]=!0,C(Z,N,re,I))}}},plugins:{},highlightAll:function(C,_){w.highlightAllUnder(document,C,_)},highlightAllUnder:function(C,_,N){var D={callback:N,container:C,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};w.hooks.run("before-highlightall",D),D.elements=Array.prototype.slice.apply(D.container.querySelectorAll(D.selector)),w.hooks.run("before-all-elements-highlight",D);for(var I=0,j;j=D.elements[I++];)w.highlightElement(j,_===!0,D.callback)},highlightElement:function(C,_,N){var D=w.util.getLanguage(C),I=w.languages[D];w.util.setLanguage(C,D);var j=C.parentElement;j&&j.nodeName.toLowerCase()==="pre"&&w.util.setLanguage(j,D);var re=C.textContent,Z={element:C,language:D,grammar:I,code:re};function U(se){Z.highlightedCode=se,w.hooks.run("before-insert",Z),Z.element.innerHTML=Z.highlightedCode,w.hooks.run("after-highlight",Z),w.hooks.run("complete",Z),N&&N.call(Z.element)}if(w.hooks.run("before-sanity-check",Z),j=Z.element.parentElement,j&&j.nodeName.toLowerCase()==="pre"&&!j.hasAttribute("tabindex")&&j.setAttribute("tabindex","0"),!Z.code){w.hooks.run("complete",Z),N&&N.call(Z.element);return}if(w.hooks.run("before-highlight",Z),!Z.grammar){U(w.util.encode(Z.code));return}if(_&&o.Worker){var fe=new Worker(w.filename);fe.onmessage=function(se){U(se.data)},fe.postMessage(JSON.stringify({language:Z.language,code:Z.code,immediateClose:!0}))}else U(w.highlight(Z.code,Z.grammar,Z.language))},highlight:function(C,_,N){var D={code:C,grammar:_,language:N};if(w.hooks.run("before-tokenize",D),!D.grammar)throw new Error('The language "'+D.language+'" has no grammar.');return D.tokens=w.tokenize(D.code,D.grammar),w.hooks.run("after-tokenize",D),z.stringify(w.util.encode(D.tokens),D.language)},tokenize:function(C,_){var N=_.rest;if(N){for(var D in N)_[D]=N[D];delete _.rest}var I=new K;return ne(I,I.head,C),G(C,I,_,I.head,0),xe(I)},hooks:{all:{},add:function(C,_){var N=w.hooks.all;N[C]=N[C]||[],N[C].push(_)},run:function(C,_){var N=w.hooks.all[C];if(!(!N||!N.length))for(var D=0,I;I=N[D++];)I(_)}},Token:z};o.Prism=w;function z(C,_,N,D){this.type=C,this.content=_,this.alias=N,this.length=(D||"").length|0}z.stringify=function C(_,N){if(typeof _=="string")return _;if(Array.isArray(_)){var D="";return _.forEach(function(U){D+=C(U,N)}),D}var I={type:_.type,content:C(_.content,N),tag:"span",classes:["token",_.type],attributes:{},language:N},j=_.alias;j&&(Array.isArray(j)?Array.prototype.push.apply(I.classes,j):I.classes.push(j)),w.hooks.run("wrap",I);var re="";for(var Z in I.attributes)re+=" "+Z+'="'+(I.attributes[Z]||"").replace(/"/g,""")+'"';return"<"+I.tag+' class="'+I.classes.join(" ")+'"'+re+">"+I.content+""};function L(C,_,N,D){C.lastIndex=_;var I=C.exec(N);if(I&&D&&I[1]){var j=I[1].length;I.index+=j,I[0]=I[0].slice(j)}return I}function G(C,_,N,D,I,j){for(var re in N)if(!(!N.hasOwnProperty(re)||!N[re])){var Z=N[re];Z=Array.isArray(Z)?Z:[Z];for(var U=0;U=j.reach);Te+=He.value.length,He=He.next){var Mt=He.value;if(_.length>C.length)return;if(!(Mt instanceof z)){var J=1,Ze;if(Pe){if(Ze=L(o0,Te,C,ze),!Ze||Ze.index>=C.length)break;var at=Ze.index,Fe=Ze.index+Ze[0].length,Ve=Te;for(Ve+=He.value.length;at>=Ve;)He=He.next,Ve+=He.value.length;if(Ve-=He.value.length,Te=Ve,He.value instanceof z)continue;for(var pt=He;pt!==_.tail&&(Vej.reach&&(j.reach=gt);var it=He.prev;Vt&&(it=ne(_,it,Vt),Te+=Vt.length),V(_,it,J);var h0=new z(re,se?w.tokenize(Ct,se):Ct,V0,Ct);if(He=ne(_,it,h0),u0&&ne(_,He,u0),J>1){var Lt={cause:re+","+U,reach:gt};G(C,_,N,He.prev,Te,Lt),j&&Lt.reach>j.reach&&(j.reach=Lt.reach)}}}}}}function K(){var C={value:null,prev:null,next:null},_={value:null,prev:C,next:null};C.next=_,this.head=C,this.tail=_,this.length=0}function ne(C,_,N){var D=_.next,I={value:N,prev:_,next:D};return _.next=I,D.prev=I,C.length++,I}function V(C,_,N){for(var D=_.next,I=0;I/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},s.languages.markup.tag.inside["attr-value"].inside.entity=s.languages.markup.entity,s.languages.markup.doctype.inside["internal-subset"].inside=s.languages.markup,s.hooks.add("wrap",function(o){o.type==="entity"&&(o.attributes.title=o.content.replace(/&/,"&"))}),Object.defineProperty(s.languages.markup.tag,"addInlined",{value:function(m,p){var x={};x["language-"+p]={pattern:/(^$)/i,lookbehind:!0,inside:s.languages[p]},x.cdata=/^$/i;var w={"included-cdata":{pattern://i,inside:x}};w["language-"+p]={pattern:/[\s\S]+/,inside:s.languages[p]};var z={};z[m]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return m}),"i"),lookbehind:!0,greedy:!0,inside:w},s.languages.insertBefore("markup","cdata",z)}}),Object.defineProperty(s.languages.markup.tag,"addAttribute",{value:function(o,m){s.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+o+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[m,"language-"+m],inside:s.languages[m]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),s.languages.html=s.languages.markup,s.languages.mathml=s.languages.markup,s.languages.svg=s.languages.markup,s.languages.xml=s.languages.extend("markup",{}),s.languages.ssml=s.languages.xml,s.languages.atom=s.languages.xml,s.languages.rss=s.languages.xml,function(o){var m=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;o.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+m.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+m.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+m.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+m.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:m,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},o.languages.css.atrule.inside.rest=o.languages.css;var p=o.languages.markup;p&&(p.tag.addInlined("style","css"),p.tag.addAttribute("style","css"))}(s),s.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},s.languages.javascript=s.languages.extend("clike",{"class-name":[s.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),s.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,s.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:s.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:s.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:s.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:s.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:s.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),s.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:s.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),s.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),s.languages.markup&&(s.languages.markup.tag.addInlined("script","javascript"),s.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),s.languages.js=s.languages.javascript,function(){if(typeof s>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var o="Loading…",m=function(ge,le){return"✖ Error "+ge+" while fetching file: "+le},p="✖ Error: File does not exist or is empty",x={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},w="data-src-status",z="loading",L="loaded",G="failed",K="pre[data-src]:not(["+w+'="'+L+'"]):not(['+w+'="'+z+'"])';function ne(ge,le,q){var C=new XMLHttpRequest;C.open("GET",ge,!0),C.onreadystatechange=function(){C.readyState==4&&(C.status<400&&C.responseText?le(C.responseText):C.status>=400?q(m(C.status,C.statusText)):q(p))},C.send(null)}function V(ge){var le=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(ge||"");if(le){var q=Number(le[1]),C=le[2],_=le[3];return C?_?[q,Number(_)]:[q,void 0]:[q,q]}}s.hooks.add("before-highlightall",function(ge){ge.selector+=", "+K}),s.hooks.add("before-sanity-check",function(ge){var le=ge.element;if(le.matches(K)){ge.code="",le.setAttribute(w,z);var q=le.appendChild(document.createElement("CODE"));q.textContent=o;var C=le.getAttribute("data-src"),_=ge.language;if(_==="none"){var N=(/\.(\w+)$/.exec(C)||[,"none"])[1];_=x[N]||N}s.util.setLanguage(q,_),s.util.setLanguage(le,_);var D=s.plugins.autoloader;D&&D.loadLanguages(_),ne(C,function(I){le.setAttribute(w,L);var j=V(le.getAttribute("data-range"));if(j){var re=I.split(/\r\n?|\n/g),Z=j[0],U=j[1]==null?re.length:j[1];Z<0&&(Z+=re.length),Z=Math.max(0,Math.min(Z-1,re.length)),U<0&&(U+=re.length),U=Math.max(0,Math.min(U,re.length)),I=re.slice(Z,U).join(` +`),le.hasAttribute("data-start")||le.setAttribute("data-start",String(Z+1))}q.textContent=I,s.highlightElement(q)},function(I){le.setAttribute(w,G),q.textContent=I})}}),s.plugins.fileHighlight={highlight:function(le){for(var q=(le||document).querySelectorAll(K),C=0,_;_=q[C++];)s.highlightElement(_)}};var xe=!1;s.fileHighlight=function(){xe||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),xe=!0),s.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(il);var bo=il.exports;const En=Gi(bo);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(v){var i=/\\(?:[^a-z()[\]]|[a-z*]+)/i,s={"equation-command":{pattern:i,alias:"regex"}};v.languages.latex={comment:/%.*/,cdata:{pattern:/(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:s,alias:"string"},{pattern:/(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:s,alias:"string"}],keyword:{pattern:/(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0,alias:"class-name"},function:{pattern:i,alias:"selector"},punctuation:/[[\]{}&]/},v.languages.tex=v.languages.latex,v.languages.context=v.languages.latex})(Prism);const yo=``,xo=``,xi=``,ll=/[&<>"']/,wo=new RegExp(ll.source,"g"),sl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ko=new RegExp(sl.source,"g"),So={"&":"&","<":"<",">":">",'"':""","'":"'"},wi=v=>So[v]||"";function Bn(v,i){if(i){if(ll.test(v))return v.replace(wo,wi)}else if(sl.test(v))return v.replace(ko,wi);return v}const Ao={code(v,i,s){const o=(i??"").match(/\S*/)?.[0]??"";if(this.options.highlight){const m=this.options.highlight(v,o);m!=null&&m!==v&&(s=!0,v=m)}return v=v.replace(/\n$/,"")+` +`,o?'
    '+xi+(s?v:Bn(v,!0))+`
    +`:"
    "+xi+(s?v:Bn(v,!0))+`
    +`}};ce.use({gfm:!0,breaks:!0,pedantic:!1,headerIds:!1,mangle:!1},mo({highlight:(v,i)=>En.languages[i]?En.highlight(v,En.languages[i],i):v}),{renderer:Ao});function To(v){v.addEventListener("click",i);async function i(s){const o=s.composedPath(),[m]=o.filter(p=>p?.tagName==="BUTTON"&&p.classList.contains("copy_code_button"));if(m){let p=function(L){L.style.opacity="1",setTimeout(()=>{L.style.opacity="0"},2e3)};s.stopImmediatePropagation();const x=m.parentElement.innerText.trim(),w=Array.from(m.children)[1];await Mo(x)&&p(w)}}return{destroy(){v.removeEventListener("click",i)}}}async function Mo(v){let i=!1;if("clipboard"in navigator)await navigator.clipboard.writeText(v),i=!0;else{const s=document.createElement("textarea");s.value=v,s.style.position="absolute",s.style.left="-999999px",document.body.prepend(s),s.select();try{document.execCommand("copy"),i=!0}catch(o){console.error(o),i=!1}finally{s.remove()}}return i}const zo=async v=>(await Promise.all(v.map(async s=>await Promise.all(s.map(async(o,m)=>{if(o===null)return"";let p=m===0?"😃":"🤖",x="";if(typeof o=="string")x=o;else{const w=await Gs(o.data,"url");o.mime_type?.includes("audio")?x=``:o.mime_type?.includes("video")?x=w:o.mime_type?.includes("image")&&(x=``)}return`${p}: ${x}`}))))).map(s=>s.join(s[0]!==""&&s[1]!==""?` +`:"")).join(` +`);/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */const{entries:ol,setPrototypeOf:ki,isFrozen:_o,getPrototypeOf:Eo,getOwnPropertyDescriptor:Bo}=Object;let{freeze:nt,seal:Bt,create:Co}=Object,{apply:On,construct:qn}=typeof Reflect<"u"&&Reflect;On||(On=function(i,s,o){return i.apply(s,o)});nt||(nt=function(i){return i});Bt||(Bt=function(i){return i});qn||(qn=function(i,s){return new i(...s)});const Do=Tt(Array.prototype.forEach),Si=Tt(Array.prototype.pop),rr=Tt(Array.prototype.push),Fr=Tt(String.prototype.toLowerCase),Cn=Tt(String.prototype.toString),No=Tt(String.prototype.match),Et=Tt(String.prototype.replace),Ro=Tt(String.prototype.indexOf),Fo=Tt(String.prototype.trim),ft=Tt(RegExp.prototype.test),nr=Io(TypeError);function Tt(v){return function(i){for(var s=arguments.length,o=new Array(s>1?s-1:0),m=1;m/gm),Ho=Bt(/\${[\w\W]*}/gm),Uo=Bt(/^data-[\-\w.\u00B7-\uFFFF]/),Go=Bt(/^aria-[\-\w]+$/),ul=Bt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vo=Bt(/^(?:\w+script|data):/i),Wo=Bt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hl=Bt(/^html$/i);var _i=Object.freeze({__proto__:null,MUSTACHE_EXPR:qo,ERB_EXPR:Po,TMPLIT_EXPR:Ho,DATA_ATTR:Uo,ARIA_ATTR:Go,IS_ALLOWED_URI:ul,IS_SCRIPT_OR_DATA:Vo,ATTR_WHITESPACE:Wo,DOCTYPE_NAME:hl});const Yo=()=>typeof window>"u"?null:window,jo=function(i,s){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let o=null;const m="data-tt-policy-suffix";s&&s.hasAttribute(m)&&(o=s.getAttribute(m));const p="dompurify"+(o?"#"+o:"");try{return i.createPolicy(p,{createHTML(x){return x},createScriptURL(x){return x}})}catch{return console.warn("TrustedTypes policy "+p+" could not be created."),null}};function cl(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yo();const i=oe=>cl(oe);if(i.version="3.0.3",i.removed=[],!v||!v.document||v.document.nodeType!==9)return i.isSupported=!1,i;const s=v.document,o=s.currentScript;let{document:m}=v;const{DocumentFragment:p,HTMLTemplateElement:x,Node:w,Element:z,NodeFilter:L,NamedNodeMap:G=v.NamedNodeMap||v.MozNamedAttrMap,HTMLFormElement:K,DOMParser:ne,trustedTypes:V}=v,xe=z.prototype,ge=Dr(xe,"cloneNode"),le=Dr(xe,"nextSibling"),q=Dr(xe,"childNodes"),C=Dr(xe,"parentNode");if(typeof x=="function"){const oe=m.createElement("template");oe.content&&oe.content.ownerDocument&&(m=oe.content.ownerDocument)}let _,N="";const{implementation:D,createNodeIterator:I,createDocumentFragment:j,getElementsByTagName:re}=m,{importNode:Z}=s;let U={};i.isSupported=typeof ol=="function"&&typeof C=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:fe,ERB_EXPR:se,TMPLIT_EXPR:ze,DATA_ATTR:Pe,ARIA_ATTR:V0,IS_SCRIPT_OR_DATA:W0,ATTR_WHITESPACE:o0}=_i;let{IS_ALLOWED_URI:He}=_i,Te=null;const Mt=ye({},[...Ai,...Dn,...Nn,...Rn,...Ti]);let J=null;const Ze=ye({},[...Mi,...Fn,...zi,...Nr]);let Fe=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ve=null,pt=null,at=!0,Ct=!0,Vt=!1,u0=!0,gt=!1,it=!1,h0=!1,Lt=!1,Wt=!1,k0=!1,c0=!1,ar=!0,Yt=!1;const vt="user-content-";let jt=!0,Xt=!1,$t={},Dt=null;const S0=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ir=null;const lr=ye({},["audio","video","img","source","image","track"]);let A0=null;const Y0=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),m0="http://www.w3.org/1998/Math/MathML",T0="http://www.w3.org/2000/svg",ct="http://www.w3.org/1999/xhtml";let Zt=ct,M0=!1,Ee=null;const X=ye({},[m0,T0,ct],Cn);let Je;const sr=["application/xhtml+xml","text/html"],or="text/html";let Ue,bt=null;const j0=m.createElement("form"),ur=function(A){return A instanceof RegExp||A instanceof Function},X0=function(A){if(!(bt&&bt===A)){if((!A||typeof A!="object")&&(A={}),A=L0(A),Je=sr.indexOf(A.PARSER_MEDIA_TYPE)===-1?Je=or:Je=A.PARSER_MEDIA_TYPE,Ue=Je==="application/xhtml+xml"?Cn:Fr,Te="ALLOWED_TAGS"in A?ye({},A.ALLOWED_TAGS,Ue):Mt,J="ALLOWED_ATTR"in A?ye({},A.ALLOWED_ATTR,Ue):Ze,Ee="ALLOWED_NAMESPACES"in A?ye({},A.ALLOWED_NAMESPACES,Cn):X,A0="ADD_URI_SAFE_ATTR"in A?ye(L0(Y0),A.ADD_URI_SAFE_ATTR,Ue):Y0,ir="ADD_DATA_URI_TAGS"in A?ye(L0(lr),A.ADD_DATA_URI_TAGS,Ue):lr,Dt="FORBID_CONTENTS"in A?ye({},A.FORBID_CONTENTS,Ue):S0,Ve="FORBID_TAGS"in A?ye({},A.FORBID_TAGS,Ue):{},pt="FORBID_ATTR"in A?ye({},A.FORBID_ATTR,Ue):{},$t="USE_PROFILES"in A?A.USE_PROFILES:!1,at=A.ALLOW_ARIA_ATTR!==!1,Ct=A.ALLOW_DATA_ATTR!==!1,Vt=A.ALLOW_UNKNOWN_PROTOCOLS||!1,u0=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,gt=A.SAFE_FOR_TEMPLATES||!1,it=A.WHOLE_DOCUMENT||!1,Wt=A.RETURN_DOM||!1,k0=A.RETURN_DOM_FRAGMENT||!1,c0=A.RETURN_TRUSTED_TYPE||!1,Lt=A.FORCE_BODY||!1,ar=A.SANITIZE_DOM!==!1,Yt=A.SANITIZE_NAMED_PROPS||!1,jt=A.KEEP_CONTENT!==!1,Xt=A.IN_PLACE||!1,He=A.ALLOWED_URI_REGEXP||ul,Zt=A.NAMESPACE||ct,Fe=A.CUSTOM_ELEMENT_HANDLING||{},A.CUSTOM_ELEMENT_HANDLING&&ur(A.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Fe.tagNameCheck=A.CUSTOM_ELEMENT_HANDLING.tagNameCheck),A.CUSTOM_ELEMENT_HANDLING&&ur(A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Fe.attributeNameCheck=A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),gt&&(Ct=!1),k0&&(Wt=!0),$t&&(Te=ye({},[...Ti]),J=[],$t.html===!0&&(ye(Te,Ai),ye(J,Mi)),$t.svg===!0&&(ye(Te,Dn),ye(J,Fn),ye(J,Nr)),$t.svgFilters===!0&&(ye(Te,Nn),ye(J,Fn),ye(J,Nr)),$t.mathMl===!0&&(ye(Te,Rn),ye(J,zi),ye(J,Nr))),A.ADD_TAGS&&(Te===Mt&&(Te=L0(Te)),ye(Te,A.ADD_TAGS,Ue)),A.ADD_ATTR&&(J===Ze&&(J=L0(J)),ye(J,A.ADD_ATTR,Ue)),A.ADD_URI_SAFE_ATTR&&ye(A0,A.ADD_URI_SAFE_ATTR,Ue),A.FORBID_CONTENTS&&(Dt===S0&&(Dt=L0(Dt)),ye(Dt,A.FORBID_CONTENTS,Ue)),jt&&(Te["#text"]=!0),it&&ye(Te,["html","head","body"]),Te.table&&(ye(Te,["tbody"]),delete Ve.tbody),A.TRUSTED_TYPES_POLICY){if(typeof A.TRUSTED_TYPES_POLICY.createHTML!="function")throw nr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof A.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw nr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=A.TRUSTED_TYPES_POLICY,N=_.createHTML("")}else _===void 0&&(_=jo(V,o)),_!==null&&typeof N=="string"&&(N=_.createHTML(""));nt&&nt(A),bt=A}},tt=ye({},["mi","mo","mn","ms","mtext"]),yt=ye({},["foreignobject","desc","title","annotation-xml"]),Nt=ye({},["title","style","font","a","script"]),Kt=ye({},Dn);ye(Kt,Nn),ye(Kt,Lo);const z0=ye({},Rn);ye(z0,Oo);const Hr=function(A){let P=C(A);(!P||!P.tagName)&&(P={namespaceURI:Zt,tagName:"template"});const $=Fr(A.tagName),we=Fr(P.tagName);return Ee[A.namespaceURI]?A.namespaceURI===T0?P.namespaceURI===ct?$==="svg":P.namespaceURI===m0?$==="svg"&&(we==="annotation-xml"||tt[we]):!!Kt[$]:A.namespaceURI===m0?P.namespaceURI===ct?$==="math":P.namespaceURI===T0?$==="math"&&yt[we]:!!z0[$]:A.namespaceURI===ct?P.namespaceURI===T0&&!yt[we]||P.namespaceURI===m0&&!tt[we]?!1:!z0[$]&&(Nt[$]||!Kt[$]):!!(Je==="application/xhtml+xml"&&Ee[A.namespaceURI]):!1},Ot=function(A){rr(i.removed,{element:A});try{A.parentNode.removeChild(A)}catch{A.remove()}},$0=function(A,P){try{rr(i.removed,{attribute:P.getAttributeNode(A),from:P})}catch{rr(i.removed,{attribute:null,from:P})}if(P.removeAttribute(A),A==="is"&&!J[A])if(Wt||k0)try{Ot(P)}catch{}else try{P.setAttribute(A,"")}catch{}},d0=function(A){let P,$;if(Lt)A=""+A;else{const qe=No(A,/^[\r\n\t ]+/);$=qe&&qe[0]}Je==="application/xhtml+xml"&&Zt===ct&&(A=''+A+"");const we=_?_.createHTML(A):A;if(Zt===ct)try{P=new ne().parseFromString(we,Je)}catch{}if(!P||!P.documentElement){P=D.createDocument(Zt,"template",null);try{P.documentElement.innerHTML=M0?N:we}catch{}}const k=P.body||P.documentElement;return A&&$&&k.insertBefore(m.createTextNode($),k.childNodes[0]||null),Zt===ct?re.call(P,it?"html":"body")[0]:it?P.documentElement:k},Ne=function(A){return I.call(A.ownerDocument||A,A,L.SHOW_ELEMENT|L.SHOW_COMMENT|L.SHOW_TEXT,null,!1)},l=function(A){return A instanceof K&&(typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||!(A.attributes instanceof G)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function")},c=function(A){return typeof w=="object"?A instanceof w:A&&typeof A=="object"&&typeof A.nodeType=="number"&&typeof A.nodeName=="string"},H=function(A,P,$){U[A]&&Do(U[A],we=>{we.call(i,P,$,bt)})},f=function(A){let P;if(H("beforeSanitizeElements",A,null),l(A))return Ot(A),!0;const $=Ue(A.nodeName);if(H("uponSanitizeElement",A,{tagName:$,allowedTags:Te}),A.hasChildNodes()&&!c(A.firstElementChild)&&(!c(A.content)||!c(A.content.firstElementChild))&&ft(/<[/\w]/g,A.innerHTML)&&ft(/<[/\w]/g,A.textContent))return Ot(A),!0;if(!Te[$]||Ve[$]){if(!Ve[$]&&Be($)&&(Fe.tagNameCheck instanceof RegExp&&ft(Fe.tagNameCheck,$)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck($)))return!1;if(jt&&!Dt[$]){const we=C(A)||A.parentNode,k=q(A)||A.childNodes;if(k&&we){const qe=k.length;for(let M=qe-1;M>=0;--M)we.insertBefore(ge(k[M],!0),le(A))}}return Ot(A),!0}return A instanceof z&&!Hr(A)||($==="noscript"||$==="noembed")&&ft(/<\/no(script|embed)/i,A.innerHTML)?(Ot(A),!0):(gt&&A.nodeType===3&&(P=A.textContent,P=Et(P,fe," "),P=Et(P,se," "),P=Et(P,ze," "),A.textContent!==P&&(rr(i.removed,{element:A.cloneNode()}),A.textContent=P)),H("afterSanitizeElements",A,null),!1)},S=function(A,P,$){if(ar&&(P==="id"||P==="name")&&($ in m||$ in j0))return!1;if(!(Ct&&!pt[P]&&ft(Pe,P))){if(!(at&&ft(V0,P))){if(!J[P]||pt[P]){if(!(Be(A)&&(Fe.tagNameCheck instanceof RegExp&&ft(Fe.tagNameCheck,A)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(A))&&(Fe.attributeNameCheck instanceof RegExp&&ft(Fe.attributeNameCheck,P)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(P))||P==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&ft(Fe.tagNameCheck,$)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck($))))return!1}else if(!A0[P]){if(!ft(He,Et($,o0,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&A!=="script"&&Ro($,"data:")===0&&ir[A])){if(!(Vt&&!ft(W0,Et($,o0,"")))){if($)return!1}}}}}}return!0},Be=function(A){return A.indexOf("-")>0},te=function(A){let P,$,we,k;H("beforeSanitizeAttributes",A,null);const{attributes:qe}=A;if(!qe)return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J};for(k=qe.length;k--;){P=qe[k];const{name:mt,namespaceURI:_0}=P;if($=mt==="value"?P.value:Fo(P.value),we=Ue(mt),M.attrName=we,M.attrValue=$,M.keepAttr=!0,M.forceKeepAttr=void 0,H("uponSanitizeAttribute",A,M),$=M.attrValue,M.forceKeepAttr||($0(mt,A),!M.keepAttr))continue;if(!u0&&ft(/\/>/i,$)){$0(mt,A);continue}gt&&($=Et($,fe," "),$=Et($,se," "),$=Et($,ze," "));const E0=Ue(A.nodeName);if(S(E0,we,$)){if(Yt&&(we==="id"||we==="name")&&($0(mt,A),$=vt+$),_&&typeof V=="object"&&typeof V.getAttributeType=="function"&&!_0)switch(V.getAttributeType(E0,we)){case"TrustedHTML":{$=_.createHTML($);break}case"TrustedScriptURL":{$=_.createScriptURL($);break}}try{_0?A.setAttributeNS(_0,mt,$):A.setAttribute(mt,$),Si(i.removed)}catch{}}}H("afterSanitizeAttributes",A,null)},Ke=function oe(A){let P;const $=Ne(A);for(H("beforeSanitizeShadowDOM",A,null);P=$.nextNode();)H("uponSanitizeShadowNode",P,null),!f(P)&&(P.content instanceof p&&oe(P.content),te(P));H("afterSanitizeShadowDOM",A,null)};return i.sanitize=function(oe){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P,$,we,k;if(M0=!oe,M0&&(oe=""),typeof oe!="string"&&!c(oe))if(typeof oe.toString=="function"){if(oe=oe.toString(),typeof oe!="string")throw nr("dirty is not a string, aborting")}else throw nr("toString is not a function");if(!i.isSupported)return oe;if(h0||X0(A),i.removed=[],typeof oe=="string"&&(Xt=!1),Xt){if(oe.nodeName){const mt=Ue(oe.nodeName);if(!Te[mt]||Ve[mt])throw nr("root node is forbidden and cannot be sanitized in-place")}}else if(oe instanceof w)P=d0(""),$=P.ownerDocument.importNode(oe,!0),$.nodeType===1&&$.nodeName==="BODY"||$.nodeName==="HTML"?P=$:P.appendChild($);else{if(!Wt&&!gt&&!it&&oe.indexOf("<")===-1)return _&&c0?_.createHTML(oe):oe;if(P=d0(oe),!P)return Wt?null:c0?N:""}P&&Lt&&Ot(P.firstChild);const qe=Ne(Xt?oe:P);for(;we=qe.nextNode();)f(we)||(we.content instanceof p&&Ke(we.content),te(we));if(Xt)return oe;if(Wt){if(k0)for(k=j.call(P.ownerDocument);P.firstChild;)k.appendChild(P.firstChild);else k=P;return(J.shadowroot||J.shadowrootmod)&&(k=Z.call(s,k,!0)),k}let M=it?P.outerHTML:P.innerHTML;return it&&Te["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&ft(hl,P.ownerDocument.doctype.name)&&(M=" +`+M),gt&&(M=Et(M,fe," "),M=Et(M,se," "),M=Et(M,ze," ")),_&&c0?_.createHTML(M):M},i.setConfig=function(oe){X0(oe),h0=!0},i.clearConfig=function(){bt=null,h0=!1},i.isValidAttribute=function(oe,A,P){bt||X0({});const $=Ue(oe),we=Ue(A);return S($,we,P)},i.addHook=function(oe,A){typeof A=="function"&&(U[oe]=U[oe]||[],rr(U[oe],A))},i.removeHook=function(oe){if(U[oe])return Si(U[oe])},i.removeHooks=function(oe){U[oe]&&(U[oe]=[])},i.removeAllHooks=function(){U={}},i}var Ei=cl(),ml={exports:{}},In={exports:{}},Bi;function Xo(){return Bi||(Bi=1,function(v,i){(function(o,m){v.exports=m()})(typeof self<"u"?self:Ir,function(){return function(){var s={};(function(){s.d=function(u,e){for(var t in e)s.o(e,t)&&!s.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:e[t]})}})(),function(){s.o=function(u,e){return Object.prototype.hasOwnProperty.call(u,e)}}();var o={};s.d(o,{default:function(){return Ds}});var m=function u(e,t){this.position=void 0;var r="KaTeX parse error: "+e,n,a=t&&t.loc;if(a&&a.start<=a.end){var h=a.lexer.input;n=a.start;var d=a.end;n===h.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var g=h.slice(n,d).replace(/[^]/g,"$&̲"),y;n>15?y="…"+h.slice(n-15,n):y=h.slice(0,n);var T;d+15":">","<":"<",'"':""","'":"'"},K=/[&><"']/g;function ne(u){return String(u).replace(K,function(e){return G[e]})}var V=function u(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?u(e.body[0]):e:e.type==="font"?u(e.body):e},xe=function(e){var t=V(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},ge=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},le=function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return t!=null?t[1]:"_relative"},q={contains:x,deflt:w,escape:ne,hyphenate:L,getBaseElem:V,isCharacterBox:xe,protocolFromUrl:le},C={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:function(e){return"#"+e}},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:function(e,t){return t.push(e),t}},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:function(e){return Math.max(0,e)},cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:function(e){return Math.max(0,e)},cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:function(e){return Math.max(0,e)},cli:"-e, --max-expand ",cliProcessor:function(e){return e==="Infinity"?1/0:parseInt(e)}},globalGroup:{type:"boolean",cli:!1}};function _(u){if(u.default)return u.default;var e=u.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}var N=function(){function u(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var r in C)if(C.hasOwnProperty(r)){var n=C[r];this[r]=t[r]!==void 0?n.processor?n.processor(t[r]):t[r]:_(n)}}var e=u.prototype;return e.reportNonstrict=function(r,n,a){var h=this.strict;if(typeof h=="function"&&(h=h(r,n,a)),!(!h||h==="ignore")){if(h===!0||h==="error")throw new p("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+r+"]"),a);h==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+r+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+h+"': "+n+" ["+r+"]"))}},e.useStrictBehavior=function(r,n,a){var h=this.strict;if(typeof h=="function")try{h=h(r,n,a)}catch{h="error"}return!h||h==="ignore"?!1:h===!0||h==="error"?!0:h==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+r+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+h+"': "+n+" ["+r+"]")),!1)},e.isTrusted=function(r){r.url&&!r.protocol&&(r.protocol=q.protocolFromUrl(r.url));var n=typeof this.trust=="function"?this.trust(r):this.trust;return!!n},u}(),D=function(){function u(t,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=r,this.cramped=n}var e=u.prototype;return e.sup=function(){return Pe[V0[this.id]]},e.sub=function(){return Pe[W0[this.id]]},e.fracNum=function(){return Pe[o0[this.id]]},e.fracDen=function(){return Pe[He[this.id]]},e.cramp=function(){return Pe[Te[this.id]]},e.text=function(){return Pe[Mt[this.id]]},e.isTight=function(){return this.size>=2},u}(),I=0,j=1,re=2,Z=3,U=4,fe=5,se=6,ze=7,Pe=[new D(I,0,!1),new D(j,0,!0),new D(re,1,!1),new D(Z,1,!0),new D(U,2,!1),new D(fe,2,!0),new D(se,3,!1),new D(ze,3,!0)],V0=[U,fe,U,fe,se,ze,se,ze],W0=[fe,fe,fe,fe,ze,ze,ze,ze],o0=[re,Z,U,fe,se,ze,se,ze],He=[Z,Z,fe,fe,ze,ze,ze,ze],Te=[j,j,Z,Z,fe,fe,ze,ze],Mt=[I,j,re,Z,re,Z,re,Z],J={DISPLAY:Pe[I],TEXT:Pe[re],SCRIPT:Pe[U],SCRIPTSCRIPT:Pe[se]},Ze=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Fe(u){for(var e=0;e=n[0]&&u<=n[1])return t.name}return null}var Ve=[];Ze.forEach(function(u){return u.blocks.forEach(function(e){return Ve.push.apply(Ve,e)})});function pt(u){for(var e=0;e=Ve[e]&&u<=Ve[e+1])return!0;return!1}var at=80,Ct=function(e,t){return"M95,"+(622+e+t)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+e/2.075+" -"+e+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+e)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Vt=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+e/2.084+" -"+e+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+e)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},u0=function(e,t){return"M983 "+(10+e+t)+` +l`+e/3.13+" -"+e+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},gt=function(e,t){return"M424,"+(2398+e+t)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+e)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+` +h400000v`+(40+e)+"h-400000z"},it=function(e,t){return"M473,"+(2713+e+t)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},h0=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},Lt=function(e,t,r){var n=r-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+` +H742v`+n+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},Wt=function(e,t,r){t=1e3*t;var n="";switch(e){case"sqrtMain":n=Ct(t,at);break;case"sqrtSize1":n=Vt(t,at);break;case"sqrtSize2":n=u0(t,at);break;case"sqrtSize3":n=gt(t,at);break;case"sqrtSize4":n=it(t,at);break;case"sqrtTall":n=Lt(t,at,r)}return n},k0=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},c0={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z +M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ar=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z +M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z +M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z +M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}},Yt=function(){function u(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var e=u.prototype;return e.hasClass=function(r){return q.contains(this.classes,r)},e.toNode=function(){for(var r=document.createDocumentFragment(),n=0;n=5?e=0:u>=3?e=1:e=2,!S0[e]){var t=S0[e]={cssEmPerMu:jt.quad[e]/18};for(var r in jt)jt.hasOwnProperty(r)&&(t[r]=jt[r][e])}return S0[e]}var lr=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],A0=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Y0=function(e,t){return t.size<2?e:lr[e-1][t.size-1]},m0=function(){function u(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||u.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=A0[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}var e=u.prototype;return e.extend=function(r){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in r)r.hasOwnProperty(a)&&(n[a]=r[a]);return new u(n)},e.havingStyle=function(r){return this.style===r?this:this.extend({style:r,size:Y0(this.textSize,r)})},e.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},e.havingSize=function(r){return this.size===r&&this.textSize===r?this:this.extend({style:this.style.text(),size:r,textSize:r,sizeMultiplier:A0[r-1]})},e.havingBaseStyle=function(r){r=r||this.style.text();var n=Y0(u.BASESIZE,r);return this.size===n&&this.textSize===u.BASESIZE&&this.style===r?this:this.extend({style:r,size:n})},e.havingBaseSizing=function(){var r;switch(this.style.id){case 4:case 5:r=3;break;case 6:case 7:r=1;break;default:r=6}return this.extend({style:this.style.text(),size:r})},e.withColor=function(r){return this.extend({color:r})},e.withPhantom=function(){return this.extend({phantom:!0})},e.withFont=function(r){return this.extend({font:r})},e.withTextFontFamily=function(r){return this.extend({fontFamily:r,font:""})},e.withTextFontWeight=function(r){return this.extend({fontWeight:r,font:""})},e.withTextFontShape=function(r){return this.extend({fontShape:r,font:""})},e.sizingClasses=function(r){return r.size!==this.size?["sizing","reset-size"+r.size,"size"+this.size]:[]},e.baseSizingClasses=function(){return this.size!==u.BASESIZE?["sizing","reset-size"+this.size,"size"+u.BASESIZE]:[]},e.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=ir(this.size)),this._fontMetrics},e.getColor=function(){return this.phantom?"transparent":this.color},u}();m0.BASESIZE=6;var T0=m0,ct={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Zt={ex:!0,em:!0,mu:!0},M0=function(e){return typeof e!="string"&&(e=e.unit),e in ct||e in Zt||e==="ex"},Ee=function(e,t){var r;if(e.unit in ct)r=ct[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var n;if(t.style.isTight()?n=t.havingStyle(t.style.text()):n=t,e.unit==="ex")r=n.fontMetrics().xHeight;else if(e.unit==="em")r=n.fontMetrics().quad;else throw new p("Invalid unit: '"+e.unit+"'");n!==t&&(r*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},X=function(e){return+e.toFixed(4)+"em"},Je=function(e){return e.filter(function(t){return t}).join(" ")},sr=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},or=function(e){var t=document.createElement(e);t.className=Je(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var a=0;a",t},bt=function(){function u(t,r,n,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,sr.call(this,t,n,a),this.children=r||[]}var e=u.prototype;return e.setAttribute=function(r,n){this.attributes[r]=n},e.hasClass=function(r){return q.contains(this.classes,r)},e.toNode=function(){return or.call(this,"span")},e.toMarkup=function(){return Ue.call(this,"span")},u}(),j0=function(){function u(t,r,n,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,sr.call(this,r,a),this.children=n||[],this.setAttribute("href",t)}var e=u.prototype;return e.setAttribute=function(r,n){this.attributes[r]=n},e.hasClass=function(r){return q.contains(this.classes,r)},e.toNode=function(){return or.call(this,"a")},e.toMarkup=function(){return Ue.call(this,"a")},u}(),ur=function(){function u(t,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=t,this.classes=["mord"],this.style=n}var e=u.prototype;return e.hasClass=function(r){return q.contains(this.classes,r)},e.toNode=function(){var r=document.createElement("img");r.src=this.src,r.alt=this.alt,r.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);return r},e.toMarkup=function(){var r=""+this.alt+"0&&(n=document.createElement("span"),n.style.marginRight=X(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Je(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(n=n||document.createElement("span"),n.style[a]=this.style[a]);return n?(n.appendChild(r),n):r},e.toMarkup=function(){var r=!1,n="0&&(a+="margin-right:"+this.italic+"em;");for(var h in this.style)this.style.hasOwnProperty(h)&&(a+=q.hyphenate(h)+":"+this.style[h]+";");a&&(r=!0,n+=' style="'+q.escape(a)+'"');var d=q.escape(this.text);return r?(n+=">",n+=d,n+="",n):d},u}(),yt=function(){function u(t,r){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=r||{}}var e=u.prototype;return e.toNode=function(){var r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);for(var h=0;h":""},u}(),Kt=function(){function u(t){this.attributes=void 0,this.attributes=t||{}}var e=u.prototype;return e.toNode=function(){var r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);return n},e.toMarkup=function(){var r=" but got "+String(u)+".")}var Ot={bin:1,close:1,inner:1,open:1,punct:1,rel:1},$0={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},d0={math:{},text:{}},Ne=d0;function l(u,e,t,r,n,a){d0[u][n]={font:e,group:t,replace:r},a&&r&&(d0[u][r]=d0[u][n])}var c="math",H="text",f="main",S="ams",Be="accent-token",te="bin",Ke="close",oe="inner",A="mathord",P="op-token",$="open",we="punct",k="rel",qe="spacing",M="textord";l(c,f,k,"≡","\\equiv",!0),l(c,f,k,"≺","\\prec",!0),l(c,f,k,"≻","\\succ",!0),l(c,f,k,"∼","\\sim",!0),l(c,f,k,"⊥","\\perp"),l(c,f,k,"⪯","\\preceq",!0),l(c,f,k,"⪰","\\succeq",!0),l(c,f,k,"≃","\\simeq",!0),l(c,f,k,"∣","\\mid",!0),l(c,f,k,"≪","\\ll",!0),l(c,f,k,"≫","\\gg",!0),l(c,f,k,"≍","\\asymp",!0),l(c,f,k,"∥","\\parallel"),l(c,f,k,"⋈","\\bowtie",!0),l(c,f,k,"⌣","\\smile",!0),l(c,f,k,"⊑","\\sqsubseteq",!0),l(c,f,k,"⊒","\\sqsupseteq",!0),l(c,f,k,"≐","\\doteq",!0),l(c,f,k,"⌢","\\frown",!0),l(c,f,k,"∋","\\ni",!0),l(c,f,k,"∝","\\propto",!0),l(c,f,k,"⊢","\\vdash",!0),l(c,f,k,"⊣","\\dashv",!0),l(c,f,k,"∋","\\owns"),l(c,f,we,".","\\ldotp"),l(c,f,we,"⋅","\\cdotp"),l(c,f,M,"#","\\#"),l(H,f,M,"#","\\#"),l(c,f,M,"&","\\&"),l(H,f,M,"&","\\&"),l(c,f,M,"ℵ","\\aleph",!0),l(c,f,M,"∀","\\forall",!0),l(c,f,M,"ℏ","\\hbar",!0),l(c,f,M,"∃","\\exists",!0),l(c,f,M,"∇","\\nabla",!0),l(c,f,M,"♭","\\flat",!0),l(c,f,M,"ℓ","\\ell",!0),l(c,f,M,"♮","\\natural",!0),l(c,f,M,"♣","\\clubsuit",!0),l(c,f,M,"℘","\\wp",!0),l(c,f,M,"♯","\\sharp",!0),l(c,f,M,"♢","\\diamondsuit",!0),l(c,f,M,"ℜ","\\Re",!0),l(c,f,M,"♡","\\heartsuit",!0),l(c,f,M,"ℑ","\\Im",!0),l(c,f,M,"♠","\\spadesuit",!0),l(c,f,M,"§","\\S",!0),l(H,f,M,"§","\\S"),l(c,f,M,"¶","\\P",!0),l(H,f,M,"¶","\\P"),l(c,f,M,"†","\\dag"),l(H,f,M,"†","\\dag"),l(H,f,M,"†","\\textdagger"),l(c,f,M,"‡","\\ddag"),l(H,f,M,"‡","\\ddag"),l(H,f,M,"‡","\\textdaggerdbl"),l(c,f,Ke,"⎱","\\rmoustache",!0),l(c,f,$,"⎰","\\lmoustache",!0),l(c,f,Ke,"⟯","\\rgroup",!0),l(c,f,$,"⟮","\\lgroup",!0),l(c,f,te,"∓","\\mp",!0),l(c,f,te,"⊖","\\ominus",!0),l(c,f,te,"⊎","\\uplus",!0),l(c,f,te,"⊓","\\sqcap",!0),l(c,f,te,"∗","\\ast"),l(c,f,te,"⊔","\\sqcup",!0),l(c,f,te,"◯","\\bigcirc",!0),l(c,f,te,"∙","\\bullet",!0),l(c,f,te,"‡","\\ddagger"),l(c,f,te,"≀","\\wr",!0),l(c,f,te,"⨿","\\amalg"),l(c,f,te,"&","\\And"),l(c,f,k,"⟵","\\longleftarrow",!0),l(c,f,k,"⇐","\\Leftarrow",!0),l(c,f,k,"⟸","\\Longleftarrow",!0),l(c,f,k,"⟶","\\longrightarrow",!0),l(c,f,k,"⇒","\\Rightarrow",!0),l(c,f,k,"⟹","\\Longrightarrow",!0),l(c,f,k,"↔","\\leftrightarrow",!0),l(c,f,k,"⟷","\\longleftrightarrow",!0),l(c,f,k,"⇔","\\Leftrightarrow",!0),l(c,f,k,"⟺","\\Longleftrightarrow",!0),l(c,f,k,"↦","\\mapsto",!0),l(c,f,k,"⟼","\\longmapsto",!0),l(c,f,k,"↗","\\nearrow",!0),l(c,f,k,"↩","\\hookleftarrow",!0),l(c,f,k,"↪","\\hookrightarrow",!0),l(c,f,k,"↘","\\searrow",!0),l(c,f,k,"↼","\\leftharpoonup",!0),l(c,f,k,"⇀","\\rightharpoonup",!0),l(c,f,k,"↙","\\swarrow",!0),l(c,f,k,"↽","\\leftharpoondown",!0),l(c,f,k,"⇁","\\rightharpoondown",!0),l(c,f,k,"↖","\\nwarrow",!0),l(c,f,k,"⇌","\\rightleftharpoons",!0),l(c,S,k,"≮","\\nless",!0),l(c,S,k,"","\\@nleqslant"),l(c,S,k,"","\\@nleqq"),l(c,S,k,"⪇","\\lneq",!0),l(c,S,k,"≨","\\lneqq",!0),l(c,S,k,"","\\@lvertneqq"),l(c,S,k,"⋦","\\lnsim",!0),l(c,S,k,"⪉","\\lnapprox",!0),l(c,S,k,"⊀","\\nprec",!0),l(c,S,k,"⋠","\\npreceq",!0),l(c,S,k,"⋨","\\precnsim",!0),l(c,S,k,"⪹","\\precnapprox",!0),l(c,S,k,"≁","\\nsim",!0),l(c,S,k,"","\\@nshortmid"),l(c,S,k,"∤","\\nmid",!0),l(c,S,k,"⊬","\\nvdash",!0),l(c,S,k,"⊭","\\nvDash",!0),l(c,S,k,"⋪","\\ntriangleleft"),l(c,S,k,"⋬","\\ntrianglelefteq",!0),l(c,S,k,"⊊","\\subsetneq",!0),l(c,S,k,"","\\@varsubsetneq"),l(c,S,k,"⫋","\\subsetneqq",!0),l(c,S,k,"","\\@varsubsetneqq"),l(c,S,k,"≯","\\ngtr",!0),l(c,S,k,"","\\@ngeqslant"),l(c,S,k,"","\\@ngeqq"),l(c,S,k,"⪈","\\gneq",!0),l(c,S,k,"≩","\\gneqq",!0),l(c,S,k,"","\\@gvertneqq"),l(c,S,k,"⋧","\\gnsim",!0),l(c,S,k,"⪊","\\gnapprox",!0),l(c,S,k,"⊁","\\nsucc",!0),l(c,S,k,"⋡","\\nsucceq",!0),l(c,S,k,"⋩","\\succnsim",!0),l(c,S,k,"⪺","\\succnapprox",!0),l(c,S,k,"≆","\\ncong",!0),l(c,S,k,"","\\@nshortparallel"),l(c,S,k,"∦","\\nparallel",!0),l(c,S,k,"⊯","\\nVDash",!0),l(c,S,k,"⋫","\\ntriangleright"),l(c,S,k,"⋭","\\ntrianglerighteq",!0),l(c,S,k,"","\\@nsupseteqq"),l(c,S,k,"⊋","\\supsetneq",!0),l(c,S,k,"","\\@varsupsetneq"),l(c,S,k,"⫌","\\supsetneqq",!0),l(c,S,k,"","\\@varsupsetneqq"),l(c,S,k,"⊮","\\nVdash",!0),l(c,S,k,"⪵","\\precneqq",!0),l(c,S,k,"⪶","\\succneqq",!0),l(c,S,k,"","\\@nsubseteqq"),l(c,S,te,"⊴","\\unlhd"),l(c,S,te,"⊵","\\unrhd"),l(c,S,k,"↚","\\nleftarrow",!0),l(c,S,k,"↛","\\nrightarrow",!0),l(c,S,k,"⇍","\\nLeftarrow",!0),l(c,S,k,"⇏","\\nRightarrow",!0),l(c,S,k,"↮","\\nleftrightarrow",!0),l(c,S,k,"⇎","\\nLeftrightarrow",!0),l(c,S,k,"△","\\vartriangle"),l(c,S,M,"ℏ","\\hslash"),l(c,S,M,"▽","\\triangledown"),l(c,S,M,"◊","\\lozenge"),l(c,S,M,"Ⓢ","\\circledS"),l(c,S,M,"®","\\circledR"),l(H,S,M,"®","\\circledR"),l(c,S,M,"∡","\\measuredangle",!0),l(c,S,M,"∄","\\nexists"),l(c,S,M,"℧","\\mho"),l(c,S,M,"Ⅎ","\\Finv",!0),l(c,S,M,"⅁","\\Game",!0),l(c,S,M,"‵","\\backprime"),l(c,S,M,"▲","\\blacktriangle"),l(c,S,M,"▼","\\blacktriangledown"),l(c,S,M,"■","\\blacksquare"),l(c,S,M,"⧫","\\blacklozenge"),l(c,S,M,"★","\\bigstar"),l(c,S,M,"∢","\\sphericalangle",!0),l(c,S,M,"∁","\\complement",!0),l(c,S,M,"ð","\\eth",!0),l(H,f,M,"ð","ð"),l(c,S,M,"╱","\\diagup"),l(c,S,M,"╲","\\diagdown"),l(c,S,M,"□","\\square"),l(c,S,M,"□","\\Box"),l(c,S,M,"◊","\\Diamond"),l(c,S,M,"¥","\\yen",!0),l(H,S,M,"¥","\\yen",!0),l(c,S,M,"✓","\\checkmark",!0),l(H,S,M,"✓","\\checkmark"),l(c,S,M,"ℶ","\\beth",!0),l(c,S,M,"ℸ","\\daleth",!0),l(c,S,M,"ℷ","\\gimel",!0),l(c,S,M,"ϝ","\\digamma",!0),l(c,S,M,"ϰ","\\varkappa"),l(c,S,$,"┌","\\@ulcorner",!0),l(c,S,Ke,"┐","\\@urcorner",!0),l(c,S,$,"└","\\@llcorner",!0),l(c,S,Ke,"┘","\\@lrcorner",!0),l(c,S,k,"≦","\\leqq",!0),l(c,S,k,"⩽","\\leqslant",!0),l(c,S,k,"⪕","\\eqslantless",!0),l(c,S,k,"≲","\\lesssim",!0),l(c,S,k,"⪅","\\lessapprox",!0),l(c,S,k,"≊","\\approxeq",!0),l(c,S,te,"⋖","\\lessdot"),l(c,S,k,"⋘","\\lll",!0),l(c,S,k,"≶","\\lessgtr",!0),l(c,S,k,"⋚","\\lesseqgtr",!0),l(c,S,k,"⪋","\\lesseqqgtr",!0),l(c,S,k,"≑","\\doteqdot"),l(c,S,k,"≓","\\risingdotseq",!0),l(c,S,k,"≒","\\fallingdotseq",!0),l(c,S,k,"∽","\\backsim",!0),l(c,S,k,"⋍","\\backsimeq",!0),l(c,S,k,"⫅","\\subseteqq",!0),l(c,S,k,"⋐","\\Subset",!0),l(c,S,k,"⊏","\\sqsubset",!0),l(c,S,k,"≼","\\preccurlyeq",!0),l(c,S,k,"⋞","\\curlyeqprec",!0),l(c,S,k,"≾","\\precsim",!0),l(c,S,k,"⪷","\\precapprox",!0),l(c,S,k,"⊲","\\vartriangleleft"),l(c,S,k,"⊴","\\trianglelefteq"),l(c,S,k,"⊨","\\vDash",!0),l(c,S,k,"⊪","\\Vvdash",!0),l(c,S,k,"⌣","\\smallsmile"),l(c,S,k,"⌢","\\smallfrown"),l(c,S,k,"≏","\\bumpeq",!0),l(c,S,k,"≎","\\Bumpeq",!0),l(c,S,k,"≧","\\geqq",!0),l(c,S,k,"⩾","\\geqslant",!0),l(c,S,k,"⪖","\\eqslantgtr",!0),l(c,S,k,"≳","\\gtrsim",!0),l(c,S,k,"⪆","\\gtrapprox",!0),l(c,S,te,"⋗","\\gtrdot"),l(c,S,k,"⋙","\\ggg",!0),l(c,S,k,"≷","\\gtrless",!0),l(c,S,k,"⋛","\\gtreqless",!0),l(c,S,k,"⪌","\\gtreqqless",!0),l(c,S,k,"≖","\\eqcirc",!0),l(c,S,k,"≗","\\circeq",!0),l(c,S,k,"≜","\\triangleq",!0),l(c,S,k,"∼","\\thicksim"),l(c,S,k,"≈","\\thickapprox"),l(c,S,k,"⫆","\\supseteqq",!0),l(c,S,k,"⋑","\\Supset",!0),l(c,S,k,"⊐","\\sqsupset",!0),l(c,S,k,"≽","\\succcurlyeq",!0),l(c,S,k,"⋟","\\curlyeqsucc",!0),l(c,S,k,"≿","\\succsim",!0),l(c,S,k,"⪸","\\succapprox",!0),l(c,S,k,"⊳","\\vartriangleright"),l(c,S,k,"⊵","\\trianglerighteq"),l(c,S,k,"⊩","\\Vdash",!0),l(c,S,k,"∣","\\shortmid"),l(c,S,k,"∥","\\shortparallel"),l(c,S,k,"≬","\\between",!0),l(c,S,k,"⋔","\\pitchfork",!0),l(c,S,k,"∝","\\varpropto"),l(c,S,k,"◀","\\blacktriangleleft"),l(c,S,k,"∴","\\therefore",!0),l(c,S,k,"∍","\\backepsilon"),l(c,S,k,"▶","\\blacktriangleright"),l(c,S,k,"∵","\\because",!0),l(c,S,k,"⋘","\\llless"),l(c,S,k,"⋙","\\gggtr"),l(c,S,te,"⊲","\\lhd"),l(c,S,te,"⊳","\\rhd"),l(c,S,k,"≂","\\eqsim",!0),l(c,f,k,"⋈","\\Join"),l(c,S,k,"≑","\\Doteq",!0),l(c,S,te,"∔","\\dotplus",!0),l(c,S,te,"∖","\\smallsetminus"),l(c,S,te,"⋒","\\Cap",!0),l(c,S,te,"⋓","\\Cup",!0),l(c,S,te,"⩞","\\doublebarwedge",!0),l(c,S,te,"⊟","\\boxminus",!0),l(c,S,te,"⊞","\\boxplus",!0),l(c,S,te,"⋇","\\divideontimes",!0),l(c,S,te,"⋉","\\ltimes",!0),l(c,S,te,"⋊","\\rtimes",!0),l(c,S,te,"⋋","\\leftthreetimes",!0),l(c,S,te,"⋌","\\rightthreetimes",!0),l(c,S,te,"⋏","\\curlywedge",!0),l(c,S,te,"⋎","\\curlyvee",!0),l(c,S,te,"⊝","\\circleddash",!0),l(c,S,te,"⊛","\\circledast",!0),l(c,S,te,"⋅","\\centerdot"),l(c,S,te,"⊺","\\intercal",!0),l(c,S,te,"⋒","\\doublecap"),l(c,S,te,"⋓","\\doublecup"),l(c,S,te,"⊠","\\boxtimes",!0),l(c,S,k,"⇢","\\dashrightarrow",!0),l(c,S,k,"⇠","\\dashleftarrow",!0),l(c,S,k,"⇇","\\leftleftarrows",!0),l(c,S,k,"⇆","\\leftrightarrows",!0),l(c,S,k,"⇚","\\Lleftarrow",!0),l(c,S,k,"↞","\\twoheadleftarrow",!0),l(c,S,k,"↢","\\leftarrowtail",!0),l(c,S,k,"↫","\\looparrowleft",!0),l(c,S,k,"⇋","\\leftrightharpoons",!0),l(c,S,k,"↶","\\curvearrowleft",!0),l(c,S,k,"↺","\\circlearrowleft",!0),l(c,S,k,"↰","\\Lsh",!0),l(c,S,k,"⇈","\\upuparrows",!0),l(c,S,k,"↿","\\upharpoonleft",!0),l(c,S,k,"⇃","\\downharpoonleft",!0),l(c,f,k,"⊶","\\origof",!0),l(c,f,k,"⊷","\\imageof",!0),l(c,S,k,"⊸","\\multimap",!0),l(c,S,k,"↭","\\leftrightsquigarrow",!0),l(c,S,k,"⇉","\\rightrightarrows",!0),l(c,S,k,"⇄","\\rightleftarrows",!0),l(c,S,k,"↠","\\twoheadrightarrow",!0),l(c,S,k,"↣","\\rightarrowtail",!0),l(c,S,k,"↬","\\looparrowright",!0),l(c,S,k,"↷","\\curvearrowright",!0),l(c,S,k,"↻","\\circlearrowright",!0),l(c,S,k,"↱","\\Rsh",!0),l(c,S,k,"⇊","\\downdownarrows",!0),l(c,S,k,"↾","\\upharpoonright",!0),l(c,S,k,"⇂","\\downharpoonright",!0),l(c,S,k,"⇝","\\rightsquigarrow",!0),l(c,S,k,"⇝","\\leadsto"),l(c,S,k,"⇛","\\Rrightarrow",!0),l(c,S,k,"↾","\\restriction"),l(c,f,M,"‘","`"),l(c,f,M,"$","\\$"),l(H,f,M,"$","\\$"),l(H,f,M,"$","\\textdollar"),l(c,f,M,"%","\\%"),l(H,f,M,"%","\\%"),l(c,f,M,"_","\\_"),l(H,f,M,"_","\\_"),l(H,f,M,"_","\\textunderscore"),l(c,f,M,"∠","\\angle",!0),l(c,f,M,"∞","\\infty",!0),l(c,f,M,"′","\\prime"),l(c,f,M,"△","\\triangle"),l(c,f,M,"Γ","\\Gamma",!0),l(c,f,M,"Δ","\\Delta",!0),l(c,f,M,"Θ","\\Theta",!0),l(c,f,M,"Λ","\\Lambda",!0),l(c,f,M,"Ξ","\\Xi",!0),l(c,f,M,"Π","\\Pi",!0),l(c,f,M,"Σ","\\Sigma",!0),l(c,f,M,"Υ","\\Upsilon",!0),l(c,f,M,"Φ","\\Phi",!0),l(c,f,M,"Ψ","\\Psi",!0),l(c,f,M,"Ω","\\Omega",!0),l(c,f,M,"A","Α"),l(c,f,M,"B","Β"),l(c,f,M,"E","Ε"),l(c,f,M,"Z","Ζ"),l(c,f,M,"H","Η"),l(c,f,M,"I","Ι"),l(c,f,M,"K","Κ"),l(c,f,M,"M","Μ"),l(c,f,M,"N","Ν"),l(c,f,M,"O","Ο"),l(c,f,M,"P","Ρ"),l(c,f,M,"T","Τ"),l(c,f,M,"X","Χ"),l(c,f,M,"¬","\\neg",!0),l(c,f,M,"¬","\\lnot"),l(c,f,M,"⊤","\\top"),l(c,f,M,"⊥","\\bot"),l(c,f,M,"∅","\\emptyset"),l(c,S,M,"∅","\\varnothing"),l(c,f,A,"α","\\alpha",!0),l(c,f,A,"β","\\beta",!0),l(c,f,A,"γ","\\gamma",!0),l(c,f,A,"δ","\\delta",!0),l(c,f,A,"ϵ","\\epsilon",!0),l(c,f,A,"ζ","\\zeta",!0),l(c,f,A,"η","\\eta",!0),l(c,f,A,"θ","\\theta",!0),l(c,f,A,"ι","\\iota",!0),l(c,f,A,"κ","\\kappa",!0),l(c,f,A,"λ","\\lambda",!0),l(c,f,A,"μ","\\mu",!0),l(c,f,A,"ν","\\nu",!0),l(c,f,A,"ξ","\\xi",!0),l(c,f,A,"ο","\\omicron",!0),l(c,f,A,"π","\\pi",!0),l(c,f,A,"ρ","\\rho",!0),l(c,f,A,"σ","\\sigma",!0),l(c,f,A,"τ","\\tau",!0),l(c,f,A,"υ","\\upsilon",!0),l(c,f,A,"ϕ","\\phi",!0),l(c,f,A,"χ","\\chi",!0),l(c,f,A,"ψ","\\psi",!0),l(c,f,A,"ω","\\omega",!0),l(c,f,A,"ε","\\varepsilon",!0),l(c,f,A,"ϑ","\\vartheta",!0),l(c,f,A,"ϖ","\\varpi",!0),l(c,f,A,"ϱ","\\varrho",!0),l(c,f,A,"ς","\\varsigma",!0),l(c,f,A,"φ","\\varphi",!0),l(c,f,te,"∗","*",!0),l(c,f,te,"+","+"),l(c,f,te,"−","-",!0),l(c,f,te,"⋅","\\cdot",!0),l(c,f,te,"∘","\\circ",!0),l(c,f,te,"÷","\\div",!0),l(c,f,te,"±","\\pm",!0),l(c,f,te,"×","\\times",!0),l(c,f,te,"∩","\\cap",!0),l(c,f,te,"∪","\\cup",!0),l(c,f,te,"∖","\\setminus",!0),l(c,f,te,"∧","\\land"),l(c,f,te,"∨","\\lor"),l(c,f,te,"∧","\\wedge",!0),l(c,f,te,"∨","\\vee",!0),l(c,f,M,"√","\\surd"),l(c,f,$,"⟨","\\langle",!0),l(c,f,$,"∣","\\lvert"),l(c,f,$,"∥","\\lVert"),l(c,f,Ke,"?","?"),l(c,f,Ke,"!","!"),l(c,f,Ke,"⟩","\\rangle",!0),l(c,f,Ke,"∣","\\rvert"),l(c,f,Ke,"∥","\\rVert"),l(c,f,k,"=","="),l(c,f,k,":",":"),l(c,f,k,"≈","\\approx",!0),l(c,f,k,"≅","\\cong",!0),l(c,f,k,"≥","\\ge"),l(c,f,k,"≥","\\geq",!0),l(c,f,k,"←","\\gets"),l(c,f,k,">","\\gt",!0),l(c,f,k,"∈","\\in",!0),l(c,f,k,"","\\@not"),l(c,f,k,"⊂","\\subset",!0),l(c,f,k,"⊃","\\supset",!0),l(c,f,k,"⊆","\\subseteq",!0),l(c,f,k,"⊇","\\supseteq",!0),l(c,S,k,"⊈","\\nsubseteq",!0),l(c,S,k,"⊉","\\nsupseteq",!0),l(c,f,k,"⊨","\\models"),l(c,f,k,"←","\\leftarrow",!0),l(c,f,k,"≤","\\le"),l(c,f,k,"≤","\\leq",!0),l(c,f,k,"<","\\lt",!0),l(c,f,k,"→","\\rightarrow",!0),l(c,f,k,"→","\\to"),l(c,S,k,"≱","\\ngeq",!0),l(c,S,k,"≰","\\nleq",!0),l(c,f,qe," ","\\ "),l(c,f,qe," ","\\space"),l(c,f,qe," ","\\nobreakspace"),l(H,f,qe," ","\\ "),l(H,f,qe," "," "),l(H,f,qe," ","\\space"),l(H,f,qe," ","\\nobreakspace"),l(c,f,qe,null,"\\nobreak"),l(c,f,qe,null,"\\allowbreak"),l(c,f,we,",",","),l(c,f,we,";",";"),l(c,S,te,"⊼","\\barwedge",!0),l(c,S,te,"⊻","\\veebar",!0),l(c,f,te,"⊙","\\odot",!0),l(c,f,te,"⊕","\\oplus",!0),l(c,f,te,"⊗","\\otimes",!0),l(c,f,M,"∂","\\partial",!0),l(c,f,te,"⊘","\\oslash",!0),l(c,S,te,"⊚","\\circledcirc",!0),l(c,S,te,"⊡","\\boxdot",!0),l(c,f,te,"△","\\bigtriangleup"),l(c,f,te,"▽","\\bigtriangledown"),l(c,f,te,"†","\\dagger"),l(c,f,te,"⋄","\\diamond"),l(c,f,te,"⋆","\\star"),l(c,f,te,"◃","\\triangleleft"),l(c,f,te,"▹","\\triangleright"),l(c,f,$,"{","\\{"),l(H,f,M,"{","\\{"),l(H,f,M,"{","\\textbraceleft"),l(c,f,Ke,"}","\\}"),l(H,f,M,"}","\\}"),l(H,f,M,"}","\\textbraceright"),l(c,f,$,"{","\\lbrace"),l(c,f,Ke,"}","\\rbrace"),l(c,f,$,"[","\\lbrack",!0),l(H,f,M,"[","\\lbrack",!0),l(c,f,Ke,"]","\\rbrack",!0),l(H,f,M,"]","\\rbrack",!0),l(c,f,$,"(","\\lparen",!0),l(c,f,Ke,")","\\rparen",!0),l(H,f,M,"<","\\textless",!0),l(H,f,M,">","\\textgreater",!0),l(c,f,$,"⌊","\\lfloor",!0),l(c,f,Ke,"⌋","\\rfloor",!0),l(c,f,$,"⌈","\\lceil",!0),l(c,f,Ke,"⌉","\\rceil",!0),l(c,f,M,"\\","\\backslash"),l(c,f,M,"∣","|"),l(c,f,M,"∣","\\vert"),l(H,f,M,"|","\\textbar",!0),l(c,f,M,"∥","\\|"),l(c,f,M,"∥","\\Vert"),l(H,f,M,"∥","\\textbardbl"),l(H,f,M,"~","\\textasciitilde"),l(H,f,M,"\\","\\textbackslash"),l(H,f,M,"^","\\textasciicircum"),l(c,f,k,"↑","\\uparrow",!0),l(c,f,k,"⇑","\\Uparrow",!0),l(c,f,k,"↓","\\downarrow",!0),l(c,f,k,"⇓","\\Downarrow",!0),l(c,f,k,"↕","\\updownarrow",!0),l(c,f,k,"⇕","\\Updownarrow",!0),l(c,f,P,"∐","\\coprod"),l(c,f,P,"⋁","\\bigvee"),l(c,f,P,"⋀","\\bigwedge"),l(c,f,P,"⨄","\\biguplus"),l(c,f,P,"⋂","\\bigcap"),l(c,f,P,"⋃","\\bigcup"),l(c,f,P,"∫","\\int"),l(c,f,P,"∫","\\intop"),l(c,f,P,"∬","\\iint"),l(c,f,P,"∭","\\iiint"),l(c,f,P,"∏","\\prod"),l(c,f,P,"∑","\\sum"),l(c,f,P,"⨂","\\bigotimes"),l(c,f,P,"⨁","\\bigoplus"),l(c,f,P,"⨀","\\bigodot"),l(c,f,P,"∮","\\oint"),l(c,f,P,"∯","\\oiint"),l(c,f,P,"∰","\\oiiint"),l(c,f,P,"⨆","\\bigsqcup"),l(c,f,P,"∫","\\smallint"),l(H,f,oe,"…","\\textellipsis"),l(c,f,oe,"…","\\mathellipsis"),l(H,f,oe,"…","\\ldots",!0),l(c,f,oe,"…","\\ldots",!0),l(c,f,oe,"⋯","\\@cdots",!0),l(c,f,oe,"⋱","\\ddots",!0),l(c,f,M,"⋮","\\varvdots"),l(c,f,Be,"ˊ","\\acute"),l(c,f,Be,"ˋ","\\grave"),l(c,f,Be,"¨","\\ddot"),l(c,f,Be,"~","\\tilde"),l(c,f,Be,"ˉ","\\bar"),l(c,f,Be,"˘","\\breve"),l(c,f,Be,"ˇ","\\check"),l(c,f,Be,"^","\\hat"),l(c,f,Be,"⃗","\\vec"),l(c,f,Be,"˙","\\dot"),l(c,f,Be,"˚","\\mathring"),l(c,f,A,"","\\@imath"),l(c,f,A,"","\\@jmath"),l(c,f,M,"ı","ı"),l(c,f,M,"ȷ","ȷ"),l(H,f,M,"ı","\\i",!0),l(H,f,M,"ȷ","\\j",!0),l(H,f,M,"ß","\\ss",!0),l(H,f,M,"æ","\\ae",!0),l(H,f,M,"œ","\\oe",!0),l(H,f,M,"ø","\\o",!0),l(H,f,M,"Æ","\\AE",!0),l(H,f,M,"Œ","\\OE",!0),l(H,f,M,"Ø","\\O",!0),l(H,f,Be,"ˊ","\\'"),l(H,f,Be,"ˋ","\\`"),l(H,f,Be,"ˆ","\\^"),l(H,f,Be,"˜","\\~"),l(H,f,Be,"ˉ","\\="),l(H,f,Be,"˘","\\u"),l(H,f,Be,"˙","\\."),l(H,f,Be,"¸","\\c"),l(H,f,Be,"˚","\\r"),l(H,f,Be,"ˇ","\\v"),l(H,f,Be,"¨",'\\"'),l(H,f,Be,"˝","\\H"),l(H,f,Be,"◯","\\textcircled");var mt={"--":!0,"---":!0,"``":!0,"''":!0};l(H,f,M,"–","--",!0),l(H,f,M,"–","\\textendash"),l(H,f,M,"—","---",!0),l(H,f,M,"—","\\textemdash"),l(H,f,M,"‘","`",!0),l(H,f,M,"‘","\\textquoteleft"),l(H,f,M,"’","'",!0),l(H,f,M,"’","\\textquoteright"),l(H,f,M,"“","``",!0),l(H,f,M,"“","\\textquotedblleft"),l(H,f,M,"”","''",!0),l(H,f,M,"”","\\textquotedblright"),l(c,f,M,"°","\\degree",!0),l(H,f,M,"°","\\degree"),l(H,f,M,"°","\\textdegree",!0),l(c,f,M,"£","\\pounds"),l(c,f,M,"£","\\mathsterling",!0),l(H,f,M,"£","\\pounds"),l(H,f,M,"£","\\textsterling",!0),l(c,S,M,"✠","\\maltese"),l(H,S,M,"✠","\\maltese");for(var _0='0123456789/@."',E0=0;E0<_0.length;E0++){var Ur=_0.charAt(E0);l(c,f,M,Ur,Ur)}for(var Vn='0123456789!@*()-=+";:?/.,',Gr=0;Grt&&(t=h.height),h.depth>r&&(r=h.depth),h.maxFontSize>n&&(n=h.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},st=function(e,t,r,n){var a=new bt(e,t,r,n);return jr(a),a},jn=function(e,t,r,n){return new bt(e,t,r,n)},yl=function(e,t,r){var n=st([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=X(n.height),n.maxFontSize=1,n},xl=function(e,t,r,n){var a=new j0(e,t,r,n);return jr(a),a},Xn=function(e){var t=new Yt(e);return jr(t),t},wl=function(e,t){return e instanceof Yt?st([],[e],t):e},kl=function(e){if(e.positionType==="individualShift"){for(var t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth,a=n,h=1;h0&&(a.push(yr(h,e)),h=[]),a.push(r[d]));h.length>0&&a.push(yr(h,e));var y;t?(y=yr(je(t,e,!0)),y.classes=["tag"],a.push(y)):n&&a.push(n);var T=Pt(["katex-html"],a);if(T.setAttribute("aria-hidden","true"),y){var B=y.children[0];B.style.height=X(T.height+T.depth),T.depth&&(B.style.verticalAlign=X(-T.depth))}return T}function ea(u){return new Yt(u)}var xt=function(){function u(t,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=r||[],this.classes=n||[]}var e=u.prototype;return e.setAttribute=function(r,n){this.attributes[r]=n},e.getAttribute=function(r){return this.attributes[r]},e.toNode=function(){var r=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);this.classes.length>0&&(r.className=Je(this.classes));for(var a=0;a0&&(r+=' class ="'+q.escape(Je(this.classes))+'"'),r+=">";for(var a=0;a",r},e.toText=function(){return this.children.map(function(r){return r.toText()}).join("")},u}(),K0=function(){function u(t){this.text=void 0,this.text=t}var e=u.prototype;return e.toNode=function(){return document.createTextNode(this.text)},e.toMarkup=function(){return q.escape(this.toText())},e.toText=function(){return this.text},u}(),Nl=function(){function u(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}var e=u.prototype;return e.toNode=function(){if(this.character)return document.createTextNode(this.character);var r=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return r.setAttribute("width",X(this.width)),r},e.toMarkup=function(){return this.character?""+this.character+"":''},e.toText=function(){return this.character?this.character:" "},u}(),W={MathNode:xt,TextNode:K0,SpaceNode:Nl,newDocumentFragment:ea},wt=function(e,t,r){return Ne[t][e]&&Ne[t][e].replace&&e.charCodeAt(0)!==55349&&!(mt.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=Ne[t][e].replace),new W.TextNode(e)},Zr=function(e){return e.length===1?e[0]:new W.MathNode("mrow",e)},Kr=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var r=t.font;if(!r||r==="mathnormal")return null;var n=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var a=e.text;if(q.contains(["\\imath","\\jmath"],a))return null;Ne[n][a]&&Ne[n][a].replace&&(a=Ne[n][a].replace);var h=E.fontMap[r].fontName;return Dt(a,h,n)?E.fontMap[r].variant:null},ot=function(e,t,r){if(e.length===1){var n=Ce(e[0],t);return r&&n instanceof xt&&n.type==="mo"&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var a=[],h,d=0;d0&&(O.text=O.text.slice(0,1)+"̸"+O.text.slice(1),a.pop())}}}a.push(g),h=g}return a},Jt=function(e,t,r){return Zr(ot(e,t,r))},Ce=function(e,t){if(!e)return new W.MathNode("mrow");if(vr[e.type]){var r=vr[e.type](e,t);return r}else throw new p("Got group of unknown type: '"+e.type+"'")};function ta(u,e,t,r,n){var a=ot(u,t),h;a.length===1&&a[0]instanceof xt&&q.contains(["mrow","mtable"],a[0].type)?h=a[0]:h=new W.MathNode("mrow",a);var d=new W.MathNode("annotation",[new W.TextNode(e)]);d.setAttribute("encoding","application/x-tex");var g=new W.MathNode("semantics",[h,d]),y=new W.MathNode("math",[g]);y.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&y.setAttribute("display","block");var T=n?"katex":"katex-mathml";return E.makeSpan([T],[y])}var ra=function(e){return new T0({style:e.displayMode?J.DISPLAY:J.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},na=function(e,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=E.makeSpan(r,[e])}return e},Rl=function(e,t,r){var n=ra(r),a;if(r.output==="mathml")return ta(e,t,n,r.displayMode,!0);if(r.output==="html"){var h=$r(e,n);a=E.makeSpan(["katex"],[h])}else{var d=ta(e,t,n,r.displayMode,!1),g=$r(e,n);a=E.makeSpan(["katex"],[d,g])}return na(a,r)},Fl=function(e,t,r){var n=ra(r),a=$r(e,n),h=E.makeSpan(["katex"],[a]);return na(h,r)},Il={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ll=function(e){var t=new W.MathNode("mo",[new W.TextNode(Il[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Ol={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},ql=function(e){return e.type==="ordgroup"?e.body.length:1},Pl=function(e,t){function r(){var g=4e5,y=e.label.slice(1);if(q.contains(["widehat","widecheck","widetilde","utilde"],y)){var T=e,B=ql(T.base),F,R,O;if(B>5)y==="widehat"||y==="widecheck"?(F=420,g=2364,O=.42,R=y+"4"):(F=312,g=2340,O=.34,R="tilde4");else{var Y=[1,1,2,2,3,3][B];y==="widehat"||y==="widecheck"?(g=[0,1062,2364,2364,2364][Y],F=[0,239,300,360,420][Y],O=[0,.24,.3,.3,.36,.42][Y],R=y+Y):(g=[0,600,1033,2339,2340][Y],F=[0,260,286,306,312][Y],O=[0,.26,.286,.3,.306,.34][Y],R="tilde"+Y)}var Q=new Nt(R),ae=new yt([Q],{width:"100%",height:X(O),viewBox:"0 0 "+g+" "+F,preserveAspectRatio:"none"});return{span:E.makeSvgSpan([],[ae],t),minWidth:0,height:O}}else{var ue=[],he=Ol[y],Ae=he[0],be=he[1],Me=he[2],Se=Me/1e3,_e=Ae.length,Ie,Qe;if(_e===1){var dt=he[3];Ie=["hide-tail"],Qe=[dt]}else if(_e===2)Ie=["halfarrow-left","halfarrow-right"],Qe=["xMinYMin","xMaxYMin"];else if(_e===3)Ie=["brace-left","brace-center","brace-right"],Qe=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+_e+" children.");for(var Oe=0;Oe<_e;Oe++){var v0=new Nt(Ae[Oe]),kt=new yt([v0],{width:"400em",height:X(Se),viewBox:"0 0 "+g+" "+Me,preserveAspectRatio:Qe[Oe]+" slice"}),rt=E.makeSvgSpan([Ie[Oe]],[kt],t);if(_e===1)return{span:rt,minWidth:be,height:Se};rt.style.height=X(Se),ue.push(rt)}return{span:E.makeSpan(["stretchy"],ue,t),minWidth:be,height:Se}}}var n=r(),a=n.span,h=n.minWidth,d=n.height;return a.height=d,a.style.height=X(d),h>0&&(a.style.minWidth=X(h)),a},Hl=function(e,t,r,n,a){var h,d=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(h=E.makeSpan(["stretchy",t],[],a),t==="fbox"){var g=a.color&&a.getColor();g&&(h.style.borderColor=g)}}else{var y=[];/^[bx]cancel$/.test(t)&&y.push(new Kt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&y.push(new Kt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var T=new yt(y,{width:"100%",height:X(d)});h=E.makeSvgSpan([],[T],a)}return h.height=d,h.style.height=X(d),h},Ht={encloseSpan:Hl,mathMLnode:Ll,svgSpan:Pl};function ve(u,e){if(!u||u.type!==e)throw new Error("Expected node of type "+e+", but got "+(u?"node of type "+u.type:String(u)));return u}function Qr(u){var e=xr(u);if(!e)throw new Error("Expected node of symbol group type, but got "+(u?"node of type "+u.type:String(u)));return e}function xr(u){return u&&(u.type==="atom"||$0.hasOwnProperty(u.type))?u:null}var Jr=function(e,t){var r,n,a;e&&e.type==="supsub"?(n=ve(e.base,"accent"),r=n.base,e.base=r,a=Hr(ke(e,t)),e.base=n):(n=ve(e,"accent"),r=n.base);var h=ke(r,t.havingCrampedStyle()),d=n.isShifty&&q.isCharacterBox(r),g=0;if(d){var y=q.getBaseElem(r),T=ke(y,t.havingCrampedStyle());g=z0(T).skew}var B=n.label==="\\c",F=B?h.height+h.depth:Math.min(h.height,t.fontMetrics().xHeight),R;if(n.isStretchy)R=Ht.svgSpan(n,t),R=E.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"elem",elem:R,wrapperClasses:["svg-align"],wrapperStyle:g>0?{width:"calc(100% - "+X(2*g)+")",marginLeft:X(2*g)}:void 0}]},t);else{var O,Y;n.label==="\\vec"?(O=E.staticSvg("vec",t),Y=E.svgData.vec[1]):(O=E.makeOrd({mode:n.mode,text:n.label},t,"textord"),O=z0(O),O.italic=0,Y=O.width,B&&(F+=O.depth)),R=E.makeSpan(["accent-body"],[O]);var Q=n.label==="\\textcircled";Q&&(R.classes.push("accent-full"),F=h.height);var ae=g;Q||(ae-=Y/2),R.style.left=X(ae),n.label==="\\textcircled"&&(R.style.top=".2em"),R=E.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:-F},{type:"elem",elem:R}]},t)}var ue=E.makeSpan(["mord","accent"],[R],t);return a?(a.children[0]=ue,a.height=Math.max(ue.height,a.height),a.classes[0]="mord",a):ue},aa=function(e,t){var r=e.isStretchy?Ht.mathMLnode(e.label):new W.MathNode("mo",[wt(e.label,e.mode)]),n=new W.MathNode("mover",[Ce(e.base,t),r]);return n.setAttribute("accent","true"),n},Ul=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(u){return"\\"+u}).join("|"));ee({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(e,t){var r=br(t[0]),n=!Ul.test(e.funcName),a=!n||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:Jr,mathmlBuilder:aa}),ee({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:function(e,t){var r=t[0],n=e.parser.mode;return n==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Jr,mathmlBuilder:aa}),ee({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:function(e,t){var r=ke(e.base,t),n=Ht.svgSpan(e,t),a=e.label==="\\utilde"?.12:0,h=E.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},t);return E.makeSpan(["mord","accentunder"],[h],t)},mathmlBuilder:function(e,t){var r=Ht.mathMLnode(e.label),n=new W.MathNode("munder",[Ce(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});var wr=function(e){var t=new W.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ee({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler:function(e,t,r){var n=e.parser,a=e.funcName;return{type:"xArrow",mode:n.mode,label:a,body:t[0],below:r[0]}},htmlBuilder:function(e,t){var r=t.style,n=t.havingStyle(r.sup()),a=E.wrapFragment(ke(e.body,n,t),t),h=e.label.slice(0,2)==="\\x"?"x":"cd";a.classes.push(h+"-arrow-pad");var d;e.below&&(n=t.havingStyle(r.sub()),d=E.wrapFragment(ke(e.below,n,t),t),d.classes.push(h+"-arrow-pad"));var g=Ht.svgSpan(e,t),y=-t.fontMetrics().axisHeight+.5*g.height,T=-t.fontMetrics().axisHeight-.5*g.height-.111;(a.depth>.25||e.label==="\\xleftequilibrium")&&(T-=a.depth);var B;if(d){var F=-t.fontMetrics().axisHeight+d.height+.5*g.height+.111;B=E.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:T},{type:"elem",elem:g,shift:y},{type:"elem",elem:d,shift:F}]},t)}else B=E.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:T},{type:"elem",elem:g,shift:y}]},t);return B.children[0].children[0].children[1].classes.push("svg-align"),E.makeSpan(["mrel","x-arrow"],[B],t)},mathmlBuilder:function(e,t){var r=Ht.mathMLnode(e.label);r.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(e.body){var a=wr(Ce(e.body,t));if(e.below){var h=wr(Ce(e.below,t));n=new W.MathNode("munderover",[r,h,a])}else n=new W.MathNode("mover",[r,a])}else if(e.below){var d=wr(Ce(e.below,t));n=new W.MathNode("munder",[r,d])}else n=wr(),n=new W.MathNode("mover",[r,n]);return n}});var Gl=E.makeSpan;function ia(u,e){var t=je(u.body,e,!0);return Gl([u.mclass],t,e)}function la(u,e){var t,r=ot(u.body,e);return u.mclass==="minner"?t=new W.MathNode("mpadded",r):u.mclass==="mord"?u.isCharacterBox?(t=r[0],t.type="mi"):t=new W.MathNode("mi",r):(u.isCharacterBox?(t=r[0],t.type="mo"):t=new W.MathNode("mo",r),u.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):u.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):u.mclass==="mopen"||u.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):u.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ee({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ge(a),isCharacterBox:q.isCharacterBox(a)}},htmlBuilder:ia,mathmlBuilder:la});var kr=function(e){var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};ee({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(e,t){var r=e.parser;return{type:"mclass",mode:r.mode,mclass:kr(t[0]),body:Ge(t[1]),isCharacterBox:q.isCharacterBox(t[1])}}}),ee({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[1],h=t[0],d;n!=="\\stackrel"?d=kr(a):d="mrel";var g={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ge(a)},y={type:"supsub",mode:h.mode,base:g,sup:n==="\\underset"?null:h,sub:n==="\\underset"?h:null};return{type:"mclass",mode:r.mode,mclass:d,body:[y],isCharacterBox:q.isCharacterBox(y)}},htmlBuilder:ia,mathmlBuilder:la}),ee({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser;return{type:"pmb",mode:r.mode,mclass:kr(t[0]),body:Ge(t[0])}},htmlBuilder:function(e,t){var r=je(e.body,t,!0),n=E.makeSpan([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder:function(e,t){var r=ot(e.body,t),n=new W.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Vl={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},sa=function(){return{type:"styling",body:[],mode:"math",style:"display"}},oa=function(e){return e.type==="textord"&&e.text==="@"},Wl=function(e,t){return(e.type==="mathord"||e.type==="atom")&&e.text===t};function Yl(u,e,t){var r=Vl[u];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var n=t.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},h=t.callFunction("\\Big",[a],[]),d=t.callFunction("\\\\cdright",[e[1]],[]),g={type:"ordgroup",mode:"math",body:[n,h,d]};return t.callFunction("\\\\cdparent",[g],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var y={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[y],[])}default:return{type:"textord",text:" ",mode:"math"}}}function jl(u){var e=[];for(u.gullet.beginGroup(),u.gullet.macros.set("\\cr","\\\\\\relax"),u.gullet.beginGroup();;){e.push(u.parseExpression(!1,"\\\\")),u.gullet.endGroup(),u.gullet.beginGroup();var t=u.fetch().text;if(t==="&"||t==="\\\\")u.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new p("Expected \\\\ or \\cr or \\end",u.nextToken)}for(var r=[],n=[r],a=0;a-1))if("<>AV".indexOf(y)>-1)for(var B=0;B<2;B++){for(var F=!0,R=g+1;RAV=|." after @',h[g]);var O=Yl(y,T,u),Y={type:"styling",body:[O],mode:"math",style:"display"};r.push(Y),d=sa()}a%2===0?r.push(d):r.shift(),r=[],n.push(r)}u.gullet.endGroup(),u.gullet.endGroup();var Q=new Array(n[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:n,arraystretch:1,addJot:!0,rowGaps:[null],cols:Q,colSeparationType:"CD",hLinesBeforeRow:new Array(n.length+1).fill([])}}ee({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder:function(e,t){var r=t.havingStyle(t.style.sup()),n=E.wrapFragment(ke(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=X(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder:function(e,t){var r=new W.MathNode("mrow",[Ce(e.label,t)]);return r=new W.MathNode("mpadded",[r]),r.setAttribute("width","0"),e.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new W.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),ee({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler:function(e,t){var r=e.parser;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder:function(e,t){var r=E.wrapFragment(ke(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder:function(e,t){return new W.MathNode("mrow",[Ce(e.fragment,t)])}}),ee({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){for(var r=e.parser,n=ve(t[0],"ordgroup"),a=n.body,h="",d=0;d=1114111)throw new p("\\@char with invalid code point "+h);return y<=65535?T=String.fromCharCode(y):(y-=65536,T=String.fromCharCode((y>>10)+55296,(y&1023)+56320)),{type:"textord",mode:r.mode,text:T}}});var ua=function(e,t){var r=je(e.body,t.withColor(e.color),!1);return E.makeFragment(r)},ha=function(e,t){var r=ot(e.body,t.withColor(e.color)),n=new W.MathNode("mstyle",r);return n.setAttribute("mathcolor",e.color),n};ee({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler:function(e,t){var r=e.parser,n=ve(t[0],"color-token").color,a=t[1];return{type:"color",mode:r.mode,color:n,body:Ge(a)}},htmlBuilder:ua,mathmlBuilder:ha}),ee({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler:function(e,t){var r=e.parser,n=e.breakOnTokenText,a=ve(t[0],"color-token").color;r.gullet.macros.set("\\current@color",a);var h=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:a,body:h}},htmlBuilder:ua,mathmlBuilder:ha}),ee({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler:function(e,t,r){var n=e.parser,a=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,h=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:h,size:a&&ve(a,"size").value}},htmlBuilder:function(e,t){var r=E.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=X(Ee(e.size,t)))),r},mathmlBuilder:function(e,t){var r=new W.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",X(Ee(e.size,t)))),r}});var en={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ca=function(e){var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new p("Expected a control sequence",e);return t},Xl=function(e){var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},ma=function(e,t,r,n){var a=e.gullet.macros.get(r.text);a==null&&(r.noexpand=!0,a={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,a,n)};ee({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler:function(e){var t=e.parser,r=e.funcName;t.consumeSpaces();var n=t.fetch();if(en[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=en[n.text]),ve(t.parseFunction(),"internal");throw new p("Invalid token after macro prefix",n)}}),ee({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=t.gullet.popToken(),a=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(a))throw new p("Expected a control sequence",n);for(var h=0,d,g=[[]];t.gullet.future().text!=="{";)if(n=t.gullet.popToken(),n.text==="#"){if(t.gullet.future().text==="{"){d=t.gullet.future(),g[h].push("{");break}if(n=t.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new p('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==h+1)throw new p('Argument number "'+n.text+'" out of order');h++,g.push([])}else{if(n.text==="EOF")throw new p("Expected a macro definition");g[h].push(n.text)}var y=t.gullet.consumeArg(),T=y.tokens;return d&&T.unshift(d),(r==="\\edef"||r==="\\xdef")&&(T=t.gullet.expandTokens(T),T.reverse()),t.gullet.macros.set(a,{tokens:T,numArgs:h,delimiters:g},r===en[r]),{type:"internal",mode:t.mode}}}),ee({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=ca(t.gullet.popToken());t.gullet.consumeSpaces();var a=Xl(t);return ma(t,n,a,r==="\\\\globallet"),{type:"internal",mode:t.mode}}}),ee({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=ca(t.gullet.popToken()),a=t.gullet.popToken(),h=t.gullet.popToken();return ma(t,n,h,r==="\\\\globalfuture"),t.gullet.pushToken(h),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var Q0=function(e,t,r){var n=Ne.math[e]&&Ne.math[e].replace,a=Dt(n||e,t,r);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return a},tn=function(e,t,r,n){var a=r.havingBaseStyle(t),h=E.makeSpan(n.concat(a.sizingClasses(r)),[e],r),d=a.sizeMultiplier/r.sizeMultiplier;return h.height*=d,h.depth*=d,h.maxFontSize=a.sizeMultiplier,h},da=function(e,t,r){var n=t.havingBaseStyle(r),a=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=X(a),e.height-=a,e.depth+=a},$l=function(e,t,r,n,a,h){var d=E.makeSymbol(e,"Main-Regular",a,n),g=tn(d,t,n,h);return r&&da(g,n,t),g},Zl=function(e,t,r,n){return E.makeSymbol(e,"Size"+t+"-Regular",r,n)},fa=function(e,t,r,n,a,h){var d=Zl(e,t,a,n),g=tn(E.makeSpan(["delimsizing","size"+t],[d],n),J.TEXT,n,h);return r&&da(g,n,J.TEXT),g},rn=function(e,t,r){var n;t==="Size1-Regular"?n="delim-size1":n="delim-size4";var a=E.makeSpan(["delimsizinginner",n],[E.makeSpan([],[E.makeSymbol(e,t,r)])]);return{type:"elem",elem:a}},nn=function(e,t,r){var n=vt["Size4-Regular"][e.charCodeAt(0)]?vt["Size4-Regular"][e.charCodeAt(0)][4]:vt["Size1-Regular"][e.charCodeAt(0)][4],a=new Nt("inner",k0(e,Math.round(1e3*t))),h=new yt([a],{width:X(n),height:X(t),style:"width:"+X(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),d=E.makeSvgSpan([],[h],r);return d.height=t,d.style.height=X(t),d.style.width=X(n),{type:"elem",elem:d}},an=.008,Sr={type:"kern",size:-1*an},Kl=["|","\\lvert","\\rvert","\\vert"],Ql=["\\|","\\lVert","\\rVert","\\Vert"],pa=function(e,t,r,n,a,h){var d,g,y,T,B="",F=0;d=y=T=e,g=null;var R="Size1-Regular";e==="\\uparrow"?y=T="⏐":e==="\\Uparrow"?y=T="‖":e==="\\downarrow"?d=y="⏐":e==="\\Downarrow"?d=y="‖":e==="\\updownarrow"?(d="\\uparrow",y="⏐",T="\\downarrow"):e==="\\Updownarrow"?(d="\\Uparrow",y="‖",T="\\Downarrow"):q.contains(Kl,e)?(y="∣",B="vert",F=333):q.contains(Ql,e)?(y="∥",B="doublevert",F=556):e==="["||e==="\\lbrack"?(d="⎡",y="⎢",T="⎣",R="Size4-Regular",B="lbrack",F=667):e==="]"||e==="\\rbrack"?(d="⎤",y="⎥",T="⎦",R="Size4-Regular",B="rbrack",F=667):e==="\\lfloor"||e==="⌊"?(y=d="⎢",T="⎣",R="Size4-Regular",B="lfloor",F=667):e==="\\lceil"||e==="⌈"?(d="⎡",y=T="⎢",R="Size4-Regular",B="lceil",F=667):e==="\\rfloor"||e==="⌋"?(y=d="⎥",T="⎦",R="Size4-Regular",B="rfloor",F=667):e==="\\rceil"||e==="⌉"?(d="⎤",y=T="⎥",R="Size4-Regular",B="rceil",F=667):e==="("||e==="\\lparen"?(d="⎛",y="⎜",T="⎝",R="Size4-Regular",B="lparen",F=875):e===")"||e==="\\rparen"?(d="⎞",y="⎟",T="⎠",R="Size4-Regular",B="rparen",F=875):e==="\\{"||e==="\\lbrace"?(d="⎧",g="⎨",T="⎩",y="⎪",R="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(d="⎫",g="⎬",T="⎭",y="⎪",R="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(d="⎧",T="⎩",y="⎪",R="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(d="⎫",T="⎭",y="⎪",R="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(d="⎧",T="⎭",y="⎪",R="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(d="⎫",T="⎩",y="⎪",R="Size4-Regular");var O=Q0(d,R,a),Y=O.height+O.depth,Q=Q0(y,R,a),ae=Q.height+Q.depth,ue=Q0(T,R,a),he=ue.height+ue.depth,Ae=0,be=1;if(g!==null){var Me=Q0(g,R,a);Ae=Me.height+Me.depth,be=2}var Se=Y+he+Ae,_e=Math.max(0,Math.ceil((t-Se)/(be*ae))),Ie=Se+_e*be*ae,Qe=n.fontMetrics().axisHeight;r&&(Qe*=n.sizeMultiplier);var dt=Ie/2-Qe,Oe=[];if(B.length>0){var v0=Ie-Y-he,kt=Math.round(Ie*1e3),rt=ar(B,Math.round(v0*1e3)),n0=new Nt(B,rt),C0=(F/1e3).toFixed(3)+"em",D0=(kt/1e3).toFixed(3)+"em",An=new yt([n0],{width:C0,height:D0,viewBox:"0 0 "+F+" "+kt}),a0=E.makeSvgSpan([],[An],n);a0.height=kt/1e3,a0.style.width=C0,a0.style.height=D0,Oe.push({type:"elem",elem:a0})}else{if(Oe.push(rn(T,R,a)),Oe.push(Sr),g===null){var i0=Ie-Y-he+2*an;Oe.push(nn(y,i0,n))}else{var St=(Ie-Y-he-Ae)/2+2*an;Oe.push(nn(y,St,n)),Oe.push(Sr),Oe.push(rn(g,R,a)),Oe.push(Sr),Oe.push(nn(y,St,n))}Oe.push(Sr),Oe.push(rn(d,R,a))}var tr=n.havingBaseStyle(J.TEXT),Tn=E.makeVList({positionType:"bottom",positionData:dt,children:Oe},tr);return tn(E.makeSpan(["delimsizing","mult"],[Tn],tr),J.TEXT,n,h)},ln=80,sn=.08,on=function(e,t,r,n,a){var h=Wt(e,n,r),d=new Nt(e,h),g=new yt([d],{width:"400em",height:X(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return E.makeSvgSpan(["hide-tail"],[g],a)},Jl=function(e,t){var r=t.havingBaseSizing(),n=ya("\\surd",e*r.sizeMultiplier,ba,r),a=r.sizeMultiplier,h=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),d,g=0,y=0,T=0,B;return n.type==="small"?(T=1e3+1e3*h+ln,e<1?a=1:e<1.4&&(a=.7),g=(1+h+sn)/a,y=(1+h)/a,d=on("sqrtMain",g,T,h,t),d.style.minWidth="0.853em",B=.833/a):n.type==="large"?(T=(1e3+ln)*J0[n.size],y=(J0[n.size]+h)/a,g=(J0[n.size]+h+sn)/a,d=on("sqrtSize"+n.size,g,T,h,t),d.style.minWidth="1.02em",B=1/a):(g=e+h+sn,y=e+h,T=Math.floor(1e3*e+h)+ln,d=on("sqrtTall",g,T,h,t),d.style.minWidth="0.742em",B=1.056),d.height=y,d.style.height=X(g),{span:d,advanceWidth:B,ruleWidth:(t.fontMetrics().sqrtRuleThickness+h)*a}},ga=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],es=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],va=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],J0=[0,1.2,1.8,2.4,3],ts=function(e,t,r,n,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),q.contains(ga,e)||q.contains(va,e))return fa(e,t,!1,r,n,a);if(q.contains(es,e))return pa(e,J0[t],!1,r,n,a);throw new p("Illegal delimiter: '"+e+"'")},rs=[{type:"small",style:J.SCRIPTSCRIPT},{type:"small",style:J.SCRIPT},{type:"small",style:J.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ns=[{type:"small",style:J.SCRIPTSCRIPT},{type:"small",style:J.SCRIPT},{type:"small",style:J.TEXT},{type:"stack"}],ba=[{type:"small",style:J.SCRIPTSCRIPT},{type:"small",style:J.SCRIPT},{type:"small",style:J.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],as=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},ya=function(e,t,r,n){for(var a=Math.min(2,3-n.style.size),h=a;ht)return r[h]}return r[r.length-1]},xa=function(e,t,r,n,a,h){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var d;q.contains(va,e)?d=rs:q.contains(ga,e)?d=ba:d=ns;var g=ya(e,t,d,n);return g.type==="small"?$l(e,g.style,r,n,a,h):g.type==="large"?fa(e,g.size,r,n,a,h):pa(e,t,r,n,a,h)},is=function(e,t,r,n,a,h){var d=n.fontMetrics().axisHeight*n.sizeMultiplier,g=901,y=5/n.fontMetrics().ptPerEm,T=Math.max(t-d,r+d),B=Math.max(T/500*g,2*T-y);return xa(e,B,!0,n,a,h)},Ut={sqrtImage:Jl,sizedDelim:ts,sizeToMaxHeight:J0,customSizedDelim:xa,leftRightDelim:is},wa={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},ls=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ar(u,e){var t=xr(u);if(t&&q.contains(ls,t.text))return t;throw t?new p("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",u):new p("Invalid delimiter type '"+u.type+"'",u)}ee({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:function(e,t){var r=Ar(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:wa[e.funcName].size,mclass:wa[e.funcName].mclass,delim:r.text}},htmlBuilder:function(e,t){return e.delim==="."?E.makeSpan([e.mclass]):Ut.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass])},mathmlBuilder:function(e){var t=[];e.delim!=="."&&t.push(wt(e.delim,e.mode));var r=new W.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=X(Ut.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function ka(u){if(!u.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ee({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new p("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ar(t[0],e).text,color:r}}}),ee({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=Ar(t[0],e),n=e.parser;++n.leftrightDepth;var a=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var h=ve(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:a,left:r.text,right:h.delim,rightColor:h.color}},htmlBuilder:function(e,t){ka(e);for(var r=je(e.body,t,!0,["mopen","mclose"]),n=0,a=0,h=!1,d=0;d-1?"mpadded":"menclose",[Ce(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),e.label==="\\fcolorbox"){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+a+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};ee({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,h=ve(t[0],"color-token").color,d=t[1];return{type:"enclose",mode:n.mode,label:a,backgroundColor:h,body:d}},htmlBuilder:un,mathmlBuilder:hn}),ee({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,h=ve(t[0],"color-token").color,d=ve(t[1],"color-token").color,g=t[2];return{type:"enclose",mode:n.mode,label:a,backgroundColor:d,borderColor:h,body:g}},htmlBuilder:un,mathmlBuilder:hn}),ee({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(e,t){var r=e.parser;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}}),ee({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"enclose",mode:r.mode,label:n,body:a}},htmlBuilder:un,mathmlBuilder:hn}),ee({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler:function(e,t){var r=e.parser;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});var Sa={};function Rt(u){for(var e=u.type,t=u.names,r=u.props,n=u.handler,a=u.htmlBuilder,h=u.mathmlBuilder,d={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:n},g=0;g1||!T)&&Y.pop(),ae.length0&&(he+=.25),y.push({pos:he,isDashed:Er[Br]})}for(Ae(h[0]),r=0;r0&&(dt+=ue,Se=d)){var R0=void 0;(n>0||e.hskipBeforeAndAfter)&&(R0=q.deflt(St.pregap,F),R0!==0&&(rt=E.makeSpan(["arraycolsep"],[]),rt.style.width=X(R0),kt.push(rt)));var F0=[];for(r=0;r0){for(var Rs=E.makeLineSpan("hline",t,T),Fs=E.makeLineSpan("hdashline",t,T),Mn=[{type:"elem",elem:g,shift:0}];y.length>0;){var si=y.pop(),oi=si.pos-Oe;si.isDashed?Mn.push({type:"elem",elem:Fs,shift:oi}):Mn.push({type:"elem",elem:Rs,shift:oi})}g=E.makeVList({positionType:"individualShift",children:Mn},t)}if(C0.length===0)return E.makeSpan(["mord"],[g],t);var zn=E.makeVList({positionType:"individualShift",children:C0},t);return zn=E.makeSpan(["tag"],[zn],t),E.makeFragment([g,zn])},ss={c:"center ",l:"left ",r:"right "},It=function(e,t){for(var r=[],n=new W.MathNode("mtd",[],["mtr-glue"]),a=new W.MathNode("mtd",[],["mml-eqn-num"]),h=0;h0){var O=e.cols,Y="",Q=!1,ae=0,ue=O.length;O[0].type==="separator"&&(F+="top ",ae=1),O[O.length-1].type==="separator"&&(F+="bottom ",ue-=1);for(var he=ae;he0?"left ":"",F+=_e[_e.length-1].length>0?"right ":"";for(var Ie=1;Ie<_e.length-1;Ie++)Se+=_e[Ie].length===0?"none ":_e[Ie][0]?"dashed ":"solid ";return/[sd]/.test(Se)&&T.setAttribute("rowlines",Se.trim()),F!==""&&(T=new W.MathNode("menclose",[T]),T.setAttribute("notation",F.trim())),e.arraystretch&&e.arraystretch<1&&(T=new W.MathNode("mstyle",[T]),T.setAttribute("scriptlevel","1")),T},Ma=function(e,t){e.envName.indexOf("ed")===-1&&Tr(e);var r=[],n=e.envName.indexOf("at")>-1?"alignat":"align",a=e.envName==="split",h=t0(e.parser,{cols:r,addJot:!0,autoTag:a?void 0:cn(e.envName),emptySingleRow:!0,colSeparationType:n,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),d,g=0,y={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var T="",B=0;B0&&R&&(Q=1),r[O]={type:"align",align:Y,pregap:Q,postgap:0}}return h.colSeparationType=R?"align":"alignat",h};Rt({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(e,t){var r=xr(t[0]),n=r?[t[0]]:ve(t[0],"ordgroup").body,a=n.map(function(d){var g=Qr(d),y=g.text;if("lcr".indexOf(y)!==-1)return{type:"align",align:y};if(y==="|")return{type:"separator",separator:"|"};if(y===":")return{type:"separator",separator:":"};throw new p("Unknown column alignment: "+y,d)}),h={cols:a,hskipBeforeAndAfter:!0,maxNumCols:a.length};return t0(e.parser,h,mn(e.envName))},htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler:function(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(e.envName.charAt(e.envName.length-1)==="*"){var a=e.parser;if(a.consumeSpaces(),a.fetch().text==="["){if(a.consume(),a.consumeSpaces(),r=a.fetch().text,"lcr".indexOf(r)===-1)throw new p("Expected l or c or r",a.nextToken);a.consume(),a.consumeSpaces(),a.expect("]"),a.consume(),n.cols=[{type:"align",align:r}]}}var h=t0(e.parser,n,mn(e.envName)),d=Math.max.apply(Math,[0].concat(h.body.map(function(g){return g.length})));return h.cols=new Array(d).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[h],left:t[0],right:t[1],rightColor:void 0}:h},htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(e){var t={arraystretch:.5},r=t0(e.parser,t,"script");return r.colSeparationType="small",r},htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["subarray"],props:{numArgs:1},handler:function(e,t){var r=xr(t[0]),n=r?[t[0]]:ve(t[0],"ordgroup").body,a=n.map(function(d){var g=Qr(d),y=g.text;if("lc".indexOf(y)!==-1)return{type:"align",align:y};throw new p("Unknown column alignment: "+y,d)});if(a.length>1)throw new p("{subarray} can contain only one column");var h={cols:a,hskipBeforeAndAfter:!1,arraystretch:.5};if(h=t0(e.parser,h,"script"),h.body.length>0&&h.body[0].length>1)throw new p("{subarray} can contain only one column");return h},htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler:function(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=t0(e.parser,t,mn(e.envName));return{type:"leftright",mode:e.mode,body:[r],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Ma,htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler:function(e){q.contains(["gather","gather*"],e.envName)&&Tr(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:cn(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return t0(e.parser,t,"display")},htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Ma,htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["equation","equation*"],props:{numArgs:0},handler:function(e){Tr(e);var t={autoTag:cn(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return t0(e.parser,t,"display")},htmlBuilder:Ft,mathmlBuilder:It}),Rt({type:"array",names:["CD"],props:{numArgs:0},handler:function(e){return Tr(e),jl(e.parser)},htmlBuilder:Ft,mathmlBuilder:It}),b("\\nonumber","\\gdef\\@eqnsw{0}"),b("\\notag","\\nonumber"),ee({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(e,t){throw new p(e.funcName+" valid only within array environment")}});var os=Sa,za=os;ee({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];if(a.type!=="ordgroup")throw new p("Invalid environment name",a);for(var h="",d=0;d=J.SCRIPT.id?r.text():J.DISPLAY:e==="text"&&r.size===J.DISPLAY.size?r=J.TEXT:e==="script"?r=J.SCRIPT:e==="scriptscript"&&(r=J.SCRIPTSCRIPT),r},dn=function(e,t){var r=Ca(e.size,t.style),n=r.fracNum(),a=r.fracDen(),h;h=t.havingStyle(n);var d=ke(e.numer,h,t);if(e.continued){var g=8.5/t.fontMetrics().ptPerEm,y=3.5/t.fontMetrics().ptPerEm;d.height=d.height0?Y=3*R:Y=7*R,Q=t.fontMetrics().denom1):(F>0?(O=t.fontMetrics().num2,Y=R):(O=t.fontMetrics().num3,Y=3*R),Q=t.fontMetrics().denom2);var ae;if(B){var he=t.fontMetrics().axisHeight;O-d.depth-(he+.5*F)0&&(t=e,t=t==="."?null:t),t};ee({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler:function(e,t){var r=e.parser,n=t[4],a=t[5],h=br(t[0]),d=h.type==="atom"&&h.family==="open"?Na(h.text):null,g=br(t[1]),y=g.type==="atom"&&g.family==="close"?Na(g.text):null,T=ve(t[2],"size"),B,F=null;T.isBlank?B=!0:(F=T.value,B=F.number>0);var R="auto",O=t[3];if(O.type==="ordgroup"){if(O.body.length>0){var Y=ve(O.body[0],"textord");R=Da[Number(Y.text)]}}else O=ve(O,"textord"),R=Da[Number(O.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:a,continued:!1,hasBarLine:B,barSize:F,leftDelim:d,rightDelim:y,size:R}},htmlBuilder:dn,mathmlBuilder:fn}),ee({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(e,t){var r=e.parser;e.funcName;var n=e.token;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:ve(t[0],"size").value,token:n}}}),ee({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(e,t){var r=e.parser;e.funcName;var n=t[0],a=ge(ve(t[1],"infix").size),h=t[2],d=a.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:h,continued:!1,hasBarLine:d,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:dn,mathmlBuilder:fn});var Ra=function(e,t){var r=t.style,n,a;e.type==="supsub"?(n=e.sup?ke(e.sup,t.havingStyle(r.sup()),t):ke(e.sub,t.havingStyle(r.sub()),t),a=ve(e.base,"horizBrace")):a=ve(e,"horizBrace");var h=ke(a.base,t.havingBaseStyle(J.DISPLAY)),d=Ht.svgSpan(a,t),g;if(a.isOver?(g=E.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.1},{type:"elem",elem:d}]},t),g.children[0].children[0].children[1].classes.push("svg-align")):(g=E.makeVList({positionType:"bottom",positionData:h.depth+.1+d.height,children:[{type:"elem",elem:d},{type:"kern",size:.1},{type:"elem",elem:h}]},t),g.children[0].children[0].children[0].classes.push("svg-align")),n){var y=E.makeSpan(["mord",a.isOver?"mover":"munder"],[g],t);a.isOver?g=E.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y},{type:"kern",size:.2},{type:"elem",elem:n}]},t):g=E.makeVList({positionType:"bottom",positionData:y.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:y}]},t)}return E.makeSpan(["mord",a.isOver?"mover":"munder"],[g],t)},us=function(e,t){var r=Ht.mathMLnode(e.label);return new W.MathNode(e.isOver?"mover":"munder",[Ce(e.base,t),r])};ee({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:Ra,mathmlBuilder:us}),ee({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[1],a=ve(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:r.mode,href:a,body:Ge(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:function(e,t){var r=je(e.body,t,!1);return E.makeAnchor(e.href,[],r,t)},mathmlBuilder:function(e,t){var r=Jt(e.body,t);return r instanceof xt||(r=new xt("mrow",[r])),r.setAttribute("href",e.href),r}}),ee({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=ve(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var a=[],h=0;h0&&(n=Ee(e.totalheight,t)-r);var a=0;e.width.number>0&&(a=Ee(e.width,t));var h={height:X(r+n)};a>0&&(h.width=X(a)),n>0&&(h.verticalAlign=X(-n));var d=new ur(e.src,e.alt,h);return d.height=r,d.depth=n,d},mathmlBuilder:function(e,t){var r=new W.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);var n=Ee(e.height,t),a=0;if(e.totalheight.number>0&&(a=Ee(e.totalheight,t)-n,r.setAttribute("valign",X(-a))),r.setAttribute("height",X(n+a)),e.width.number>0){var h=Ee(e.width,t);r.setAttribute("width",X(h))}return r.setAttribute("src",e.src),r}}),ee({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=ve(t[0],"size");if(r.settings.strict){var h=n[1]==="m",d=a.value.unit==="mu";h?(d||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+a.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):d&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:a.value}},htmlBuilder:function(e,t){return E.makeGlue(e.dimension,t)},mathmlBuilder:function(e,t){var r=Ee(e.dimension,t);return new W.SpaceNode(r)}}),ee({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:a}},htmlBuilder:function(e,t){var r;e.alignment==="clap"?(r=E.makeSpan([],[ke(e.body,t)]),r=E.makeSpan(["inner"],[r],t)):r=E.makeSpan(["inner"],[ke(e.body,t)]);var n=E.makeSpan(["fix"],[]),a=E.makeSpan([e.alignment],[r,n],t),h=E.makeSpan(["strut"]);return h.style.height=X(a.height+a.depth),a.depth&&(h.style.verticalAlign=X(-a.depth)),a.children.unshift(h),a=E.makeSpan(["thinbox"],[a],t),E.makeSpan(["mord","vbox"],[a],t)},mathmlBuilder:function(e,t){var r=new W.MathNode("mpadded",[Ce(e.body,t)]);if(e.alignment!=="rlap"){var n=e.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),ee({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){var r=e.funcName,n=e.parser,a=n.mode;n.switchMode("math");var h=r==="\\("?"\\)":"$",d=n.parseExpression(!1,h);return n.expect(h),n.switchMode(a),{type:"styling",mode:n.mode,style:"text",body:d}}}),ee({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){throw new p("Mismatched "+e.funcName)}});var Fa=function(e,t){switch(t.style.size){case J.DISPLAY.size:return e.display;case J.TEXT.size:return e.text;case J.SCRIPT.size:return e.script;case J.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ee({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:function(e,t){var r=e.parser;return{type:"mathchoice",mode:r.mode,display:Ge(t[0]),text:Ge(t[1]),script:Ge(t[2]),scriptscript:Ge(t[3])}},htmlBuilder:function(e,t){var r=Fa(e,t),n=je(r,t,!1);return E.makeFragment(n)},mathmlBuilder:function(e,t){var r=Fa(e,t);return Jt(r,t)}});var Ia=function(e,t,r,n,a,h,d){e=E.makeSpan([],[e]);var g=r&&q.isCharacterBox(r),y,T;if(t){var B=ke(t,n.havingStyle(a.sup()),n);T={elem:B,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-B.depth)}}if(r){var F=ke(r,n.havingStyle(a.sub()),n);y={elem:F,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-F.height)}}var R;if(T&&y){var O=n.fontMetrics().bigOpSpacing5+y.elem.height+y.elem.depth+y.kern+e.depth+d;R=E.makeVList({positionType:"bottom",positionData:O,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:y.elem,marginLeft:X(-h)},{type:"kern",size:y.kern},{type:"elem",elem:e},{type:"kern",size:T.kern},{type:"elem",elem:T.elem,marginLeft:X(h)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(y){var Y=e.height-d;R=E.makeVList({positionType:"top",positionData:Y,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:y.elem,marginLeft:X(-h)},{type:"kern",size:y.kern},{type:"elem",elem:e}]},n)}else if(T){var Q=e.depth+d;R=E.makeVList({positionType:"bottom",positionData:Q,children:[{type:"elem",elem:e},{type:"kern",size:T.kern},{type:"elem",elem:T.elem,marginLeft:X(h)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return e;var ae=[R];if(y&&h!==0&&!g){var ue=E.makeSpan(["mspace"],[],n);ue.style.marginRight=X(h),ae.unshift(ue)}return E.makeSpan(["mop","op-limits"],ae,n)},La=["\\smallint"],B0=function(e,t){var r,n,a=!1,h;e.type==="supsub"?(r=e.sup,n=e.sub,h=ve(e.base,"op"),a=!0):h=ve(e,"op");var d=t.style,g=!1;d.size===J.DISPLAY.size&&h.symbol&&!q.contains(La,h.name)&&(g=!0);var y;if(h.symbol){var T=g?"Size2-Regular":"Size1-Regular",B="";if((h.name==="\\oiint"||h.name==="\\oiiint")&&(B=h.name.slice(1),h.name=B==="oiint"?"\\iint":"\\iiint"),y=E.makeSymbol(h.name,T,"math",t,["mop","op-symbol",g?"large-op":"small-op"]),B.length>0){var F=y.italic,R=E.staticSvg(B+"Size"+(g?"2":"1"),t);y=E.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:0},{type:"elem",elem:R,shift:g?.08:0}]},t),h.name="\\"+B,y.classes.unshift("mop"),y.italic=F}}else if(h.body){var O=je(h.body,t,!0);O.length===1&&O[0]instanceof tt?(y=O[0],y.classes[0]="mop"):y=E.makeSpan(["mop"],O,t)}else{for(var Y=[],Q=1;Q0){for(var g=h.body.map(function(F){var R=F.text;return typeof R=="string"?{type:"textord",mode:F.mode,text:R}:F}),y=je(g,t.withFont("mathrm"),!0),T=0;T=0?g.setAttribute("height",X(a)):(g.setAttribute("height",X(a)),g.setAttribute("depth",X(-a))),g.setAttribute("voffset",X(a)),g}});function qa(u,e,t){for(var r=je(u,e,!1),n=e.sizeMultiplier/t.sizeMultiplier,a=0;ar.height+r.depth+d&&(d=(d+R-r.height-r.depth)/2);var O=T.height-r.height-d-B;r.style.paddingLeft=X(F);var Y=E.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+O)},{type:"elem",elem:T},{type:"kern",size:B}]},t);if(e.index){var Q=t.havingStyle(J.SCRIPTSCRIPT),ae=ke(e.index,Q,t),ue=.6*(Y.height-Y.depth),he=E.makeVList({positionType:"shift",positionData:-ue,children:[{type:"elem",elem:ae}]},t),Ae=E.makeSpan(["root"],[he]);return E.makeSpan(["mord","sqrt"],[Ae,Y],t)}else return E.makeSpan(["mord","sqrt"],[Y],t)},mathmlBuilder:function(e,t){var r=e.body,n=e.index;return n?new W.MathNode("mroot",[Ce(r,t),Ce(n,t)]):new W.MathNode("msqrt",[Ce(r,t)])}});var Ha={display:J.DISPLAY,text:J.TEXT,script:J.SCRIPT,scriptscript:J.SCRIPTSCRIPT};ee({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e,t){var r=e.breakOnTokenText,n=e.funcName,a=e.parser,h=a.parseExpression(!0,r),d=n.slice(1,n.length-5);return{type:"styling",mode:a.mode,style:d,body:h}},htmlBuilder:function(e,t){var r=Ha[e.style],n=t.havingStyle(r).withFont("");return qa(e.body,n,t)},mathmlBuilder:function(e,t){var r=Ha[e.style],n=t.havingStyle(r),a=ot(e.body,n),h=new W.MathNode("mstyle",a),d={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},g=d[e.style];return h.setAttribute("scriptlevel",g[0]),h.setAttribute("displaystyle",g[1]),h}});var fs=function(e,t){var r=e.base;if(r)if(r.type==="op"){var n=r.limits&&(t.style.size===J.DISPLAY.size||r.alwaysHandleSupSub);return n?B0:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(t.style.size===J.DISPLAY.size||r.limits);return a?Oa:null}else{if(r.type==="accent")return q.isCharacterBox(r.base)?Jr:null;if(r.type==="horizBrace"){var h=!e.sub;return h===r.isOver?Ra:null}else return null}else return null};g0({type:"supsub",htmlBuilder:function(e,t){var r=fs(e,t);if(r)return r(e,t);var n=e.base,a=e.sup,h=e.sub,d=ke(n,t),g,y,T=t.fontMetrics(),B=0,F=0,R=n&&q.isCharacterBox(n);if(a){var O=t.havingStyle(t.style.sup());g=ke(a,O,t),R||(B=d.height-O.fontMetrics().supDrop*O.sizeMultiplier/t.sizeMultiplier)}if(h){var Y=t.havingStyle(t.style.sub());y=ke(h,Y,t),R||(F=d.depth+Y.fontMetrics().subDrop*Y.sizeMultiplier/t.sizeMultiplier)}var Q;t.style===J.DISPLAY?Q=T.sup1:t.style.cramped?Q=T.sup3:Q=T.sup2;var ae=t.sizeMultiplier,ue=X(.5/T.ptPerEm/ae),he=null;if(y){var Ae=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(d instanceof tt||Ae)&&(he=X(-d.italic))}var be;if(g&&y){B=Math.max(B,Q,g.depth+.25*T.xHeight),F=Math.max(F,T.sub2);var Me=T.defaultRuleThickness,Se=4*Me;if(B-g.depth-(y.height-F)0&&(B+=_e,F-=_e)}var Ie=[{type:"elem",elem:y,shift:F,marginRight:ue,marginLeft:he},{type:"elem",elem:g,shift:-B,marginRight:ue}];be=E.makeVList({positionType:"individualShift",children:Ie},t)}else if(y){F=Math.max(F,T.sub1,y.height-.8*T.xHeight);var Qe=[{type:"elem",elem:y,marginLeft:he,marginRight:ue}];be=E.makeVList({positionType:"shift",positionData:F,children:Qe},t)}else if(g)B=Math.max(B,Q,g.depth+.25*T.xHeight),be=E.makeVList({positionType:"shift",positionData:-B,children:[{type:"elem",elem:g,marginRight:ue}]},t);else throw new Error("supsub must have either sup or sub.");var dt=Xr(d,"right")||"mord";return E.makeSpan([dt],[d,E.makeSpan(["msupsub"],[be])],t)},mathmlBuilder:function(e,t){var r=!1,n,a;e.base&&e.base.type==="horizBrace"&&(a=!!e.sup,a===e.base.isOver&&(r=!0,n=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var h=[Ce(e.base,t)];e.sub&&h.push(Ce(e.sub,t)),e.sup&&h.push(Ce(e.sup,t));var d;if(r)d=n?"mover":"munder";else if(e.sub)if(e.sup){var T=e.base;T&&T.type==="op"&&T.limits&&t.style===J.DISPLAY||T&&T.type==="operatorname"&&T.alwaysHandleSupSub&&(t.style===J.DISPLAY||T.limits)?d="munderover":d="msubsup"}else{var y=e.base;y&&y.type==="op"&&y.limits&&(t.style===J.DISPLAY||y.alwaysHandleSupSub)||y&&y.type==="operatorname"&&y.alwaysHandleSupSub&&(y.limits||t.style===J.DISPLAY)?d="munder":d="msub"}else{var g=e.base;g&&g.type==="op"&&g.limits&&(t.style===J.DISPLAY||g.alwaysHandleSupSub)||g&&g.type==="operatorname"&&g.alwaysHandleSupSub&&(g.limits||t.style===J.DISPLAY)?d="mover":d="msup"}return new W.MathNode(d,h)}}),g0({type:"atom",htmlBuilder:function(e,t){return E.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder:function(e,t){var r=new W.MathNode("mo",[wt(e.text,e.mode)]);if(e.family==="bin"){var n=Kr(e,t);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else e.family==="punct"?r.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&r.setAttribute("stretchy","false");return r}});var Ua={mi:"italic",mn:"normal",mtext:"normal"};g0({type:"mathord",htmlBuilder:function(e,t){return E.makeOrd(e,t,"mathord")},mathmlBuilder:function(e,t){var r=new W.MathNode("mi",[wt(e.text,e.mode,t)]),n=Kr(e,t)||"italic";return n!==Ua[r.type]&&r.setAttribute("mathvariant",n),r}}),g0({type:"textord",htmlBuilder:function(e,t){return E.makeOrd(e,t,"textord")},mathmlBuilder:function(e,t){var r=wt(e.text,e.mode,t),n=Kr(e,t)||"normal",a;return e.mode==="text"?a=new W.MathNode("mtext",[r]):/[0-9]/.test(e.text)?a=new W.MathNode("mn",[r]):e.text==="\\prime"?a=new W.MathNode("mo",[r]):a=new W.MathNode("mi",[r]),n!==Ua[a.type]&&a.setAttribute("mathvariant",n),a}});var gn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},vn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};g0({type:"spacing",htmlBuilder:function(e,t){if(vn.hasOwnProperty(e.text)){var r=vn[e.text].className||"";if(e.mode==="text"){var n=E.makeOrd(e,t,"textord");return n.classes.push(r),n}else return E.makeSpan(["mspace",r],[E.mathsym(e.text,e.mode,t)],t)}else{if(gn.hasOwnProperty(e.text))return E.makeSpan(["mspace",gn[e.text]],[],t);throw new p('Unknown type of space "'+e.text+'"')}},mathmlBuilder:function(e,t){var r;if(vn.hasOwnProperty(e.text))r=new W.MathNode("mtext",[new W.TextNode(" ")]);else{if(gn.hasOwnProperty(e.text))return new W.MathNode("mspace");throw new p('Unknown type of space "'+e.text+'"')}return r}});var Ga=function(){var e=new W.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};g0({type:"tag",mathmlBuilder:function(e,t){var r=new W.MathNode("mtable",[new W.MathNode("mtr",[Ga(),new W.MathNode("mtd",[Jt(e.body,t)]),Ga(),new W.MathNode("mtd",[Jt(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var Va={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Wa={"\\textbf":"textbf","\\textmd":"textmd"},ps={"\\textit":"textit","\\textup":"textup"},Ya=function(e,t){var r=e.font;return r?Va[r]?t.withTextFontFamily(Va[r]):Wa[r]?t.withTextFontWeight(Wa[r]):t.withTextFontShape(ps[r]):t};ee({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"text",mode:r.mode,body:Ge(a),font:n}},htmlBuilder:function(e,t){var r=Ya(e,t),n=je(e.body,r,!0);return E.makeSpan(["mord","text"],n,r)},mathmlBuilder:function(e,t){var r=Ya(e,t);return Jt(e.body,r)}}),ee({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder:function(e,t){var r=ke(e.body,t),n=E.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,h=E.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a},{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r}]},t);return E.makeSpan(["mord","underline"],[h],t)},mathmlBuilder:function(e,t){var r=new W.MathNode("mo",[new W.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new W.MathNode("munder",[Ce(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),ee({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:function(e,t){var r=e.parser;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder:function(e,t){var r=ke(e.body,t),n=t.fontMetrics().axisHeight,a=.5*(r.height-n-(r.depth+n));return E.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:function(e,t){return new W.MathNode("mpadded",[Ce(e.body,t)],["vcenter"])}}),ee({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(e,t,r){throw new p("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(e,t){for(var r=ja(e),n=[],a=t.havingStyle(t.style.text()),h=0;h0;)this.endGroup()},e.has=function(r){return this.current.hasOwnProperty(r)||this.builtins.hasOwnProperty(r)},e.get=function(r){return this.current.hasOwnProperty(r)?this.current[r]:this.builtins[r]},e.set=function(r,n,a){if(a===void 0&&(a=!1),a){for(var h=0;h0&&(this.undefStack[this.undefStack.length-1][r]=n)}else{var d=this.undefStack[this.undefStack.length-1];d&&!d.hasOwnProperty(r)&&(d[r]=this.current[r])}n==null?delete this.current[r]:this.current[r]=n},u}(),As=Aa,Ts=As;b("\\noexpand",function(u){var e=u.popToken();return u.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),b("\\expandafter",function(u){var e=u.popToken();return u.expandOnce(!0),{tokens:[e],numArgs:0}}),b("\\@firstoftwo",function(u){var e=u.consumeArgs(2);return{tokens:e[0],numArgs:0}}),b("\\@secondoftwo",function(u){var e=u.consumeArgs(2);return{tokens:e[1],numArgs:0}}),b("\\@ifnextchar",function(u){var e=u.consumeArgs(3);u.consumeSpaces();var t=u.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),b("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),b("\\TextOrMath",function(u){var e=u.consumeArgs(2);return u.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Za={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};b("\\char",function(u){var e=u.popToken(),t,r="";if(e.text==="'")t=8,e=u.popToken();else if(e.text==='"')t=16,e=u.popToken();else if(e.text==="`")if(e=u.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new p("\\char` missing argument");r=e.text.charCodeAt(0)}else t=10;if(t){if(r=Za[e.text],r==null||r>=t)throw new p("Invalid base-"+t+" digit "+e.text);for(var n;(n=Za[u.future().text])!=null&&n":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};b("\\dots",function(u){var e="\\dotso",t=u.expandAfterFuture().text;return t in Ka?e=Ka[t]:(t.slice(0,4)==="\\not"||t in Ne.math&&q.contains(["bin","rel"],Ne.math[t].group))&&(e="\\dotsb"),e});var xn={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};b("\\dotso",function(u){var e=u.future().text;return e in xn?"\\ldots\\,":"\\ldots"}),b("\\dotsc",function(u){var e=u.future().text;return e in xn&&e!==","?"\\ldots\\,":"\\ldots"}),b("\\cdots",function(u){var e=u.future().text;return e in xn?"\\@cdots\\,":"\\@cdots"}),b("\\dotsb","\\cdots"),b("\\dotsm","\\cdots"),b("\\dotsi","\\!\\cdots"),b("\\dotsx","\\ldots\\,"),b("\\DOTSI","\\relax"),b("\\DOTSB","\\relax"),b("\\DOTSX","\\relax"),b("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),b("\\,","\\tmspace+{3mu}{.1667em}"),b("\\thinspace","\\,"),b("\\>","\\mskip{4mu}"),b("\\:","\\tmspace+{4mu}{.2222em}"),b("\\medspace","\\:"),b("\\;","\\tmspace+{5mu}{.2777em}"),b("\\thickspace","\\;"),b("\\!","\\tmspace-{3mu}{.1667em}"),b("\\negthinspace","\\!"),b("\\negmedspace","\\tmspace-{4mu}{.2222em}"),b("\\negthickspace","\\tmspace-{5mu}{.277em}"),b("\\enspace","\\kern.5em "),b("\\enskip","\\hskip.5em\\relax"),b("\\quad","\\hskip1em\\relax"),b("\\qquad","\\hskip2em\\relax"),b("\\tag","\\@ifstar\\tag@literal\\tag@paren"),b("\\tag@paren","\\tag@literal{({#1})}"),b("\\tag@literal",function(u){if(u.macros.get("\\df@tag"))throw new p("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),b("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),b("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),b("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),b("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),b("\\newline","\\\\\\relax"),b("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Qa=X(vt["Main-Regular"]["T".charCodeAt(0)][1]-.7*vt["Main-Regular"]["A".charCodeAt(0)][1]);b("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Qa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),b("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Qa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),b("\\hspace","\\@ifstar\\@hspacer\\@hspace"),b("\\@hspace","\\hskip #1\\relax"),b("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),b("\\ordinarycolon",":"),b("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),b("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),b("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),b("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),b("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),b("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),b("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),b("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),b("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),b("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),b("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),b("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),b("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),b("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),b("∷","\\dblcolon"),b("∹","\\eqcolon"),b("≔","\\coloneqq"),b("≕","\\eqqcolon"),b("⩴","\\Coloneqq"),b("\\ratio","\\vcentcolon"),b("\\coloncolon","\\dblcolon"),b("\\colonequals","\\coloneqq"),b("\\coloncolonequals","\\Coloneqq"),b("\\equalscolon","\\eqqcolon"),b("\\equalscoloncolon","\\Eqqcolon"),b("\\colonminus","\\coloneq"),b("\\coloncolonminus","\\Coloneq"),b("\\minuscolon","\\eqcolon"),b("\\minuscoloncolon","\\Eqcolon"),b("\\coloncolonapprox","\\Colonapprox"),b("\\coloncolonsim","\\Colonsim"),b("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),b("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),b("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),b("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),b("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),b("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),b("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),b("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),b("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),b("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),b("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),b("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),b("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),b("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),b("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),b("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),b("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),b("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),b("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),b("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),b("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),b("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),b("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),b("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),b("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),b("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),b("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),b("\\imath","\\html@mathml{\\@imath}{ı}"),b("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),b("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),b("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),b("⟦","\\llbracket"),b("⟧","\\rrbracket"),b("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),b("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),b("⦃","\\lBrace"),b("⦄","\\rBrace"),b("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),b("⦵","\\minuso"),b("\\darr","\\downarrow"),b("\\dArr","\\Downarrow"),b("\\Darr","\\Downarrow"),b("\\lang","\\langle"),b("\\rang","\\rangle"),b("\\uarr","\\uparrow"),b("\\uArr","\\Uparrow"),b("\\Uarr","\\Uparrow"),b("\\N","\\mathbb{N}"),b("\\R","\\mathbb{R}"),b("\\Z","\\mathbb{Z}"),b("\\alef","\\aleph"),b("\\alefsym","\\aleph"),b("\\Alpha","\\mathrm{A}"),b("\\Beta","\\mathrm{B}"),b("\\bull","\\bullet"),b("\\Chi","\\mathrm{X}"),b("\\clubs","\\clubsuit"),b("\\cnums","\\mathbb{C}"),b("\\Complex","\\mathbb{C}"),b("\\Dagger","\\ddagger"),b("\\diamonds","\\diamondsuit"),b("\\empty","\\emptyset"),b("\\Epsilon","\\mathrm{E}"),b("\\Eta","\\mathrm{H}"),b("\\exist","\\exists"),b("\\harr","\\leftrightarrow"),b("\\hArr","\\Leftrightarrow"),b("\\Harr","\\Leftrightarrow"),b("\\hearts","\\heartsuit"),b("\\image","\\Im"),b("\\infin","\\infty"),b("\\Iota","\\mathrm{I}"),b("\\isin","\\in"),b("\\Kappa","\\mathrm{K}"),b("\\larr","\\leftarrow"),b("\\lArr","\\Leftarrow"),b("\\Larr","\\Leftarrow"),b("\\lrarr","\\leftrightarrow"),b("\\lrArr","\\Leftrightarrow"),b("\\Lrarr","\\Leftrightarrow"),b("\\Mu","\\mathrm{M}"),b("\\natnums","\\mathbb{N}"),b("\\Nu","\\mathrm{N}"),b("\\Omicron","\\mathrm{O}"),b("\\plusmn","\\pm"),b("\\rarr","\\rightarrow"),b("\\rArr","\\Rightarrow"),b("\\Rarr","\\Rightarrow"),b("\\real","\\Re"),b("\\reals","\\mathbb{R}"),b("\\Reals","\\mathbb{R}"),b("\\Rho","\\mathrm{P}"),b("\\sdot","\\cdot"),b("\\sect","\\S"),b("\\spades","\\spadesuit"),b("\\sub","\\subset"),b("\\sube","\\subseteq"),b("\\supe","\\supseteq"),b("\\Tau","\\mathrm{T}"),b("\\thetasym","\\vartheta"),b("\\weierp","\\wp"),b("\\Zeta","\\mathrm{Z}"),b("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),b("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),b("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),b("\\bra","\\mathinner{\\langle{#1}|}"),b("\\ket","\\mathinner{|{#1}\\rangle}"),b("\\braket","\\mathinner{\\langle{#1}\\rangle}"),b("\\Bra","\\left\\langle#1\\right|"),b("\\Ket","\\left|#1\\right\\rangle");var Ja=function(e){return function(t){var r=t.consumeArg().tokens,n=t.consumeArg().tokens,a=t.consumeArg().tokens,h=t.consumeArg().tokens,d=t.macros.get("|"),g=t.macros.get("\\|");t.macros.beginGroup();var y=function(R){return function(O){e&&(O.macros.set("|",d),a.length&&O.macros.set("\\|",g));var Y=R;if(!R&&a.length){var Q=O.future();Q.text==="|"&&(O.popToken(),Y=!0)}return{tokens:Y?a:n,numArgs:0}}};t.macros.set("|",y(!1)),a.length&&t.macros.set("\\|",y(!0));var T=t.consumeArg().tokens,B=t.expandTokens([].concat(h,T,r));return t.macros.endGroup(),{tokens:B.reverse(),numArgs:0}}};b("\\bra@ket",Ja(!1)),b("\\bra@set",Ja(!0)),b("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),b("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),b("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),b("\\angln","{\\angl n}"),b("\\blue","\\textcolor{##6495ed}{#1}"),b("\\orange","\\textcolor{##ffa500}{#1}"),b("\\pink","\\textcolor{##ff00af}{#1}"),b("\\red","\\textcolor{##df0030}{#1}"),b("\\green","\\textcolor{##28ae7b}{#1}"),b("\\gray","\\textcolor{gray}{#1}"),b("\\purple","\\textcolor{##9d38bd}{#1}"),b("\\blueA","\\textcolor{##ccfaff}{#1}"),b("\\blueB","\\textcolor{##80f6ff}{#1}"),b("\\blueC","\\textcolor{##63d9ea}{#1}"),b("\\blueD","\\textcolor{##11accd}{#1}"),b("\\blueE","\\textcolor{##0c7f99}{#1}"),b("\\tealA","\\textcolor{##94fff5}{#1}"),b("\\tealB","\\textcolor{##26edd5}{#1}"),b("\\tealC","\\textcolor{##01d1c1}{#1}"),b("\\tealD","\\textcolor{##01a995}{#1}"),b("\\tealE","\\textcolor{##208170}{#1}"),b("\\greenA","\\textcolor{##b6ffb0}{#1}"),b("\\greenB","\\textcolor{##8af281}{#1}"),b("\\greenC","\\textcolor{##74cf70}{#1}"),b("\\greenD","\\textcolor{##1fab54}{#1}"),b("\\greenE","\\textcolor{##0d923f}{#1}"),b("\\goldA","\\textcolor{##ffd0a9}{#1}"),b("\\goldB","\\textcolor{##ffbb71}{#1}"),b("\\goldC","\\textcolor{##ff9c39}{#1}"),b("\\goldD","\\textcolor{##e07d10}{#1}"),b("\\goldE","\\textcolor{##a75a05}{#1}"),b("\\redA","\\textcolor{##fca9a9}{#1}"),b("\\redB","\\textcolor{##ff8482}{#1}"),b("\\redC","\\textcolor{##f9685d}{#1}"),b("\\redD","\\textcolor{##e84d39}{#1}"),b("\\redE","\\textcolor{##bc2612}{#1}"),b("\\maroonA","\\textcolor{##ffbde0}{#1}"),b("\\maroonB","\\textcolor{##ff92c6}{#1}"),b("\\maroonC","\\textcolor{##ed5fa6}{#1}"),b("\\maroonD","\\textcolor{##ca337c}{#1}"),b("\\maroonE","\\textcolor{##9e034e}{#1}"),b("\\purpleA","\\textcolor{##ddd7ff}{#1}"),b("\\purpleB","\\textcolor{##c6b9fc}{#1}"),b("\\purpleC","\\textcolor{##aa87ff}{#1}"),b("\\purpleD","\\textcolor{##7854ab}{#1}"),b("\\purpleE","\\textcolor{##543b78}{#1}"),b("\\mintA","\\textcolor{##f5f9e8}{#1}"),b("\\mintB","\\textcolor{##edf2df}{#1}"),b("\\mintC","\\textcolor{##e0e5cc}{#1}"),b("\\grayA","\\textcolor{##f6f7f7}{#1}"),b("\\grayB","\\textcolor{##f0f1f2}{#1}"),b("\\grayC","\\textcolor{##e3e5e6}{#1}"),b("\\grayD","\\textcolor{##d6d8da}{#1}"),b("\\grayE","\\textcolor{##babec2}{#1}"),b("\\grayF","\\textcolor{##888d93}{#1}"),b("\\grayG","\\textcolor{##626569}{#1}"),b("\\grayH","\\textcolor{##3b3e40}{#1}"),b("\\grayI","\\textcolor{##21242c}{#1}"),b("\\kaBlue","\\textcolor{##314453}{#1}"),b("\\kaGreen","\\textcolor{##71B307}{#1}");var ei={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Ms=function(){function u(t,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(t),this.macros=new Ss(Ts,r.macros),this.mode=n,this.stack=[]}var e=u.prototype;return e.feed=function(r){this.lexer=new $a(r,this.settings)},e.switchMode=function(r){this.mode=r},e.beginGroup=function(){this.macros.beginGroup()},e.endGroup=function(){this.macros.endGroup()},e.endGroups=function(){this.macros.endGroups()},e.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},e.popToken=function(){return this.future(),this.stack.pop()},e.pushToken=function(r){this.stack.push(r)},e.pushTokens=function(r){var n;(n=this.stack).push.apply(n,r)},e.scanArgument=function(r){var n,a,h;if(r){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken();var d=this.consumeArg(["]"]);h=d.tokens,a=d.end}else{var g=this.consumeArg();h=g.tokens,n=g.start,a=g.end}return this.pushToken(new e0("EOF",a.loc)),this.pushTokens(h),n.range(a,"")},e.consumeSpaces=function(){for(;;){var r=this.future();if(r.text===" ")this.stack.pop();else break}},e.consumeArg=function(r){var n=[],a=r&&r.length>0;a||this.consumeSpaces();var h=this.future(),d,g=0,y=0;do{if(d=this.popToken(),n.push(d),d.text==="{")++g;else if(d.text==="}"){if(--g,g===-1)throw new p("Extra }",d)}else if(d.text==="EOF")throw new p("Unexpected end of input in a macro argument, expected '"+(r&&a?r[y]:"}")+"'",d);if(r&&a)if((g===0||g===1&&r[y]==="{")&&d.text===r[y]){if(++y,y===r.length){n.splice(-y,y);break}}else y=0}while(g!==0||a);return h.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:h,end:d}},e.consumeArgs=function(r,n){if(n){if(n.length!==r+1)throw new p("The length of delimiters doesn't match the number of args!");for(var a=n[0],h=0;hthis.settings.maxExpand)throw new p("Too many expansions: infinite loop or need to increase maxExpand setting");var d=h.tokens,g=this.consumeArgs(h.numArgs,h.delimiters);if(h.numArgs){d=d.slice();for(var y=d.length-1;y>=0;--y){var T=d[y];if(T.text==="#"){if(y===0)throw new p("Incomplete placeholder at end of macro body",T);if(T=d[--y],T.text==="#")d.splice(y+1,1);else if(/^[1-9]$/.test(T.text)){var B;(B=d).splice.apply(B,[y,2].concat(g[+T.text-1]))}else throw new p("Not a valid argument number",T)}}}return this.pushTokens(d),d.length},e.expandAfterFuture=function(){return this.expandOnce(),this.future()},e.expandNextToken=function(){for(;;)if(this.expandOnce()===!1){var r=this.stack.pop();return r.treatAsRelax&&(r.text="\\relax"),r}throw new Error},e.expandMacro=function(r){return this.macros.has(r)?this.expandTokens([new e0(r)]):void 0},e.expandTokens=function(r){var n=[],a=this.stack.length;for(this.pushTokens(r);this.stack.length>a;)if(this.expandOnce(!0)===!1){var h=this.stack.pop();h.treatAsRelax&&(h.noexpand=!1,h.treatAsRelax=!1),n.push(h)}return n},e.expandMacroAsText=function(r){var n=this.expandMacro(r);return n&&n.map(function(a){return a.text}).join("")},e._getExpansion=function(r){var n=this.macros.get(r);if(n==null)return n;if(r.length===1){var a=this.lexer.catcodes[r];if(a!=null&&a!==13)return}var h=typeof n=="function"?n(this):n;if(typeof h=="string"){var d=0;if(h.indexOf("#")!==-1)for(var g=h.replace(/##/g,"");g.indexOf("#"+(d+1))!==-1;)++d;for(var y=new $a(h,this.settings),T=[],B=y.lex();B.text!=="EOF";)T.push(B),B=y.lex();T.reverse();var F={tokens:T,numArgs:d};return F}return h},e.isDefined=function(r){return this.macros.has(r)||r0.hasOwnProperty(r)||Ne.math.hasOwnProperty(r)||Ne.text.hasOwnProperty(r)||ei.hasOwnProperty(r)},e.isExpandable=function(r){var n=this.macros.get(r);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:r0.hasOwnProperty(r)&&!r0[r].primitive},u}(),ti=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Mr=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),wn={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},ri={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"},ni=function(){function u(t,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Ms(t,r,this.mode),this.settings=r,this.leftrightDepth=0}var e=u.prototype;return e.expect=function(r,n){if(n===void 0&&(n=!0),this.fetch().text!==r)throw new p("Expected '"+r+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()},e.consume=function(){this.nextToken=null},e.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},e.switchMode=function(r){this.mode=r,this.gullet.switchMode(r)},e.parse=function(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var r=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),r}finally{this.gullet.endGroups()}},e.subparse=function(r){var n=this.nextToken;this.consume(),this.gullet.pushToken(new e0("}")),this.gullet.pushTokens(r);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a},e.parseExpression=function(r,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var h=this.fetch();if(u.endOfExpression.indexOf(h.text)!==-1||n&&h.text===n||r&&r0[h.text]&&r0[h.text].infix)break;var d=this.parseAtom(n);if(d){if(d.type==="internal")continue}else break;a.push(d)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)},e.handleInfixNodes=function(r){for(var n=-1,a,h=0;h=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',r);var y=Ne[this.mode][n].group,T=_t.range(r),B;if(Ot.hasOwnProperty(y)){var F=y;B={type:"atom",mode:this.mode,family:F,loc:T,text:n}}else B={type:y,mode:this.mode,loc:T,text:n};g=B}else if(n.charCodeAt(0)>=128)this.settings.strict&&(pt(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',r):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),r)),g={type:"textord",mode:"text",loc:_t.range(r),text:n};else return null;if(this.consume(),d)for(var R=0;R0&&(I.push({type:"text",data:_.slice(0,D)}),_=_.slice(D));var re=N.findIndex(function(fe){return _.startsWith(fe.left)});if(D=L(N[re].right,_,N[re].left.length),D===-1)break;var Z=_.slice(0,D+N[re].right.length),U=K.test(Z)?Z:_.slice(N[re].left.length,D);I.push({type:"math",data:U,rawData:Z,display:N[re].display}),_=_.slice(D+N[re].right.length)}return _!==""&&I.push({type:"text",data:_}),I},V=ne,xe=function(_,N){var D=V(_,N.delimiters);if(D.length===1&&D[0].type==="text")return null;for(var I=document.createDocumentFragment(),j=0;j{Is().then(()=>{m!==p&&requestAnimationFrame(()=>{s(0,w.innerHTML=Ei.sanitize(ce.parse(m)),w),s(3,z=!0),p=m,o("load")})})});function L(G){Yi[G?"unshift":"push"](()=>{w=G,s(0,w)})}return v.$$set=G=>{"message"in G&&s(1,m=G.message),"latex_delimiters"in G&&s(2,x=G.latex_delimiters)},v.$$.update=()=>{v.$$.dirty&13&&z&&x.length>0&&Zo(w,{delimiters:x,throwOnError:!1})},[w,m,x,z,L]}class Jo extends Or{constructor(i){super(),qr(this,i,Qo,Ko,Pr,{message:1,latex_delimiters:2})}}function Ci(v,i,s){const o=v.slice();return o[25]=i[s],o[27]=s,o}function Di(v,i,s){const o=v.slice();return o[28]=i[s],o[30]=s,o}function Ni(v,i,s){const o=v.slice();return o[31]=i[s],o}function Ri(v){let i,s,o;return s=new Vs({props:{formatter:zo,value:v[0]}}),s.$on("error",v[18]),s.$on("share",v[19]),{c(){i=ht("div"),H0(s.$$.fragment),de(i,"class","icon-button svelte-lpz3rh")},m(m,p){Xe(m,i,p),U0(s,i,null),o=!0},p(m,p){const x={};p[0]&1&&(x.value=m[0]),s.$set(x)},i(m){o||(Re(s.$$.fragment,m),o=!0)},o(m){Ye(s.$$.fragment,m),o=!1},d(m){m&&$e(i),G0(s)}}}function Fi(v){let i,s,o=q0(v[0]),m=[];for(let x=0;xYe(m[x],1,1,()=>{m[x]=null});return{c(){for(let x=0;x{V[C]=null}),x0()),~p?(x=V[p],x?x.p(v,q):(x=V[p]=ne[p](v),x.c()),Re(x,1),x.m(i,w)):x=null),(!L||q[0]&64&&z!==(z=v[6]?"rtl":"ltr"))&&de(i,"dir",z),(!L||q[0]&1)&&I0(i,"latest",v[27]===v[0].length-1),(!L||q[0]&1)&&I0(i,"hide",v[28]===null),(!L||q[0]&16)&&I0(i,"selectable",v[4])},i(le){L||(Re(x),L=!0)},o(le){Ye(x),L=!1},d(le){le&&$e(i),~p&&V[p].d(),G=!1,K()}}}function qi(v){let i,s,o=q0(v[25]),m=[];for(let x=0;xYe(m[x],1,1,()=>{m[x]=null});return{c(){for(let x=0;x +   +
    +   +
    `,de(i,"class","message pending svelte-lpz3rh")},m(s,o){Xe(s,i,o)},d(s){s&&$e(i)}}}function i1(v){let i,s,o,m,p,x,w,z=v[5]&&v[0]!==null&&v[0].length>0&&Ri(v),L=v[0]!==null&&Fi(v),G=v[2]&&Pi();return{c(){z&&z.c(),i=O0(),s=ht("div"),o=ht("div"),L&&L.c(),m=O0(),G&&G.c(),de(o,"class","message-wrap svelte-lpz3rh"),de(s,"class","wrap svelte-lpz3rh")},m(K,ne){z&&z.m(K,ne),Xe(K,i,ne),Xe(K,s,ne),Gt(s,o),L&&L.m(o,null),Gt(o,m),G&&G.m(o,null),v[21](s),p=!0,x||(w=Ls(To.call(null,o)),x=!0)},p(K,ne){K[5]&&K[0]!==null&&K[0].length>0?z?(z.p(K,ne),ne[0]&33&&Re(z,1)):(z=Ri(K),z.c(),Re(z,1),z.m(i.parentNode,i)):z&&(y0(),Ye(z,1,1,()=>{z=null}),x0()),K[0]!==null?L?(L.p(K,ne),ne[0]&1&&Re(L,1)):(L=Fi(K),L.c(),Re(L,1),L.m(o,m)):L&&(y0(),Ye(L,1,1,()=>{L=null}),x0()),K[2]?G||(G=Pi(),G.c(),G.m(o,null)):G&&(G.d(1),G=null)},i(K){p||(Re(z),Re(L),p=!0)},o(K){Ye(z),Ye(L),p=!1},d(K){K&&($e(i),$e(s)),z&&z.d(K),L&&L.d(),G&&G.d(),v[21](null),x=!1,w()}}}function l1(v,i,s){const o={light:()=>ui(()=>Promise.resolve({}),["assets/prism-13e6f0be.css"]),dark:()=>ui(()=>Promise.resolve({}),["assets/prism-dark-f18b46fb.css"])};let{value:m}=i,p=null,{latex_delimiters:x}=i,{pending_message:w=!1}=i,{feedback:z=null}=i,{selectable:L=!1}=i,{show_share_button:G=!1}=i,{theme_mode:K}=i,{rtl:ne=!1}=i,V,xe;const ge=Vi();Os(()=>{xe=V&&V.offsetHeight+V.scrollTop>V.scrollHeight-100});const le=()=>{xe&&V.scrollTo(0,V.scrollHeight)};Wi(()=>{xe&&(le(),V.querySelectorAll("img").forEach(se=>{se.addEventListener("load",()=>{le()})}))});function q(se,ze,Pe){ge("select",{index:[se,ze],value:Pe})}function C(se){At.call(this,v,se)}function _(se){At.call(this,v,se)}function N(se){At.call(this,v,se)}function D(se){At.call(this,v,se)}function I(se){At.call(this,v,se)}function j(se){At.call(this,v,se)}function re(se){At.call(this,v,se)}function Z(se){At.call(this,v,se)}const U=(se,ze,Pe)=>q(se,ze,Pe);function fe(se){Yi[se?"unshift":"push"](()=>{V=se,s(7,V)})}return v.$$set=se=>{"value"in se&&s(0,m=se.value),"latex_delimiters"in se&&s(1,x=se.latex_delimiters),"pending_message"in se&&s(2,w=se.pending_message),"feedback"in se&&s(3,z=se.feedback),"selectable"in se&&s(4,L=se.selectable),"show_share_button"in se&&s(5,G=se.show_share_button),"theme_mode"in se&&s(10,K=se.theme_mode),"rtl"in se&&s(6,ne=se.rtl)},v.$$.update=()=>{v.$$.dirty[0]&1024&&(K=="dark"?o.dark():o.light()),v.$$.dirty[0]&2049&&m!==p&&(s(11,p=m),ge("change"))},[m,x,w,z,L,G,ne,V,le,q,K,p,C,_,N,D,I,j,re,Z,U,fe]}class s1 extends Or{constructor(i){super(),qr(this,i,l1,i1,Pr,{value:0,latex_delimiters:1,pending_message:2,feedback:3,selectable:4,show_share_button:5,theme_mode:10,rtl:6},null,[-1,-1])}}function Hi(v){let i,s;const o=[v[12],{show_progress:v[12].show_progress==="hidden"?"hidden":"minimal"}];let m={};for(let p=0;p{x=null}),x0()),z[7]?w?(w.p(z,L),L&128&&Re(w,1)):(w=Ui(z),w.c(),Re(w,1),w.m(s,o)):w&&(y0(),Ye(w,1,1,()=>{w=null}),x0());const G={};L&256&&(G.selectable=z[8]),L&1024&&(G.show_share_button=z[10]),L&512&&(G.theme_mode=z[9]),L&16384&&(G.value=z[14]),L&8&&(G.latex_delimiters=z[3]),L&4096&&(G.pending_message=z[12]?.status==="pending"),L&2048&&(G.rtl=z[11]),m.$set(G)},i(z){p||(Re(x),Re(w),Re(m.$$.fragment,z),p=!0)},o(z){Ye(x),Ye(w),Ye(m.$$.fragment,z),p=!1},d(z){z&&($e(i),$e(s)),x&&x.d(z),w&&w.d(),G0(m)}}}function u1(v){let i,s;return i=new Ws({props:{elem_id:v[0],elem_classes:v[1],visible:v[2],padding:!1,scale:v[4],min_width:v[5],height:v[13],allow_overflow:!1,$$slots:{default:[o1]},$$scope:{ctx:v}}}),{c(){H0(i.$$.fragment)},m(o,m){U0(i,o,m),s=!0},p(o,[m]){const p={};m&1&&(p.elem_id=o[0]),m&2&&(p.elem_classes=o[1]),m&4&&(p.visible=o[2]),m&16&&(p.scale=o[4]),m&32&&(p.min_width=o[5]),m&8192&&(p.height=o[13]),m&8413128&&(p.$$scope={dirty:m,ctx:o}),i.$set(p)},i(o){s||(Re(i.$$.fragment,o),s=!0)},o(o){Ye(i.$$.fragment,o),s=!1},d(o){G0(i,o)}}}function h1(v,i,s){let{elem_id:o=""}=i,{elem_classes:m=[]}=i,{visible:p=!0}=i,{value:x=[]}=i,w,{latex_delimiters:z}=i,{scale:L=null}=i,{min_width:G=void 0}=i,{label:K}=i,{show_label:ne=!0}=i,{root:V}=i,{root_url:xe}=i,{selectable:ge=!1}=i,{theme_mode:le}=i,{show_share_button:q=!1}=i,{rtl:C=!1}=i;const _=U=>U.replace('src="/file',`src="${V}file`);let{loading_status:N=void 0}=i,{height:D=400}=i;function I(U){At.call(this,v,U)}function j(U){At.call(this,v,U)}function re(U){At.call(this,v,U)}function Z(U){At.call(this,v,U)}return v.$$set=U=>{"elem_id"in U&&s(0,o=U.elem_id),"elem_classes"in U&&s(1,m=U.elem_classes),"visible"in U&&s(2,p=U.visible),"value"in U&&s(15,x=U.value),"latex_delimiters"in U&&s(3,z=U.latex_delimiters),"scale"in U&&s(4,L=U.scale),"min_width"in U&&s(5,G=U.min_width),"label"in U&&s(6,K=U.label),"show_label"in U&&s(7,ne=U.show_label),"root"in U&&s(16,V=U.root),"root_url"in U&&s(17,xe=U.root_url),"selectable"in U&&s(8,ge=U.selectable),"theme_mode"in U&&s(9,le=U.theme_mode),"show_share_button"in U&&s(10,q=U.show_share_button),"rtl"in U&&s(11,C=U.rtl),"loading_status"in U&&s(12,N=U.loading_status),"height"in U&&s(13,D=U.height)},v.$$.update=()=>{v.$$.dirty&229376&&s(14,w=x?x.map(([U,fe])=>[typeof U=="string"?_(U):hi(U,V,xe),typeof fe=="string"?_(fe):hi(fe,V,xe)]):[])},[o,m,p,z,L,G,K,ne,ge,le,q,C,N,D,w,x,V,xe,I,j,re,Z]}class c1 extends Or{constructor(i){super(),qr(this,i,h1,u1,Pr,{elem_id:0,elem_classes:1,visible:2,value:15,latex_delimiters:3,scale:4,min_width:5,label:6,show_label:7,root:16,root_url:17,selectable:8,theme_mode:9,show_share_button:10,rtl:11,loading_status:12,height:13})}}const b1=c1,y1=["static"];export{b1 as Component,y1 as modes}; +//# sourceMappingURL=index-1508c6c1.js.map diff --git a/gradio/templates/cdn/assets/index-1508c6c1.js.map b/gradio/templates/cdn/assets/index-1508c6c1.js.map new file mode 100644 index 0000000000000000000000000000000000000000..982bdf026ea221981a3b7e7108f9fdef07797cc4 --- /dev/null +++ b/gradio/templates/cdn/assets/index-1508c6c1.js.map @@ -0,0 +1 @@ +{"version":3,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KACT,CACH,EACIC,GAAiB,CACnB,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,MACL,EAAK,MACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,KACL,EAAK,K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zC,EACZwD,GACO,iBAAAtD,CAIR,EAAAF,EACQ,OAAAt0B,EAAuB,IAAI,EAAAs0B,EAC3B,WAAAyD,EAAgC,MAAS,EAAAzD,GACzC,MAAA12B,CAAa,EAAA02B,EACb,YAAA0D,GAAa,EAAI,EAAA1D,GACjB,KAAAtvC,CAAY,EAAAsvC,GACZ,SAAA2D,EAAuB,EAAA3D,EACvB,YAAAyC,GAAa,EAAK,EAAAzC,GAClB,WAAA2C,EAAqB,EAAA3C,EACrB,mBAAA0C,EAAoB,EAAK,EAAA1C,EACzB,KAAA4C,EAAM,EAAK,EAAA5C,QAEhB4D,EAAoB/8C,GACzBA,EAAI,QAAQ,aAAY,QAAU6J,OAAI,EAY5B,mBAAAmzC,EAA4C,MAAS,EAAA7D,EACrD,QAAA52B,EAAS,GAAG,EAAA42B,gyBAXtBO,EAAA,GAAEiD,EAASv3C,EACTA,EAAM,IAAM,EAAA63C,EAAUC,EAAO,KACtB,OAAAD,GAAa,SACjBF,EAAiBE,CAAQ,EACzBE,GAAeF,EAAUpzC,EAAMizC,EAAQ,EACnC,OAAAI,IAAY,SAChBH,EAAiBG,EAAO,EACxBC,GAAeD,GAASrzC,EAAMizC,EAAQ,wVCxChCM,GAAQ,CAAC,QAAQ","names":["insert","target","svg","anchor","append","path0","path1","getDefaults","defaults","changeDefaults","newDefaults","escapeTest","escapeReplace","escapeTestNoEncode","escapeReplaceNoEncode","escapeReplacements","getEscapeReplacement","ch","escape","html","encode","unescapeTest","unescape","_","n","caret","edit","regex","opt","obj","name","val","nonWordAndColonTest","originIndependentUrl","cleanUrl","sanitize","base","href","prot","resolveUrl","baseUrls","justDomain","protocol","domain","rtrim","relativeBase","noopTest","splitCells","tableRow","count","row","match","offset","str","escaped","curr","cells","i","c","invert","l","suffLen","currChar","findClosingBracket","b","level","checkDeprecations","callback","repeatString","pattern","result","outputLink","cap","link","raw","lexer","title","text","token","indentCodeCompensation","matchIndentToCode","indentToCode","node","matchIndentInNode","indentInNode","Tokenizer","options","src","trimmed","top","tokens","istask","ischecked","indent","blankLine","endsWithBlankLine","line","nextLine","rawLine","itemContents","endEarly","bull","isordered","list","itemRegex","t","nextBulletRegex","hrRegex","fencesBeginRegex","headingBeginRegex","spacers","hasMultipleLineBreaks","tag","item","j","k","trimmedUrl","rtrimSlash","lastParenIndex","linkLen","links","maskedSrc","prevChar","nextChar","lLength","rDelim","rLength","delimTotal","midDelimTotal","endReg","hasNonSpaceChars","hasSpaceCharsOnBothEnds","mangle","prevCapZero","smartypants","block","inline","out","Lexer","rules","next","leading","tabs","lastToken","cutSrc","lastParagraphClipped","extTokenizer","startIndex","tempSrc","tempStart","getStartIndex","errMsg","keepPrevChar","Renderer","code","infostring","lang","quote","slugger","id","body","ordered","start","type","startatt","checked","header","content","flags","TextRenderer","Slugger","value","originalSlug","isDryRun","slug","occurenceAccumulator","Parser","l2","l3","cell","loose","itemBody","task","checkbox","ret","renderer","Hooks","markdown","onError","silent","async","e","msg","parseMarkdown","parser","origOpt","marked","throwError","highlight","done","err","pending","args","extensions","pack","opts","ext","prevRenderer","prop","tokenizer","prevTokenizer","hooks","prevHook","arg","walkTokens","values","childTokens","markedHighlight","getLang","updateToken","infoString","classAttr","_self","Prism","uniqueId","plainTextGrammar","Token","o","deepClone","visited","clone","key","v","element","m","language","scripts","className","defaultActivation","no","classList","redef","inside","before","root","grammar","newToken","old","DFS","objId","property","propertyType","container","env","parent","insertHighlightedCode","highlightedCode","worker","evt","rest","tokenList","LinkedList","addAfter","matchGrammar","toArray","callbacks","alias","matchedStr","stringify","s","aliases","attributes","matchPattern","pos","lookbehind","lookbehindLength","startNode","startPos","rematch","patterns","patternObj","greedy","currentNode","removeCount","from","to","p","matchStr","after","reach","removeFrom","removeRange","wrapped","nestedRematch","head","tail","newNode","array","message","immediateClose","script","highlightAutomaticallyCallback","readyState","module","global","tagName","includedCdataInside","def","attrName","string","markup","LOADING_MESSAGE","FAILURE_MESSAGE","status","FAILURE_EMPTY_MESSAGE","EXTENSIONS","STATUS_ATTR","STATUS_LOADING","STATUS_LOADED","STATUS_FAILED","SELECTOR","loadFile","success","error","xhr","parseRange","range","comma","end","pre","extension","autoloader","lines","elements","logged","funcPattern","insideEqu","COPY_ICON_CODE","CHECK_ICON_CODE","COPY_BUTTON_CODE","escape_test","escape_replace","escape_test_no_encode","escape_replace_no_encode","escape_replacements","get_escape_replacement","copy","handle_copy","event","path","copy_button","copy_feedback","_copy_sucess_button","copy_text","copy_sucess_button","copy_to_clipboard","copied","textArea","format_chat_for_sharing","chat","message_pair","speaker_emoji","html_content","file_url","uploadToHuggingFace","entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","create","apply","construct","fun","thisValue","x","Func","arrayForEach","unapply","arrayPop","arrayPush","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","regExpTest","typeErrorCreate","unconstruct","func","thisArg","_len","_key","_len2","_key2","addToSet","set","transformCaseFunc","_transformCaseFunc","lcElement","object","newObject","lookupGetter","desc","fallbackValue","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","EXPRESSIONS","getGlobal","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","suffix","ATTR_NAME","policyName","scriptUrl","createDOMPurify","window","DOMPurify","originalDocument","currentScript","document","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","formElement","isRegexOrFunction","testValue","_parseConfig","cfg","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parentTagName","_forceRemove","_removeAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","_createIterator","_isClobbered","elm","_isNode","_executeHook","entryPoint","data","hook","_sanitizeElements","_basicCustomElementTest","parentNode","childNodes","childCount","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","attr","hookEvent","namespaceURI","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","importedNode","returnNode","nodeIterator","serializedHTML","hookFunction","purify","factory","this","__webpack_require__","exports","definition","__webpack_exports__","katex_webpack","ParseError","loc","input","underlined","left","right","self","src_ParseError","contains","elem","deflt","setting","defaultIfUndefined","uppercase","hyphenate","ESCAPE_LOOKUP","ESCAPE_REGEX","utils_escape","getBaseElem","group","isCharacterBox","baseElem","assert","protocolFromUrl","url","utils","SETTINGS_SCHEMA","color","defs","getDefaultValue","schema","defaultType","Settings","_proto","errorCode","errorMsg","strict","context","trust","Style","size","cramped","styles","_sup","_sub","_fracNum","_fracDen","_cramp","_text","D","Dc","T","Tc","S","Sc","SS","SSc","src_Style","scriptData","scriptFromCodepoint","codepoint","_i","allBlocks","supportedCodepoint","hLinePad","sqrtMain","extraVinculum","sqrtSize1","sqrtSize2","sqrtSize3","sqrtSize4","phasePath","y","sqrtTall","viewBoxHeight","vertSegment","sqrtPath","innerPath","height","tallDelim","label","midHeight","children","frag","toText","child","fontMetricsData","sigmasAndXis","extraCharacterMap","setFontMetrics","fontName","metrics","getCharacterMetrics","character","font","mode","fontMetricsBySizeIndex","getGlobalMetrics","sizeIndex","sizeStyleMap","sizeMultipliers","sizeAtStyle","style","Options","wantSize","fontFamily","fontWeight","fontShape","oldOptions","src_Options","ptPerUnit","relativeUnit","validUnit","unit","calculateSize","sizeValue","scale","unitOptions","makeEm","createClass","classes","cls","initNode","_toNode","_toMarkup","Span","attribute","Anchor","_proto2","Img","alt","_proto3","iCombinations","SymbolNode","depth","italic","skew","width","_proto4","span","needsSpan","SvgNode","_proto5","svgNS","PathNode","pathName","alternate","_proto6","LineNode","_proto7","assertSymbolDomNode","assertSpan","ATOMS","NON_ATOMS","symbols","src_symbols","defineSymbol","replace","acceptUnicodeChar","math","symbols_text","main","ams","accent","bin","symbols_close","inner","mathord","op","symbols_open","punct","rel","spacing","textord","ligatures","mathTextSymbols","textSymbols","_ch","letters","_i2","_ch2","wideChar","_i3","_ch3","_i4","_ch4","extraLatin","_i5","_ch5","wideLatinLetterData","wideNumeralData","wideCharacterFont","H","L","codePoint","lookupSymbol","makeSymbol","lookup","symbolNode","mathsym","boldsymbol","makeOrd","isFont","fontOrFamily","_wideCharacterFont","wideFontName","wideFontClass","fontClasses","fontData","fontMap","retrieveTextFontName","parts","makeFragment","_fontName","_fontName2","_fontName3","canCombine","prev","_style","tryCombineChars","chars","sizeElementFromChildren","maxFontSize","makeSpan","makeSvgSpan","makeLineSpan","thickness","makeAnchor","wrapFragment","getVListChildrenAndDepth","params","oldChildren","_depth","currPos","diff","bottom","firstChild","makeVList","_getVListChildrenAndD","pstrutSize","pstrut","realChildren","minPos","maxPos","_child","_elem","childWrap","vlist","rows","emptySpan","depthStrut","topStrut","vtable","makeGlue","measurement","rule","baseFontName","fontStylesName","svgData","staticSvg","_svgData$value","svgNode","buildCommon","thinspace","mediumspace","thickspace","spacings","tightSpacings","_functions","_htmlGroupBuilders","_mathmlGroupBuilders","defineFunction","_ref","names","props","handler","htmlBuilder","mathmlBuilder","defineFunctionBuilders","_ref2","normalizeArgument","ordargument","buildHTML_makeSpan","binLeftCanceller","binRightCanceller","styleMap","DomEnum","buildExpression","expression","isRealGroup","surrounding","groups","output","buildGroup","glueOptions","dummyPrev","dummyNext","isRoot","traverseNonSpaceNodes","prevType","getTypeOfDomTree","space","nodes","partialGroup","checkPartialGroup","nonspace","index","getOutermostNode","side","makeNullDelimiter","moreClasses","baseOptions","groupNode","multiplier","buildHTMLUnbreakable","strut","buildHTML","tree","eqnNum","nobreak","tagChild","htmlNode","newDocumentFragment","MathNode","TextNode","SpaceNode","mathMLTree","makeText","makeRow","getVariant","buildMathML_buildExpression","isOrdgroup","buildMathML_buildGroup","lastGroup","_group","_lastGroup$children","_lastGroup$children2","_lastGroup$children3","lastChild","buildExpressionRow","buildMathML","texExpression","isDisplayMode","forMathmlOnly","wrapper","annotation","semantics","wrapperClass","optionsFromSettings","settings","displayWrap","buildTree","katexNode","mathMLNode","_htmlNode","buildHTMLTree","stretchyCodePoint","mathMLnode","katexImagesData","groupLength","svgSpan","buildSvgSpan_","viewBoxWidth","grp","numChars","_height","imgIndex","spans","paths","_minWidth","_viewBoxHeight","_height2","numSvgChildren","widthClasses","aligns","align1","_path","_svgNode","_span","_buildSvgSpan_","minWidth","encloseSpan","topPad","bottomPad","img","totalHeight","stretchy","assertNodeType","assertSymbolNodeType","typedNode","checkSymbolNodeType","supSubGroup","mustShift","baseChar","baseGroup","accentBelow","clearance","accentBody","accentFull","accentWrap","accentNode","NON_STRETCHY_ACCENT_REGEX","isStretchy","isShifty","funcName","innerGroup","kern","paddedNode","optArgs","newOptions","upperGroup","arrowPrefix","lowerGroup","arrowBody","arrowShift","upperShift","lowerShift","arrowNode","upperNode","lowerNode","_lowerNode","mclass_makeSpan","mclass_htmlBuilder","mclass_mathmlBuilder","binrelClass","atom","_ref3","baseArg","shiftedArg","mclass","baseOp","supsub","cdArrowFunctionName","newCell","isStartOfArrow","isLabelEnd","endChar","cdArrow","arrowChar","labels","leftLabel","bareArrow","sizedArrow","rightLabel","arrowGroup","arrow","parseCD","parsedRows","rowNodes","labelNum","inLabel","wrappedArrow","cols","number","color_htmlBuilder","color_mathmlBuilder","breakOnTokenText","newLine","globalMap","checkControlSequence","tok","getRHS","letCommand","macro","numArgs","delimiters","_parser$gullet$consum","_ref4","middle","getMetrics","symbol","styleWrap","delim","toStyle","delimSizeMultiplier","centerSpan","shift","makeSmallDelim","center","mathrmSize","makeLargeDelim","makeGlyphSpan","sizeClass","corner","makeInner","lapInEms","lap","verts","doubleVerts","makeStackedDelim","heightTotal","repeat","svgLabel","topMetrics","topHeightTotal","repeatMetrics","repeatHeightTotal","bottomMetrics","bottomHeightTotal","middleHeightTotal","middleFactor","middleMetrics","minHeight","repeatCount","realHeightTotal","axisHeight","stack","pathStr","innerHeight","_innerHeight","vbPad","emPad","sqrtSvg","sqrtName","pathNode","makeSqrtImage","traverseSequence","stackLargeDelimiterSequence","sizeMultiplier","spanHeight","texHeight","advanceWidth","sizeToMaxHeight","stackLargeDelimiters","stackAlwaysDelimiters","stackNeverDelimiters","makeSizedDelim","stackNeverDelimiterSequence","stackAlwaysDelimiterSequence","delimTypeToFont","sequence","heightDepth","makeCustomSizedDelim","delimType","makeLeftRightDelim","delimiterFactor","delimiterExtend","maxDistFromAxis","delimiter","delimiterSizes","checkDelimiter","symDelim","assertParsed","innerDepth","hadMiddle","leftDelim","middleDelim","isMiddle","rightDelim","colorOptions","leftNode","rightNode","textNode","middleNode","enclose_htmlBuilder","imgShift","isSingleChar","lineWeight","angleHeight","ruleThickness","enclose_mathmlBuilder","fboxsep","thk","borderColor","backgroundColor","_ref5","_environments","defineEnvironment","_macros","defineMacro","SourceLocation","first","second","endToken","getHLines","hlineInfo","nxt","validateAmsEnvironmentContext","getAutoTag","parseArray","hskipBeforeAndAfter","addJot","arraystretch","colSeparationType","autoTag","singleRow","emptySingleRow","maxNumCols","leqno","stretch","rowGaps","hLinesBeforeRow","tags","beginRow","endRow","dCellStyle","envName","array_htmlBuilder","nr","nc","hlines","pt","arraycolsep","localMultiplier","baselineskip","jot","arrayskip","arstrutHeight","arstrutDepth","setHLinePos","hlinesInGap","inrow","outrow","elt","rowGap","gap","colDescriptions","colSep","colDescrNum","tagSpans","rw","tagSpan","colDescr","firstSeparator","lineType","separator","_shift","sepwidth","col","_shift2","dashes","vListElems","hline","lineShift","eqnNumCol","alignMap","array_mathmlBuilder","tbl","glue","table","menclose","align","columnLines","prevTypeWasAlign","iStart","iEnd","_cols","rowLines","alignedHandler","separationType","isSplit","res","numMaths","numCols","emptyGroup","arg0","isAligned","styling","ordgroup","curMaths","pregap","symNode","colalign","nde","ca","colAlign","payload","environments","src_environments","nameGroup","_parser$parseArgument","_args","endNameToken","font_htmlBuilder","font_mathmlBuilder","fontAliases","adjustStyle","originalStyle","genfrac_htmlBuilder","nstyle","dstyle","numerm","hStrut","dStrut","denomm","ruleWidth","ruleSpacing","numShift","denomShift","frac","midShift","candidateClearance","delimSize","genfrac_mathmlBuilder","isDisplay","withDelims","leftOp","rightOp","numer","denom","hasBarLine","replaceWith","stylArray","delimFromValue","delimString","barNode","barSize","styl","textOrd","_ref6","horizBrace_htmlBuilder","braceBody","vSpan","horizBrace_mathmlBuilder","trustContext","keyVal","sizeData","totalheight","attributeStr","mathFunction","muUnit","dimension","fix","outerMode","close","chooseMathStyle","assembleSupSub","supGroup","subGroup","slant","baseShift","subIsSingleCharacter","sub","sup","finalGroup","_bottom","spacer","noSuccessor","op_htmlBuilder","hasLimits","large","stash","oval","op_mathmlBuilder","operator","singleCharBigOps","fName","singleCharIntegrals","operatorname_htmlBuilder","childText","operatorname_mathmlBuilder","isAllString","word","identifier","defaultRuleThickness","phantom","amount","dy","sizingGroup","sizeFuncs","sizing_htmlBuilder","smashHeight","smashDepth","tbArg","letter","smashedNode","theta","phi","lineClearance","minDelimiterHeight","_delimiter$sqrtImage","delimDepth","rootm","toShift","rootVList","rootVListWrap","styling_styleMap","newStyle","styleAttributes","htmlBuilderDelegate","delegate","_delegate","isSup","builderDelegate","valueBase","valueSup","valueSub","supm","subm","supShift","subShift","_newOptions","minSupShift","marginRight","marginLeft","isOiint","maxWidth","psi","vlistElem","_vlistElem","isBrace","isOver","nodeType","_base2","_base","variant","defaultVariant","cssSpace","regularSpace","ord","pad","padNode","textFontFamilies","textFontWeights","textFontShapes","optionsWithFont","makeVerb","functions","src_functions","spaceRegexString","controlWordRegexString","controlSymbolRegexString","controlWordWhitespaceRegexString","controlSpaceRegexString","combiningDiacriticalMarkString","combiningDiacriticalMarksEndRegex","tokenRegexString","char","nlIndex","Namespace","builtins","globalMacros","undefs","undef","macros","src_macros","nextToken","digitToNumber","digit","newcommand","existsOK","nonexistsOK","exists","argText","dotsByToken","thedots","spaceAfterDots","latexRaiseA","braketHelper","one","middleDouble","oldMiddle","oldMiddleDouble","midMacro","double","doubled","expanded","implicitCommands","MacroExpander","newMode","_this$stack","isOptional","_this$consumeArg","_this$consumeArg2","delims","isDelimited","expandableOnly","topToken","expansion","_tokens","oldStackLength","catcode","stripped","bodyLexer","unicodeSubRegEx","uSubsAndSups","unicodeAccents","unicodeSymbols","consume","parse","oldToken","breakOnInfix","lex","overIndex","numerNode","denomNode","numerBody","denomBody","symbolToken","textordArray","colorNode","superscript","subscript","limits","prime","primes","isSub","funcData","_this$parseArguments","totalArgs","argType","optional","modeName","argToken","firstToken","isBlank","groupEnd","a","nucleus","star","family","command","parseTree","toParse","src_parseTree","render","baseNode","renderToDomTree","renderToString","generateParseTree","renderError","renderToHTMLTree","katex","require$$0","__WEBPACK_EXTERNAL_MODULE__771__","__webpack_modules__","__webpack_module_cache__","moduleId","cachedModule","getter","auto_render","external_katex_","external_katex_default","findEndOfMath","braceLevel","delimLength","escapeRegex","amsRegex","splitAtDelimiters","regexLeft","rawData","auto_render_splitAtDelimiters","renderMathInText","optionsCopy","renderElem","childNode","textContentConcat","sibling","nSiblings","shouldRender","renderMathInElement","option","dispatch","createEventDispatcher","$$props","old_message","latex_delimiters","el","mounted","afterUpdate","tick","$$invalidate","$$value","render_math_in_element","div_1","ctx","each_blocks","t_value","a_href_value","a_download_value","set_data","src_url_equal","img_src_value","img_alt_value","video","video_src_value","video_title_value","track","audio","audio_src_value","audio_title_value","create_if_block_3","button","toggle_class","div3","create_if_block_8","if_block1","create_if_block_1","create_if_block","div1","div0","code_highlight_css","old_value","pending_message","feedback","selectable","show_share_button","theme_mode","rtl","div","autoscroll","beforeUpdate","scroll","handle_select","click_handler","Chat","blocklabel_changes","elem_id","elem_classes","visible","_value","min_width","show_label","root_url","redirect_src_url","loading_status","user_msg","bot_msg","normalise_file","modes"],"sources":["../../../../js/icons/src/Chat.svelte","../../../../node_modules/.pnpm/marked@5.0.1/node_modules/marked/lib/marked.esm.js","../../../../node_modules/.pnpm/marked-highlight@2.0.1_marked@5.0.1/node_modules/marked-highlight/src/index.js","../../../../node_modules/.pnpm/prismjs@1.29.0/node_modules/prismjs/prism.js","../../../../node_modules/.pnpm/prismjs@1.29.0/node_modules/prismjs/components/prism-python.js","../../../../node_modules/.pnpm/prismjs@1.29.0/node_modules/prismjs/components/prism-latex.js","../../../../js/chatbot/src/utils.ts","../../../../node_modules/.pnpm/dompurify@3.0.3/node_modules/dompurify/dist/purify.es.js","../../../../node_modules/.pnpm/katex@0.16.7/node_modules/katex/dist/katex.js","../../../../node_modules/.pnpm/katex@0.16.7/node_modules/katex/dist/contrib/auto-render.js","../../../../js/chatbot/src/static/MarkdownCode.svelte","../../../../js/chatbot/src/static/ChatBot.svelte","../../../../js/chatbot/src/Index.svelte","../../../../js/app/src/components/Chatbot/index.ts"],"sourcesContent":["\n\t\n\t\n\n","/**\n * marked v5.0.1 - a markdown parser\n * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/markedjs/marked\n */\n\n/**\n * DO NOT EDIT THIS FILE\n * The code in this file is generated from files in ./src/\n */\n\nfunction getDefaults() {\n return {\n async: false,\n baseUrl: null,\n breaks: false,\n extensions: null,\n gfm: true,\n headerIds: true,\n headerPrefix: '',\n highlight: null,\n hooks: null,\n langPrefix: 'language-',\n mangle: true,\n pedantic: false,\n renderer: null,\n sanitize: false,\n sanitizer: null,\n silent: false,\n smartypants: false,\n tokenizer: null,\n walkTokens: null,\n xhtml: false\n };\n}\n\nlet defaults = getDefaults();\n\nfunction changeDefaults(newDefaults) {\n defaults = newDefaults;\n}\n\n/**\n * Helpers\n */\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nconst unescapeTest = /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig;\n\n/**\n * @param {string} html\n */\nfunction unescape(html) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nconst caret = /(^|[^\\[])\\^/g;\n\n/**\n * @param {string | RegExp} regex\n * @param {string} opt\n */\nfunction edit(regex, opt) {\n regex = typeof regex === 'string' ? regex : regex.source;\n opt = opt || '';\n const obj = {\n replace: (name, val) => {\n val = val.source || val;\n val = val.replace(caret, '$1');\n regex = regex.replace(name, val);\n return obj;\n },\n getRegex: () => {\n return new RegExp(regex, opt);\n }\n };\n return obj;\n}\n\nconst nonWordAndColonTest = /[^\\w:]/g;\nconst originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;\n\n/**\n * @param {boolean} sanitize\n * @param {string} base\n * @param {string} href\n */\nfunction cleanUrl(sanitize, base, href) {\n if (sanitize) {\n let prot;\n try {\n prot = decodeURIComponent(unescape(href))\n .replace(nonWordAndColonTest, '')\n .toLowerCase();\n } catch (e) {\n return null;\n }\n if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {\n return null;\n }\n }\n if (base && !originIndependentUrl.test(href)) {\n href = resolveUrl(base, href);\n }\n try {\n href = encodeURI(href).replace(/%25/g, '%');\n } catch (e) {\n return null;\n }\n return href;\n}\n\nconst baseUrls = {};\nconst justDomain = /^[^:]+:\\/*[^/]*$/;\nconst protocol = /^([^:]+:)[\\s\\S]*$/;\nconst domain = /^([^:]+:\\/*[^/]*)[\\s\\S]*$/;\n\n/**\n * @param {string} base\n * @param {string} href\n */\nfunction resolveUrl(base, href) {\n if (!baseUrls[' ' + base]) {\n // we can ignore everything in base after the last slash of its path component,\n // but we might need to add _that_\n // https://tools.ietf.org/html/rfc3986#section-3\n if (justDomain.test(base)) {\n baseUrls[' ' + base] = base + '/';\n } else {\n baseUrls[' ' + base] = rtrim(base, '/', true);\n }\n }\n base = baseUrls[' ' + base];\n const relativeBase = base.indexOf(':') === -1;\n\n if (href.substring(0, 2) === '//') {\n if (relativeBase) {\n return href;\n }\n return base.replace(protocol, '$1') + href;\n } else if (href.charAt(0) === '/') {\n if (relativeBase) {\n return href;\n }\n return base.replace(domain, '$1') + href;\n } else {\n return base + href;\n }\n}\n\nconst noopTest = { exec: function noopTest() {} };\n\nfunction splitCells(tableRow, count) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(/\\|/g, (match, offset, str) => {\n let escaped = false,\n curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(/ \\|/);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) { cells.shift(); }\n if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }\n\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(/\\\\\\|/g, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param {string} str\n * @param {string} c\n * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.\n */\nfunction rtrim(str, c, invert) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nfunction findClosingBracket(str, b) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n const l = str.length;\n let level = 0,\n i = 0;\n for (; i < l; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\nfunction checkDeprecations(opt, callback) {\n if (!opt || opt.silent) {\n return;\n }\n\n if (callback) {\n console.warn('marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async');\n }\n\n if (opt.sanitize || opt.sanitizer) {\n console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');\n }\n\n if (opt.highlight || opt.langPrefix !== 'language-') {\n console.warn('marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight.');\n }\n\n if (opt.mangle) {\n console.warn('marked(): mangle parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-mangle.');\n }\n\n if (opt.baseUrl) {\n console.warn('marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url.');\n }\n\n if (opt.smartypants) {\n console.warn('marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants.');\n }\n\n if (opt.xhtml) {\n console.warn('marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml.');\n }\n\n if (opt.headerIds || opt.headerPrefix) {\n console.warn('marked(): headerIds and headerPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-gfm-heading-id.');\n }\n}\n\n// copied from https://stackoverflow.com/a/5450113/806777\n/**\n * @param {string} pattern\n * @param {number} count\n */\nfunction repeatString(pattern, count) {\n if (count < 1) {\n return '';\n }\n let result = '';\n while (count > 1) {\n if (count & 1) {\n result += pattern;\n }\n count >>= 1;\n pattern += pattern;\n }\n return result + pattern;\n}\n\nfunction outputLink(cap, link, raw, lexer) {\n const href = link.href;\n const title = link.title ? escape(link.title) : null;\n const text = cap[1].replace(/\\\\([\\[\\]])/g, '$1');\n\n if (cap[0].charAt(0) !== '!') {\n lexer.state.inLink = true;\n const token = {\n type: 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text)\n };\n lexer.state.inLink = false;\n return token;\n }\n return {\n type: 'image',\n raw,\n href,\n title,\n text: escape(text)\n };\n}\n\nfunction indentCodeCompensation(raw, text) {\n const matchIndentToCode = raw.match(/^(\\s+)(?:```)/);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(/^\\s+/);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nclass Tokenizer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n space(src) {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0]\n };\n }\n }\n\n code(src) {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ {1,4}/gm, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text\n };\n }\n }\n\n fences(src) {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '');\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],\n text\n };\n }\n }\n\n heading(src) {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (/#$/.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || / $/.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n hr(src) {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: cap[0]\n };\n }\n }\n\n blockquote(src) {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n const text = cap[0].replace(/^ *>[ \\t]?/gm, '');\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n const tokens = this.lexer.blockTokens(text);\n this.lexer.state.top = top;\n return {\n type: 'blockquote',\n raw: cap[0],\n tokens,\n text\n };\n }\n }\n\n list(src) {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,\n line, nextLine, rawLine, itemContents, endEarly;\n\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: []\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`);\n\n // Check if current bullet point can start a new List Item\n while (src) {\n endEarly = false;\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n line = cap[2].split('\\n', 1)[0].replace(/^\\t+/, (t) => ' '.repeat(3 * t.length));\n nextLine = src.split('\\n', 1)[0];\n\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimLeft();\n } else {\n indent = cap[2].search(/[^ ]/); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n blankLine = false;\n\n if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`);\n const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`);\n const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`);\n const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);\n\n // Check if following lines should be included in List Item\n while (src) {\n rawLine = src.split('\\n', 1)[0];\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(src)) {\n break;\n }\n\n if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLine.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.search(/[^ ]/) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLine.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (/\\n *\\n *$/.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n // Check for task list items\n if (this.options.gfm) {\n istask = /^\\[[ xX]\\] /.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(/^\\[[ xX]\\] +/, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n list.items[list.items.length - 1].raw = raw.trimRight();\n list.items[list.items.length - 1].text = itemContents.trimRight();\n list.raw = list.raw.trimRight();\n\n const l = list.items.length;\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (i = 0; i < l; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\\n.*\\n/.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (i = 0; i < l; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src) {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: !this.options.sanitizer\n && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),\n text: cap[0]\n };\n if (this.options.sanitize) {\n const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);\n token.type = 'paragraph';\n token.text = text;\n token.tokens = this.lexer.inline(text);\n }\n return token;\n }\n }\n\n def(src) {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(/\\s+/g, ' ');\n const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title\n };\n }\n }\n\n table(src) {\n const cap = this.rules.block.table.exec(src);\n if (cap) {\n const item = {\n type: 'table',\n header: splitCells(cap[1]).map(c => { return { text: c }; }),\n align: cap[2].replace(/^ *|\\| *$/g, '').split(/ *\\| */),\n rows: cap[3] && cap[3].trim() ? cap[3].replace(/\\n[ \\t]*$/, '').split('\\n') : []\n };\n\n if (item.header.length === item.align.length) {\n item.raw = cap[0];\n\n let l = item.align.length;\n let i, j, k, row;\n for (i = 0; i < l; i++) {\n if (/^ *-+: *$/.test(item.align[i])) {\n item.align[i] = 'right';\n } else if (/^ *:-+: *$/.test(item.align[i])) {\n item.align[i] = 'center';\n } else if (/^ *:-+ *$/.test(item.align[i])) {\n item.align[i] = 'left';\n } else {\n item.align[i] = null;\n }\n }\n\n l = item.rows.length;\n for (i = 0; i < l; i++) {\n item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });\n }\n\n // parse child tokens inside headers and cells\n\n // header child tokens\n l = item.header.length;\n for (j = 0; j < l; j++) {\n item.header[j].tokens = this.lexer.inline(item.header[j].text);\n }\n\n // cell child tokens\n l = item.rows.length;\n for (j = 0; j < l; j++) {\n row = item.rows[j];\n for (k = 0; k < row.length; k++) {\n row[k].tokens = this.lexer.inline(row[k].text);\n }\n }\n\n return item;\n }\n }\n }\n\n lheading(src) {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1])\n };\n }\n }\n\n paragraph(src) {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text)\n };\n }\n }\n\n text(src) {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0])\n };\n }\n }\n\n escape(src) {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: escape(cap[1])\n };\n }\n }\n\n tag(src) {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && /^
    /i.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && /^<\\/(pre|code|kbd|script)(\\s|>)/i.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: this.options.sanitize\n ? 'text'\n : 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: this.options.sanitize\n ? (this.options.sanitizer\n ? this.options.sanitizer(cap[0])\n : escape(cap[0]))\n : cap[0]\n };\n }\n }\n\n link(src) {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && /^$/.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (/^$/.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline._escapes, '$1') : href,\n title: title ? title.replace(this.rules.inline._escapes, '$1') : title\n }, cap[0], this.lexer);\n }\n }\n\n reflink(src, links) {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n let link = (cap[2] || cap[1]).replace(/\\s+/g, ' ');\n link = links[link.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text\n };\n }\n return outputLink(cap, link, cap[0], this.lexer);\n }\n }\n\n emStrong(src, maskedSrc, prevChar = '') {\n let match = this.rules.inline.emStrong.lDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(/[\\p{L}\\p{N}]/u)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || (nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {\n const lLength = match[0].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = rDelim.length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n\n const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text)\n };\n }\n }\n }\n\n codespan(src) {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(/\\n/g, ' ');\n const hasNonSpaceChars = /[^ ]/.test(text);\n const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n text = escape(text, true);\n return {\n type: 'codespan',\n raw: cap[0],\n text\n };\n }\n }\n\n br(src) {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0]\n };\n }\n }\n\n del(src) {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2])\n };\n }\n }\n\n autolink(src, mangle) {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);\n href = 'mailto:' + text;\n } else {\n text = escape(cap[1]);\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n url(src, mangle) {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];\n } while (prevCapZero !== cap[0]);\n text = escape(cap[0]);\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text\n }\n ]\n };\n }\n }\n\n inlineText(src, smartypants) {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n let text;\n if (this.lexer.state.inRawBlock) {\n text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];\n } else {\n text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);\n }\n return {\n type: 'text',\n raw: cap[0],\n text\n };\n }\n }\n}\n\n/**\n * Block-Level Grammar\n */\nconst block = {\n newline: /^(?: *(?:\\n|$))+/,\n code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,\n fences: /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/,\n hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,\n heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,\n blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,\n list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,\n html: '^ {0,3}(?:' // optional indentation\n + '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:[^\\\\n]*\\\\n+|$)' // (1)\n + '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n + '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n + '|\\\\n*|$)' // (4)\n + '|\\\\n*|$)' // (5)\n + '|)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (6)\n + '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) open tag\n + '|(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)' // (7) closing tag\n + ')',\n def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,\n table: noopTest,\n lheading: /^((?:.|\\n(?!\\n))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n // regex template, placeholders will be replaced according to different paragraph\n // interruption rules of commonmark and the original markdown spec:\n _paragraph: /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,\n text: /^[^\\n]+/\n};\n\nblock._label = /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/;\nblock._title = /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/;\nblock.def = edit(block.def)\n .replace('label', block._label)\n .replace('title', block._title)\n .getRegex();\n\nblock.bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nblock.listItemStart = edit(/^( *)(bull) */)\n .replace('bull', block.bullet)\n .getRegex();\n\nblock.list = edit(block.list)\n .replace(/bull/g, block.bullet)\n .replace('hr', '\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))')\n .replace('def', '\\\\n+(?=' + block.def.source + ')')\n .getRegex();\n\nblock._tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'\n + '|track|ul';\nblock._comment = /|$)/;\nblock.html = edit(block.html, 'i')\n .replace('comment', block._comment)\n .replace('tag', block._tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nblock.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.blockquote = edit(block.blockquote)\n .replace('paragraph', block.paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nblock.normal = { ...block };\n\n/**\n * GFM Block Grammar\n */\n\nblock.gfm = {\n ...block.normal,\n table: '^ *([^\\\\n ].*\\\\|.*)\\\\n' // Header\n + ' {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?' // Align\n + '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)' // Cells\n};\n\nblock.gfm.table = edit(block.gfm.table)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('blockquote', ' {0,3}>')\n .replace('code', ' {4}[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nblock.gfm.paragraph = edit(block._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' {0,3}#{1,6} ')\n .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs\n .replace('table', block.gfm.table) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nblock.pedantic = {\n ...block.normal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+? *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', block._comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(block.normal._paragraph)\n .replace('hr', block.hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', block.lheading)\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .getRegex()\n};\n\n/**\n * Inline-Level Grammar\n */\nconst inline = {\n escape: /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,\n autolink: /^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/,\n url: noopTest,\n tag: '^comment'\n + '|^' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. \n + '|^' // declaration, e.g. \n + '|^', // CDATA section\n link: /^!?\\[(label)\\]\\(\\s*(href)(?:\\s+(title))?\\s*\\)/,\n reflink: /^!?\\[(label)\\]\\[(ref)\\]/,\n nolink: /^!?\\[(ref)\\](?:\\[\\])?/,\n reflinkSearch: 'reflink|nolink(?!\\\\()',\n emStrong: {\n lDelim: /^(?:\\*+(?:([punct_])|[^\\s*]))|^_+(?:([punct*])|([^\\s_]))/,\n // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.\n // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a\n rDelimAst: /^(?:[^_*\\\\]|\\\\.)*?\\_\\_(?:[^_*\\\\]|\\\\.)*?\\*(?:[^_*\\\\]|\\\\.)*?(?=\\_\\_)|(?:[^*\\\\]|\\\\.)+(?=[^*])|[punct_](\\*+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[punct_\\s]|$)|[punct_\\s](\\*+)(?=[^punct*_\\s])|[\\s](\\*+)(?=[punct_])|[punct_](\\*+)(?=[punct_])|(?:[^punct*_\\s\\\\]|\\\\.)(\\*+)(?=[^punct*_\\s])/,\n rDelimUnd: /^(?:[^_*\\\\]|\\\\.)*?\\*\\*(?:[^_*\\\\]|\\\\.)*?\\_(?:[^_*\\\\]|\\\\.)*?(?=\\*\\*)|(?:[^_\\\\]|\\\\.)+(?=[^_])|[punct*](\\_+)(?=[\\s]|$)|(?:[^punct*_\\s\\\\]|\\\\.)(\\_+)(?=[punct*\\s]|$)|[punct*\\s](\\_+)(?=[^punct*_\\s])|[\\s](\\_+)(?=[punct*])|[punct*](\\_+)(?=[punct*])/ // ^- Not allowed for _\n },\n code: /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,\n br: /^( {2,}|\\\\)\\n(?!\\s*$)/,\n del: noopTest,\n text: /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\?@\\\\[\\\\]`^{|}~';\ninline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();\n\n// sequences em should skip over [title](link), `code`, \ninline.blockSkip = /\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>/g;\n// lookbehind is not available on Safari as of version 16\n// inline.escapedEmSt = /(?<=(?:^|[^\\\\)(?:\\\\[^])*)\\\\[*_]/g;\ninline.escapedEmSt = /(?:^|[^\\\\])(?:\\\\\\\\)*\\\\[*_]/g;\n\ninline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();\n\ninline.emStrong.lDelim = edit(inline.emStrong.lDelim)\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')\n .replace(/punct/g, inline._punctuation)\n .getRegex();\n\ninline._escapes = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/g;\n\ninline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;\ninline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;\ninline.autolink = edit(inline.autolink)\n .replace('scheme', inline._scheme)\n .replace('email', inline._email)\n .getRegex();\n\ninline._attribute = /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/;\n\ninline.tag = edit(inline.tag)\n .replace('comment', inline._comment)\n .replace('attribute', inline._attribute)\n .getRegex();\n\ninline._label = /(?:\\[(?:\\\\.|[^\\[\\]\\\\])*\\]|\\\\.|`[^`]*`|[^\\[\\]\\\\`])*?/;\ninline._href = /<(?:\\\\.|[^\\n<>\\\\])+>|[^\\s\\x00-\\x1f]*/;\ninline._title = /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/;\n\ninline.link = edit(inline.link)\n .replace('label', inline._label)\n .replace('href', inline._href)\n .replace('title', inline._title)\n .getRegex();\n\ninline.reflink = edit(inline.reflink)\n .replace('label', inline._label)\n .replace('ref', block._label)\n .getRegex();\n\ninline.nolink = edit(inline.nolink)\n .replace('ref', block._label)\n .getRegex();\n\ninline.reflinkSearch = edit(inline.reflinkSearch, 'g')\n .replace('reflink', inline.reflink)\n .replace('nolink', inline.nolink)\n .getRegex();\n\n/**\n * Normal Inline Grammar\n */\n\ninline.normal = { ...inline };\n\n/**\n * Pedantic Inline Grammar\n */\n\ninline.pedantic = {\n ...inline.normal,\n strong: {\n start: /^__|\\*\\*/,\n middle: /^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,\n endAst: /\\*\\*(?!\\*)/g,\n endUnd: /__(?!_)/g\n },\n em: {\n start: /^_|\\*/,\n middle: /^()\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)|^_(?=\\S)([\\s\\S]*?\\S)_(?!_)/,\n endAst: /\\*(?!\\*)/g,\n endUnd: /_(?!_)/g\n },\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', inline._label)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', inline._label)\n .getRegex()\n};\n\n/**\n * GFM Inline Grammar\n */\n\ninline.gfm = {\n ...inline.normal,\n escape: edit(inline.escape).replace('])', '~|])').getRegex(),\n _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,\n url: /^((?:ftp|https?):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/,\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])([\\s\\S]*?[^\\s~])\\1(?=[^~]|$)/,\n text: /^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\ 0.5) {\n ch = 'x' + ch.toString(16);\n }\n out += '&#' + ch + ';';\n }\n\n return out;\n}\n\n/**\n * Block Lexer\n */\nclass Lexer {\n constructor(options) {\n this.tokens = [];\n this.tokens.links = Object.create(null);\n this.options = options || defaults;\n this.options.tokenizer = this.options.tokenizer || new Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true\n };\n\n const rules = {\n block: block.normal,\n inline: inline.normal\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src, options) {\n const lexer = new Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src) {\n src = src\n .replace(/\\r\\n|\\r/g, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n let next;\n while (next = this.inlineQueue.shift()) {\n this.inlineTokens(next.src, next.tokens);\n }\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src, tokens = []) {\n if (this.options.pedantic) {\n src = src.replace(/\\t/g, ' ').replace(/^ +$/gm, '');\n } else {\n src = src.replace(/^( *)(\\t+)/gm, (_, leading, tabs) => {\n return leading + ' '.repeat(tabs.length);\n });\n }\n\n let token, lastToken, cutSrc, lastParagraphClipped;\n\n while (src) {\n if (this.options.extensions\n && this.options.extensions.block\n && this.options.extensions.block.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n if (token.raw.length === 1 && tokens.length > 0) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unecessary paragraph tags\n tokens[tokens.length - 1].raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n // An indented code block cannot interrupt a paragraph.\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title\n };\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n lastToken = tokens[tokens.length - 1];\n if (lastParagraphClipped && lastToken.type === 'paragraph') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = (cutSrc.length !== src.length);\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += '\\n' + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src, tokens = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src, tokens = []) {\n let token, lastToken, cutSrc;\n\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match;\n let keepPrevChar, prevChar;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n // Mask out other blocks\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out escaped em & strong delimiters\n while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);\n this.tokenizer.rules.inline.escapedEmSt.lastIndex--;\n }\n\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n // extensions\n if (this.options.extensions\n && this.options.extensions.inline\n && this.options.extensions.inline.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n lastToken = tokens[tokens.length - 1];\n if (lastToken && token.type === 'text' && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src, mangle)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n cutSrc = src;\n if (this.options.extensions && this.options.extensions.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach(function(getStartIndex) {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n lastToken = tokens[tokens.length - 1];\n if (lastToken && lastToken.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n\n/**\n * Renderer\n */\nclass Renderer {\n constructor(options) {\n this.options = options || defaults;\n }\n\n code(code, infostring, escaped) {\n const lang = (infostring || '').match(/\\S*/)[0];\n if (this.options.highlight) {\n const out = this.options.highlight(code, lang);\n if (out != null && out !== code) {\n escaped = true;\n code = out;\n }\n }\n\n code = code.replace(/\\n$/, '') + '\\n';\n\n if (!lang) {\n return '
    '\n        + (escaped ? code : escape(code, true))\n        + '
    \\n';\n }\n\n return '
    '\n      + (escaped ? code : escape(code, true))\n      + '
    \\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `
    \\n${quote}
    \\n`;\n }\n\n html(html, block) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `${text}\\n`;\n }\n\n // ignore IDs\n return `${text}\\n`;\n }\n\n hr() {\n return this.options.xhtml ? '
    \\n' : '
    \\n';\n }\n\n list(body, ordered, start) {\n const type = ordered ? 'ol' : 'ul',\n startatt = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startatt + '>\\n' + body + '\\n';\n }\n\n /**\n * @param {string} text\n */\n listitem(text) {\n return `
  • ${text}
  • \\n`;\n }\n\n checkbox(checked) {\n return ' ';\n }\n\n /**\n * @param {string} text\n */\n paragraph(text) {\n return `

    ${text}

    \\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `${body}`;\n\n return '\\n'\n + '\\n'\n + header\n + '\\n'\n + body\n + '
    \\n';\n }\n\n /**\n * @param {string} content\n */\n tablerow(content) {\n return `\\n${content}\\n`;\n }\n\n tablecell(content, flags) {\n const type = flags.header ? 'th' : 'td';\n const tag = flags.align\n ? `<${type} align=\"${flags.align}\">`\n : `<${type}>`;\n return tag + content + `\\n`;\n }\n\n /**\n * span level renderer\n * @param {string} text\n */\n strong(text) {\n return `${text}`;\n }\n\n /**\n * @param {string} text\n */\n em(text) {\n return `${text}`;\n }\n\n /**\n * @param {string} text\n */\n codespan(text) {\n return `${text}`;\n }\n\n br() {\n return this.options.xhtml ? '
    ' : '
    ';\n }\n\n /**\n * @param {string} text\n */\n del(text) {\n return `${text}`;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n link(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n let out = '
    ';\n return out;\n }\n\n /**\n * @param {string} href\n * @param {string} title\n * @param {string} text\n */\n image(href, title, text) {\n href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);\n if (href === null) {\n return text;\n }\n\n let out = `\"${text}\"`;\n' : '>';\n return out;\n }\n\n text(text) {\n return text;\n }\n}\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nclass TextRenderer {\n // no need for block level renderers\n strong(text) {\n return text;\n }\n\n em(text) {\n return text;\n }\n\n codespan(text) {\n return text;\n }\n\n del(text) {\n return text;\n }\n\n html(text) {\n return text;\n }\n\n text(text) {\n return text;\n }\n\n link(href, title, text) {\n return '' + text;\n }\n\n image(href, title, text) {\n return '' + text;\n }\n\n br() {\n return '';\n }\n}\n\n/**\n * Slugger generates header id\n */\nclass Slugger {\n constructor() {\n this.seen = {};\n }\n\n /**\n * @param {string} value\n */\n serialize(value) {\n return value\n .toLowerCase()\n .trim()\n // remove html tags\n .replace(/<[!\\/a-z].*?>/ig, '')\n // remove unwanted chars\n .replace(/[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,./:;<=>?@[\\]^`{|}~]/g, '')\n .replace(/\\s/g, '-');\n }\n\n /**\n * Finds the next safe (unique) slug to use\n * @param {string} originalSlug\n * @param {boolean} isDryRun\n */\n getNextSafeSlug(originalSlug, isDryRun) {\n let slug = originalSlug;\n let occurenceAccumulator = 0;\n if (this.seen.hasOwnProperty(slug)) {\n occurenceAccumulator = this.seen[originalSlug];\n do {\n occurenceAccumulator++;\n slug = originalSlug + '-' + occurenceAccumulator;\n } while (this.seen.hasOwnProperty(slug));\n }\n if (!isDryRun) {\n this.seen[originalSlug] = occurenceAccumulator;\n this.seen[slug] = 0;\n }\n return slug;\n }\n\n /**\n * Convert string to unique id\n * @param {object} [options]\n * @param {boolean} [options.dryrun] Generates the next unique slug without\n * updating the internal accumulator.\n */\n slug(value, options = {}) {\n const slug = this.serialize(value);\n return this.getNextSafeSlug(slug, options.dryrun);\n }\n}\n\n/**\n * Parsing & Compiling\n */\nclass Parser {\n constructor(options) {\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.textRenderer = new TextRenderer();\n this.slugger = new Slugger();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens, options) {\n const parser = new Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens, options) {\n const parser = new Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens, top = true) {\n let out = '',\n i,\n j,\n k,\n l2,\n l3,\n row,\n cell,\n header,\n body,\n token,\n ordered,\n start,\n loose,\n itemBody,\n item,\n checked,\n task,\n checkbox,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'space': {\n continue;\n }\n case 'hr': {\n out += this.renderer.hr();\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(\n this.parseInline(token.tokens),\n token.depth,\n unescape(this.parseInline(token.tokens, this.textRenderer)),\n this.slugger);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token.text,\n token.lang,\n token.escaped);\n continue;\n }\n case 'table': {\n header = '';\n\n // header\n cell = '';\n l2 = token.header.length;\n for (j = 0; j < l2; j++) {\n cell += this.renderer.tablecell(\n this.parseInline(token.header[j].tokens),\n { header: true, align: token.align[j] }\n );\n }\n header += this.renderer.tablerow(cell);\n\n body = '';\n l2 = token.rows.length;\n for (j = 0; j < l2; j++) {\n row = token.rows[j];\n\n cell = '';\n l3 = row.length;\n for (k = 0; k < l3; k++) {\n cell += this.renderer.tablecell(\n this.parseInline(row[k].tokens),\n { header: false, align: token.align[k] }\n );\n }\n\n body += this.renderer.tablerow(cell);\n }\n out += this.renderer.table(header, body);\n continue;\n }\n case 'blockquote': {\n body = this.parse(token.tokens);\n out += this.renderer.blockquote(body);\n continue;\n }\n case 'list': {\n ordered = token.ordered;\n start = token.start;\n loose = token.loose;\n l2 = token.items.length;\n\n body = '';\n for (j = 0; j < l2; j++) {\n item = token.items[j];\n checked = item.checked;\n task = item.task;\n\n itemBody = '';\n if (item.task) {\n checkbox = this.renderer.checkbox(checked);\n if (loose) {\n if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n text: checkbox\n });\n }\n } else {\n itemBody += checkbox;\n }\n }\n\n itemBody += this.parse(item.tokens, loose);\n body += this.renderer.listitem(itemBody, task, checked);\n }\n\n out += this.renderer.list(body, ordered, start);\n continue;\n }\n case 'html': {\n out += this.renderer.html(token.text, token.block);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(this.parseInline(token.tokens));\n continue;\n }\n case 'text': {\n body = token.tokens ? this.parseInline(token.tokens) : token.text;\n while (i + 1 < l && tokens[i + 1].type === 'text') {\n token = tokens[++i];\n body += '\\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);\n }\n out += top ? this.renderer.paragraph(body) : body;\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens, renderer) {\n renderer = renderer || this.renderer;\n let out = '',\n i,\n token,\n ret;\n\n const l = tokens.length;\n for (i = 0; i < l; i++) {\n token = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {\n ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {\n out += ret || '';\n continue;\n }\n }\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token.text);\n break;\n }\n case 'html': {\n out += renderer.html(token.text);\n break;\n }\n case 'link': {\n out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));\n break;\n }\n case 'image': {\n out += renderer.image(token.href, token.title, token.text);\n break;\n }\n case 'strong': {\n out += renderer.strong(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'em': {\n out += renderer.em(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token.text);\n break;\n }\n case 'br': {\n out += renderer.br();\n break;\n }\n case 'del': {\n out += renderer.del(this.parseInline(token.tokens, renderer));\n break;\n }\n case 'text': {\n out += renderer.text(token.text);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out;\n }\n}\n\nclass Hooks {\n constructor(options) {\n this.options = options || defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess'\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html) {\n return html;\n }\n}\n\nfunction onError(silent, async, callback) {\n return (e) => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '

    An error occurred:

    '\n        + escape(e.message + '', true)\n        + '
    ';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkDeprecations(opt, callback);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = parser(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...marked.defaults, ...opt };\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","export function markedHighlight(options) {\n if (typeof options === 'function') {\n options = {\n highlight: options\n };\n }\n\n if (!options || typeof options.highlight !== 'function') {\n throw new Error('Must provide highlight function');\n }\n\n if (typeof options.langPrefix !== 'string') {\n options.langPrefix = 'language-';\n }\n\n return {\n async: !!options.async,\n walkTokens(token) {\n if (token.type !== 'code') {\n return;\n }\n\n const lang = getLang(token);\n\n if (options.async) {\n return Promise.resolve(options.highlight(token.text, lang)).then(updateToken(token));\n }\n\n const code = options.highlight(token.text, lang);\n updateToken(token)(code);\n },\n renderer: {\n code(code, infoString, escaped) {\n const lang = (infoString || '').match(/\\S*/)[0];\n const classAttr = lang\n ? ` class=\"${options.langPrefix}${escape(lang)}\"`\n : '';\n code = code.replace(/\\n$/, '');\n return `
    ${escaped ? code : escape(code, true)}\\n
    `;\n }\n }\n };\n}\n\nfunction getLang(token) {\n return (token.lang || '').match(/\\S*/)[0];\n}\n\nfunction updateToken(token) {\n return (code) => {\n if (typeof code === 'string' && code !== token.text) {\n token.escaped = true;\n token.text = code;\n }\n };\n}\n\n// copied from marked helpers\nconst escapeTest = /[&<>\"']/;\nconst escapeReplace = new RegExp(escapeTest.source, 'g');\nconst escapeTestNoEncode = /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/;\nconst escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');\nconst escapeReplacements = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\nconst getEscapeReplacement = (ch) => escapeReplacements[ch];\nfunction escape(html, encode) {\n if (encode) {\n if (escapeTest.test(html)) {\n return html.replace(escapeReplace, getEscapeReplacement);\n }\n } else {\n if (escapeTestNoEncode.test(html)) {\n return html.replace(escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n","\n/* **********************************************\n Begin prism-core.js\n********************************************** */\n\n/// \n\nvar _self = (typeof window !== 'undefined')\n\t? window // if in browser\n\t: (\n\t\t(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)\n\t\t\t? self // if in worker\n\t\t\t: {} // if in node js\n\t);\n\n/**\n * Prism: Lightweight, robust, elegant syntax highlighting\n *\n * @license MIT \n * @author Lea Verou \n * @namespace\n * @public\n */\nvar Prism = (function (_self) {\n\n\t// Private helper vars\n\tvar lang = /(?:^|\\s)lang(?:uage)?-([\\w-]+)(?=\\s|$)/i;\n\tvar uniqueId = 0;\n\n\t// The grammar object for plaintext\n\tvar plainTextGrammar = {};\n\n\n\tvar _ = {\n\t\t/**\n\t\t * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the\n\t\t * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load\n\t\t * additional languages or plugins yourself.\n\t\t *\n\t\t * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.\n\t\t *\n\t\t * You obviously have to change this value before the automatic highlighting started. To do this, you can add an\n\t\t * empty Prism object into the global scope before loading the Prism script like this:\n\t\t *\n\t\t * ```js\n\t\t * window.Prism = window.Prism || {};\n\t\t * Prism.manual = true;\n\t\t * // add a new \n\n\n\n\n","\n\n{#if show_share_button && value !== null && value.length > 0}\n\t
    \n\t\t\n\t
    \n{/if}\n
    \n\t\n\t\t\t\t{/each}\n\t\t\t{/each}\n\t\t{/if}\n\t\t{#if pending_message}\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t \n\t\t\t\t
    \n\t\t\t\t \n\t\t\t\t
    \n\t\t\t
    \n\t\t{/if}\n\t
    \n
    \n\n\n","\n\n\n\t{#if loading_status}\n\t\t\n\t{/if}\n\t
    \n\t\t{#if show_label}\n\t\t\t\n\t\t{/if}\n\t\t\n\t
    \n\n\n\n","export { default as Component } from \"@gradio/chatbot\";\nexport const modes = [\"static\"];\n"],"file":"assets/index-1508c6c1.js"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-1893465a.js b/gradio/templates/cdn/assets/index-1893465a.js new file mode 100644 index 0000000000000000000000000000000000000000..3c0a2808b57a55ab289bf72a3657cc27f471ff9f --- /dev/null +++ b/gradio/templates/cdn/assets/index-1893465a.js @@ -0,0 +1,2 @@ +import{C as ge,E as q,L as Pe}from"./index-10e05757.js";import{s as Te,t as S,p as be,L as Ve,i as xe,f as _e,u as ye,b as ve,v as qe,h as z,E as G}from"./index-ea4e155c.js";import{cssLanguage as F,css as $e}from"./index-025d1662.js";import{typescriptLanguage as we,jsxLanguage as Ce,tsxLanguage as Qe,javascriptLanguage as K,javascript as Ae}from"./index-592991bc.js";import"./index-fda37c89.js";import"./Blocks-53d5f72d.js";import"./Button-e3640f74.js";import"./BlockLabel-fe40816b.js";import"./Empty-85ccd7df.js";import"./Copy-be466f7f.js";import"./Download-6021cc15.js";const Xe=54,ke=1,Ye=55,Me=2,Be=56,Ee=3,D=4,Ge=5,y=6,ee=7,te=8,ae=9,le=10,De=11,Re=12,Ze=13,w=57,Ne=14,R=58,We=20,He=22,re=23,Ie=24,k=26,ne=27,Ue=28,je=31,Je=34,se=36,Le=37,ze=0,Fe=1,Ke={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},et={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Z={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function tt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function oe(e){return e==9||e==10||e==13||e==32}let N=null,W=null,H=0;function Y(e,t){let l=e.pos+t;if(H==l&&W==e)return N;let a=e.peek(t);for(;oe(a);)a=e.peek(++t);let r="";for(;tt(a);)r+=String.fromCharCode(a),a=e.peek(++t);return W=e,H=l,N=r?r.toLowerCase():a==at||a==lt?void 0:null}const Oe=60,v=62,M=47,at=63,lt=33,rt=45;function I(e,t){this.name=e,this.parent=t,this.hash=t?t.hash:0;for(let l=0;l-1?new I(Y(a,1)||"",e):e},reduce(e,t){return t==We&&e?e.parent:e},reuse(e,t,l,a){let r=t.type.id;return r==y||r==se?new I(Y(a,1)||"",e):e},hash(e){return e?e.hash:0},strict:!1}),ot=new q((e,t)=>{if(e.next!=Oe){e.next<0&&t.context&&e.acceptToken(w);return}e.advance();let l=e.next==M;l&&e.advance();let a=Y(e,0);if(a===void 0)return;if(!a)return e.acceptToken(l?Ne:y);let r=t.context?t.context.name:null;if(l){if(a==r)return e.acceptToken(De);if(r&&et[r])return e.acceptToken(w,-2);if(t.dialectEnabled(ze))return e.acceptToken(Re);for(let n=t.context;n;n=n.parent)if(n.name==a)return;e.acceptToken(Ze)}else{if(a=="script")return e.acceptToken(ee);if(a=="style")return e.acceptToken(te);if(a=="textarea")return e.acceptToken(ae);if(Ke.hasOwnProperty(a))return e.acceptToken(le);r&&Z[r]&&Z[r][a]?e.acceptToken(w,-1):e.acceptToken(y)}},{contextual:!0}),Ot=new q(e=>{for(let t=0,l=0;;l++){if(e.next<0){l&&e.acceptToken(R);break}if(e.next==rt)t++;else if(e.next==v&&t>=2){l>3&&e.acceptToken(R,-2);break}else t=0;e.advance()}});function it(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ut=new q((e,t)=>{if(e.next==M&&e.peek(1)==v){let l=t.dialectEnabled(Fe)||it(t.context);e.acceptToken(l?Ge:D,2)}else e.next==v&&e.acceptToken(D,1)});function B(e,t,l){let a=2+e.length;return new q(r=>{for(let n=0,o=0,O=0;;O++){if(r.next<0){O&&r.acceptToken(t);break}if(n==0&&r.next==Oe||n==1&&r.next==M||n>=2&&no?r.acceptToken(t,-o):r.acceptToken(l,-(o-2));break}else if((r.next==10||r.next==13)&&O){r.acceptToken(t,1);break}else n=o=0;r.advance()}})}const pt=B("script",Xe,ke),ct=B("style",Ye,Me),dt=B("textarea",Be,Ee),ft=Te({"Text RawText":S.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":S.angleBracket,TagName:S.tagName,"MismatchedCloseTag/TagName":[S.tagName,S.invalid],AttributeName:S.attributeName,"AttributeValue UnquotedAttributeValue":S.attributeValue,Is:S.definitionOperator,"EntityReference CharacterReference":S.character,Comment:S.blockComment,ProcessingInst:S.processingInstruction,DoctypeDecl:S.documentMeta}),ht=Pe.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/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PPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:st,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[ft],skippedNodes:[0],repeatNodeCount:9,tokenData:"#%g!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs4ysv-_vw5iwxJ^x}-_}!OKP!O!P-_!P!Q$q!Q![-_![!]!!O!]!^-_!^!_!&W!_!`#$o!`!a&X!a!c-_!c!}!!O!}#R-_#R#S!!O#S#T3V#T#o!!O#o#s-_#s$f$q$f%W-_%W%o!!O%o%p-_%p&a!!O&a&b-_&b1p!!O1p4U-_4U4d!!O4d4e-_4e$IS!!O$IS$I`-_$I`$Ib!!O$Ib$Kh-_$Kh%#t!!O%#t&/x-_&/x&Et!!O&Et&FV-_&FV;'S!!O;'S;:j!&Q;:j;=`4s<%l?&r-_?&r?Ah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G_!V#$lP;=`<%l!Ey!V#$zXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pt,ct,dt,ut,ot,Ot,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:485},tokenPrec:487});function ie(e,t){let l=Object.create(null);for(let a of e.getChildren(re)){let r=a.getChild(Ie),n=a.getChild(k)||a.getChild(ne);r&&(l[t.read(r.from,r.to)]=n?n.type.id==k?t.read(n.from+1,n.to-1):t.read(n.from,n.to):"")}return l}function U(e,t){let l=e.getChild(He);return l?t.read(l.from,l.to):" "}function C(e,t,l){let a;for(let r of l)if(!r.attrs||r.attrs(a||(a=ie(e.node.parent.firstChild,t))))return{parser:r.parser};return null}function ue(e=[],t=[]){let l=[],a=[],r=[],n=[];for(let O of e)(O.tag=="script"?l:O.tag=="style"?a:O.tag=="textarea"?r:n).push(O);let o=t.length?Object.create(null):null;for(let O of t)(o[O.name]||(o[O.name]=[])).push(O);return be((O,p)=>{let h=O.type.id;if(h==Ue)return C(O,p,l);if(h==je)return C(O,p,a);if(h==Je)return C(O,p,r);if(h==se&&n.length){let i=O.node,u=U(i,p),c;for(let d of n)if(d.tag==u&&(!d.attrs||d.attrs(c||(c=ie(i,p))))){let f=i.parent.lastChild;return{parser:d.parser,overlay:[{from:O.to,to:f.type.id==Le?f.from:i.parent.to}]}}}if(o&&h==re){let i=O.node,u;if(u=i.firstChild){let c=o[p.read(u.from,u.to)];if(c)for(let d of c){if(d.tagName&&d.tagName!=U(i.parent,p))continue;let f=i.lastChild;if(f.type.id==k){let P=f.from+1,T=f.lastChild,x=f.to-(T&&T.isError?0:1);if(x>P)return{parser:d.parser,overlay:[{from:P,to:x}]}}else if(f.type.id==ne)return{parser:d.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const b=["_blank","_self","_top","_parent"],Q=["ascii","utf-8","utf-16","latin1","latin1"],A=["get","post","put","delete"],X=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],m=["true","false"],s={},mt={a:{attrs:{href:null,ping:null,type:null,media:null,target:b,hreflang:null}},abbr:s,address:s,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:s,aside:s,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:s,base:{attrs:{href:null,target:b}},bdi:s,bdo:s,blockquote:{attrs:{cite:null}},body:s,br:s,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:X,formmethod:A,formnovalidate:["novalidate"],formtarget:b,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:s,center:s,cite:s,code:s,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:s,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:s,div:s,dl:s,dt:s,em:s,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:s,figure:s,footer:s,form:{attrs:{action:null,name:null,"accept-charset":Q,autocomplete:["on","off"],enctype:X,method:A,novalidate:["novalidate"],target:b}},h1:s,h2:s,h3:s,h4:s,h5:s,h6:s,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:s,hgroup:s,hr:s,html:{attrs:{manifest:null}},i:s,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:X,formmethod:A,formnovalidate:["novalidate"],formtarget:b,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:s,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:s,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:s,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Q,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:s,noscript:s,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:s,param:{attrs:{name:null,value:null}},pre:s,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:s,rt:s,ruby:s,samp:s,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Q}},section:s,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:s,source:{attrs:{src:null,type:null,media:null}},span:s,strong:s,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:s,summary:s,sup:s,table:s,tbody:s,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:s,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:s,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:s,time:{attrs:{datetime:null}},title:s,tr:s,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:s,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:s},pe={accesskey:null,class:null,contenteditable:m,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:m,autocorrect:m,autocapitalize:m,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":m,"aria-autocomplete":["inline","list","both","none"],"aria-busy":m,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":m,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":m,"aria-hidden":m,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":m,"aria-multiselectable":m,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":m,"aria-relevant":null,"aria-required":m,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},ce="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of ce)pe[e]=null;class V{constructor(t,l){this.tags=Object.assign(Object.assign({},mt),t),this.globalAttrs=Object.assign(Object.assign({},pe),l),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}V.default=new V;function g(e,t,l=e.length){if(!t)return"";let a=t.firstChild,r=a&&a.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,l)):""}function $(e,t=!1){for(let l=e.parent;l;l=l.parent)if(l.name=="Element")if(t)t=!1;else return l;return null}function de(e,t,l){let a=l.tags[g(e,$(t,!0))];return a?.children||l.allTags}function E(e,t){let l=[];for(let a=t;a=$(a);){let r=g(e,a);if(r&&a.lastChild.name=="CloseTag")break;r&&l.indexOf(r)<0&&(t.name=="EndTag"||t.from>=a.firstChild.to)&&l.push(r)}return l}const fe=/^[:\-\.\w\u00b7-\uffff]*$/;function j(e,t,l,a,r){let n=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:a,to:r,options:de(e.doc,l,t).map(o=>({label:o,type:"type"})).concat(E(e.doc,l).map((o,O)=>({label:"/"+o,apply:"/"+o+n,type:"type",boost:99-O}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function J(e,t,l,a){let r=/\s*>/.test(e.sliceDoc(a,a+5))?"":">";return{from:l,to:a,options:E(e.doc,t).map((n,o)=>({label:n,apply:n+r,type:"type",boost:99-o})),validFor:fe}}function St(e,t,l,a){let r=[],n=0;for(let o of de(e.doc,l,t))r.push({label:"<"+o,type:"type"});for(let o of E(e.doc,l))r.push({label:"",type:"type",boost:99-n++});return{from:a,to:a,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function gt(e,t,l,a,r){let n=$(l),o=n?t.tags[g(e.doc,n)]:null,O=o&&o.attrs?Object.keys(o.attrs):[],p=o&&o.globalAttrs===!1?O:O.length?O.concat(t.globalAttrNames):t.globalAttrNames;return{from:a,to:r,options:p.map(h=>({label:h,type:"property"})),validFor:fe}}function Pt(e,t,l,a,r){var n;let o=(n=l.parent)===null||n===void 0?void 0:n.getChild("AttributeName"),O=[],p;if(o){let h=e.sliceDoc(o.from,o.to),i=t.globalAttrs[h];if(!i){let u=$(l),c=u?t.tags[g(e.doc,u)]:null;i=c?.attrs&&c.attrs[h]}if(i){let u=e.sliceDoc(a,r).toLowerCase(),c='"',d='"';/^['"]/.test(u)?(p=u[0]=='"'?/^[^"]*$/:/^[^']*$/,c="",d=e.sliceDoc(r,r+1)==u[0]?"":u[0],u=u.slice(1),a++):p=/^[^\s<>='"]*$/;for(let f of i)O.push({label:f,apply:c+f+d,type:"constant"})}}return{from:a,to:r,options:O,validFor:p}}function he(e,t){let{state:l,pos:a}=t,r=z(l).resolveInner(a),n=r.resolve(a,-1);for(let o=a,O;r==n&&(O=n.childBefore(o));){let p=O.lastChild;if(!p||!p.type.isError||p.fromhe(a,r)}const me=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:we.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Qe.parser},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:K.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:F.parser}],Se=[{name:"style",parser:F.parser.configure({top:"Styles"})}].concat(ce.map(e=>({name:e,parser:K.parser}))),_=Ve.define({name:"html",parser:ht.configure({props:[xe.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})],wrap:ue(me,Se)}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}});function kt(e={}){let t="",l;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(l=ue((e.nestedLanguages||[]).concat(me),(e.nestedAttributes||[]).concat(Se)));let a=l||t?_.configure({dialect:t,wrap:l}):_;return new ve(a,[_.data.of({autocomplete:Tt(e)}),e.autoCloseTags!==!1?bt:[],Ae().support,$e().support])}const L=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),bt=qe.inputHandler.of((e,t,l,a)=>{if(e.composing||e.state.readOnly||t!=l||a!=">"&&a!="/"||!_.isActiveAt(e.state,t,-1))return!1;let{state:r}=e,n=r.changeByRange(o=>{var O,p,h;let{head:i}=o,u=z(r).resolveInner(i,-1),c;if((u.name=="TagName"||u.name=="StartTag")&&(u=u.parent),a==">"&&u.name=="OpenTag"){if(((p=(O=u.parent)===null||O===void 0?void 0:O.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(c=g(r.doc,u.parent,i))&&!L.has(c)){let d=e.state.doc.sliceString(i,i+1)===">",f=`${d?"":">"}`;return{range:G.cursor(i+1),changes:{from:i+(d?1:0),insert:f}}}}else if(a=="/"&&u.name=="OpenTag"){let d=u.parent,f=d?.parent;if(d.from==i-1&&((h=f.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(c=g(r.doc,f,i))&&!L.has(c)){let P=e.state.doc.sliceString(i,i+1)===">",T=`/${c}${P?"":">"}`,x=i+T.length+(P?1:0);return{range:G.cursor(x),changes:{from:i,insert:T}}}}return{range:o}});return n.changes.empty?!1:(e.dispatch(n,{userEvent:"input.type",scrollIntoView:!0}),!0)});export{bt as autoCloseTags,kt as html,Xt as htmlCompletionSource,Tt as htmlCompletionSourceWith,_ as htmlLanguage}; +//# sourceMappingURL=index-1893465a.js.map diff --git a/gradio/templates/cdn/assets/index-1893465a.js.map b/gradio/templates/cdn/assets/index-1893465a.js.map new file mode 100644 index 0000000000000000000000000000000000000000..81eecf52b4039c4465fb759354f79d18f37dd561 --- /dev/null +++ b/gradio/templates/cdn/assets/index-1893465a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-1893465a.js","sources":["../../../../node_modules/.pnpm/@lezer+html@1.3.3/node_modules/@lezer/html/dist/index.es.js","../../../../node_modules/.pnpm/@codemirror+lang-html@6.4.2/node_modules/@codemirror/lang-html/dist/index.js"],"sourcesContent":["import { ContextTracker, ExternalTokenizer, LRParser } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\nimport { parseMixed } from '@lezer/common';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst scriptText = 54,\n StartCloseScriptTag = 1,\n styleText = 55,\n StartCloseStyleTag = 2,\n textareaText = 56,\n StartCloseTextareaTag = 3,\n EndTag = 4,\n SelfClosingEndTag = 5,\n StartTag = 6,\n StartScriptTag = 7,\n StartStyleTag = 8,\n StartTextareaTag = 9,\n StartSelfClosingTag = 10,\n StartCloseTag = 11,\n NoMatchStartCloseTag = 12,\n MismatchedStartCloseTag = 13,\n missingCloseTag = 57,\n IncompleteCloseTag = 14,\n commentContent$1 = 58,\n Element = 20,\n TagName = 22,\n Attribute = 23,\n AttributeName = 24,\n AttributeValue = 26,\n UnquotedAttributeValue = 27,\n ScriptText = 28,\n StyleText = 31,\n TextareaText = 34,\n OpenTag = 36,\n CloseTag = 37,\n Dialect_noMatch = 0,\n Dialect_selfClosing = 1;\n\n/* Hand-written tokenizers for HTML. */\n\nconst selfClosers = {\n area: true, base: true, br: true, col: true, command: true,\n embed: true, frame: true, hr: true, img: true, input: true,\n keygen: true, link: true, meta: true, param: true, source: true,\n track: true, wbr: true, menuitem: true\n};\n\nconst implicitlyClosed = {\n dd: true, li: true, optgroup: true, option: true, p: true,\n rp: true, rt: true, tbody: true, td: true, tfoot: true,\n th: true, tr: true\n};\n\nconst closeOnOpen = {\n dd: {dd: true, dt: true},\n dt: {dd: true, dt: true},\n li: {li: true},\n option: {option: true, optgroup: true},\n optgroup: {optgroup: true},\n p: {\n address: true, article: true, aside: true, blockquote: true, dir: true,\n div: true, dl: true, fieldset: true, footer: true, form: true,\n h1: true, h2: true, h3: true, h4: true, h5: true, h6: true,\n header: true, hgroup: true, hr: true, menu: true, nav: true, ol: true,\n p: true, pre: true, section: true, table: true, ul: true\n },\n rp: {rp: true, rt: true},\n rt: {rp: true, rt: true},\n tbody: {tbody: true, tfoot: true},\n td: {td: true, th: true},\n tfoot: {tbody: true},\n th: {td: true, th: true},\n thead: {tbody: true, tfoot: true},\n tr: {tr: true}\n};\n\nfunction nameChar(ch) {\n return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161\n}\n\nfunction isSpace(ch) {\n return ch == 9 || ch == 10 || ch == 13 || ch == 32\n}\n\nlet cachedName = null, cachedInput = null, cachedPos = 0;\nfunction tagNameAfter(input, offset) {\n let pos = input.pos + offset;\n if (cachedPos == pos && cachedInput == input) return cachedName\n let next = input.peek(offset);\n while (isSpace(next)) next = input.peek(++offset);\n let name = \"\";\n for (;;) {\n if (!nameChar(next)) break\n name += String.fromCharCode(next);\n next = input.peek(++offset);\n }\n // Undefined to signal there's a -1 ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n reduce(context, term) {\n return term == Element && context ? context.parent : context\n },\n reuse(context, node, stack, input) {\n let type = node.type.id;\n return type == StartTag || type == OpenTag\n ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n hash(context) { return context ? context.hash : 0 },\n strict: false\n});\n\nconst tagStart = new ExternalTokenizer((input, stack) => {\n if (input.next != lessThan) {\n // End of file, close any open tags\n if (input.next < 0 && stack.context) input.acceptToken(missingCloseTag);\n return\n }\n input.advance();\n let close = input.next == slash;\n if (close) input.advance();\n let name = tagNameAfter(input, 0);\n if (name === undefined) return\n if (!name) return input.acceptToken(close ? IncompleteCloseTag : StartTag)\n\n let parent = stack.context ? stack.context.name : null;\n if (close) {\n if (name == parent) return input.acceptToken(StartCloseTag)\n if (parent && implicitlyClosed[parent]) return input.acceptToken(missingCloseTag, -2)\n if (stack.dialectEnabled(Dialect_noMatch)) return input.acceptToken(NoMatchStartCloseTag)\n for (let cx = stack.context; cx; cx = cx.parent) if (cx.name == name) return\n input.acceptToken(MismatchedStartCloseTag);\n } else {\n if (name == \"script\") return input.acceptToken(StartScriptTag)\n if (name == \"style\") return input.acceptToken(StartStyleTag)\n if (name == \"textarea\") return input.acceptToken(StartTextareaTag)\n if (selfClosers.hasOwnProperty(name)) return input.acceptToken(StartSelfClosingTag)\n if (parent && closeOnOpen[parent] && closeOnOpen[parent][name]) input.acceptToken(missingCloseTag, -1);\n else input.acceptToken(StartTag);\n }\n}, {contextual: true});\n\nconst commentContent = new ExternalTokenizer(input => {\n for (let dashes = 0, i = 0;; i++) {\n if (input.next < 0) {\n if (i) input.acceptToken(commentContent$1);\n break\n }\n if (input.next == dash) {\n dashes++;\n } else if (input.next == greaterThan && dashes >= 2) {\n if (i > 3) input.acceptToken(commentContent$1, -2);\n break\n } else {\n dashes = 0;\n }\n input.advance();\n }\n});\n\nfunction inForeignElement(context) {\n for (; context; context = context.parent)\n if (context.name == \"svg\" || context.name == \"math\") return true\n return false\n}\n\nconst endTag = new ExternalTokenizer((input, stack) => {\n if (input.next == slash && input.peek(1) == greaterThan) {\n let selfClosing = stack.dialectEnabled(Dialect_selfClosing) || inForeignElement(stack.context);\n input.acceptToken(selfClosing ? SelfClosingEndTag : EndTag, 2);\n } else if (input.next == greaterThan) {\n input.acceptToken(EndTag, 1);\n }\n});\n\nfunction contentTokenizer(tag, textToken, endToken) {\n let lastState = 2 + tag.length;\n return new ExternalTokenizer(input => {\n // state means:\n // - 0 nothing matched\n // - 1 '<' matched\n // - 2 '= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) {\n state++;\n matchedLen++;\n } else if ((state == 2 || state == lastState) && isSpace(input.next)) {\n matchedLen++;\n } else if (state == lastState && input.next == greaterThan) {\n if (i > matchedLen)\n input.acceptToken(textToken, -matchedLen);\n else\n input.acceptToken(endToken, -(matchedLen - 2));\n break\n } else if ((input.next == 10 /* '\\n' */ || input.next == 13 /* '\\r' */) && i) {\n input.acceptToken(textToken, 1);\n break\n } else {\n state = matchedLen = 0;\n }\n input.advance();\n }\n })\n}\n\nconst scriptTokens = contentTokenizer(\"script\", scriptText, StartCloseScriptTag);\n\nconst styleTokens = contentTokenizer(\"style\", styleText, StartCloseStyleTag);\n\nconst textareaTokens = contentTokenizer(\"textarea\", textareaText, StartCloseTextareaTag);\n\nconst htmlHighlighting = styleTags({\n \"Text RawText\": tags.content,\n \"StartTag StartCloseTag SelfClosingEndTag EndTag\": tags.angleBracket,\n TagName: tags.tagName,\n \"MismatchedCloseTag/TagName\": [tags.tagName, tags.invalid],\n AttributeName: tags.attributeName,\n \"AttributeValue UnquotedAttributeValue\": tags.attributeValue,\n Is: tags.definitionOperator,\n \"EntityReference CharacterReference\": tags.character,\n Comment: tags.blockComment,\n ProcessingInst: tags.processingInstruction,\n DoctypeDecl: tags.documentMeta\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst parser = LRParser.deserialize({\n version: 14,\n states: \",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Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl\",\n maxTerm: 67,\n context: elementContext,\n nodeProps: [\n [\"closedBy\", -10,1,2,3,7,8,9,10,11,12,13,\"EndTag\",6,\"EndTag SelfClosingEndTag\",-4,21,30,33,36,\"CloseTag\"],\n [\"openedBy\", 4,\"StartTag StartCloseTag\",5,\"StartTag\",-4,29,32,35,37,\"OpenTag\"],\n [\"group\", -9,14,17,18,19,20,39,40,41,42,\"Entity\",16,\"Entity TextContent\",-3,28,31,34,\"TextContent Entity\"]\n ],\n propSources: [htmlHighlighting],\n skippedNodes: [0],\n repeatNodeCount: 9,\n tokenData: \"#%g!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs4ysv-_vw5iwxJ^x}-_}!OKP!O!P-_!P!Q$q!Q![-_![!]!!O!]!^-_!^!_!&W!_!`#$o!`!a&X!a!c-_!c!}!!O!}#R-_#R#S!!O#S#T3V#T#o!!O#o#s-_#s$f$q$f%W-_%W%o!!O%o%p-_%p&a!!O&a&b-_&b1p!!O1p4U-_4U4d!!O4d4e-_4e$IS!!O$IS$I`-_$I`$Ib!!O$Ib$Kh-_$Kh%#t!!O%#t&/x-_&/x&Et!!O&Et&FV-_&FV;'S!!O;'S;:j!&Q;:j;=`4s<%l?&r-_?&r?Ah!!O?Ah?BY$q?BY?Mn!!O?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&}wx'kx!^&}!^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= Object.create(null);\n for (let att of openTag.getChildren(Attribute)) {\n let name = att.getChild(AttributeName), value = att.getChild(AttributeValue) || att.getChild(UnquotedAttributeValue);\n if (name) attrs[input.read(name.from, name.to)] =\n !value ? \"\" : value.type.id == AttributeValue ? input.read(value.from + 1, value.to - 1) : input.read(value.from, value.to);\n }\n return attrs\n}\n\nfunction findTagName(openTag, input) {\n let tagNameNode = openTag.getChild(TagName);\n return tagNameNode ? input.read(tagNameNode.from, tagNameNode.to) : \" \"\n}\n\nfunction maybeNest(node, input, tags) {\n let attrs;\n for (let tag of tags) {\n if (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(node.node.parent.firstChild, input))))\n return {parser: tag.parser}\n }\n return null\n}\n\n// tags?: {\n// tag: string,\n// attrs?: ({[attr: string]: string}) => boolean,\n// parser: Parser\n// }[]\n// attributes?: {\n// name: string,\n// tagName?: string,\n// parser: Parser\n// }[]\n \nfunction configureNesting(tags = [], attributes = []) {\n let script = [], style = [], textarea = [], other = [];\n for (let tag of tags) {\n let array = tag.tag == \"script\" ? script : tag.tag == \"style\" ? style : tag.tag == \"textarea\" ? textarea : other;\n array.push(tag);\n }\n let attrs = attributes.length ? Object.create(null) : null;\n for (let attr of attributes) (attrs[attr.name] || (attrs[attr.name] = [])).push(attr);\n\n return parseMixed((node, input) => {\n let id = node.type.id;\n if (id == ScriptText) return maybeNest(node, input, script)\n if (id == StyleText) return maybeNest(node, input, style)\n if (id == TextareaText) return maybeNest(node, input, textarea)\n\n if (id == OpenTag && other.length) {\n let n = node.node, tagName = findTagName(n, input), attrs;\n for (let tag of other) {\n if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(n, input))))) {\n let close = n.parent.lastChild;\n return {parser: tag.parser, overlay: [{from: node.to, to: close.type.id == CloseTag ? close.from : n.parent.to}]}\n }\n }\n }\n\n if (attrs && id == Attribute) {\n let n = node.node, nameNode;\n if (nameNode = n.firstChild) {\n let matches = attrs[input.read(nameNode.from, nameNode.to)];\n if (matches) for (let attr of matches) {\n if (attr.tagName && attr.tagName != findTagName(n.parent, input)) continue\n let value = n.lastChild;\n if (value.type.id == AttributeValue) {\n let from = value.from + 1;\n let last = value.lastChild, to = value.to - (last && last.isError ? 0 : 1);\n if (to > from) return {parser: attr.parser, overlay: [{from, to}]}\n } else if (value.type.id == UnquotedAttributeValue) {\n return {parser: attr.parser, overlay: [{from: value.from, to: value.to}]}\n }\n }\n }\n }\n return null\n })\n}\n\nexport { configureNesting, parser };\n","import { parser, configureNesting } from '@lezer/html';\nimport { cssLanguage, css } from '@codemirror/lang-css';\nimport { typescriptLanguage, jsxLanguage, tsxLanguage, javascriptLanguage, javascript } from '@codemirror/lang-javascript';\nimport { EditorView } from '@codemirror/view';\nimport { EditorSelection } from '@codemirror/state';\nimport { syntaxTree, LRLanguage, indentNodeProp, foldNodeProp, bracketMatchingHandle, LanguageSupport } from '@codemirror/language';\n\nconst Targets = [\"_blank\", \"_self\", \"_top\", \"_parent\"];\nconst Charsets = [\"ascii\", \"utf-8\", \"utf-16\", \"latin1\", \"latin1\"];\nconst Methods = [\"get\", \"post\", \"put\", \"delete\"];\nconst Encs = [\"application/x-www-form-urlencoded\", \"multipart/form-data\", \"text/plain\"];\nconst Bool = [\"true\", \"false\"];\nconst S = {}; // Empty tag spec\nconst Tags = {\n a: {\n attrs: {\n href: null, ping: null, type: null,\n media: null,\n target: Targets,\n hreflang: null\n }\n },\n abbr: S,\n address: S,\n area: {\n attrs: {\n alt: null, coords: null, href: null, target: null, ping: null,\n media: null, hreflang: null, type: null,\n shape: [\"default\", \"rect\", \"circle\", \"poly\"]\n }\n },\n article: S,\n aside: S,\n audio: {\n attrs: {\n src: null, mediagroup: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"none\", \"metadata\", \"auto\"],\n autoplay: [\"autoplay\"],\n loop: [\"loop\"],\n controls: [\"controls\"]\n }\n },\n b: S,\n base: { attrs: { href: null, target: Targets } },\n bdi: S,\n bdo: S,\n blockquote: { attrs: { cite: null } },\n body: S,\n br: S,\n button: {\n attrs: {\n form: null, formaction: null, name: null, value: null,\n autofocus: [\"autofocus\"],\n disabled: [\"autofocus\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n type: [\"submit\", \"reset\", \"button\"]\n }\n },\n canvas: { attrs: { width: null, height: null } },\n caption: S,\n center: S,\n cite: S,\n code: S,\n col: { attrs: { span: null } },\n colgroup: { attrs: { span: null } },\n command: {\n attrs: {\n type: [\"command\", \"checkbox\", \"radio\"],\n label: null, icon: null, radiogroup: null, command: null, title: null,\n disabled: [\"disabled\"],\n checked: [\"checked\"]\n }\n },\n data: { attrs: { value: null } },\n datagrid: { attrs: { disabled: [\"disabled\"], multiple: [\"multiple\"] } },\n datalist: { attrs: { data: null } },\n dd: S,\n del: { attrs: { cite: null, datetime: null } },\n details: { attrs: { open: [\"open\"] } },\n dfn: S,\n div: S,\n dl: S,\n dt: S,\n em: S,\n embed: { attrs: { src: null, type: null, width: null, height: null } },\n eventsource: { attrs: { src: null } },\n fieldset: { attrs: { disabled: [\"disabled\"], form: null, name: null } },\n figcaption: S,\n figure: S,\n footer: S,\n form: {\n attrs: {\n action: null, name: null,\n \"accept-charset\": Charsets,\n autocomplete: [\"on\", \"off\"],\n enctype: Encs,\n method: Methods,\n novalidate: [\"novalidate\"],\n target: Targets\n }\n },\n h1: S, h2: S, h3: S, h4: S, h5: S, h6: S,\n head: {\n children: [\"title\", \"base\", \"link\", \"style\", \"meta\", \"script\", \"noscript\", \"command\"]\n },\n header: S,\n hgroup: S,\n hr: S,\n html: {\n attrs: { manifest: null }\n },\n i: S,\n iframe: {\n attrs: {\n src: null, srcdoc: null, name: null, width: null, height: null,\n sandbox: [\"allow-top-navigation\", \"allow-same-origin\", \"allow-forms\", \"allow-scripts\"],\n seamless: [\"seamless\"]\n }\n },\n img: {\n attrs: {\n alt: null, src: null, ismap: null, usemap: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"]\n }\n },\n input: {\n attrs: {\n alt: null, dirname: null, form: null, formaction: null,\n height: null, list: null, max: null, maxlength: null, min: null,\n name: null, pattern: null, placeholder: null, size: null, src: null,\n step: null, value: null, width: null,\n accept: [\"audio/*\", \"video/*\", \"image/*\"],\n autocomplete: [\"on\", \"off\"],\n autofocus: [\"autofocus\"],\n checked: [\"checked\"],\n disabled: [\"disabled\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n multiple: [\"multiple\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n type: [\"hidden\", \"text\", \"search\", \"tel\", \"url\", \"email\", \"password\", \"datetime\", \"date\", \"month\",\n \"week\", \"time\", \"datetime-local\", \"number\", \"range\", \"color\", \"checkbox\", \"radio\",\n \"file\", \"submit\", \"image\", \"reset\", \"button\"]\n }\n },\n ins: { attrs: { cite: null, datetime: null } },\n kbd: S,\n keygen: {\n attrs: {\n challenge: null, form: null, name: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n keytype: [\"RSA\"]\n }\n },\n label: { attrs: { for: null, form: null } },\n legend: S,\n li: { attrs: { value: null } },\n link: {\n attrs: {\n href: null, type: null,\n hreflang: null,\n media: null,\n sizes: [\"all\", \"16x16\", \"16x16 32x32\", \"16x16 32x32 64x64\"]\n }\n },\n map: { attrs: { name: null } },\n mark: S,\n menu: { attrs: { label: null, type: [\"list\", \"context\", \"toolbar\"] } },\n meta: {\n attrs: {\n content: null,\n charset: Charsets,\n name: [\"viewport\", \"application-name\", \"author\", \"description\", \"generator\", \"keywords\"],\n \"http-equiv\": [\"content-language\", \"content-type\", \"default-style\", \"refresh\"]\n }\n },\n meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },\n nav: S,\n noscript: S,\n object: {\n attrs: {\n data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,\n typemustmatch: [\"typemustmatch\"]\n }\n },\n ol: { attrs: { reversed: [\"reversed\"], start: null, type: [\"1\", \"a\", \"A\", \"i\", \"I\"] },\n children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n optgroup: { attrs: { disabled: [\"disabled\"], label: null } },\n option: { attrs: { disabled: [\"disabled\"], label: null, selected: [\"selected\"], value: null } },\n output: { attrs: { for: null, form: null, name: null } },\n p: S,\n param: { attrs: { name: null, value: null } },\n pre: S,\n progress: { attrs: { value: null, max: null } },\n q: { attrs: { cite: null } },\n rp: S,\n rt: S,\n ruby: S,\n samp: S,\n script: {\n attrs: {\n type: [\"text/javascript\"],\n src: null,\n async: [\"async\"],\n defer: [\"defer\"],\n charset: Charsets\n }\n },\n section: S,\n select: {\n attrs: {\n form: null, name: null, size: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n multiple: [\"multiple\"]\n }\n },\n slot: { attrs: { name: null } },\n small: S,\n source: { attrs: { src: null, type: null, media: null } },\n span: S,\n strong: S,\n style: {\n attrs: {\n type: [\"text/css\"],\n media: null,\n scoped: null\n }\n },\n sub: S,\n summary: S,\n sup: S,\n table: S,\n tbody: S,\n td: { attrs: { colspan: null, rowspan: null, headers: null } },\n template: S,\n textarea: {\n attrs: {\n dirname: null, form: null, maxlength: null, name: null, placeholder: null,\n rows: null, cols: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n wrap: [\"soft\", \"hard\"]\n }\n },\n tfoot: S,\n th: { attrs: { colspan: null, rowspan: null, headers: null, scope: [\"row\", \"col\", \"rowgroup\", \"colgroup\"] } },\n thead: S,\n time: { attrs: { datetime: null } },\n title: S,\n tr: S,\n track: {\n attrs: {\n src: null, label: null, default: null,\n kind: [\"subtitles\", \"captions\", \"descriptions\", \"chapters\", \"metadata\"],\n srclang: null\n }\n },\n ul: { children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n var: S,\n video: {\n attrs: {\n src: null, poster: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"auto\", \"metadata\", \"none\"],\n autoplay: [\"autoplay\"],\n mediagroup: [\"movie\"],\n muted: [\"muted\"],\n controls: [\"controls\"]\n }\n },\n wbr: S\n};\nconst GlobalAttrs = {\n accesskey: null,\n class: null,\n contenteditable: Bool,\n contextmenu: null,\n dir: [\"ltr\", \"rtl\", \"auto\"],\n draggable: [\"true\", \"false\", \"auto\"],\n dropzone: [\"copy\", \"move\", \"link\", \"string:\", \"file:\"],\n hidden: [\"hidden\"],\n id: null,\n inert: [\"inert\"],\n itemid: null,\n itemprop: null,\n itemref: null,\n itemscope: [\"itemscope\"],\n itemtype: null,\n lang: [\"ar\", \"bn\", \"de\", \"en-GB\", \"en-US\", \"es\", \"fr\", \"hi\", \"id\", \"ja\", \"pa\", \"pt\", \"ru\", \"tr\", \"zh\"],\n spellcheck: Bool,\n autocorrect: Bool,\n autocapitalize: Bool,\n style: null,\n tabindex: null,\n title: null,\n translate: [\"yes\", \"no\"],\n rel: [\"stylesheet\", \"alternate\", \"author\", \"bookmark\", \"help\", \"license\", \"next\", \"nofollow\", \"noreferrer\", \"prefetch\", \"prev\", \"search\", \"tag\"],\n role: /*@__PURE__*/\"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer\".split(\" \"),\n \"aria-activedescendant\": null,\n \"aria-atomic\": Bool,\n \"aria-autocomplete\": [\"inline\", \"list\", \"both\", \"none\"],\n \"aria-busy\": Bool,\n \"aria-checked\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-controls\": null,\n \"aria-describedby\": null,\n \"aria-disabled\": Bool,\n \"aria-dropeffect\": null,\n \"aria-expanded\": [\"true\", \"false\", \"undefined\"],\n \"aria-flowto\": null,\n \"aria-grabbed\": [\"true\", \"false\", \"undefined\"],\n \"aria-haspopup\": Bool,\n \"aria-hidden\": Bool,\n \"aria-invalid\": [\"true\", \"false\", \"grammar\", \"spelling\"],\n \"aria-label\": null,\n \"aria-labelledby\": null,\n \"aria-level\": null,\n \"aria-live\": [\"off\", \"polite\", \"assertive\"],\n \"aria-multiline\": Bool,\n \"aria-multiselectable\": Bool,\n \"aria-owns\": null,\n \"aria-posinset\": null,\n \"aria-pressed\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-readonly\": Bool,\n \"aria-relevant\": null,\n \"aria-required\": Bool,\n \"aria-selected\": [\"true\", \"false\", \"undefined\"],\n \"aria-setsize\": null,\n \"aria-sort\": [\"ascending\", \"descending\", \"none\", \"other\"],\n \"aria-valuemax\": null,\n \"aria-valuemin\": null,\n \"aria-valuenow\": null,\n \"aria-valuetext\": null\n};\nconst eventAttributes = /*@__PURE__*/(\"beforeunload copy cut dragstart dragover dragleave dragenter dragend \" +\n \"drag paste focus blur change click load mousedown mouseenter mouseleave \" +\n \"mouseup keydown keyup resize scroll unload\").split(\" \").map(n => \"on\" + n);\nfor (let a of eventAttributes)\n GlobalAttrs[a] = null;\nclass Schema {\n constructor(extraTags, extraAttrs) {\n this.tags = Object.assign(Object.assign({}, Tags), extraTags);\n this.globalAttrs = Object.assign(Object.assign({}, GlobalAttrs), extraAttrs);\n this.allTags = Object.keys(this.tags);\n this.globalAttrNames = Object.keys(this.globalAttrs);\n }\n}\nSchema.default = /*@__PURE__*/new Schema;\nfunction elementName(doc, tree, max = doc.length) {\n if (!tree)\n return \"\";\n let tag = tree.firstChild;\n let name = tag && tag.getChild(\"TagName\");\n return name ? doc.sliceString(name.from, Math.min(name.to, max)) : \"\";\n}\nfunction findParentElement(tree, skip = false) {\n for (let cur = tree.parent; cur; cur = cur.parent)\n if (cur.name == \"Element\") {\n if (skip)\n skip = false;\n else\n return cur;\n }\n return null;\n}\nfunction allowedChildren(doc, tree, schema) {\n let parentInfo = schema.tags[elementName(doc, findParentElement(tree, true))];\n return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;\n}\nfunction openTags(doc, tree) {\n let open = [];\n for (let parent = tree; parent = findParentElement(parent);) {\n let tagName = elementName(doc, parent);\n if (tagName && parent.lastChild.name == \"CloseTag\")\n break;\n if (tagName && open.indexOf(tagName) < 0 && (tree.name == \"EndTag\" || tree.from >= parent.firstChild.to))\n open.push(tagName);\n }\n return open;\n}\nconst identifier = /^[:\\-\\.\\w\\u00b7-\\uffff]*$/;\nfunction completeTag(state, schema, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n return { from, to,\n options: allowedChildren(state.doc, tree, schema).map(tagName => ({ label: tagName, type: \"type\" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: \"/\" + tag, apply: \"/\" + tag + end,\n type: \"type\", boost: 99 - i }))),\n validFor: /^\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n}\nfunction completeCloseTag(state, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n return { from, to,\n options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: \"type\", boost: 99 - i })),\n validFor: identifier };\n}\nfunction completeStartTag(state, schema, tree, pos) {\n let options = [], level = 0;\n for (let tagName of allowedChildren(state.doc, tree, schema))\n options.push({ label: \"<\" + tagName, type: \"type\" });\n for (let open of openTags(state.doc, tree))\n options.push({ label: \"\", type: \"type\", boost: 99 - level++ });\n return { from: pos, to: pos, options, validFor: /^<\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n}\nfunction completeAttrName(state, schema, tree, from, to) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;\n let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];\n let names = info && info.globalAttrs === false ? localAttrs\n : localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames;\n return { from, to,\n options: names.map(attrName => ({ label: attrName, type: \"property\" })),\n validFor: identifier };\n}\nfunction completeAttrValue(state, schema, tree, from, to) {\n var _a;\n let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild(\"AttributeName\");\n let options = [], token = undefined;\n if (nameNode) {\n let attrName = state.sliceDoc(nameNode.from, nameNode.to);\n let attrs = schema.globalAttrs[attrName];\n if (!attrs) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;\n attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];\n }\n if (attrs) {\n let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = '\"', quoteEnd = '\"';\n if (/^['\"]/.test(base)) {\n token = base[0] == '\"' ? /^[^\"]*$/ : /^[^']*$/;\n quoteStart = \"\";\n quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? \"\" : base[0];\n base = base.slice(1);\n from++;\n }\n else {\n token = /^[^\\s<>='\"]*$/;\n }\n for (let value of attrs)\n options.push({ label: value, apply: quoteStart + value + quoteEnd, type: \"constant\" });\n }\n }\n return { from, to, options, validFor: token };\n}\nfunction htmlCompletionFor(schema, context) {\n let { state, pos } = context, around = syntaxTree(state).resolveInner(pos), tree = around.resolve(pos, -1);\n for (let scan = pos, before; around == tree && (before = tree.childBefore(scan));) {\n let last = before.lastChild;\n if (!last || !last.type.isError || last.from < last.to)\n break;\n around = tree = before;\n scan = last.from;\n }\n if (tree.name == \"TagName\") {\n return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos)\n : completeTag(state, schema, tree, tree.from, pos);\n }\n else if (tree.name == \"StartTag\") {\n return completeTag(state, schema, tree, pos, pos);\n }\n else if (tree.name == \"StartCloseTag\" || tree.name == \"IncompleteCloseTag\") {\n return completeCloseTag(state, tree, pos, pos);\n }\n else if (context.explicit && (tree.name == \"OpenTag\" || tree.name == \"SelfClosingTag\") || tree.name == \"AttributeName\") {\n return completeAttrName(state, schema, tree, tree.name == \"AttributeName\" ? tree.from : pos, pos);\n }\n else if (tree.name == \"Is\" || tree.name == \"AttributeValue\" || tree.name == \"UnquotedAttributeValue\") {\n return completeAttrValue(state, schema, tree, tree.name == \"Is\" ? pos : tree.from, pos);\n }\n else if (context.explicit && (around.name == \"Element\" || around.name == \"Text\" || around.name == \"Document\")) {\n return completeStartTag(state, schema, tree, pos);\n }\n else {\n return null;\n }\n}\n/**\nHTML tag completion. Opens and closes tags and attributes in a\ncontext-aware way.\n*/\nfunction htmlCompletionSource(context) {\n return htmlCompletionFor(Schema.default, context);\n}\n/**\nCreate a completion source for HTML extended with additional tags\nor attributes.\n*/\nfunction htmlCompletionSourceWith(config) {\n let { extraTags, extraGlobalAttributes: extraAttrs } = config;\n let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;\n return (context) => htmlCompletionFor(schema, context);\n}\n\nconst defaultNesting = [\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript\" || attrs.lang == \"ts\",\n parser: typescriptLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/babel\" || attrs.type == \"text/jsx\",\n parser: jsxLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript-jsx\",\n parser: tsxLanguage.parser },\n { tag: \"script\",\n attrs(attrs) {\n return !attrs.type || /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);\n },\n parser: javascriptLanguage.parser },\n { tag: \"style\",\n attrs(attrs) {\n return (!attrs.lang || attrs.lang == \"css\") && (!attrs.type || /^(text\\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));\n },\n parser: cssLanguage.parser }\n];\nconst defaultAttrs = /*@__PURE__*/[\n { name: \"style\",\n parser: /*@__PURE__*/cssLanguage.parser.configure({ top: \"Styles\" }) }\n].concat(/*@__PURE__*/eventAttributes.map(name => ({ name, parser: javascriptLanguage.parser })));\n/**\nA language provider based on the [Lezer HTML\nparser](https://github.com/lezer-parser/html), extended with the\nJavaScript and CSS parsers to parse the content of `\n\n\n\n\n\t\n\n\n\n","\n\n\n\t{$_(label)}\n\n","export { default as Component } from \"./UploadButton.svelte\";\nexport const modes = [\"static\", \"dynamic\"];\n"],"names":["ctx","insert","target","input","anchor","dirty","button_changes","elem_id","$$props","elem_classes","visible","file_count","file_types","include_file_metadata","size","scale","min_width","mode","variant","label","hidden_upload","dispatch","createEventDispatcher","accept_file_types","x","openFileUpload","loadFiles","files","_files","all_file_data","f","i","loadFilesFromUpload","e","clearInputValue","$$value","t_value","set_data","t","value","root","upload_files","getContext","default_upload_files","handle_upload","detail","$$invalidate","tick","file_data","response","blobToBase64","modes"],"mappings":"yyBAsGW,SAAAA,OAAS,iEAHTA,EAAc,EAAA,CAAA,0FAjBhBA,EAAiB,EAAA,CAAA,kCAKfA,EAAU,CAAA,IAAK,YAAc,+BACtBA,EAAU,CAAA,IAAK,aAAe,MAAS,uBAC1CA,EAAU,CAAA,IAAK,aAAe,MAAS,sBACvCA,EAAK,CAAA,EAAA,gBAAA,UAVpBC,EAWCC,EAAAC,EAAAC,CAAA,sDANWJ,EAAmB,EAAA,CAAA,cACpBA,EAAe,EAAA,CAAA,8CAJjBA,EAAiB,EAAA,CAAA,mBAKfA,EAAU,CAAA,IAAK,YAAc,0CACtBA,EAAU,CAAA,IAAK,aAAe,oDACjCA,EAAU,CAAA,IAAK,aAAe,mDAC9BA,EAAK,CAAA,EAAA,qNAYTK,EAAA,MAAAC,EAAA,SAAAN,OAAS,gOAjGR,CAAA,QAAAO,EAAU,EAAE,EAAAC,GACZ,aAAAC,EAAY,EAAA,EAAAD,EACZ,CAAA,QAAAE,EAAU,EAAI,EAAAF,GACd,WAAAG,CAAkB,EAAAH,GAClB,WAAAI,EAAU,EAAA,EAAAJ,EACV,CAAA,sBAAAK,EAAwB,EAAI,EAAAL,EAC5B,CAAA,KAAAM,EAAoB,IAAI,EAAAN,EACxB,CAAA,MAAAO,EAAuB,IAAI,EAAAP,EAC3B,CAAA,UAAAQ,EAAgC,MAAS,EAAAR,EACzC,CAAA,KAAAS,EAA6B,SAAS,EAAAT,EACtC,CAAA,QAAAU,EAA4C,WAA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AAAI,EAAU,EAAA,EAAAJ,GACV,KAAAgC,CAAY,EAAAhC,EACZ,CAAA,KAAAM,EAAoB,IAAI,EAAAN,EACxB,CAAA,MAAAO,EAAuB,IAAI,EAAAP,EAC3B,CAAA,UAAAQ,EAAgC,MAAS,EAAAR,EACzC,CAAA,KAAAS,EAA6B,SAAS,EAAAT,EACtC,CAAA,QAAAU,EAA4C,WAAW,EAAAV,EAE5D,MAAAiC,EACLC,EAAwC,cAAc,GACtDC,GAEc,eAAAC,GAAgB,OAAAC,GAAM,CACpCC,EAAA,GAAAP,EAAQM,CAAM,QACRE,GAAI,EACN,IAAApB,GAAS,MAAM,QAAQkB,CAAM,EAAIA,EAAU,CAAAA,CAAM,GAAG,IACtDG,GAAcA,EAAU,IAAK,EAG/BP,EAAaD,EAAMb,CAAK,EAAE,WAAYsB,GAAQ,CACzCA,EAAS,OACX,MAAM,QAAQJ,CAAM,EAAIA,EAAU,CAAAA,CAAM,GAAG,QACpC,MAAAG,EAAWjB,IAAC,CAClBiB,EAAU,KAAI,MAASE,GAAaF,EAAU,IAAK,EACnDA,EAAU,KAAO,UAIlB,MAAM,QAAQH,CAAM,EAAIA,EAAU,CAAAA,CAAM,GAAG,QAAS,CAAAG,EAAWjB,IAAC,CAC5DkB,EAAS,QACZD,EAAU,UAAYA,EAAU,KAChCA,EAAU,KAAOC,EAAS,MAAMlB,CAAC,EACjCiB,EAAU,QAAU,GACpBA,EAAU,KAAO,UAKpB3B,EAAS,SAAUkB,CAAK,EACxBlB,EAAS,SAAUwB,CAAM,IAIrB,MAAAxB,EAAWC,usBCxDL6B,GAAQ,CAAC,SAAU,SAAS"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-259159d9.js b/gradio/templates/cdn/assets/index-259159d9.js new file mode 100644 index 0000000000000000000000000000000000000000..ff6b6baf8c60802c49b10316620cd5f51d7e0a08 --- /dev/null +++ b/gradio/templates/cdn/assets/index-259159d9.js @@ -0,0 +1,7 @@ +import{S as T,e as q,s as L,N as y,P as A,K as h,U as u,p as b,M,R as N,n as k,A as v,G as D,V,m as W,Z as Ie,ar as Fe,C as qe,h as Le,T as ne,Q as E,X as se,a1 as x,O as B,L as X,k as Z,o as J,z as S,v as H,x as K,B as Ge,J as ie,u as I,y as F,f as Y,as as ae}from"./index-fda37c89.js";import{B as Oe}from"./Button-e3640f74.js";import{E as We}from"./Image-20833b5a.js";import{c as Ze}from"./csv-b0b7514a.js";import{d as Je}from"./dsv-576afacd.js";import{E as Ke}from"./Model3D-7a003e98.js";var Qe=Je(" "),Ue=Qe.parseRows;function Xe(s){let e,l;return{c(){e=y("div"),l=A(s[0]),h(e,"class","svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(t,n){b(t,e,n),M(e,l)},p(t,[n]){n&1&&N(l,t[0]),n&2&&u(e,"table",t[1]==="table"),n&2&&u(e,"gallery",t[1]==="gallery"),n&4&&u(e,"selected",t[2])},i:k,o:k,d(t){t&&v(e)}}}function Ye(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class xe extends T{constructor(e){super(),q(this,e,Ye,Xe,L,{value:0,type:1,selected:2})}}function $e(s){let e,l;return{c(){e=y("div"),l=A(s[0]),h(e,"class","svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(t,n){b(t,e,n),M(e,l)},p(t,[n]){n&1&&N(l,t[0]),n&2&&u(e,"table",t[1]==="table"),n&2&&u(e,"gallery",t[1]==="gallery"),n&4&&u(e,"selected",t[2])},i:k,o:k,d(t){t&&v(e)}}}function el(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class ll extends T{constructor(e){super(),q(this,e,el,$e,L,{value:0,type:1,selected:2})}}function tl(s){let e,l=s[0].toLocaleString()+"",t;return{c(){e=y("div"),t=A(l),h(e,"class","svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(n,a){b(n,e,a),M(e,t)},p(n,[a]){a&1&&l!==(l=n[0].toLocaleString()+"")&&N(t,l),a&2&&u(e,"table",n[1]==="table"),a&2&&u(e,"gallery",n[1]==="gallery"),a&4&&u(e,"selected",n[2])},i:k,o:k,d(n){n&&v(e)}}}function nl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class sl extends T{constructor(e){super(),q(this,e,nl,tl,L,{value:0,type:1,selected:2})}}function fe(s,e,l){const t=s.slice();return t[3]=e[l],t[5]=l,t}function ce(s){let e;return{c(){e=A(", ")},m(l,t){b(l,e,t)},d(l){l&&v(e)}}}function ue(s){let e=s[3].toLocaleString()+"",l,t,n=s[5]!==s[0].length-1&&ce();return{c(){l=A(e),n&&n.c(),t=W()},m(a,i){b(a,l,i),n&&n.m(a,i),b(a,t,i)},p(a,i){i&1&&e!==(e=a[3].toLocaleString()+"")&&N(l,e),a[5]!==a[0].length-1?n||(n=ce(),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(a){a&&(v(l),v(t)),n&&n.d(a)}}}function il(s){let e,l=D(s[0]),t=[];for(let n=0;n{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class fl extends T{constructor(e){super(),q(this,e,al,il,L,{value:0,type:1,selected:2})}}function cl(s){let e,l;return{c(){e=y("div"),l=A(s[0]),h(e,"class","svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(t,n){b(t,e,n),M(e,l)},p(t,[n]){n&1&&N(l,t[0]),n&2&&u(e,"table",t[1]==="table"),n&2&&u(e,"gallery",t[1]==="gallery"),n&4&&u(e,"selected",t[2])},i:k,o:k,d(t){t&&v(e)}}}function ul(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class rl extends T{constructor(e){super(),q(this,e,ul,cl,L,{value:0,type:1,selected:2})}}function ol(s){let e,l;return{c(){e=y("div"),l=A(s[0]),h(e,"class","svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(t,n){b(t,e,n),M(e,l)},p(t,[n]){n&1&&N(l,t[0]),n&2&&u(e,"table",t[1]==="table"),n&2&&u(e,"gallery",t[1]==="gallery"),n&4&&u(e,"selected",t[2])},i:k,o:k,d(t){t&&v(e)}}}function _l(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class dl extends T{constructor(e){super(),q(this,e,_l,ol,L,{value:0,type:1,selected:2})}}function ml(s){let e,l,t;return{c(){e=y("div"),l=A(s[0]),h(e,"class","svelte-1viwdyg"),Ie(()=>s[5].call(e)),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(n,a){b(n,e,a),M(e,l),t=Fe(e,s[5].bind(e)),s[6](e)},p(n,[a]){a&1&&N(l,n[0]),a&2&&u(e,"table",n[1]==="table"),a&2&&u(e,"gallery",n[1]==="gallery"),a&4&&u(e,"selected",n[2])},i:k,o:k,d(n){n&&v(e),t(),s[6](null)}}}function hl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e,i,f;function c(o,w){!o||!w||(f.style.setProperty("--local-text-width",`${w<150?w:200}px`),l(4,f.style.whiteSpace="unset",f))}qe(()=>{c(f,i)});function _(){i=this.clientWidth,l(3,i)}function m(o){Le[o?"unshift":"push"](()=>{f=o,l(4,f)})}return s.$$set=o=>{"value"in o&&l(0,t=o.value),"type"in o&&l(1,n=o.type),"selected"in o&&l(2,a=o.selected)},[t,n,a,i,f,_,m]}class gl extends T{constructor(e){super(),q(this,e,hl,ml,L,{value:0,type:1,selected:2})}}function bl(s){let e,l;return{c(){e=y("div"),l=A(s[0]),h(e,"class","svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(t,n){b(t,e,n),M(e,l)},p(t,[n]){n&1&&N(l,t[0]),n&2&&u(e,"table",t[1]==="table"),n&2&&u(e,"gallery",t[1]==="gallery"),n&4&&u(e,"selected",t[2])},i:k,o:k,d(t){t&&v(e)}}}function vl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class yl extends T{constructor(e){super(),q(this,e,vl,bl,L,{value:0,type:1,selected:2})}}function kl(s){let e,l,t,n;return{c(){e=y("video"),e.muted=!0,e.playsInline=!0,ne(e.src,l=s[3]+s[2])||h(e,"src",l),h(e,"class","svelte-1tntsc1"),u(e,"table",s[0]==="table"),u(e,"gallery",s[0]==="gallery"),u(e,"selected",s[1])},m(a,i){b(a,e,i),s[5](e),t||(n=[E(e,"mouseover",function(){se(s[4].play)&&s[4].play.apply(this,arguments)}),E(e,"mouseout",function(){se(s[4].pause)&&s[4].pause.apply(this,arguments)})],t=!0)},p(a,i){s=a,i&12&&!ne(e.src,l=s[3]+s[2])&&h(e,"src",l),i&1&&u(e,"table",s[0]==="table"),i&1&&u(e,"gallery",s[0]==="gallery"),i&2&&u(e,"selected",s[1])},d(a){a&&v(e),s[5](null),t=!1,x(n)}}}function wl(s){let e;function l(a,i){return kl}let n=l()(s);return{c(){n.c(),e=W()},m(a,i){n.m(a,i),b(a,e,i)},p(a,[i]){n.p(a,i)},i:k,o:k,d(a){a&&v(e),n.d(a)}}}function zl(s,e,l){let{type:t}=e,{selected:n=!1}=e,{value:a}=e,{samples_dir:i}=e,f;async function c(){l(4,f.muted=!0,f),l(4,f.playsInline=!0,f),l(4,f.controls=!1,f),f.setAttribute("muted",""),await f.play(),f.pause()}qe(()=>{c()});function _(m){Le[m?"unshift":"push"](()=>{f=m,l(4,f)})}return s.$$set=m=>{"type"in m&&l(0,t=m.type),"selected"in m&&l(1,n=m.selected),"value"in m&&l(2,a=m.value),"samples_dir"in m&&l(3,i=m.samples_dir)},[t,n,a,i,f,_]}class Cl extends T{constructor(e){super(),q(this,e,zl,wl,L,{type:0,selected:1,value:2,samples_dir:3})}}function Ml(s){let e,l=(Array.isArray(s[0])?s[0].join(", "):s[0])+"",t;return{c(){e=y("div"),t=A(l),h(e,"class","svelte-rgtszb"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(n,a){b(n,e,a),M(e,t)},p(n,[a]){a&1&&l!==(l=(Array.isArray(n[0])?n[0].join(", "):n[0])+"")&&N(t,l),a&2&&u(e,"table",n[1]==="table"),a&2&&u(e,"gallery",n[1]==="gallery"),a&4&&u(e,"selected",n[2])},i:k,o:k,d(n){n&&v(e)}}}function Sl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class Al extends T{constructor(e){super(),q(this,e,Sl,Ml,L,{value:0,type:1,selected:2})}}function re(s,e,l){const t=s.slice();return t[10]=e[l],t[12]=l,t}function oe(s,e,l){const t=s.slice();return t[13]=e[l],t[15]=l,t}function _e(s){let e,l,t;function n(f,c){return typeof f[6]=="string"?Tl:Hl}let a=n(s),i=a(s);return{c(){e=y("div"),i.c(),h(e,"class","svelte-1cib1xd"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(f,c){b(f,e,c),i.m(e,null),l||(t=[E(e,"mouseenter",s[8]),E(e,"mouseleave",s[9])],l=!0)},p(f,c){a===(a=n(f))&&i?i.p(f,c):(i.d(1),i=a(f),i&&(i.c(),i.m(e,null))),c&2&&u(e,"table",f[1]==="table"),c&2&&u(e,"gallery",f[1]==="gallery"),c&4&&u(e,"selected",f[2])},d(f){f&&v(e),i.d(),l=!1,x(t)}}}function Hl(s){let e,l,t=D(s[6].slice(0,3)),n=[];for(let i=0;i3&&ge(s);return{c(){e=y("table");for(let i=0;i3?a?a.p(i,f):(a=ge(i),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(i){i&&v(e),V(n,i),a&&a.d()}}}function Tl(s){let e;return{c(){e=A(s[6])},m(l,t){b(l,e,t)},p(l,t){t&64&&N(e,l[6])},d(l){l&&v(e)}}}function de(s){let e,l=s[13]+"",t;return{c(){e=y("td"),t=A(l),h(e,"class","svelte-1cib1xd")},m(n,a){b(n,e,a),M(e,t)},p(n,a){a&64&&l!==(l=n[13]+"")&&N(t,l)},d(n){n&&v(e)}}}function me(s){let e;return{c(){e=y("td"),e.textContent="…",h(e,"class","svelte-1cib1xd")},m(l,t){b(l,e,t)},d(l){l&&v(e)}}}function he(s){let e,l,t=D(s[10].slice(0,3)),n=[];for(let i=0;i3&&me();return{c(){e=y("tr");for(let i=0;i3?a||(a=me(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(i){i&&v(e),V(n,i),a&&a.d()}}}function ge(s){let e;return{c(){e=y("div"),h(e,"class","overlay svelte-1cib1xd"),u(e,"odd",s[3]%2!=0),u(e,"even",s[3]%2==0),u(e,"button",s[1]==="gallery")},m(l,t){b(l,e,t)},p(l,t){t&8&&u(e,"odd",l[3]%2!=0),t&8&&u(e,"even",l[3]%2==0),t&2&&u(e,"button",l[1]==="gallery")},d(l){l&&v(e)}}}function ql(s){let e,l=s[4]&&_e(s);return{c(){l&&l.c(),e=W()},m(t,n){l&&l.m(t,n),b(t,e,n)},p(t,[n]){t[4]?l?l.p(t,n):(l=_e(t),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:k,o:k,d(t){t&&v(e),l&&l.d(t)}}}function Ll(s,e,l){let{value:t}=e,{samples_dir:n}=e,{type:a}=e,{selected:i=!1}=e,{index:f}=e,c=!1,_=t,m=Array.isArray(_);const o=()=>l(5,c=!0),w=()=>l(5,c=!1);return s.$$set=r=>{"value"in r&&l(0,t=r.value),"samples_dir"in r&&l(7,n=r.samples_dir),"type"in r&&l(1,a=r.type),"selected"in r&&l(2,i=r.selected),"index"in r&&l(3,f=r.index)},s.$$.update=()=>{s.$$.dirty&145&&!m&&typeof t=="string"&&/\.[a-zA-Z]+$/.test(t)&&fetch(n+t).then(r=>r.text()).then(r=>{try{if(t.endsWith("csv")){const z=r.split(` +`).slice(0,4).map(d=>d.split(",").slice(0,4).join(",")).join(` +`);l(6,_=Ze(z))}else if(t.endsWith("tsv")){const z=r.split(` +`).slice(0,4).map(d=>d.split(" ").slice(0,4).join(" ")).join(` +`);l(6,_=Ue(z))}else throw new Error("Incorrect format, only CSV and TSV files are supported");l(4,m=!0)}catch(z){console.error(z)}}).catch(r=>{l(6,_=t),l(4,m=!0)})},[t,a,i,f,m,c,_,n,o,w]}class Dl extends T{constructor(e){super(),q(this,e,Ll,ql,L,{value:0,samples_dir:7,type:1,selected:2,index:3})}}function Nl(s){let e;return{c(){e=y("div"),X(e,"background-color",s[0]),h(e,"class","svelte-h6ogpl"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(l,t){b(l,e,t)},p(l,[t]){t&1&&X(e,"background-color",l[0]),t&2&&u(e,"table",l[1]==="table"),t&2&&u(e,"gallery",l[1]==="gallery"),t&4&&u(e,"selected",l[2])},i:k,o:k,d(l){l&&v(e)}}}function jl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class pl extends T{constructor(e){super(),q(this,e,jl,Nl,L,{value:0,type:1,selected:2})}}function El(s){let e,l;return{c(){e=y("div"),l=A(s[0]),h(e,"class","svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(t,n){b(t,e,n),M(e,l)},p(t,[n]){n&1&&N(l,t[0]),n&2&&u(e,"table",t[1]==="table"),n&2&&u(e,"gallery",t[1]==="gallery"),n&4&&u(e,"selected",t[2])},i:k,o:k,d(t){t&&v(e)}}}function Bl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class Pl extends T{constructor(e){super(),q(this,e,Bl,El,L,{value:0,type:1,selected:2})}}function Rl(s){let e;return{c(){e=y("div"),h(e,"class","prose svelte-1ayixqk"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(l,t){b(l,e,t),e.innerHTML=s[0]},p(l,[t]){t&1&&(e.innerHTML=l[0]),t&2&&u(e,"table",l[1]==="table"),t&2&&u(e,"gallery",l[1]==="gallery"),t&4&&u(e,"selected",l[2])},i:k,o:k,d(l){l&&v(e)}}}function Vl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class Il extends T{constructor(e){super(),q(this,e,Vl,Rl,L,{value:0,type:1,selected:2})}}function Fl(s){let e;return{c(){e=y("div"),h(e,"class","prose svelte-zvfedn"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(l,t){b(l,e,t),e.innerHTML=s[0]},p(l,[t]){t&1&&(e.innerHTML=l[0]),t&2&&u(e,"table",l[1]==="table"),t&2&&u(e,"gallery",l[1]==="gallery"),t&4&&u(e,"selected",l[2])},i:k,o:k,d(l){l&&v(e)}}}function Gl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class Ol extends T{constructor(e){super(),q(this,e,Gl,Fl,L,{value:0,type:1,selected:2})}}function Wl(s){let e,l;return{c(){e=y("pre"),l=A(s[0]),h(e,"class","svelte-agpzo2"),u(e,"table",s[1]==="table"),u(e,"gallery",s[1]==="gallery"),u(e,"selected",s[2])},m(t,n){b(t,e,n),M(e,l)},p(t,[n]){n&1&&N(l,t[0]),n&2&&u(e,"table",t[1]==="table"),n&2&&u(e,"gallery",t[1]==="gallery"),n&4&&u(e,"selected",t[2])},i:k,o:k,d(t){t&&v(e)}}}function Zl(s,e,l){let{value:t}=e,{type:n}=e,{selected:a=!1}=e;return s.$$set=i=>{"value"in i&&l(0,t=i.value),"type"in i&&l(1,n=i.type),"selected"in i&&l(2,a=i.selected)},[t,n,a]}class Jl extends T{constructor(e){super(),q(this,e,Zl,Wl,L,{value:0,type:1,selected:2})}}const O={dropdown:ll,checkbox:sl,checkboxgroup:fl,number:xe,slider:rl,radio:dl,image:We,textbox:gl,audio:yl,video:Cl,file:Al,dataframe:Dl,model3d:Ke,colorpicker:pl,timeseries:Pl,markdown:Il,html:Ol,code:Jl};function be(s,e,l){const t=s.slice();return t[32]=e[l],t}function ve(s,e,l){const t=s.slice();return t[35]=e[l],t[37]=l,t}function ye(s,e,l){const t=s.slice();t[0]=e[l].value,t[39]=e[l].component,t[42]=l;const n=t[1][t[42]];return t[40]=n,t}function ke(s,e,l){const t=s.slice();return t[43]=e[l],t}function we(s,e,l){const t=s.slice();return t[35]=e[l],t[37]=l,t}function Kl(s){let e,l,t,n,a,i,f,c=D(s[3]),_=[];for(let r=0;rH(o[r],1,1,()=>{o[r]=null});return{c(){e=y("div"),l=y("table"),t=y("thead"),n=y("tr");for(let r=0;r<_.length;r+=1)_[r].c();a=B(),i=y("tbody");for(let r=0;rH(n[i],1,1,()=>{n[i]=null});return{c(){e=y("div");for(let i=0;i{K(m,1)}),F()}a?(l=Y(a,i(f)),Z(l.$$.fragment),S(l.$$.fragment,1),J(l,e,null)):l=null}else a&&l.$set(_);(!n||c[0]&2)&&X(e,"max-width",f[40]==="textbox"?"35ch":"auto"),(!n||c[0]&2&&t!==(t=ae(f[40])+" svelte-13hsdno"))&&h(e,"class",t)},i(f){n||(l&&S(l.$$.fragment,f),n=!0)},o(f){l&&H(l.$$.fragment,f),n=!1},d(f){f&&v(e),l&&K(l)}}}function Me(s){let e,l,t=s[40]!==void 0&&O[s[40]]!==void 0&&Ce(s);return{c(){t&&t.c(),e=W()},m(n,a){t&&t.m(n,a),b(n,e,a),l=!0},p(n,a){n[40]!==void 0&&O[n[40]]!==void 0?t?(t.p(n,a),a[0]&2&&S(t,1)):(t=Ce(n),t.c(),S(t,1),t.m(e.parentNode,e)):t&&(I(),H(t,1,1,()=>{t=null}),F())},i(n){l||(S(t),l=!0)},o(n){H(t),l=!1},d(n){n&&v(e),t&&t.d(n)}}}function Se(s){let e,l,t,n,a,i=D(s[35]),f=[];for(let o=0;oH(f[o],1,1,()=>{f[o]=null});function _(){return s[28](s[37])}function m(){return s[29](s[37])}return{c(){e=y("tr");for(let o=0;o{K(_,1)}),F()}n?(e=Y(n,a(i)),Z(e.$$.fragment),S(e.$$.fragment,1),J(e,l.parentNode,l)):e=null}else n&&e.$set(c)},i(i){t||(e&&S(e.$$.fragment,i),t=!0)},o(i){e&&H(e.$$.fragment,i),t=!1},d(i){i&&v(l),e&&K(e,i)}}}function He(s){let e,l=Object.keys(O).includes(s[1][0])&&O[s[1][0]],t,n,a,i,f=l&&Ae(s);function c(){return s[25](s[37],s[35])}function _(){return s[26](s[37])}return{c(){e=y("button"),f&&f.c(),t=B(),h(e,"class","gallery-item svelte-13hsdno")},m(m,o){b(m,e,o),f&&f.m(e,null),M(e,t),n=!0,a||(i=[E(e,"click",c),E(e,"mouseenter",_),E(e,"mouseleave",s[27])],a=!0)},p(m,o){s=m,o[0]&2&&(l=Object.keys(O).includes(s[1][0])&&O[s[1][0]]),l?f?(f.p(s,o),o[0]&2&&S(f,1)):(f=Ae(s),f.c(),S(f,1),f.m(e,t)):f&&(I(),H(f,1,1,()=>{f=null}),F())},i(m){n||(S(f),n=!0)},o(m){H(f),n=!1},d(m){m&&v(e),f&&f.d(),a=!1,x(i)}}}function Ul(s){let e,l,t=D(s[12]),n=[];for(let a=0;a{r[P]=null}),F(),c=r[f],c?c.p(C,j):(c=r[f]=w[f](C),c.c()),S(c,1),c.m(_.parentNode,_)),C[18]&&d.p(C,j)},i(C){o||(S(c),o=!0)},o(C){H(c),o=!1},d(C){C&&(v(e),v(i),v(_),v(m)),r[f].d(C),d&&d.d(C)}}}function $l(s){let e,l;return e=new Oe({props:{visible:s[6],padding:!1,elem_id:s[4],elem_classes:s[5],scale:s[8],min_width:s[9],allow_overflow:!1,container:!1,$$slots:{default:[xl]},$$scope:{ctx:s}}}),{c(){Z(e.$$.fragment)},m(t,n){J(e,t,n),l=!0},p(t,n){const a={};n[0]&64&&(a.visible=t[6]),n[0]&16&&(a.elem_id=t[4]),n[0]&32&&(a.elem_classes=t[5]),n[0]&256&&(a.scale=t[8]),n[0]&512&&(a.min_width=t[9]),n[0]&64655|n[1]&32768&&(a.$$scope={dirty:n,ctx:t}),e.$set(a)},i(t){l||(S(e.$$.fragment,t),l=!0)},o(t){H(e.$$.fragment,t),l=!1},d(t){K(e,t)}}}function et(s,e,l){let t,n,{components:a}=e,{label:i="Examples"}=e,{headers:f}=e,{samples:c}=e,{elem_id:_=""}=e,{elem_classes:m=[]}=e,{visible:o=!0}=e,{value:w=null}=e,{root:r}=e,{root_url:z}=e,{samples_per_page:d=10}=e,{scale:C=null}=e,{min_width:j=void 0}=e;const P=Ge();let De=z?"proxy="+z+"file=":r+"/file=",G=0,te=c.length>d,Q,U,R=[],$=-1;function ee(g){l(13,$=g)}function le(){l(13,$=-1)}const Ne=(g,p)=>{l(0,w=g+G*d),P("click",w),P("select",{index:w,value:p})},je=g=>ee(g),pe=()=>le(),Ee=g=>{l(0,w=g+G*d),P("click",w)},Be=g=>ee(g),Pe=()=>le(),Re=g=>l(10,G=g);return s.$$set=g=>{"components"in g&&l(1,a=g.components),"label"in g&&l(2,i=g.label),"headers"in g&&l(3,f=g.headers),"samples"in g&&l(21,c=g.samples),"elem_id"in g&&l(4,_=g.elem_id),"elem_classes"in g&&l(5,m=g.elem_classes),"visible"in g&&l(6,o=g.visible),"value"in g&&l(0,w=g.value),"root"in g&&l(22,r=g.root),"root_url"in g&&l(23,z=g.root_url),"samples_per_page"in g&&l(7,d=g.samples_per_page),"scale"in g&&l(8,C=g.scale),"min_width"in g&&l(9,j=g.min_width)},s.$$.update=()=>{s.$$.dirty[0]&2&&l(15,t=a.length<2),s.$$.dirty[0]&18879616&&(te?(l(12,R=[]),l(11,Q=c.slice(G*d,(G+1)*d)),l(24,U=Math.ceil(c.length/d)),[0,G,U-1].forEach(g=>{for(let p=g-2;p<=g+2;p++)p>=0&&p0&&p-R[R.length-1]>1&&R.push(-1),R.push(p))})):l(11,Q=c.slice())),s.$$.dirty[0]&2050&&l(14,n=Q.map(g=>g.map((p,Ve)=>({value:p,component:O[a[Ve]]}))))},[w,a,i,f,_,m,o,d,C,j,G,Q,R,$,n,t,P,De,te,ee,le,c,r,z,U,Ne,je,pe,Ee,Be,Pe,Re]}class lt extends T{constructor(e){super(),q(this,e,et,$l,L,{components:1,label:2,headers:3,samples:21,elem_id:4,elem_classes:5,visible:6,value:0,root:22,root_url:23,samples_per_page:7,scale:8,min_width:9},null,[-1,-1])}}const ct=lt,ut=["dynamic"],rt=()=>({type:{payload:"number"},description:{payload:"index of selected row"},example_data:0});export{ct as Component,rt as document,ut as modes}; +//# sourceMappingURL=index-259159d9.js.map diff --git a/gradio/templates/cdn/assets/index-259159d9.js.map b/gradio/templates/cdn/assets/index-259159d9.js.map new file mode 100644 index 0000000000000000000000000000000000000000..eb35e7124b6d68c85a0d84fac73e3d8ad4d8fc90 --- /dev/null +++ b/gradio/templates/cdn/assets/index-259159d9.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-259159d9.js","sources":["../../../../node_modules/.pnpm/d3-dsv@3.0.1/node_modules/d3-dsv/src/tsv.js","../../../../js/app/src/components/Dataset/ExampleComponents/Number.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Dropdown.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Checkbox.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/CheckboxGroup.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Slider.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Radio.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Textbox.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Audio.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Video.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/File.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Dataframe.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/ColorPicker.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/TimeSeries.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Markdown.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/HTML.svelte","../../../../js/app/src/components/Dataset/ExampleComponents/Code.svelte","../../../../js/app/src/components/Dataset/directory.ts","../../../../js/app/src/components/Dataset/Dataset.svelte","../../../../js/app/src/components/Dataset/index.ts"],"sourcesContent":["import dsv from \"./dsv.js\";\n\nvar tsv = dsv(\"\\t\");\n\nexport var tsvParse = tsv.parse;\nexport var tsvParseRows = tsv.parseRows;\nexport var tsvFormat = tsv.format;\nexport var tsvFormatBody = tsv.formatBody;\nexport var tsvFormatRows = tsv.formatRows;\nexport var tsvFormatRow = tsv.formatRow;\nexport var tsvFormatValue = tsv.formatValue;\n","\n\n\n\t{value}\n
    \n\n\n","\n\n\n\t{value}\n
    \n\n\n","\n\n\n\t{value.toLocaleString()}\n\n\n\n","\n\n\n\t{#each value as check, i}{check.toLocaleString()}{#if i !== value.length - 1}, {/if}{/each}\n\n\n\n","\n\n\n\t{value}\n\n\n\n","\n\n\n\t{value}\n\n\n\n","\n\n\n\t{value}\n\n\n\n","\n\n\n\t{value}\n\n\n\n","\n\n\n\n{#if playable()}\n\t\n{:else}\n\t
    {value}
    \n{/if}\n\n\n","\n\n\n\t{Array.isArray(value) ? value.join(\", \") : value}\n\n\n\n","\n\n{#if loaded}\n\t (hovered = true)}\n\t\ton:mouseleave={() => (hovered = false)}\n\t>\n\t\t{#if typeof loaded_value === \"string\"}\n\t\t\t{loaded_value}\n\t\t{:else}\n\t\t\t\n\t\t\t\t{#each loaded_value.slice(0, 3) as row, i}\n\t\t\t\t\t\n\t\t\t\t\t\t{#each row.slice(0, 3) as cell, j}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t{#if row.length > 3}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t\n\t\t\t\t{/each}\n\t\t\t\t{#if value.length > 3}\n\t\t\t\t\t\n\t\t\t\t{/if}\n\t\t\t
    {cell}…
    \n\t\t{/if}\n\t\n{/if}\n\n\n","\n\n\n\n\n","\n\n\n\t{value}\n\n\n\n","\n\n\n\t{@html value}\n\n\n\n","\n\n\n\t{@html value}\n\n\n\n","\n\n{value}\n\n\n","import ExampleNumber from \"./ExampleComponents/Number.svelte\";\nimport ExampleDropdown from \"./ExampleComponents/Dropdown.svelte\";\nimport ExampleCheckbox from \"./ExampleComponents/Checkbox.svelte\";\nimport ExampleCheckboxGroup from \"./ExampleComponents/CheckboxGroup.svelte\";\nimport ExampleSlider from \"./ExampleComponents/Slider.svelte\";\nimport ExampleRadio from \"./ExampleComponents/Radio.svelte\";\nimport ExampleImage from \"./ExampleComponents/Image.svelte\";\nimport ExampleTextbox from \"./ExampleComponents/Textbox.svelte\";\nimport ExampleAudio from \"./ExampleComponents/Audio.svelte\";\nimport ExampleVideo from \"./ExampleComponents/Video.svelte\";\nimport ExampleFile from \"./ExampleComponents/File.svelte\";\nimport ExampleDataframe from \"./ExampleComponents/Dataframe.svelte\";\nimport ExampleModel3D from \"./ExampleComponents/Model3D.svelte\";\nimport ExampleColorPicker from \"./ExampleComponents/ColorPicker.svelte\";\nimport ExampleTimeSeries from \"./ExampleComponents/TimeSeries.svelte\";\nimport ExampleMarkdown from \"./ExampleComponents/Markdown.svelte\";\nimport ExampleHTML from \"./ExampleComponents/HTML.svelte\";\nimport ExampleCode from \"./ExampleComponents/Code.svelte\";\n\nexport const component_map = {\n\tdropdown: ExampleDropdown,\n\tcheckbox: ExampleCheckbox,\n\tcheckboxgroup: ExampleCheckboxGroup,\n\tnumber: ExampleNumber,\n\tslider: ExampleSlider,\n\tradio: ExampleRadio,\n\timage: ExampleImage,\n\ttextbox: ExampleTextbox,\n\taudio: ExampleAudio,\n\tvideo: ExampleVideo,\n\tfile: ExampleFile,\n\tdataframe: ExampleDataframe,\n\tmodel3d: ExampleModel3D,\n\tcolorpicker: ExampleColorPicker,\n\ttimeseries: ExampleTimeSeries,\n\tmarkdown: ExampleMarkdown,\n\thtml: ExampleHTML,\n\tcode: ExampleCode\n};\n","\n\n\n\t
    \n\t\t\n\t\t\t\n\t\t\n\t\t{label}\n\t
    \n\t{#if gallery}\n\t\t
    \n\t\t\t{#each selected_samples as sample_row, i}\n\t\t\t\t {\n\t\t\t\t\t\tvalue = i + page * samples_per_page;\n\t\t\t\t\t\tdispatch(\"click\", value);\n\t\t\t\t\t\tdispatch(\"select\", { index: value, value: sample_row });\n\t\t\t\t\t}}\n\t\t\t\t\ton:mouseenter={() => handle_mouseenter(i)}\n\t\t\t\t\ton:mouseleave={() => handle_mouseleave()}\n\t\t\t\t>\n\t\t\t\t\t{#if Object.keys(component_map).includes(components[0]) && component_map[components[0]]}\n\t\t\t\t\t\t\n\t\t\t\t\t{/if}\n\t\t\t\t\n\t\t\t{/each}\n\t\t
    \n\t{:else}\n\t\t
    \n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{#each headers as header}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{#each component_meta as sample_row, i}\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tvalue = i + page * samples_per_page;\n\t\t\t\t\t\t\t\tdispatch(\"click\", value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ton:mouseenter={() => handle_mouseenter(i)}\n\t\t\t\t\t\t\ton:mouseleave={() => handle_mouseleave()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{#each sample_row as { value, component }, j}\n\t\t\t\t\t\t\t\t{@const component_name = components[j]}\n\t\t\t\t\t\t\t\t{#if component_name !== undefined && component_map[component_name] !== undefined}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t\n\t\t\t\t\t{/each}\n\t\t\t\t\n\t\t\t
    \n\t\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t
    \n\t\t
    \n\t{/if}\n\t{#if paginate}\n\t\t
    \n\t\t\tPages:\n\t\t\t{#each visible_pages as visible_page}\n\t\t\t\t{#if visible_page === -1}\n\t\t\t\t\t
    ...
    \n\t\t\t\t{:else}\n\t\t\t\t\t (page = visible_page)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{visible_page + 1}\n\t\t\t\t\t\n\t\t\t\t{/if}\n\t\t\t{/each}\n\t\t
    \n\t{/if}\n\n\n\n","export { default as Component } from \"./Dataset.svelte\";\nexport const modes = [\"dynamic\"];\n\nexport const document = () => ({\n\ttype: {\n\t\tpayload: \"number\"\n\t},\n\tdescription: {\n\t\tpayload: \"index of selected row\"\n\t},\n\texample_data: 0\n});\n"],"names":["tsv","dsv","tsvParseRows","ctx","toggle_class","div","insert","target","anchor","value","$$props","type","selected","t_value","dirty","set_data","if_block","create_if_block","t","i","size","el","set_styles","element","el_width","$$invalidate","onMount","$$value","src_url_equal","video_1","video_1_src_value","attr","is_function","samples_dir","video","init","create_if_block_1","each_value","ensure_array_like","create_if_block_2","table","td","each_value_1","create_if_block_3","tr","index","hovered","loaded_value","loaded","mouseenter_handler","mouseleave_handler","v","small_df","csvParseRows","e","pre","component_map","ExampleDropdown","ExampleCheckbox","ExampleCheckboxGroup","ExampleNumber","ExampleSlider","ExampleRadio","ExampleImage","ExampleTextbox","ExampleAudio","ExampleVideo","ExampleFile","ExampleDataframe","ExampleModel3D","ExampleColorPicker","ExampleTimeSeries","ExampleMarkdown","ExampleHTML","ExampleCode","constants_0","child_ctx","append","thead","tbody","each_blocks","th","t0","t0_value","set_style","switch_instance_changes","create_if_block_4","switch_value","show_if","button","svg","path","if_block1","components","label","headers","samples","elem_id","elem_classes","visible","root","root_url","samples_per_page","scale","min_width","dispatch","createEventDispatcher","page","paginate","selected_samples","page_count","visible_pages","current_hover","handle_mouseenter","handle_mouseleave","sample_row","mouseenter_handler_1","click_handler_2","visible_page","gallery","component_meta","sample_cell","j","modes","document"],"mappings":"2eAEA,IAAIA,GAAMC,GAAI,GAAI,EAGPC,GAAeF,GAAI,2DCQ5BG,EAAK,CAAA,CAAA,gCAJOC,EAAAC,EAAA,QAAAF,OAAS,OAAO,EACdC,EAAAC,EAAA,UAAAF,OAAS,SAAS,+BAFlCG,EAMKC,EAAAF,EAAAG,CAAA,4BADHL,EAAK,CAAA,CAAA,OAJOC,EAAAC,EAAA,QAAAF,OAAS,OAAO,OACdC,EAAAC,EAAA,UAAAF,OAAS,SAAS,2EAPtB,MAAAM,CAAY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A,GAAK,GAAKA,EAAI2F,GAAU,CAAKC,EAAc,SAAS5F,CAAC,IAEvD4F,EAAc,OAAS,GACvB5F,EAAI4F,EAAcA,EAAc,OAAS,CAAC,EAAI,GAE9CA,EAAc,KAAI,EAAG,EAEtBA,EAAc,KAAK5F,CAAC,WAKvB0F,EAAmBb,EAAQ,MAAK,CAAA,uBAI/BvE,EAAA,GAAA+F,EAAiBX,EAAiB,IAAKM,GACzCA,EAAW,IAAK,CAAAM,EAAaC,MAAC,CAC7B,MAAOD,EACP,UAAWjE,EAAcqC,EAAW6B,EAAC,CAAA,6TC1E3BC,GAAQ,CAAC,SAAS,EAElBC,GAAW,KAAO,CAC9B,KAAM,CACL,QAAS,QACV,EACA,YAAa,CACZ,QAAS,uBACV,EACA,aAAc,CACf","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-2908e8a9.css b/gradio/templates/cdn/assets/index-2908e8a9.css new file mode 100644 index 0000000000000000000000000000000000000000..78067c2729600b4ee3e7e9c6442a129e8ffe9894 --- /dev/null +++ b/gradio/templates/cdn/assets/index-2908e8a9.css @@ -0,0 +1 @@ +.gradio-bokeh.svelte-1fe5ixn.svelte-1fe5ixn{display:flex;justify-content:center}.layout.svelte-1fe5ixn.svelte-1fe5ixn{display:flex;flex-direction:column;justify-content:center;align-items:center;width:var(--size-full);height:var(--size-full);color:var(--body-text-color)}.altair.svelte-1fe5ixn.svelte-1fe5ixn{display:flex;flex-direction:column;justify-content:center;align-items:center;width:var(--size-full);height:var(--size-full)}.caption.svelte-1fe5ixn.svelte-1fe5ixn{font-size:var(--text-sm)}.matplotlib.svelte-1fe5ixn img.svelte-1fe5ixn{object-fit:contain} diff --git a/gradio/templates/cdn/assets/index-3164dc56.js b/gradio/templates/cdn/assets/index-3164dc56.js new file mode 100644 index 0000000000000000000000000000000000000000..e977f4c5e5e7086bc4cd35910df6f7a46d8c103a --- /dev/null +++ b/gradio/templates/cdn/assets/index-3164dc56.js @@ -0,0 +1,2 @@ +import{S as ne,e as se,s as ae,k as S,o as z,z as I,v as A,x as C,B as ie,E as oe,ae as ue,O as L,N as E,K as d,p as b,q as fe,r as re,u as _e,y as me,A as v,G as j,m as ce,T as D,U as M,M as G,n as V,V as y,P as he,L as F,Q as q,R as ge,a1 as de}from"./index-fda37c89.js";import{B as be}from"./Button-e3640f74.js";import{B as ve}from"./BlockLabel-fe40816b.js";import{E as ke}from"./Empty-85ccd7df.js";import{I as p}from"./Image-23929e47.js";import{n as H}from"./ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js";function J(t,e,n){const l=t.slice();return l[27]=e[n][0],l[12]=e[n][1],l[29]=n,l}function W(t,e,n){const l=t.slice();return l[30]=e[n][0],l[12]=e[n][1],l[29]=n,l}function we(t){let e,n,l,s,i,a,_=j(t[13]?t[13][1]:[]),m=[];for(let u=0;u<_.length;u+=1)m[u]=X(W(t,_,u));let c=t[4]&&t[13]&&Y(t);return{c(){e=E("div"),n=E("img"),s=L();for(let u=0;u{r[w]=null}),me(),_=r[a],_?_.p(f,g):(_=r[a]=h[a](f),_.c()),I(_,1),_.m(i,null))},i(f){m||(I(e.$$.fragment,f),I(l.$$.fragment,f),I(_),m=!0)},o(f){A(e.$$.fragment,f),A(l.$$.fragment,f),A(_),m=!1},d(f){f&&(v(n),v(s),v(i)),C(e,f),C(l,f),r[a].d()}}}function Me(t){let e,n;return e=new be({props:{visible:t[2],elem_id:t[0],elem_classes:t[1],padding:!1,height:t[5],width:t[6],allow_overflow:!1,container:t[8],scale:t[9],min_width:t[10],$$slots:{default:[Be]},$$scope:{ctx:t}}}),{c(){S(e.$$.fragment)},m(l,s){z(e,l,s),n=!0},p(l,s){const i={};s[0]&4&&(i.visible=l[2]),s[0]&1&&(i.elem_id=l[0]),s[0]&2&&(i.elem_classes=l[1]),s[0]&32&&(i.height=l[5]),s[0]&64&&(i.width=l[6]),s[0]&256&&(i.container=l[8]),s[0]&512&&(i.scale=l[9]),s[0]&1024&&(i.min_width=l[10]),s[0]&30904|s[1]&2&&(i.$$scope={dirty:s,ctx:l}),e.$set(i)},i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){A(e.$$.fragment,l),n=!1},d(l){C(e,l)}}}function Ee(t,e,n){let{elem_id:l=""}=e,{elem_classes:s=[]}=e,{visible:i=!0}=e,{value:a}=e,_,m,{label:c="Annotated Image"}=e,{show_label:u=!0}=e,{show_legend:h=!0}=e,{height:r}=e,{width:k}=e,{color_map:f}=e,{container:g=!0}=e,{scale:N=null}=e,{min_width:B=void 0}=e,{root:w}=e,{root_url:T}=e,K=null,{loading_status:U}=e;const O=ie();function P(o){n(14,K=o)}function Q(){n(14,K=null)}const x=o=>P(o),$=o=>P(o),ee=()=>Q(),le=()=>Q(),te=(o,R)=>O("select",{index:o,value:R});return t.$$set=o=>{"elem_id"in o&&n(0,l=o.elem_id),"elem_classes"in o&&n(1,s=o.elem_classes),"visible"in o&&n(2,i=o.visible),"value"in o&&n(18,a=o.value),"label"in o&&n(12,c=o.label),"show_label"in o&&n(3,u=o.show_label),"show_legend"in o&&n(4,h=o.show_legend),"height"in o&&n(5,r=o.height),"width"in o&&n(6,k=o.width),"color_map"in o&&n(7,f=o.color_map),"container"in o&&n(8,g=o.container),"scale"in o&&n(9,N=o.scale),"min_width"in o&&n(10,B=o.min_width),"root"in o&&n(19,w=o.root),"root_url"in o&&n(20,T=o.root_url),"loading_status"in o&&n(11,U=o.loading_status)},t.$$.update=()=>{t.$$.dirty[0]&3932160&&(a!==_&&(n(21,_=a),O("change")),a?n(13,m=[H(a[0],w,T),a[1].map(([o,R])=>[H(o,w,T),R])]):n(13,m=null))},[l,s,i,u,h,r,k,f,g,N,B,U,c,m,K,O,P,Q,a,w,T,_,x,$,ee,le,te]}class qe extends ne{constructor(e){super(),se(this,e,Ee,Me,ae,{elem_id:0,elem_classes:1,visible:2,value:18,label:12,show_label:3,show_legend:4,height:5,width:6,color_map:7,container:8,scale:9,min_width:10,root:19,root_url:20,loading_status:11},null,[-1,-1])}}const je=qe,De=["static"],Ge=t=>({type:{payload:"[string, Array<[string, string]>]"},description:{payload:"path to base image, followed by a list of tuples [mask image path, label]"}});export{je as Component,Ge as document,De as modes}; +//# sourceMappingURL=index-3164dc56.js.map diff --git a/gradio/templates/cdn/assets/index-3164dc56.js.map b/gradio/templates/cdn/assets/index-3164dc56.js.map new file mode 100644 index 0000000000000000000000000000000000000000..34a73a0109aa39f773fc1c4d55ac7a2d0b92fe2d --- /dev/null +++ b/gradio/templates/cdn/assets/index-3164dc56.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-3164dc56.js","sources":["../../../../js/app/src/components/AnnotatedImage/AnnotatedImage.svelte","../../../../js/app/src/components/AnnotatedImage/index.ts"],"sourcesContent":["\n\n\n\t\n\t\n\n\t
    \n\t\t{#if _value == null}\n\t\t\t\n\t\t{:else}\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{#each _value ? _value[1] : [] as [file, label], i}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t{/each}\n\t\t\t
    \n\t\t\t{#if show_legend && _value}\n\t\t\t\t
    \n\t\t\t\t\t{#each _value[1] as [_, label], i}\n\t\t\t\t\t\t\n\t\t\t\t\t\t handle_mouseover(label)}\n\t\t\t\t\t\t\ton:focus={() => handle_mouseover(label)}\n\t\t\t\t\t\t\ton:mouseout={() => handle_mouseout()}\n\t\t\t\t\t\t\ton:blur={() => handle_mouseout()}\n\t\t\t\t\t\t\ton:click={() => dispatch(\"select\", { index: i, value: label })}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t
    \n\t\t\t\t\t{/each}\n\t\t\t\t
    \n\t\t\t{/if}\n\t\t{/if}\n\t\n\n\n\n","export { default as Component } from \"./AnnotatedImage.svelte\";\nexport const modes = [\"static\"];\n\nexport const document = (config: Record) => ({\n\ttype: {\n\t\tpayload: \"[string, Array<[string, string]>]\"\n\t},\n\tdescription: {\n\t\tpayload:\n\t\t\t\"path to base image, followed by a list of tuples [mask image path, label]\"\n\t}\n});\n"],"names":["ctx","i","if_block","create_if_block_1","src_url_equal","img","img_src_value","attr","insert","target","div","anchor","append","dirty","toggle_class","each_value","ensure_array_like","set_data","t0","t0_value","Image","blocklabel_changes","elem_id","$$props","elem_classes","visible","value","old_value","_value","label","show_label","show_legend","height","width","color_map","container","scale","min_width","root","root_url","active","loading_status","dispatch","createEventDispatcher","handle_mouseover","$$invalidate","handle_mouseout","mouseover_handler","focus_handler","normalise_file","file","modes","document","config"],"mappings":"4sBAqFWA,EAAM,EAAA,EAAGA,EAAM,EAAA,EAAC,CAAC,EAAA,CAAA,CAAA,uBAAtB,OAAIC,GAAA,mBAeF,IAAAC,EAAAF,MAAeA,EAAM,EAAA,GAAAG,EAAAH,CAAA,4IAjBnBI,EAAAC,EAAA,IAAAC,EAAAN,MAASA,EAAM,EAAA,EAAC,CAAC,EAAE,KAAO,IAAI,GAAAO,EAAAF,EAAA,MAAAC,CAAA,mBADjBN,EAAM,CAAA,CAAA,uDAJ1BQ,EAqBKC,EAAAC,EAAAC,CAAA,EAnBJC,EAICF,EAAAL,CAAA,mGADKQ,EAAA,CAAA,EAAA,MAAA,CAAAT,EAAAC,EAAA,IAAAC,EAAAN,MAASA,EAAM,EAAA,EAAC,CAAC,EAAE,KAAO,IAAI,0CADjBA,EAAM,CAAA,CAAA,kBAGlBA,EAAM,EAAA,EAAGA,EAAM,EAAA,EAAC,CAAC,EAAA,CAAA,CAAA,oBAAtB,OAAIC,GAAA,EAAA,iHAAJ,OAeED,MAAeA,EAAM,EAAA,iMAxBQ,qUAe1BI,EAAAC,EAAA,IAAAC,EAAAN,MAAK,IAAI,GAAAO,EAAAF,EAAA,MAAAC,CAAA,gBACPN,EAAS,CAAA,GAAIA,EAAS,EAAA,IAAAA,EAAA,CAAA,EAC1B,2BACsB,KAAK,MAC1BA,EAAC,EAAA,EAAG,IAAOA,EAAO,EAAA,EAAA,CAAC,EAAE,MAAA,QAAA,EANXc,EAAAT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,EAAM,CAAC,EAAE,IAAG,CAAA,CAAGwB,EAAMrB,CAAK,IACzB,CAAAoB,EAAeC,EAAMZ,EAAMC,CAAQ,EACnCV,CAAA,CAAA,IAIFgB,EAAA,GAAAjB,EAAS,IAAI,8UC/CHuB,GAAQ,CAAC,QAAQ,EAEjBC,GAAYC,IAAiC,CACzD,KAAM,CACL,QAAS,mCACV,EACA,YAAa,CACZ,QACC,2EACF,CACD"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-3223d4c0.css b/gradio/templates/cdn/assets/index-3223d4c0.css new file mode 100644 index 0000000000000000000000000000000000000000..65e99be8ed14568337bbe90bf15c34bebf20ce12 --- /dev/null +++ b/gradio/templates/cdn/assets/index-3223d4c0.css @@ -0,0 +1 @@ +.preview.svelte-1a6pxdl.svelte-1a6pxdl{display:flex;position:absolute;inset:0;flex-direction:column;z-index:var(--layer-2);backdrop-filter:blur(8px);background:var(--background-fill-primary);height:var(--size-full)}.fixed-height.svelte-1a6pxdl.svelte-1a6pxdl{min-height:var(--size-80);max-height:55vh}@media (min-width: 1280px){.fixed-height.svelte-1a6pxdl.svelte-1a6pxdl{min-height:450px}}.preview.svelte-1a6pxdl img.svelte-1a6pxdl{width:var(--size-full);height:calc(var(--size-full) - 60px);object-fit:contain}.preview.svelte-1a6pxdl img.with-caption.svelte-1a6pxdl{height:calc(var(--size-full) - 80px)}.caption.svelte-1a6pxdl.svelte-1a6pxdl{padding:var(--size-2) var(--size-3);overflow:hidden;color:var(--block-label-text-color);font-weight:var(--weight-semibold);text-align:center;text-overflow:ellipsis;white-space:nowrap}.thumbnails.svelte-1a6pxdl.svelte-1a6pxdl{display:flex;position:absolute;bottom:0;justify-content:center;align-items:center;gap:var(--spacing-lg);width:var(--size-full);height:var(--size-14);overflow-x:scroll}.thumbnail-item.svelte-1a6pxdl.svelte-1a6pxdl{--ring-color:transparent;position:relative;box-shadow:0 0 0 2px var(--ring-color),var(--shadow-drop);border:1px solid var(--border-color-primary);border-radius:var(--button-small-radius);background:var(--background-fill-secondary);aspect-ratio:var(--ratio-square);width:var(--size-full);height:var(--size-full);overflow:clip}.thumbnail-item.svelte-1a6pxdl.svelte-1a6pxdl:hover{--ring-color:var(--color-accent);filter:brightness(1.1)}.thumbnail-item.selected.svelte-1a6pxdl.svelte-1a6pxdl{--ring-color:var(--color-accent)}.thumbnail-small.svelte-1a6pxdl.svelte-1a6pxdl{flex:none;transform:scale(.9);transition:75ms;width:var(--size-9);height:var(--size-9)}.thumbnail-small.selected.svelte-1a6pxdl.svelte-1a6pxdl{--ring-color:var(--color-accent);transform:scale(1);border-color:var(--color-accent)}.thumbnail-small.svelte-1a6pxdl>img.svelte-1a6pxdl{width:var(--size-full);height:var(--size-full);overflow:hidden;object-fit:var(--object-fit)}.grid-wrap.svelte-1a6pxdl.svelte-1a6pxdl{position:relative;padding:var(--size-2);height:var(--size-full);overflow-y:scroll}.grid-container.svelte-1a6pxdl.svelte-1a6pxdl{display:grid;position:relative;grid-template-rows:repeat(var(--grid-rows),minmax(100px,1fr));grid-template-columns:repeat(var(--grid-cols),minmax(100px,1fr));grid-auto-rows:minmax(100px,1fr);gap:var(--spacing-lg)}.thumbnail-lg.svelte-1a6pxdl>img.svelte-1a6pxdl{width:var(--size-full);height:var(--size-full);overflow:hidden;object-fit:var(--object-fit)}.thumbnail-lg.svelte-1a6pxdl:hover .caption-label.svelte-1a6pxdl{opacity:.5}.caption-label.svelte-1a6pxdl.svelte-1a6pxdl{position:absolute;right:var(--block-label-margin);bottom:var(--block-label-margin);z-index:var(--layer-1);border-top:1px solid var(--border-color-primary);border-left:1px solid var(--border-color-primary);border-radius:var(--block-label-radius);background:var(--background-fill-secondary);padding:var(--block-label-padding);max-width:80%;overflow:hidden;font-size:var(--block-label-text-size);text-align:left;text-overflow:ellipsis;white-space:nowrap}.icon-button.svelte-1a6pxdl.svelte-1a6pxdl{position:absolute;top:0;right:0;z-index:var(--layer-1)} diff --git a/gradio/templates/cdn/assets/index-322e8a8e.css b/gradio/templates/cdn/assets/index-322e8a8e.css new file mode 100644 index 0000000000000000000000000000000000000000..aa7186b19dcf31452295d0d5d4dbb3b5aadb3dea --- /dev/null +++ b/gradio/templates/cdn/assets/index-322e8a8e.css @@ -0,0 +1 @@ +.gallery.svelte-1ayixqk,.gallery.svelte-1viwdyg{padding:var(--size-1) var(--size-2)}div.svelte-1viwdyg{overflow:hidden;min-width:var(--local-text-width);white-space:nowrap}video.svelte-1tntsc1{flex:none;border:2px solid var(--border-color-primary);border-radius:var(--radius-lg);max-width:none}video.svelte-1tntsc1:hover,video.selected.svelte-1tntsc1{border-color:var(--border-color-accent)}.table.svelte-1tntsc1{margin:0 auto;width:var(--size-20);height:var(--size-20);object-fit:cover}.gallery.svelte-1tntsc1{max-height:var(--size-20);object-fit:cover}div.svelte-rgtszb{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gallery.svelte-rgtszb{display:flex;align-items:center;cursor:pointer;padding:var(--size-1) var(--size-2);text-align:left}table.svelte-1cib1xd.svelte-1cib1xd{position:relative}td.svelte-1cib1xd.svelte-1cib1xd{border:1px solid var(--table-border-color);padding:var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.selected.svelte-1cib1xd td.svelte-1cib1xd{border-color:var(--border-color-accent)}.table.svelte-1cib1xd.svelte-1cib1xd{display:inline-block;margin:0 auto}.gallery.svelte-1cib1xd td.svelte-1cib1xd:first-child{border-left:none}.gallery.svelte-1cib1xd tr:first-child td.svelte-1cib1xd{border-top:none}.gallery.svelte-1cib1xd td.svelte-1cib1xd:last-child{border-right:none}.gallery.svelte-1cib1xd tr:last-child td.svelte-1cib1xd{border-bottom:none}.overlay.svelte-1cib1xd.svelte-1cib1xd{--gradient-to:transparent;position:absolute;bottom:0;background:linear-gradient(to bottom,transparent,var(--gradient-to));width:var(--size-full);height:50%}.odd.svelte-1cib1xd.svelte-1cib1xd{--gradient-to:var(--table-even-background-fill)}.even.svelte-1cib1xd.svelte-1cib1xd{--gradient-to:var(--table-odd-background-fill)}.button.svelte-1cib1xd.svelte-1cib1xd{--gradient-to:var(--background-fill-primary)}div.svelte-h6ogpl{width:var(--size-10);height:var(--size-10)}.table.svelte-h6ogpl{margin:0 auto}.gallery.svelte-1ayixqk{padding:var(--size-1) var(--size-2)}.gallery.svelte-zvfedn{padding:var(--size-2)}pre.svelte-agpzo2{text-align:left}.gallery.svelte-agpzo2{padding:var(--size-1) var(--size-2)}.wrap.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{display:inline-block;width:var(--size-full);max-width:var(--size-full);color:var(--body-text-color)}.hide.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{display:none}.label.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{display:flex;align-items:center;margin-bottom:var(--size-2);color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}svg.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{margin-right:var(--size-1)}.gallery.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{display:flex;flex-wrap:wrap;gap:var(--spacing-lg)}.gallery-item.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{border:1px solid var(--border-color-primary);border-radius:var(--button-large-radius);overflow:hidden}.gallery-item.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno:hover{border-color:var(--border-color-accent);background:var(--table-row-focus)}.table-wrap.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{border:1px solid var(--border-color-primary);border-radius:var(--table-radius);width:var(--size-full);table-layout:auto;overflow-x:auto;line-height:var(--line-sm)}table.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{width:var(--size-full)}.tr-head.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{box-shadow:var(--shadow-drop-lg);border-bottom:1px solid var(--border-color-primary)}.tr-head.svelte-13hsdno>.svelte-13hsdno+.svelte-13hsdno{border-right-width:0px;border-left-width:1px;border-color:var(--border-color-primary)}th.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{padding:var(--size-2);white-space:nowrap}.tr-body.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{cursor:pointer;border-bottom:1px solid var(--border-color-primary);background:var(--table-even-background-fill)}.tr-body.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno:last-child{border:none}.tr-body.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno:nth-child(odd){background:var(--table-odd-background-fill)}.tr-body.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno:hover{background:var(--table-row-focus)}.tr-body.svelte-13hsdno>.svelte-13hsdno+.svelte-13hsdno{border-right-width:0px;border-left-width:1px;border-color:var(--border-color-primary)}.tr-body.svelte-13hsdno:hover>.svelte-13hsdno+.svelte-13hsdno{border-color:var(--border-color-accent)}td.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{padding:var(--size-2);text-align:center}.paginate.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{display:flex;justify-content:center;align-items:center;gap:var(--spacing-sm);margin-top:var(--size-2);color:var(--block-label-text-color);font-size:var(--text-sm)}button.current-page.svelte-13hsdno.svelte-13hsdno.svelte-13hsdno{font-weight:var(--weight-bold)} diff --git a/gradio/templates/cdn/assets/index-329f8260.css b/gradio/templates/cdn/assets/index-329f8260.css new file mode 100644 index 0000000000000000000000000000000000000000..3b53ee465e192f512a964e9050e9aab81384add8 --- /dev/null +++ b/gradio/templates/cdn/assets/index-329f8260.css @@ -0,0 +1 @@ +.min.svelte-1ybaih5{min-height:var(--size-24)}.hide.svelte-1ybaih5{display:none}div.svelte-1ed2p3z{transition:.15s}.pending.svelte-1ed2p3z{opacity:.2} diff --git a/gradio/templates/cdn/assets/index-35a96ad2.js b/gradio/templates/cdn/assets/index-35a96ad2.js new file mode 100644 index 0000000000000000000000000000000000000000..9da58eb33ab0abad45ce03d1b641caffe01ef5a4 --- /dev/null +++ b/gradio/templates/cdn/assets/index-35a96ad2.js @@ -0,0 +1,2 @@ +import{S as v,e as g,s as d,a9 as r,N as q,K as o,as as h,U as f,p as b,ab as w,ac as R,ad as j,z as C,v as S,A as z}from"./index-fda37c89.js";function A(i){let e,_,s;const u=i[6].default,a=r(u,i,i[5],null);return{c(){e=q("div"),a&&a.c(),o(e,"id",i[1]),o(e,"class",_=h(i[2].join(" "))+" svelte-15lo0d8"),f(e,"compact",i[4]==="compact"),f(e,"panel",i[4]==="panel"),f(e,"unequal-height",i[0]===!1),f(e,"stretch",i[0]),f(e,"hide",!i[3])},m(l,t){b(l,e,t),a&&a.m(e,null),s=!0},p(l,[t]){a&&a.p&&(!s||t&32)&&w(a,u,l,l[5],s?j(u,l[5],t,null):R(l[5]),null),(!s||t&2)&&o(e,"id",l[1]),(!s||t&4&&_!==(_=h(l[2].join(" "))+" svelte-15lo0d8"))&&o(e,"class",_),(!s||t&20)&&f(e,"compact",l[4]==="compact"),(!s||t&20)&&f(e,"panel",l[4]==="panel"),(!s||t&5)&&f(e,"unequal-height",l[0]===!1),(!s||t&5)&&f(e,"stretch",l[0]),(!s||t&12)&&f(e,"hide",!l[3])},i(l){s||(C(a,l),s=!0)},o(l){S(a,l),s=!1},d(l){l&&z(e),a&&a.d(l)}}}function K(i,e,_){let{$$slots:s={},$$scope:u}=e,{equal_height:a=!0}=e,{elem_id:l}=e,{elem_classes:t=[]}=e,{visible:m=!0}=e,{variant:c="default"}=e;return i.$$set=n=>{"equal_height"in n&&_(0,a=n.equal_height),"elem_id"in n&&_(1,l=n.elem_id),"elem_classes"in n&&_(2,t=n.elem_classes),"visible"in n&&_(3,m=n.visible),"variant"in n&&_(4,c=n.variant),"$$scope"in n&&_(5,u=n.$$scope)},[a,l,t,m,c,u,s]}class N extends v{constructor(e){super(),g(this,e,K,A,d,{equal_height:0,elem_id:1,elem_classes:2,visible:3,variant:4})}}const k=N,B=["static"];export{k as Component,B as modes}; +//# sourceMappingURL=index-35a96ad2.js.map diff --git a/gradio/templates/cdn/assets/index-35a96ad2.js.map b/gradio/templates/cdn/assets/index-35a96ad2.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2a1ad592acdaa5c597fd2311527b7fd84bbea7ac --- /dev/null +++ b/gradio/templates/cdn/assets/index-35a96ad2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-35a96ad2.js","sources":["../../../../js/app/src/components/Row/Row.svelte","../../../../js/app/src/components/Row/index.ts"],"sourcesContent":["\n\n\n\t\n\n\n\n","export { default as Component } from \"./Row.svelte\";\nexport const modes = [\"static\"];\n"],"names":["ctx","toggle_class","div","insert","target","anchor","equal_height","$$props","elem_id","elem_classes","visible","variant","modes"],"mappings":"uPAcKA,EAAO,CAAA,CAAA,kBACJA,EAAY,CAAA,EAAC,KAAK,GAAG,CAAA,EAAA,iBAAA,EANbC,EAAAC,EAAA,UAAAF,OAAY,SAAS,EACvBC,EAAAC,EAAA,QAAAF,OAAY,OAAO,EACVC,EAAAC,EAAA,iBAAAF,OAAiB,EAAK,gBAC7BA,EAAY,CAAA,CAAA,cACdA,EAAO,CAAA,CAAA,UALrBG,EAUKC,EAAAF,EAAAG,CAAA,sHAJAL,EAAO,CAAA,CAAA,qBACJA,EAAY,CAAA,EAAC,KAAK,GAAG,CAAA,EAAA,gDANbC,EAAAC,EAAA,UAAAF,OAAY,SAAS,cACvBC,EAAAC,EAAA,QAAAF,OAAY,OAAO,aACVC,EAAAC,EAAA,iBAAAF,OAAiB,EAAK,2BAC7BA,EAAY,CAAA,CAAA,0BACdA,EAAO,CAAA,CAAA,qHAZT,CAAA,aAAAM,EAAe,EAAI,EAAAC,GACnB,QAAAC,CAAe,EAAAD,GACf,aAAAE,EAAY,EAAA,EAAAF,EACZ,CAAA,QAAAG,EAAU,EAAI,EAAAH,EACd,CAAA,QAAAI,EAA2C,SAAS,EAAAJ,4XCJnDK,EAAQ,CAAC,QAAQ"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-37519934.css b/gradio/templates/cdn/assets/index-37519934.css new file mode 100644 index 0000000000000000000000000000000000000000..d48203638574e0f2bb6a0f0ad5a39d7f559a8875 --- /dev/null +++ b/gradio/templates/cdn/assets/index-37519934.css @@ -0,0 +1 @@ +div.svelte-iyf88w{border:var(--block-border-width) solid var(--border-color-primary);background:var(--border-color-primary);border-radius:var(--block-radius);display:flex;flex-direction:column;gap:var(--form-gap-width);overflow:hidden}div.svelte-iyf88w>*:not(.absolute){border:none;border-radius:0}.hide.svelte-iyf88w{display:none} diff --git a/gradio/templates/cdn/assets/index-3ca142e0.css b/gradio/templates/cdn/assets/index-3ca142e0.css new file mode 100644 index 0000000000000000000000000000000000000000..77ebe6c1fea2e3557f76088bb9f5c30e2cfdb72a --- /dev/null +++ b/gradio/templates/cdn/assets/index-3ca142e0.css @@ -0,0 +1 @@ +.spacer.svelte-1kspdo{display:inline-block;width:0;height:0}.json-node.svelte-1kspdo{display:inline;color:var(--body-text-color);line-height:var(--line-sm);font-family:var(--font-mono)}.expand-array.svelte-1kspdo{border:1px solid var(--border-color-primary);border-radius:var(--radius-sm);background:var(--background-fill-secondary);padding:0 var(--size-1);color:var(--body-text-color)}.expand-array.svelte-1kspdo:hover{background:var(--background-fill-primary)}.children.svelte-1kspdo{padding-left:var(--size-4)}.json-item.svelte-1kspdo{display:inline}.null.svelte-1kspdo{color:var(--body-text-color-subdued)}.string.svelte-1kspdo{color:var(--color-green-500)}.number.svelte-1kspdo{color:var(--color-blue-500)}.bool.svelte-1kspdo{color:var(--color-red-500)}.json-holder.svelte-1trjy9a{padding:var(--size-2)}button.svelte-1trjy9a{display:flex;position:absolute;top:var(--block-label-margin);right:var(--block-label-margin);align-items:center;box-shadow:var(--shadow-drop);border:1px solid var(--border-color-primary);border-top:none;border-right:none;border-radius:var(--block-label-right-radius);background:var(--block-label-background-fill);padding:5px;width:22px;height:22px;overflow:hidden;color:var(--block-label-text-color);font:var(--font);font-size:var(--button-small-text-size)} diff --git a/gradio/templates/cdn/assets/index-3dd81c21.js b/gradio/templates/cdn/assets/index-3dd81c21.js new file mode 100644 index 0000000000000000000000000000000000000000..6f63851f81c75fb62f78b74dff37106f3a118245 --- /dev/null +++ b/gradio/templates/cdn/assets/index-3dd81c21.js @@ -0,0 +1,7 @@ +import{c as F,e as I,s as ce,N as me,t as c,P as _e,g as Ue,T as E,p as Qe,h as J,E as v,b as se,j as Ze,k as Ge,l as Ve,m as Ke,f as Je,i as Ye,n as We,o as et,q as ne,r as tt}from"./index-ea4e155c.js";import{html as rt}from"./index-1893465a.js";import"./index-fda37c89.js";import"./Blocks-53d5f72d.js";import"./Button-e3640f74.js";import"./BlockLabel-fe40816b.js";import"./Empty-85ccd7df.js";import"./Copy-be466f7f.js";import"./Download-6021cc15.js";import"./index-10e05757.js";import"./index-025d1662.js";import"./index-592991bc.js";class X{constructor(e,r,s,n,i,o,a){this.type=e,this.value=r,this.from=s,this.hash=n,this.end=i,this.children=o,this.positions=a,this.hashProp=[[I.contextHash,n]]}static create(e,r,s,n,i){let o=n+(n<<8)+e+(r<<4)|0;return new X(e,r,s,o,i,[],[])}addChild(e,r){e.prop(I.contextHash)!=this.hash&&(e=new E(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let s=this.children.length-1;return s>=0&&(r=Math.max(r,this.positions[s]+this.children[s].length+this.from)),new E(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(i,o,a)=>new E(F.none,i,o,a,this.hashProp)})}}var f;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.URL=33]="URL",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel"})(f||(f={}));class st{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class nt{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return N(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,s=0){for(let n=r;n=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let s=(t.type==f.OrderedList?ee:W)(r,e,!1);return s>0&&(t.type!=f.BulletList||Y(r,e,!1)<0)&&r.text.charCodeAt(r.pos+s-1)==t.value}const ge={[f.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(m(f.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(C(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[f.ListItem](t,e,r){return r.indent-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[f.OrderedList]:ie,[f.BulletList]:ie,[f.Document](){return!0}};function C(t){return t==32||t==9||t==10||t==13}function N(t,e=0){for(;er&&C(t.charCodeAt(e-1));)e--;return e}function ke(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length||s<3?-1:1}function be(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function W(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||C(t.text.charCodeAt(t.pos+1)))&&(!r||be(e,f.BulletList)||t.skipSpace(t.pos+2)=48&&n<=57;){s++;if(s==t.text.length)return-1;n=t.text.charCodeAt(s)}return s==t.pos||s>t.pos+9||n!=46&&n!=41||st.pos+1||t.next!=49)?-1:s+1-t.pos}function Se(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:r}function we(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,Ae=/\?>/,Z=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(s);if(i)return t.append(m(f.Comment,r,r+1+i[0].length));let o=/^\?[^]*?\?>/.exec(s);if(o)return t.append(m(f.ProcessingInstruction,r,r+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(s);return a?t.append(m(f.HTMLTag,r,r+1+a[0].length)):-1},Emphasis(t,e,r){if(e!=95&&e!=42)return-1;let s=r+1;for(;t.char(s)==e;)s++;let n=t.slice(r-1,r),i=t.slice(s,s+1),o=R.test(n),a=R.test(i),l=/\s|^$/.test(n),h=/\s|^$/.test(i),u=!h&&(!a||l||o),p=!l&&(!o||h||a),d=u&&(e==42||!p||o),L=p&&(e==42||!u||a);return t.append(new A(e==95?He:Pe,r,s,(d?1:0)|(L?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(m(f.HardBreak,r,r+2));if(e==32){let s=r+1;for(;t.char(s)==32;)s++;if(t.char(s)==10&&s>=r+2)return t.append(m(f.HardBreak,r,s+1))}return-1},Link(t,e,r){return e==91?t.append(new A(P,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new A(le,r,r+2,1)):-1},LinkEnd(t,e,r){if(e!=93)return-1;for(let s=t.parts.length-1;s>=0;s--){let n=t.parts[s];if(n instanceof A&&(n.type==P||n.type==le)){if(!n.side||t.skipSpace(n.to)==r&&!/[(\[]/.test(t.slice(r+1,r+2)))return t.parts[s]=null,-1;let i=t.takeContent(s),o=t.parts[s]=ut(t,i,n.type==P?f.Link:f.Image,n.from,r+1);if(n.type==P)for(let a=0;ae?m(f.URL,e+r,i+r):i==t.length?null:!1}}function Ne(t,e,r){let s=t.charCodeAt(e);if(s!=39&&s!=34&&s!=40)return!1;let n=s==40?41:s;for(let i=e+1,o=!1;i=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,r){return this.text.slice(e-this.offset,r-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,r,s,n,i){return this.append(new A(e,r,s,(n?1:0)|(i?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let s=e;s=e;l--){let g=this.parts[l];if(g instanceof A&&g.side&1&&g.type==n.type&&!(i&&(n.side&1||g.side&2)&&(g.to-g.from+o)%3==0&&((g.to-g.from)%3||o%3))){a=g;break}}if(!a)continue;let h=n.type.resolve,u=[],p=a.from,d=n.to;if(i){let g=Math.min(2,a.to-a.from,o);p=a.to-g,d=n.from+g,h=g==1?"Emphasis":"StrongEmphasis"}a.type.mark&&u.push(this.elt(a.type.mark,p,a.to));for(let g=l+1;g=0;r--){let s=this.parts[r];if(s instanceof A&&s.type==e)return r}return null}takeContent(e){let r=this.resolveMarkers(e);return this.parts.length=e,r}skipSpace(e){return N(this.text,e-this.offset)+this.offset}elt(e,r,s,n){return typeof e=="string"?m(this.parser.getNodeType(e),r,s,n):new Me(e,r)}}function V(t,e){if(!e.length)return t;if(!t.length)return e;let r=t.slice(),s=0;for(let n of e){for(;s(e?e-1:0))return!1;if(this.fragmentEnd<0){let i=this.fragment.to;for(;i>0&&this.input.read(i-1,i)!=` +`;)i--;this.fragmentEnd=i?i-1:0}let s=this.cursor;s||(s=this.cursor=this.fragment.tree.cursor(),s.firstChild());let n=e+this.fragment.offset;for(;s.to<=n;)if(!s.parent())return!1;for(;;){if(s.from>=n)return this.fragment.from<=r;if(!s.childAfter(n))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(I.contextHash)==e}takeNodes(e){let r=this.cursor,s=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,o=i,a=e.block.children.length,l=o,h=a;for(;;){if(r.to-s>n){if(r.type.isAnonymous&&r.firstChild())continue;break}if(e.dontInject.add(r.tree),e.addNode(r.tree,r.from-s),r.type.is("Block")&&(pt.indexOf(r.type.id)<0?(o=r.to-s,a=e.block.children.length):(o=l,a=h,l=r.to-s,h=e.block.children.length)),!r.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-i}}const mt=ce({"Blockquote/...":c.quote,HorizontalRule:c.contentSeparator,"ATXHeading1/... SetextHeading1/...":c.heading1,"ATXHeading2/... SetextHeading2/...":c.heading2,"ATXHeading3/...":c.heading3,"ATXHeading4/...":c.heading4,"ATXHeading5/...":c.heading5,"ATXHeading6/...":c.heading6,"Comment CommentBlock":c.comment,Escape:c.escape,Entity:c.character,"Emphasis/...":c.emphasis,"StrongEmphasis/...":c.strong,"Link/... Image/...":c.link,"OrderedList/... BulletList/...":c.list,"BlockQuote/...":c.quote,"InlineCode CodeText":c.monospace,URL:c.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":c.processingInstruction,"CodeInfo LinkLabel":c.labelName,LinkTitle:c.string,Paragraph:c.content}),gt=new j(new me(Ee).extend(mt),Object.keys(z).map(t=>z[t]),Object.keys(z).map(t=>at[t]),Object.keys(z),lt,ge,Object.keys(_).map(t=>_[t]),Object.keys(_),[]);function kt(t,e,r){let s=[];for(let n=t.firstChild,i=e;;n=n.nextSibling){let o=n?n.from:r;if(o>i&&s.push({from:i,to:o}),!n)break;i=n.to}return s}function Lt(t){let{codeParser:e,htmlParser:r}=t;return{wrap:Qe((n,i)=>{let o=n.type.id;if(e&&(o==f.CodeBlock||o==f.FencedCode)){let a="";if(o==f.FencedCode){let h=n.node.getChild(f.CodeInfo);h&&(a=i.read(h.from,h.to))}let l=e(a);if(l)return{parser:l,overlay:h=>h.type.id==f.CodeText}}else if(r&&(o==f.HTMLBlock||o==f.HTMLTag))return{parser:r,overlay:kt(n.node,n.from,n.to)};return null})}}const bt={resolve:"Strikethrough",mark:"StrikethroughMark"},St={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":c.strikethrough}},{name:"StrikethroughMark",style:c.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let s=t.slice(r-1,r),n=t.slice(r+2,r+3),i=/\s|^$/.test(s),o=/\s|^$/.test(n),a=R.test(s),l=R.test(n);return t.addDelimiter(bt,r,r+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function y(t,e,r=0,s,n=0){let i=0,o=!0,a=-1,l=-1,h=!1,u=()=>{s.push(t.elt("TableCell",n+a,n+l,t.parser.parseInline(e.slice(a,l),n+a)))};for(let p=r;p-1)&&i++,o=!1,s&&(a>-1&&u(),s.push(t.elt("TableDelimiter",p+n,p+n+1))),a=l=-1):(h||d!=32&&d!=9)&&(a<0&&(a=p),l=p+1),h=!h&&d==92}return a>-1&&(i++,s&&u()),i}function fe(t,e){for(let r=e;rn instanceof ue)||!fe(e.text,e.basePos))return!1;let s=t.scanLine(t.absoluteLineEnd+1).text;return Oe.test(s)&&y(t,e.text,e.basePos)==y(t,s,e.basePos)},before:"SetextHeading"}]};class Ct{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const At={defineNodes:[{name:"Task",block:!0,style:c.list},{name:"TaskMarker",style:c.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\]/.test(e.content)&&t.parentType().name=="ListItem"?new Ct:null},after:"SetextHeading"}]},xt=[wt,At,St];function Re(t,e,r){return(s,n,i)=>{if(n!=t||s.char(i+1)==t)return-1;let o=[s.elt(r,i,i+1)];for(let a=i+1;a"}}),Te=new I,De=gt.configure({props:[Je.add(t=>!t.is("Block")||t.is("Document")||K(t)!=null?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),Te.add(K),Ye.add({Document:()=>null}),We.add({Document:ze})]});function K(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Mt(t,e){let r=t;for(;;){let s=r.nextSibling,n;if(!s||(n=K(s.type))!=null&&n<=e)break;r=s}return r.to}const Ht=et.of((t,e,r)=>{for(let s=J(t).resolveInner(r,-1);s&&!(s.fromr)return{from:r,to:i}}return null});function te(t){return new Ve(ze,t,[Ht],"markdown")}const Pt=te(De),vt=De.configure([xt,Et,Bt,It]),Xe=te(vt);function Nt(t,e){return r=>{if(r&&t){let s=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?s=t(r):s=ne.matchLanguageName(t,r,!0),s instanceof ne)return s.support?s.support.language.parser:tt.getSkippingParser(s.load());if(s)return s.parser}return e?e.parser:null}}class D{constructor(e,r,s,n,i,o,a){this.node=e,this.from=r,this.to=s,this.spaceBefore=n,this.spaceAfter=i,this.type=o,this.item=a}blank(e,r=!0){let s=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;s.length0;n--)s+=" ";return s+(r?this.spaceAfter:"")}}marker(e,r){let s=this.node.name=="OrderedList"?String(+je(this.item,e)[2]+r):"";return this.spaceBefore+s+this.type+this.spaceAfter}}function Fe(t,e){let r=[];for(let n=t;n&&n.name!="Document";n=n.parent)(n.name=="ListItem"||n.name=="Blockquote"||n.name=="FencedCode")&&r.push(n);let s=[];for(let n=r.length-1;n>=0;n--){let i=r[n],o,a=e.lineAt(i.from),l=i.from-a.from;if(i.name=="FencedCode")s.push(new D(i,l,l,"","","",null));else if(i.name=="Blockquote"&&(o=/^[ \t]*>( ?)/.exec(a.text.slice(l))))s.push(new D(i,l,l+o[0].length,"",o[1],">",null));else if(i.name=="ListItem"&&i.parent.name=="OrderedList"&&(o=/^([ \t]*)\d+([.)])([ \t]*)/.exec(a.text.slice(l)))){let h=o[3],u=o[0].length;h.length>=4&&(h=h.slice(0,h.length-4),u-=4),s.push(new D(i.parent,l,l+u,o[1],h,o[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(o=/^([ \t]*)([-+*])([ \t]{1,4}\[[ xX]\])?([ \t]+)/.exec(a.text.slice(l)))){let h=o[4],u=o[0].length;h.length>4&&(h=h.slice(0,h.length-4),u-=4);let p=o[2];o[3]&&(p+=o[3].replace(/[xX]/," ")),s.push(new D(i.parent,l,l+u,o[1],h,p,i))}}return s}function je(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function U(t,e,r,s=0){for(let n=-1,i=t;;){if(i.name=="ListItem"){let a=je(i,e),l=+a[2];if(n>=0){if(l!=n+1)return;r.push({from:i.from+a[1].length,to:i.from+a[0].length,insert:String(n+2+s)})}n=l}let o=i.nextSibling;if(!o)break;i=o}}const yt=({state:t,dispatch:e})=>{let r=J(t),{doc:s}=t,n=null,i=t.changeByRange(o=>{if(!o.empty||!Xe.isActiveAt(t,o.from))return n={range:o};let a=o.from,l=s.lineAt(a),h=Fe(r.resolveInner(a,-1),s);for(;h.length&&h[h.length-1].from>a-l.from;)h.pop();if(!h.length)return n={range:o};let u=h[h.length-1];if(u.to-u.spaceAfter.length>a-l.from)return n={range:o};let p=a>=u.to-u.spaceAfter.length&&!/\S/.test(l.text.slice(u.to));if(u.item&&p)if(u.node.firstChild.to>=a||l.from>0&&!/[^\s>]/.test(s.lineAt(l.from-1).text)){let k=h.length>1?h[h.length-2]:null,b,w="";k&&k.item?(b=l.from+k.from,w=k.marker(s,1)):b=l.from+(k?k.to:0);let x=[{from:b,to:a,insert:w}];return u.node.name=="OrderedList"&&U(u.item,s,x,-2),k&&k.node.name=="OrderedList"&&U(k.item,s,x),{range:v.cursor(b+w.length),changes:x}}else{let k="";for(let b=0,w=h.length-2;b<=w;b++)k+=h[b].blank(b\s*$/.exec(k.text);if(b&&b.index==u.from){let w=t.changes([{from:k.from+b.index,to:k.to},{from:l.from+u.from,to:l.to}]);return{range:o.map(w),changes:w}}}let d=[];u.node.name=="OrderedList"&&U(u.item,s,d);let L=u.item&&u.item.from]*/.exec(l.text)[0].length>=u.to)for(let k=0,b=h.length-1;k<=b;k++)S+=k==b&&!L?h[k].marker(s,1):h[k].blank(kl.from&&/\s/.test(l.text.charAt(g-l.from-1));)g--;return S=t.lineBreak+S,d.push({from:g,to:a,insert:S}),{range:v.cursor(g+S.length),changes:d}});return n?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)};function de(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Ot(t,e){let r=t.resolveInner(e,-1),s=e;de(r)&&(s=r.from,r=r.parent);for(let n;n=r.childBefore(s);)if(de(n))s=n.from;else if(n.name=="OrderedList"||n.name=="BulletList")r=n.lastChild,s=r.to;else break;return r}const Rt=({state:t,dispatch:e})=>{let r=J(t),s=null,n=t.changeByRange(i=>{let o=i.from,{doc:a}=t;if(i.empty&&Xe.isActiveAt(t,i.from)){let l=a.lineAt(o),h=Fe(Ot(r,o),a);if(h.length){let u=h[h.length-1],p=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>p&&!/\S/.test(l.text.slice(p,o-l.from)))return{range:v.cursor(l.from+p),changes:{from:l.from+p,to:o}};if(o-l.from==p){let d=l.from+u.from;if(u.item&&u.node.from= 0)\n end = Math.max(end, this.positions[last] + this.children[last].length + this.from);\n let tree = new Tree(nodeSet.types[this.type], this.children, this.positions, end - this.from).balance({\n makeTree: (children, positions, length) => new Tree(NodeType.none, children, positions, length, this.hashProp)\n });\n return tree;\n }\n}\nvar Type;\n(function (Type) {\n Type[Type[\"Document\"] = 1] = \"Document\";\n Type[Type[\"CodeBlock\"] = 2] = \"CodeBlock\";\n Type[Type[\"FencedCode\"] = 3] = \"FencedCode\";\n Type[Type[\"Blockquote\"] = 4] = \"Blockquote\";\n Type[Type[\"HorizontalRule\"] = 5] = \"HorizontalRule\";\n Type[Type[\"BulletList\"] = 6] = \"BulletList\";\n Type[Type[\"OrderedList\"] = 7] = \"OrderedList\";\n Type[Type[\"ListItem\"] = 8] = \"ListItem\";\n Type[Type[\"ATXHeading1\"] = 9] = \"ATXHeading1\";\n Type[Type[\"ATXHeading2\"] = 10] = \"ATXHeading2\";\n Type[Type[\"ATXHeading3\"] = 11] = \"ATXHeading3\";\n Type[Type[\"ATXHeading4\"] = 12] = \"ATXHeading4\";\n Type[Type[\"ATXHeading5\"] = 13] = \"ATXHeading5\";\n Type[Type[\"ATXHeading6\"] = 14] = \"ATXHeading6\";\n Type[Type[\"SetextHeading1\"] = 15] = \"SetextHeading1\";\n Type[Type[\"SetextHeading2\"] = 16] = \"SetextHeading2\";\n Type[Type[\"HTMLBlock\"] = 17] = \"HTMLBlock\";\n Type[Type[\"LinkReference\"] = 18] = \"LinkReference\";\n Type[Type[\"Paragraph\"] = 19] = \"Paragraph\";\n Type[Type[\"CommentBlock\"] = 20] = \"CommentBlock\";\n Type[Type[\"ProcessingInstructionBlock\"] = 21] = \"ProcessingInstructionBlock\";\n // Inline\n Type[Type[\"Escape\"] = 22] = \"Escape\";\n Type[Type[\"Entity\"] = 23] = \"Entity\";\n Type[Type[\"HardBreak\"] = 24] = \"HardBreak\";\n Type[Type[\"Emphasis\"] = 25] = \"Emphasis\";\n Type[Type[\"StrongEmphasis\"] = 26] = \"StrongEmphasis\";\n Type[Type[\"Link\"] = 27] = \"Link\";\n Type[Type[\"Image\"] = 28] = \"Image\";\n Type[Type[\"InlineCode\"] = 29] = \"InlineCode\";\n Type[Type[\"HTMLTag\"] = 30] = \"HTMLTag\";\n Type[Type[\"Comment\"] = 31] = \"Comment\";\n Type[Type[\"ProcessingInstruction\"] = 32] = \"ProcessingInstruction\";\n Type[Type[\"URL\"] = 33] = \"URL\";\n // Smaller tokens\n Type[Type[\"HeaderMark\"] = 34] = \"HeaderMark\";\n Type[Type[\"QuoteMark\"] = 35] = \"QuoteMark\";\n Type[Type[\"ListMark\"] = 36] = \"ListMark\";\n Type[Type[\"LinkMark\"] = 37] = \"LinkMark\";\n Type[Type[\"EmphasisMark\"] = 38] = \"EmphasisMark\";\n Type[Type[\"CodeMark\"] = 39] = \"CodeMark\";\n Type[Type[\"CodeText\"] = 40] = \"CodeText\";\n Type[Type[\"CodeInfo\"] = 41] = \"CodeInfo\";\n Type[Type[\"LinkTitle\"] = 42] = \"LinkTitle\";\n Type[Type[\"LinkLabel\"] = 43] = \"LinkLabel\";\n})(Type || (Type = {}));\n/// Data structure used to accumulate a block's content during [leaf\n/// block parsing](#BlockParser.leaf).\nclass LeafBlock {\n /// @internal\n constructor(\n /// The start position of the block.\n start, \n /// The block's text content.\n content) {\n this.start = start;\n this.content = content;\n /// @internal\n this.marks = [];\n /// The block parsers active for this block.\n this.parsers = [];\n }\n}\n/// Data structure used during block-level per-line parsing.\nclass Line {\n constructor() {\n /// The line's full text.\n this.text = \"\";\n /// The base indent provided by the composite contexts (that have\n /// been handled so far).\n this.baseIndent = 0;\n /// The string position corresponding to the base indent.\n this.basePos = 0;\n /// The number of contexts handled @internal\n this.depth = 0;\n /// Any markers (i.e. block quote markers) parsed for the contexts. @internal\n this.markers = [];\n /// The position of the next non-whitespace character beyond any\n /// list, blockquote, or other composite block markers.\n this.pos = 0;\n /// The column of the next non-whitespace character.\n this.indent = 0;\n /// The character code of the character after `pos`.\n this.next = -1;\n }\n /// @internal\n forward() {\n if (this.basePos > this.pos)\n this.forwardInner();\n }\n /// @internal\n forwardInner() {\n let newPos = this.skipSpace(this.basePos);\n this.indent = this.countIndent(newPos, this.pos, this.indent);\n this.pos = newPos;\n this.next = newPos == this.text.length ? -1 : this.text.charCodeAt(newPos);\n }\n /// Skip whitespace after the given position, return the position of\n /// the next non-space character or the end of the line if there's\n /// only space after `from`.\n skipSpace(from) { return skipSpace(this.text, from); }\n /// @internal\n reset(text) {\n this.text = text;\n this.baseIndent = this.basePos = this.pos = this.indent = 0;\n this.forwardInner();\n this.depth = 1;\n while (this.markers.length)\n this.markers.pop();\n }\n /// Move the line's base position forward to the given position.\n /// This should only be called by composite [block\n /// parsers](#BlockParser.parse) or [markup skipping\n /// functions](#NodeSpec.composite).\n moveBase(to) {\n this.basePos = to;\n this.baseIndent = this.countIndent(to, this.pos, this.indent);\n }\n /// Move the line's base position forward to the given _column_.\n moveBaseColumn(indent) {\n this.baseIndent = indent;\n this.basePos = this.findColumn(indent);\n }\n /// Store a composite-block-level marker. Should be called from\n /// [markup skipping functions](#NodeSpec.composite) when they\n /// consume any non-whitespace characters.\n addMarker(elt) {\n this.markers.push(elt);\n }\n /// Find the column position at `to`, optionally starting at a given\n /// position and column.\n countIndent(to, from = 0, indent = 0) {\n for (let i = from; i < to; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return indent;\n }\n /// Find the position corresponding to the given column.\n findColumn(goal) {\n let i = 0;\n for (let indent = 0; i < this.text.length && indent < goal; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return i;\n }\n /// @internal\n scrub() {\n if (!this.baseIndent)\n return this.text;\n let result = \"\";\n for (let i = 0; i < this.basePos; i++)\n result += \" \";\n return result + this.text.slice(this.basePos);\n }\n}\nfunction skipForList(bl, cx, line) {\n if (line.pos == line.text.length ||\n (bl != cx.block && line.indent >= cx.stack[line.depth + 1].value + line.baseIndent))\n return true;\n if (line.indent >= line.baseIndent + 4)\n return false;\n let size = (bl.type == Type.OrderedList ? isOrderedList : isBulletList)(line, cx, false);\n return size > 0 &&\n (bl.type != Type.BulletList || isHorizontalRule(line, cx, false) < 0) &&\n line.text.charCodeAt(line.pos + size - 1) == bl.value;\n}\nconst DefaultSkipMarkup = {\n [Type.Blockquote](bl, cx, line) {\n if (line.next != 62 /* '>' */)\n return false;\n line.markers.push(elt(Type.QuoteMark, cx.lineStart + line.pos, cx.lineStart + line.pos + 1));\n line.moveBase(line.pos + (space(line.text.charCodeAt(line.pos + 1)) ? 2 : 1));\n bl.end = cx.lineStart + line.text.length;\n return true;\n },\n [Type.ListItem](bl, _cx, line) {\n if (line.indent < line.baseIndent + bl.value && line.next > -1)\n return false;\n line.moveBaseColumn(line.baseIndent + bl.value);\n return true;\n },\n [Type.OrderedList]: skipForList,\n [Type.BulletList]: skipForList,\n [Type.Document]() { return true; }\n};\nfunction space(ch) { return ch == 32 || ch == 9 || ch == 10 || ch == 13; }\nfunction skipSpace(line, i = 0) {\n while (i < line.length && space(line.charCodeAt(i)))\n i++;\n return i;\n}\nfunction skipSpaceBack(line, i, to) {\n while (i > to && space(line.charCodeAt(i - 1)))\n i--;\n return i;\n}\nfunction isFencedCode(line) {\n if (line.next != 96 && line.next != 126 /* '`~' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n if (pos < line.pos + 3)\n return -1;\n if (line.next == 96)\n for (let i = pos; i < line.text.length; i++)\n if (line.text.charCodeAt(i) == 96)\n return -1;\n return pos;\n}\nfunction isBlockquote(line) {\n return line.next != 62 /* '>' */ ? -1 : line.text.charCodeAt(line.pos + 1) == 32 ? 2 : 1;\n}\nfunction isHorizontalRule(line, cx, breaking) {\n if (line.next != 42 && line.next != 45 && line.next != 95 /* '_-*' */)\n return -1;\n let count = 1;\n for (let pos = line.pos + 1; pos < line.text.length; pos++) {\n let ch = line.text.charCodeAt(pos);\n if (ch == line.next)\n count++;\n else if (!space(ch))\n return -1;\n }\n // Setext headers take precedence\n if (breaking && line.next == 45 && isSetextUnderline(line) > -1 && line.depth == cx.stack.length)\n return -1;\n return count < 3 ? -1 : 1;\n}\nfunction inList(cx, type) {\n for (let i = cx.stack.length - 1; i >= 0; i--)\n if (cx.stack[i].type == type)\n return true;\n return false;\n}\nfunction isBulletList(line, cx, breaking) {\n return (line.next == 45 || line.next == 43 || line.next == 42 /* '-+*' */) &&\n (line.pos == line.text.length - 1 || space(line.text.charCodeAt(line.pos + 1))) &&\n (!breaking || inList(cx, Type.BulletList) || line.skipSpace(line.pos + 2) < line.text.length) ? 1 : -1;\n}\nfunction isOrderedList(line, cx, breaking) {\n let pos = line.pos, next = line.next;\n for (;;) {\n if (next >= 48 && next <= 57 /* '0-9' */)\n pos++;\n else\n break;\n if (pos == line.text.length)\n return -1;\n next = line.text.charCodeAt(pos);\n }\n if (pos == line.pos || pos > line.pos + 9 ||\n (next != 46 && next != 41 /* '.)' */) ||\n (pos < line.text.length - 1 && !space(line.text.charCodeAt(pos + 1))) ||\n breaking && !inList(cx, Type.OrderedList) &&\n (line.skipSpace(pos + 1) == line.text.length || pos > line.pos + 1 || line.next != 49 /* '1' */))\n return -1;\n return pos + 1 - line.pos;\n}\nfunction isAtxHeading(line) {\n if (line.next != 35 /* '#' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == 35)\n pos++;\n if (pos < line.text.length && line.text.charCodeAt(pos) != 32)\n return -1;\n let size = pos - line.pos;\n return size > 6 ? -1 : size;\n}\nfunction isSetextUnderline(line) {\n if (line.next != 45 && line.next != 61 /* '-=' */ || line.indent >= line.baseIndent + 4)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n let end = pos;\n while (pos < line.text.length && space(line.text.charCodeAt(pos)))\n pos++;\n return pos == line.text.length ? end : -1;\n}\nconst EmptyLine = /^[ \\t]*$/, CommentEnd = /-->/, ProcessingEnd = /\\?>/;\nconst HTMLBlockStyle = [\n [/^<(?:script|pre|style)(?:\\s|>|$)/i, /<\\/(?:script|pre|style)>/i],\n [/^\\s*/i.exec(after);\n if (comment)\n return cx.append(elt(Type.Comment, start, start + 1 + comment[0].length));\n let procInst = /^\\?[^]*?\\?>/.exec(after);\n if (procInst)\n return cx.append(elt(Type.ProcessingInstruction, start, start + 1 + procInst[0].length));\n let m = /^(?:![A-Z][^]*?>|!\\[CDATA\\[[^]*?\\]\\]>|\\/\\s*[a-zA-Z][\\w-]*\\s*>|\\s*[a-zA-Z][\\w-]*(\\s+[a-zA-Z:_][\\w-.:]*(?:\\s*=\\s*(?:[^\\s\"'=<>`]+|'[^']*'|\"[^\"]*\"))?)*\\s*(\\/\\s*)?>)/.exec(after);\n if (!m)\n return -1;\n return cx.append(elt(Type.HTMLTag, start, start + 1 + m[0].length));\n },\n Emphasis(cx, next, start) {\n if (next != 95 && next != 42)\n return -1;\n let pos = start + 1;\n while (cx.char(pos) == next)\n pos++;\n let before = cx.slice(start - 1, start), after = cx.slice(pos, pos + 1);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let leftFlanking = !sAfter && (!pAfter || sBefore || pBefore);\n let rightFlanking = !sBefore && (!pBefore || sAfter || pAfter);\n let canOpen = leftFlanking && (next == 42 || !rightFlanking || pBefore);\n let canClose = rightFlanking && (next == 42 || !leftFlanking || pAfter);\n return cx.append(new InlineDelimiter(next == 95 ? EmphasisUnderscore : EmphasisAsterisk, start, pos, (canOpen ? 1 /* Open */ : 0) | (canClose ? 2 /* Close */ : 0)));\n },\n HardBreak(cx, next, start) {\n if (next == 92 /* '\\\\' */ && cx.char(start + 1) == 10 /* '\\n' */)\n return cx.append(elt(Type.HardBreak, start, start + 2));\n if (next == 32) {\n let pos = start + 1;\n while (cx.char(pos) == 32)\n pos++;\n if (cx.char(pos) == 10 && pos >= start + 2)\n return cx.append(elt(Type.HardBreak, start, pos + 1));\n }\n return -1;\n },\n Link(cx, next, start) {\n return next == 91 /* '[' */ ? cx.append(new InlineDelimiter(LinkStart, start, start + 1, 1 /* Open */)) : -1;\n },\n Image(cx, next, start) {\n return next == 33 /* '!' */ && cx.char(start + 1) == 91 /* '[' */\n ? cx.append(new InlineDelimiter(ImageStart, start, start + 2, 1 /* Open */)) : -1;\n },\n LinkEnd(cx, next, start) {\n if (next != 93 /* ']' */)\n return -1;\n // Scanning back to the next link/image start marker\n for (let i = cx.parts.length - 1; i >= 0; i--) {\n let part = cx.parts[i];\n if (part instanceof InlineDelimiter && (part.type == LinkStart || part.type == ImageStart)) {\n // If this one has been set invalid (because it would produce\n // a nested link) or there's no valid link here ignore both.\n if (!part.side || cx.skipSpace(part.to) == start && !/[(\\[]/.test(cx.slice(start + 1, start + 2))) {\n cx.parts[i] = null;\n return -1;\n }\n // Finish the content and replace the entire range in\n // this.parts with the link/image node.\n let content = cx.takeContent(i);\n let link = cx.parts[i] = finishLink(cx, content, part.type == LinkStart ? Type.Link : Type.Image, part.from, start + 1);\n // Set any open-link markers before this link to invalid.\n if (part.type == LinkStart)\n for (let j = 0; j < i; j++) {\n let p = cx.parts[j];\n if (p instanceof InlineDelimiter && p.type == LinkStart)\n p.side = 0;\n }\n return link.to;\n }\n }\n return -1;\n }\n};\nfunction finishLink(cx, content, type, start, startPos) {\n let { text } = cx, next = cx.char(startPos), endPos = startPos;\n content.unshift(elt(Type.LinkMark, start, start + (type == Type.Image ? 2 : 1)));\n content.push(elt(Type.LinkMark, startPos - 1, startPos));\n if (next == 40 /* '(' */) {\n let pos = cx.skipSpace(startPos + 1);\n let dest = parseURL(text, pos - cx.offset, cx.offset), title;\n if (dest) {\n pos = cx.skipSpace(dest.to);\n title = parseLinkTitle(text, pos - cx.offset, cx.offset);\n if (title)\n pos = cx.skipSpace(title.to);\n }\n if (cx.char(pos) == 41 /* ')' */) {\n content.push(elt(Type.LinkMark, startPos, startPos + 1));\n endPos = pos + 1;\n if (dest)\n content.push(dest);\n if (title)\n content.push(title);\n content.push(elt(Type.LinkMark, pos, endPos));\n }\n }\n else if (next == 91 /* '[' */) {\n let label = parseLinkLabel(text, startPos - cx.offset, cx.offset, false);\n if (label) {\n content.push(label);\n endPos = label.to;\n }\n }\n return elt(type, start, endPos, content);\n}\n// These return `null` when falling off the end of the input, `false`\n// when parsing fails otherwise (for use in the incremental link\n// reference parser).\nfunction parseURL(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next == 60 /* '<' */) {\n for (let pos = start + 1; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (ch == 62 /* '>' */)\n return elt(Type.URL, start + offset, pos + 1 + offset);\n if (ch == 60 || ch == 10 /* '<\\n' */)\n return false;\n }\n return null;\n }\n else {\n let depth = 0, pos = start;\n for (let escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (space(ch)) {\n break;\n }\n else if (escaped) {\n escaped = false;\n }\n else if (ch == 40 /* '(' */) {\n depth++;\n }\n else if (ch == 41 /* ')' */) {\n if (!depth)\n break;\n depth--;\n }\n else if (ch == 92 /* '\\\\' */) {\n escaped = true;\n }\n }\n return pos > start ? elt(Type.URL, start + offset, pos + offset) : pos == text.length ? null : false;\n }\n}\nfunction parseLinkTitle(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next != 39 && next != 34 && next != 40 /* '\"\\'(' */)\n return false;\n let end = next == 40 ? 41 : next;\n for (let pos = start + 1, escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == end)\n return elt(Type.LinkTitle, start + offset, pos + 1 + offset);\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n return null;\n}\nfunction parseLinkLabel(text, start, offset, requireNonWS) {\n for (let escaped = false, pos = start + 1, end = Math.min(text.length, pos + 999); pos < end; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == 93 /* ']' */)\n return requireNonWS ? false : elt(Type.LinkLabel, start + offset, pos + 1 + offset);\n else {\n if (requireNonWS && !space(ch))\n requireNonWS = false;\n if (ch == 91 /* '[' */)\n return false;\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n }\n return null;\n}\n/// Inline parsing functions get access to this context, and use it to\n/// read the content and emit syntax nodes.\nclass InlineContext {\n /// @internal\n constructor(\n /// The parser that is being used.\n parser, \n /// The text of this inline section.\n text, \n /// The starting offset of the section in the document.\n offset) {\n this.parser = parser;\n this.text = text;\n this.offset = offset;\n /// @internal\n this.parts = [];\n }\n /// Get the character code at the given (document-relative)\n /// position.\n char(pos) { return pos >= this.end ? -1 : this.text.charCodeAt(pos - this.offset); }\n /// The position of the end of this inline section.\n get end() { return this.offset + this.text.length; }\n /// Get a substring of this inline section. Again uses\n /// document-relative positions.\n slice(from, to) { return this.text.slice(from - this.offset, to - this.offset); }\n /// @internal\n append(elt) {\n this.parts.push(elt);\n return elt.to;\n }\n /// Add a [delimiter](#DelimiterType) at this given position. `open`\n /// and `close` indicate whether this delimiter is opening, closing,\n /// or both. Returns the end of the delimiter, for convenient\n /// returning from [parse functions](#InlineParser.parse).\n addDelimiter(type, from, to, open, close) {\n return this.append(new InlineDelimiter(type, from, to, (open ? 1 /* Open */ : 0) | (close ? 2 /* Close */ : 0)));\n }\n /// Add an inline element. Returns the end of the element.\n addElement(elt) {\n return this.append(elt);\n }\n /// Resolve markers between this.parts.length and from, wrapping matched markers in the\n /// appropriate node and updating the content of this.parts. @internal\n resolveMarkers(from) {\n // Scan forward, looking for closing tokens\n for (let i = from; i < this.parts.length; i++) {\n let close = this.parts[i];\n if (!(close instanceof InlineDelimiter && close.type.resolve && (close.side & 2 /* Close */)))\n continue;\n let emp = close.type == EmphasisUnderscore || close.type == EmphasisAsterisk;\n let closeSize = close.to - close.from;\n let open, j = i - 1;\n // Continue scanning for a matching opening token\n for (; j >= from; j--) {\n let part = this.parts[j];\n if (part instanceof InlineDelimiter && (part.side & 1 /* Open */) && part.type == close.type &&\n // Ignore emphasis delimiters where the character count doesn't match\n !(emp && ((close.side & 1 /* Open */) || (part.side & 2 /* Close */)) &&\n (part.to - part.from + closeSize) % 3 == 0 && ((part.to - part.from) % 3 || closeSize % 3))) {\n open = part;\n break;\n }\n }\n if (!open)\n continue;\n let type = close.type.resolve, content = [];\n let start = open.from, end = close.to;\n // Emphasis marker effect depends on the character count. Size consumed is minimum of the two\n // markers.\n if (emp) {\n let size = Math.min(2, open.to - open.from, closeSize);\n start = open.to - size;\n end = close.from + size;\n type = size == 1 ? \"Emphasis\" : \"StrongEmphasis\";\n }\n // Move the covered region into content, optionally adding marker nodes\n if (open.type.mark)\n content.push(this.elt(open.type.mark, start, open.to));\n for (let k = j + 1; k < i; k++) {\n if (this.parts[k] instanceof Element)\n content.push(this.parts[k]);\n this.parts[k] = null;\n }\n if (close.type.mark)\n content.push(this.elt(close.type.mark, close.from, end));\n let element = this.elt(type, start, end, content);\n // If there are leftover emphasis marker characters, shrink the close/open markers. Otherwise, clear them.\n this.parts[j] = emp && open.from != start ? new InlineDelimiter(open.type, open.from, start, open.side) : null;\n let keep = this.parts[i] = emp && close.to != end ? new InlineDelimiter(close.type, end, close.to, close.side) : null;\n // Insert the new element in this.parts\n if (keep)\n this.parts.splice(i, 0, element);\n else\n this.parts[i] = element;\n }\n // Collect the elements remaining in this.parts into an array.\n let result = [];\n for (let i = from; i < this.parts.length; i++) {\n let part = this.parts[i];\n if (part instanceof Element)\n result.push(part);\n }\n return result;\n }\n /// Find an opening delimiter of the given type. Returns `null` if\n /// no delimiter is found, or an index that can be passed to\n /// [`takeContent`](#InlineContext.takeContent) otherwise.\n findOpeningDelimiter(type) {\n for (let i = this.parts.length - 1; i >= 0; i--) {\n let part = this.parts[i];\n if (part instanceof InlineDelimiter && part.type == type)\n return i;\n }\n return null;\n }\n /// Remove all inline elements and delimiters starting from the\n /// given index (which you should get from\n /// [`findOpeningDelimiter`](#InlineContext.findOpeningDelimiter),\n /// resolve delimiters inside of them, and return them as an array\n /// of elements.\n takeContent(startIndex) {\n let content = this.resolveMarkers(startIndex);\n this.parts.length = startIndex;\n return content;\n }\n /// Skip space after the given (document) position, returning either\n /// the position of the next non-space character or the end of the\n /// section.\n skipSpace(from) { return skipSpace(this.text, from - this.offset) + this.offset; }\n elt(type, from, to, children) {\n if (typeof type == \"string\")\n return elt(this.parser.getNodeType(type), from, to, children);\n return new TreeElement(type, from);\n }\n}\nfunction injectMarks(elements, marks) {\n if (!marks.length)\n return elements;\n if (!elements.length)\n return marks;\n let elts = elements.slice(), eI = 0;\n for (let mark of marks) {\n while (eI < elts.length && elts[eI].to < mark.to)\n eI++;\n if (eI < elts.length && elts[eI].from < mark.from) {\n let e = elts[eI];\n if (e instanceof Element)\n elts[eI] = new Element(e.type, e.from, e.to, injectMarks(e.children, [mark]));\n }\n else {\n elts.splice(eI++, 0, mark);\n }\n }\n return elts;\n}\n// These are blocks that can span blank lines, and should thus only be\n// reused if their next sibling is also being reused.\nconst NotLast = [Type.CodeBlock, Type.ListItem, Type.OrderedList, Type.BulletList];\nclass FragmentCursor {\n constructor(fragments, input) {\n this.fragments = fragments;\n this.input = input;\n // Index into fragment array\n this.i = 0;\n // Active fragment\n this.fragment = null;\n this.fragmentEnd = -1;\n // Cursor into the current fragment, if any. When `moveTo` returns\n // true, this points at the first block after `pos`.\n this.cursor = null;\n if (fragments.length)\n this.fragment = fragments[this.i++];\n }\n nextFragment() {\n this.fragment = this.i < this.fragments.length ? this.fragments[this.i++] : null;\n this.cursor = null;\n this.fragmentEnd = -1;\n }\n moveTo(pos, lineStart) {\n while (this.fragment && this.fragment.to <= pos)\n this.nextFragment();\n if (!this.fragment || this.fragment.from > (pos ? pos - 1 : 0))\n return false;\n if (this.fragmentEnd < 0) {\n let end = this.fragment.to;\n while (end > 0 && this.input.read(end - 1, end) != \"\\n\")\n end--;\n this.fragmentEnd = end ? end - 1 : 0;\n }\n let c = this.cursor;\n if (!c) {\n c = this.cursor = this.fragment.tree.cursor();\n c.firstChild();\n }\n let rPos = pos + this.fragment.offset;\n while (c.to <= rPos)\n if (!c.parent())\n return false;\n for (;;) {\n if (c.from >= rPos)\n return this.fragment.from <= lineStart;\n if (!c.childAfter(rPos))\n return false;\n }\n }\n matches(hash) {\n let tree = this.cursor.tree;\n return tree && tree.prop(NodeProp.contextHash) == hash;\n }\n takeNodes(cx) {\n let cur = this.cursor, off = this.fragment.offset, fragEnd = this.fragmentEnd - (this.fragment.openEnd ? 1 : 0);\n let start = cx.absoluteLineStart, end = start, blockI = cx.block.children.length;\n let prevEnd = end, prevI = blockI;\n for (;;) {\n if (cur.to - off > fragEnd) {\n if (cur.type.isAnonymous && cur.firstChild())\n continue;\n break;\n }\n cx.dontInject.add(cur.tree);\n cx.addNode(cur.tree, cur.from - off);\n // Taken content must always end in a block, because incremental\n // parsing happens on block boundaries. Never stop directly\n // after an indented code block, since those can continue after\n // any number of blank lines.\n if (cur.type.is(\"Block\")) {\n if (NotLast.indexOf(cur.type.id) < 0) {\n end = cur.to - off;\n blockI = cx.block.children.length;\n }\n else {\n end = prevEnd;\n blockI = prevI;\n prevEnd = cur.to - off;\n prevI = cx.block.children.length;\n }\n }\n if (!cur.nextSibling())\n break;\n }\n while (cx.block.children.length > blockI) {\n cx.block.children.pop();\n cx.block.positions.pop();\n }\n return end - start;\n }\n}\nconst markdownHighlighting = styleTags({\n \"Blockquote/...\": tags.quote,\n HorizontalRule: tags.contentSeparator,\n \"ATXHeading1/... SetextHeading1/...\": tags.heading1,\n \"ATXHeading2/... SetextHeading2/...\": tags.heading2,\n \"ATXHeading3/...\": tags.heading3,\n \"ATXHeading4/...\": tags.heading4,\n \"ATXHeading5/...\": tags.heading5,\n \"ATXHeading6/...\": tags.heading6,\n \"Comment CommentBlock\": tags.comment,\n Escape: tags.escape,\n Entity: tags.character,\n \"Emphasis/...\": tags.emphasis,\n \"StrongEmphasis/...\": tags.strong,\n \"Link/... Image/...\": tags.link,\n \"OrderedList/... BulletList/...\": tags.list,\n \"BlockQuote/...\": tags.quote,\n \"InlineCode CodeText\": tags.monospace,\n URL: tags.url,\n \"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark\": tags.processingInstruction,\n \"CodeInfo LinkLabel\": tags.labelName,\n LinkTitle: tags.string,\n Paragraph: tags.content\n});\n/// The default CommonMark parser.\nconst parser = new MarkdownParser(new NodeSet(nodeTypes).extend(markdownHighlighting), Object.keys(DefaultBlockParsers).map(n => DefaultBlockParsers[n]), Object.keys(DefaultBlockParsers).map(n => DefaultLeafBlocks[n]), Object.keys(DefaultBlockParsers), DefaultEndLeaf, DefaultSkipMarkup, Object.keys(DefaultInline).map(n => DefaultInline[n]), Object.keys(DefaultInline), []);\n\nfunction leftOverSpace(node, from, to) {\n let ranges = [];\n for (let n = node.firstChild, pos = from;; n = n.nextSibling) {\n let nextPos = n ? n.from : to;\n if (nextPos > pos)\n ranges.push({ from: pos, to: nextPos });\n if (!n)\n break;\n pos = n.to;\n }\n return ranges;\n}\n/// Create a Markdown extension to enable nested parsing on code\n/// blocks and/or embedded HTML.\nfunction parseCode(config) {\n let { codeParser, htmlParser } = config;\n let wrap = parseMixed((node, input) => {\n let id = node.type.id;\n if (codeParser && (id == Type.CodeBlock || id == Type.FencedCode)) {\n let info = \"\";\n if (id == Type.FencedCode) {\n let infoNode = node.node.getChild(Type.CodeInfo);\n if (infoNode)\n info = input.read(infoNode.from, infoNode.to);\n }\n let parser = codeParser(info);\n if (parser)\n return { parser, overlay: node => node.type.id == Type.CodeText };\n }\n else if (htmlParser && (id == Type.HTMLBlock || id == Type.HTMLTag)) {\n return { parser: htmlParser, overlay: leftOverSpace(node.node, node.from, node.to) };\n }\n return null;\n });\n return { wrap };\n}\n\nconst StrikethroughDelim = { resolve: \"Strikethrough\", mark: \"StrikethroughMark\" };\n/// An extension that implements\n/// [GFM-style](https://github.github.com/gfm/#strikethrough-extension-)\n/// Strikethrough syntax using `~~` delimiters.\nconst Strikethrough = {\n defineNodes: [{\n name: \"Strikethrough\",\n style: { \"Strikethrough/...\": tags.strikethrough }\n }, {\n name: \"StrikethroughMark\",\n style: tags.processingInstruction\n }],\n parseInline: [{\n name: \"Strikethrough\",\n parse(cx, next, pos) {\n if (next != 126 /* '~' */ || cx.char(pos + 1) != 126 || cx.char(pos + 2) == 126)\n return -1;\n let before = cx.slice(pos - 1, pos), after = cx.slice(pos + 2, pos + 3);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n return cx.addDelimiter(StrikethroughDelim, pos, pos + 2, !sAfter && (!pAfter || sBefore || pBefore), !sBefore && (!pBefore || sAfter || pAfter));\n },\n after: \"Emphasis\"\n }]\n};\nfunction parseRow(cx, line, startI = 0, elts, offset = 0) {\n let count = 0, first = true, cellStart = -1, cellEnd = -1, esc = false;\n let parseCell = () => {\n elts.push(cx.elt(\"TableCell\", offset + cellStart, offset + cellEnd, cx.parser.parseInline(line.slice(cellStart, cellEnd), offset + cellStart)));\n };\n for (let i = startI; i < line.length; i++) {\n let next = line.charCodeAt(i);\n if (next == 124 /* '|' */ && !esc) {\n if (!first || cellStart > -1)\n count++;\n first = false;\n if (elts) {\n if (cellStart > -1)\n parseCell();\n elts.push(cx.elt(\"TableDelimiter\", i + offset, i + offset + 1));\n }\n cellStart = cellEnd = -1;\n }\n else if (esc || next != 32 && next != 9) {\n if (cellStart < 0)\n cellStart = i;\n cellEnd = i + 1;\n }\n esc = !esc && next == 92;\n }\n if (cellStart > -1) {\n count++;\n if (elts)\n parseCell();\n }\n return count;\n}\nfunction hasPipe(str, start) {\n for (let i = start; i < str.length; i++) {\n let next = str.charCodeAt(i);\n if (next == 124 /* '|' */)\n return true;\n if (next == 92 /* '\\\\' */)\n i++;\n }\n return false;\n}\nconst delimiterLine = /^\\|?(\\s*:?-+:?\\s*\\|)+(\\s*:?-+:?\\s*)?$/;\nclass TableParser {\n constructor() {\n // Null means we haven't seen the second line yet, false means this\n // isn't a table, and an array means this is a table and we've\n // parsed the given rows so far.\n this.rows = null;\n }\n nextLine(cx, line, leaf) {\n if (this.rows == null) { // Second line\n this.rows = false;\n let lineText;\n if ((line.next == 45 || line.next == 58 || line.next == 124 /* '-:|' */) &&\n delimiterLine.test(lineText = line.text.slice(line.pos))) {\n let firstRow = [], firstCount = parseRow(cx, leaf.content, 0, firstRow, leaf.start);\n if (firstCount == parseRow(cx, lineText, line.pos))\n this.rows = [cx.elt(\"TableHeader\", leaf.start, leaf.start + leaf.content.length, firstRow),\n cx.elt(\"TableDelimiter\", cx.lineStart + line.pos, cx.lineStart + line.text.length)];\n }\n }\n else if (this.rows) { // Line after the second\n let content = [];\n parseRow(cx, line.text, line.pos, content, cx.lineStart);\n this.rows.push(cx.elt(\"TableRow\", cx.lineStart + line.pos, cx.lineStart + line.text.length, content));\n }\n return false;\n }\n finish(cx, leaf) {\n if (!this.rows)\n return false;\n cx.addLeafElement(leaf, cx.elt(\"Table\", leaf.start, leaf.start + leaf.content.length, this.rows));\n return true;\n }\n}\n/// This extension provides\n/// [GFM-style](https://github.github.com/gfm/#tables-extension-)\n/// tables, using syntax like this:\n///\n/// ```\n/// | head 1 | head 2 |\n/// | --- | --- |\n/// | cell 1 | cell 2 |\n/// ```\nconst Table = {\n defineNodes: [\n { name: \"Table\", block: true },\n { name: \"TableHeader\", style: { \"TableHeader/...\": tags.heading } },\n \"TableRow\",\n { name: \"TableCell\", style: tags.content },\n { name: \"TableDelimiter\", style: tags.processingInstruction },\n ],\n parseBlock: [{\n name: \"Table\",\n leaf(_, leaf) { return hasPipe(leaf.content, 0) ? new TableParser : null; },\n endLeaf(cx, line, leaf) {\n if (leaf.parsers.some(p => p instanceof TableParser) || !hasPipe(line.text, line.basePos))\n return false;\n let next = cx.scanLine(cx.absoluteLineEnd + 1).text;\n return delimiterLine.test(next) && parseRow(cx, line.text, line.basePos) == parseRow(cx, next, line.basePos);\n },\n before: \"SetextHeading\"\n }]\n};\nclass TaskParser {\n nextLine() { return false; }\n finish(cx, leaf) {\n cx.addLeafElement(leaf, cx.elt(\"Task\", leaf.start, leaf.start + leaf.content.length, [\n cx.elt(\"TaskMarker\", leaf.start, leaf.start + 3),\n ...cx.parser.parseInline(leaf.content.slice(3), leaf.start + 3)\n ]));\n return true;\n }\n}\n/// Extension providing\n/// [GFM-style](https://github.github.com/gfm/#task-list-items-extension-)\n/// task list items, where list items can be prefixed with `[ ]` or\n/// `[x]` to add a checkbox.\nconst TaskList = {\n defineNodes: [\n { name: \"Task\", block: true, style: tags.list },\n { name: \"TaskMarker\", style: tags.atom }\n ],\n parseBlock: [{\n name: \"TaskList\",\n leaf(cx, leaf) {\n return /^\\[[ xX]\\]/.test(leaf.content) && cx.parentType().name == \"ListItem\" ? new TaskParser : null;\n },\n after: \"SetextHeading\"\n }]\n};\n/// Extension bundle containing [`Table`](#Table),\n/// [`TaskList`](#TaskList) and [`Strikethrough`](#Strikethrough).\nconst GFM = [Table, TaskList, Strikethrough];\nfunction parseSubSuper(ch, node, mark) {\n return (cx, next, pos) => {\n if (next != ch || cx.char(pos + 1) == ch)\n return -1;\n let elts = [cx.elt(mark, pos, pos + 1)];\n for (let i = pos + 1; i < cx.end; i++) {\n let next = cx.char(i);\n if (next == ch)\n return cx.addElement(cx.elt(node, pos, i + 1, elts.concat(cx.elt(mark, i, i + 1))));\n if (next == 92 /* '\\\\' */)\n elts.push(cx.elt(\"Escape\", i, i++ + 2));\n if (space(next))\n break;\n }\n return -1;\n };\n}\n/// Extension providing\n/// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n/// superscript using `^` markers.\nconst Superscript = {\n defineNodes: [\n { name: \"Superscript\", style: tags.special(tags.content) },\n { name: \"SuperscriptMark\", style: tags.processingInstruction }\n ],\n parseInline: [{\n name: \"Superscript\",\n parse: parseSubSuper(94 /* '^' */, \"Superscript\", \"SuperscriptMark\")\n }]\n};\n/// Extension providing\n/// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n/// subscript using `~` markers.\nconst Subscript = {\n defineNodes: [\n { name: \"Subscript\", style: tags.special(tags.content) },\n { name: \"SubscriptMark\", style: tags.processingInstruction }\n ],\n parseInline: [{\n name: \"Subscript\",\n parse: parseSubSuper(126 /* '~' */, \"Subscript\", \"SubscriptMark\")\n }]\n};\n/// Extension that parses two colons with only letters, underscores,\n/// and numbers between them as `Emoji` nodes.\nconst Emoji = {\n defineNodes: [{ name: \"Emoji\", style: tags.character }],\n parseInline: [{\n name: \"Emoji\",\n parse(cx, next, pos) {\n let match;\n if (next != 58 /* ':' */ || !(match = /^[a-zA-Z_0-9]+:/.exec(cx.slice(pos + 1, cx.end))))\n return -1;\n return cx.addElement(cx.elt(\"Emoji\", pos, pos + 1 + match[0].length));\n }\n }]\n};\n\nexport { BlockContext, Element, Emoji, GFM, InlineContext, LeafBlock, Line, MarkdownParser, Strikethrough, Subscript, Superscript, Table, TaskList, parseCode, parser };\n","import { EditorSelection, Prec } from '@codemirror/state';\nimport { keymap } from '@codemirror/view';\nimport { defineLanguageFacet, foldNodeProp, indentNodeProp, languageDataProp, foldService, syntaxTree, Language, LanguageDescription, ParseContext, LanguageSupport } from '@codemirror/language';\nimport { parser, GFM, Subscript, Superscript, Emoji, MarkdownParser, parseCode } from '@lezer/markdown';\nimport { html } from '@codemirror/lang-html';\nimport { NodeProp } from '@lezer/common';\n\nconst data = /*@__PURE__*/defineLanguageFacet({ block: { open: \"\" } });\nconst headingProp = /*@__PURE__*/new NodeProp();\nconst commonmark = /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/foldNodeProp.add(type => {\n return !type.is(\"Block\") || type.is(\"Document\") || isHeading(type) != null ? undefined\n : (tree, state) => ({ from: state.doc.lineAt(tree.from).to, to: tree.to });\n }),\n /*@__PURE__*/headingProp.add(isHeading),\n /*@__PURE__*/indentNodeProp.add({\n Document: () => null\n }),\n /*@__PURE__*/languageDataProp.add({\n Document: data\n })\n ]\n});\nfunction isHeading(type) {\n let match = /^(?:ATX|Setext)Heading(\\d)$/.exec(type.name);\n return match ? +match[1] : undefined;\n}\nfunction findSectionEnd(headerNode, level) {\n let last = headerNode;\n for (;;) {\n let next = last.nextSibling, heading;\n if (!next || (heading = isHeading(next.type)) != null && heading <= level)\n break;\n last = next;\n }\n return last.to;\n}\nconst headerIndent = /*@__PURE__*/foldService.of((state, start, end) => {\n for (let node = syntaxTree(state).resolveInner(end, -1); node; node = node.parent) {\n if (node.from < start)\n break;\n let heading = node.type.prop(headingProp);\n if (heading == null)\n continue;\n let upto = findSectionEnd(node, heading);\n if (upto > end)\n return { from: end, to: upto };\n }\n return null;\n});\nfunction mkLang(parser) {\n return new Language(data, parser, [headerIndent], \"markdown\");\n}\n/**\nLanguage support for strict CommonMark.\n*/\nconst commonmarkLanguage = /*@__PURE__*/mkLang(commonmark);\nconst extended = /*@__PURE__*/commonmark.configure([GFM, Subscript, Superscript, Emoji]);\n/**\nLanguage support for [GFM](https://github.github.com/gfm/) plus\nsubscript, superscript, and emoji syntax.\n*/\nconst markdownLanguage = /*@__PURE__*/mkLang(extended);\nfunction getCodeParser(languages, defaultLanguage) {\n return (info) => {\n if (info && languages) {\n let found = null;\n // Strip anything after whitespace\n info = /\\S*/.exec(info)[0];\n if (typeof languages == \"function\")\n found = languages(info);\n else\n found = LanguageDescription.matchLanguageName(languages, info, true);\n if (found instanceof LanguageDescription)\n return found.support ? found.support.language.parser : ParseContext.getSkippingParser(found.load());\n else if (found)\n return found.parser;\n }\n return defaultLanguage ? defaultLanguage.parser : null;\n };\n}\n\nclass Context {\n constructor(node, from, to, spaceBefore, spaceAfter, type, item) {\n this.node = node;\n this.from = from;\n this.to = to;\n this.spaceBefore = spaceBefore;\n this.spaceAfter = spaceAfter;\n this.type = type;\n this.item = item;\n }\n blank(maxWidth, trailing = true) {\n let result = this.spaceBefore + (this.node.name == \"Blockquote\" ? \">\" : \"\");\n if (maxWidth != null) {\n while (result.length < maxWidth)\n result += \" \";\n return result;\n }\n else {\n for (let i = this.to - this.from - result.length - this.spaceAfter.length; i > 0; i--)\n result += \" \";\n return result + (trailing ? this.spaceAfter : \"\");\n }\n }\n marker(doc, add) {\n let number = this.node.name == \"OrderedList\" ? String((+itemNumber(this.item, doc)[2] + add)) : \"\";\n return this.spaceBefore + number + this.type + this.spaceAfter;\n }\n}\nfunction getContext(node, doc) {\n let nodes = [];\n for (let cur = node; cur && cur.name != \"Document\"; cur = cur.parent) {\n if (cur.name == \"ListItem\" || cur.name == \"Blockquote\" || cur.name == \"FencedCode\")\n nodes.push(cur);\n }\n let context = [];\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i], match;\n let line = doc.lineAt(node.from), startPos = node.from - line.from;\n if (node.name == \"FencedCode\") {\n context.push(new Context(node, startPos, startPos, \"\", \"\", \"\", null));\n }\n else if (node.name == \"Blockquote\" && (match = /^[ \\t]*>( ?)/.exec(line.text.slice(startPos)))) {\n context.push(new Context(node, startPos, startPos + match[0].length, \"\", match[1], \">\", null));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"OrderedList\" &&\n (match = /^([ \\t]*)\\d+([.)])([ \\t]*)/.exec(line.text.slice(startPos)))) {\n let after = match[3], len = match[0].length;\n if (after.length >= 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, match[2], node));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"BulletList\" &&\n (match = /^([ \\t]*)([-+*])([ \\t]{1,4}\\[[ xX]\\])?([ \\t]+)/.exec(line.text.slice(startPos)))) {\n let after = match[4], len = match[0].length;\n if (after.length > 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n let type = match[2];\n if (match[3])\n type += match[3].replace(/[xX]/, ' ');\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, type, node));\n }\n }\n return context;\n}\nfunction itemNumber(item, doc) {\n return /^(\\s*)(\\d+)(?=[.)])/.exec(doc.sliceString(item.from, item.from + 10));\n}\nfunction renumberList(after, doc, changes, offset = 0) {\n for (let prev = -1, node = after;;) {\n if (node.name == \"ListItem\") {\n let m = itemNumber(node, doc);\n let number = +m[2];\n if (prev >= 0) {\n if (number != prev + 1)\n return;\n changes.push({ from: node.from + m[1].length, to: node.from + m[0].length, insert: String(prev + 2 + offset) });\n }\n prev = number;\n }\n let next = node.nextSibling;\n if (!next)\n break;\n node = next;\n }\n}\n/**\nThis command, when invoked in Markdown context with cursor\nselection(s), will create a new line with the markup for\nblockquotes and lists that were active on the old line. If the\ncursor was directly after the end of the markup for the old line,\ntrailing whitespace and list markers are removed from that line.\n\nThe command does nothing in non-Markdown context, so it should\nnot be used as the only binding for Enter (even in a Markdown\ndocument, HTML and code regions might use a different language).\n*/\nconst insertNewlineContinueMarkup = ({ state, dispatch }) => {\n let tree = syntaxTree(state), { doc } = state;\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty || !markdownLanguage.isActiveAt(state, range.from))\n return dont = { range };\n let pos = range.from, line = doc.lineAt(pos);\n let context = getContext(tree.resolveInner(pos, -1), doc);\n while (context.length && context[context.length - 1].from > pos - line.from)\n context.pop();\n if (!context.length)\n return dont = { range };\n let inner = context[context.length - 1];\n if (inner.to - inner.spaceAfter.length > pos - line.from)\n return dont = { range };\n let emptyLine = pos >= (inner.to - inner.spaceAfter.length) && !/\\S/.test(line.text.slice(inner.to));\n // Empty line in list\n if (inner.item && emptyLine) {\n // First list item or blank line before: delete a level of markup\n if (inner.node.firstChild.to >= pos ||\n line.from > 0 && !/[^\\s>]/.test(doc.lineAt(line.from - 1).text)) {\n let next = context.length > 1 ? context[context.length - 2] : null;\n let delTo, insert = \"\";\n if (next && next.item) { // Re-add marker for the list at the next level\n delTo = line.from + next.from;\n insert = next.marker(doc, 1);\n }\n else {\n delTo = line.from + (next ? next.to : 0);\n }\n let changes = [{ from: delTo, to: pos, insert }];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes, -2);\n if (next && next.node.name == \"OrderedList\")\n renumberList(next.item, doc, changes);\n return { range: EditorSelection.cursor(delTo + insert.length), changes };\n }\n else { // Move this line down\n let insert = \"\";\n for (let i = 0, e = context.length - 2; i <= e; i++) {\n insert += context[i].blank(i < e ? context[i + 1].from - insert.length : null, i < e);\n }\n insert += state.lineBreak;\n return { range: EditorSelection.cursor(pos + insert.length), changes: { from: line.from, insert } };\n }\n }\n if (inner.node.name == \"Blockquote\" && emptyLine && line.from) {\n let prevLine = doc.lineAt(line.from - 1), quoted = />\\s*$/.exec(prevLine.text);\n // Two aligned empty quoted lines in a row\n if (quoted && quoted.index == inner.from) {\n let changes = state.changes([{ from: prevLine.from + quoted.index, to: prevLine.to },\n { from: line.from + inner.from, to: line.to }]);\n return { range: range.map(changes), changes };\n }\n }\n let changes = [];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes);\n let continued = inner.item && inner.item.from < line.from;\n let insert = \"\";\n // If not dedented\n if (!continued || /^[\\s\\d.)\\-+*>]*/.exec(line.text)[0].length >= inner.to) {\n for (let i = 0, e = context.length - 1; i <= e; i++) {\n insert += i == e && !continued ? context[i].marker(doc, 1)\n : context[i].blank(i < e ? context[i + 1].from - insert.length : null);\n }\n }\n let from = pos;\n while (from > line.from && /\\s/.test(line.text.charAt(from - line.from - 1)))\n from--;\n insert = state.lineBreak + insert;\n changes.push({ from, to: pos, insert });\n return { range: EditorSelection.cursor(from + insert.length), changes };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n};\nfunction isMark(node) {\n return node.name == \"QuoteMark\" || node.name == \"ListMark\";\n}\nfunction contextNodeForDelete(tree, pos) {\n let node = tree.resolveInner(pos, -1), scan = pos;\n if (isMark(node)) {\n scan = node.from;\n node = node.parent;\n }\n for (let prev; prev = node.childBefore(scan);) {\n if (isMark(prev)) {\n scan = prev.from;\n }\n else if (prev.name == \"OrderedList\" || prev.name == \"BulletList\") {\n node = prev.lastChild;\n scan = node.to;\n }\n else {\n break;\n }\n }\n return node;\n}\n/**\nThis command will, when invoked in a Markdown context with the\ncursor directly after list or blockquote markup, delete one level\nof markup. When the markup is for a list, it will be replaced by\nspaces on the first invocation (a further invocation will delete\nthe spaces), to make it easy to continue a list.\n\nWhen not after Markdown block markup, this command will return\nfalse, so it is intended to be bound alongside other deletion\ncommands, with a higher precedence than the more generic commands.\n*/\nconst deleteMarkupBackward = ({ state, dispatch }) => {\n let tree = syntaxTree(state);\n let dont = null, changes = state.changeByRange(range => {\n let pos = range.from, { doc } = state;\n if (range.empty && markdownLanguage.isActiveAt(state, range.from)) {\n let line = doc.lineAt(pos);\n let context = getContext(contextNodeForDelete(tree, pos), doc);\n if (context.length) {\n let inner = context[context.length - 1];\n let spaceEnd = inner.to - inner.spaceAfter.length + (inner.spaceAfter ? 1 : 0);\n // Delete extra trailing space after markup\n if (pos - line.from > spaceEnd && !/\\S/.test(line.text.slice(spaceEnd, pos - line.from)))\n return { range: EditorSelection.cursor(line.from + spaceEnd),\n changes: { from: line.from + spaceEnd, to: pos } };\n if (pos - line.from == spaceEnd) {\n let start = line.from + inner.from;\n // Replace a list item marker with blank space\n if (inner.item && inner.node.from < inner.item.from && /\\S/.test(line.text.slice(inner.from, inner.to)))\n return { range, changes: { from: start, to: line.from + inner.to, insert: inner.blank(inner.to - inner.from) } };\n // Delete one level of indentation\n if (start < pos)\n return { range: EditorSelection.cursor(start), changes: { from: start, to: pos } };\n }\n }\n }\n return dont = { range };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"delete\" }));\n return true;\n};\n\n/**\nA small keymap with Markdown-specific bindings. Binds Enter to\n[`insertNewlineContinueMarkup`](https://codemirror.net/6/docs/ref/#lang-markdown.insertNewlineContinueMarkup)\nand Backspace to\n[`deleteMarkupBackward`](https://codemirror.net/6/docs/ref/#lang-markdown.deleteMarkupBackward).\n*/\nconst markdownKeymap = [\n { key: \"Enter\", run: insertNewlineContinueMarkup },\n { key: \"Backspace\", run: deleteMarkupBackward }\n];\nconst htmlNoMatch = /*@__PURE__*/html({ matchClosingTags: false });\n/**\nMarkdown language support.\n*/\nfunction markdown(config = {}) {\n let { codeLanguages, defaultCodeLanguage, addKeymap = true, base: { parser } = commonmarkLanguage } = config;\n if (!(parser instanceof MarkdownParser))\n throw new RangeError(\"Base parser provided to `markdown` should be a Markdown parser\");\n let extensions = config.extensions ? [config.extensions] : [];\n let support = [htmlNoMatch.support], defaultCode;\n if (defaultCodeLanguage instanceof LanguageSupport) {\n support.push(defaultCodeLanguage.support);\n defaultCode = defaultCodeLanguage.language;\n }\n else if (defaultCodeLanguage) {\n defaultCode = defaultCodeLanguage;\n }\n let codeParser = codeLanguages || defaultCode ? getCodeParser(codeLanguages, defaultCode) : undefined;\n extensions.push(parseCode({ codeParser, htmlParser: htmlNoMatch.language.parser }));\n if (addKeymap)\n support.push(Prec.high(keymap.of(markdownKeymap)));\n return new LanguageSupport(mkLang(parser.configure(extensions)), support);\n}\n\nexport { commonmarkLanguage, deleteMarkupBackward, insertNewlineContinueMarkup, markdown, markdownKeymap, markdownLanguage };\n"],"names":["CompositeBlock","type","value","from","hash","end","children","positions","NodeProp","parentHash","child","pos","Tree","nodeSet","last","length","NodeType","Type","LeafBlock","start","content","Line","newPos","skipSpace","text","to","indent","elt","i","goal","result","skipForList","bl","cx","line","size","isOrderedList","isBulletList","isHorizontalRule","DefaultSkipMarkup","space","_cx","ch","skipSpaceBack","isFencedCode","isBlockquote","breaking","count","isSetextUnderline","inList","next","isAtxHeading","EmptyLine","CommentEnd","ProcessingEnd","HTMLBlockStyle","isHTMLBlock","rest","e","getListIndent","indentAfter","indented","addCodeText","marks","DefaultBlockParsers","base","pendingMarks","m","codeStart","fenceEnd","len","infoFrom","infoTo","first","textStart","textEnd","newBase","off","endOfSpace","after","buf","node","trailing","nodeType","LinkReferenceParser","leaf","finish","parseLinkLabel","parseURL","skip","title","parseLinkTitle","titleEnd","lineEnd","SetextHeadingParser","underline","underlineMark","DefaultLeafBlocks","_","DefaultEndLeaf","p","scanLineResult","BlockContext","parser","input","fragments","ranges","FragmentCursor","mark","parse","lines","stop","taken","withoutGaps","gapFrom","gapTo","depth","textOffset","rangeI","nextFrom","handler","eol","block","none","injectMarks","top","tree","injectGaps","inline","TreeElement","Buffer","offset","dont","rangeEnd","movePastNext","upto","inclusive","MarkdownParser","Parser","blockParsers","leafBlockParsers","blockNames","endLeafBlock","skipContextMarkup","inlineParsers","inlineNames","wrappers","t","w","spec","config","resolveConfig","nonEmpty","nodeTypes","styles","s","name","composite","style","id","group","Tag","NodeSet","styleTags","rm","found","findName","InlineContext","outer","token","a","conf","conc","b","wrapA","wrapB","inner","names","elts","Element","startOff","EmphasisUnderscore","EmphasisAsterisk","LinkStart","ImageStart","InlineDelimiter","side","Escapable","Punctuation","DefaultInline","escaped","curSize","url","comment","procInst","before","pBefore","pAfter","sBefore","sAfter","leftFlanking","rightFlanking","canOpen","canClose","part","link","finishLink","j","startPos","endPos","dest","label","requireNonWS","open","close","emp","closeSize","k","element","startIndex","elements","eI","NotLast","lineStart","c","rPos","cur","fragEnd","blockI","prevEnd","prevI","markdownHighlighting","tags","n","leftOverSpace","nextPos","parseCode","codeParser","htmlParser","parseMixed","info","infoNode","StrikethroughDelim","Strikethrough","parseRow","startI","cellStart","cellEnd","esc","parseCell","hasPipe","str","delimiterLine","TableParser","lineText","firstRow","Table","TaskParser","TaskList","GFM","parseSubSuper","Superscript","Subscript","Emoji","match","data","defineLanguageFacet","headingProp","commonmark","foldNodeProp","isHeading","state","indentNodeProp","languageDataProp","findSectionEnd","headerNode","level","heading","headerIndent","foldService","syntaxTree","mkLang","Language","commonmarkLanguage","extended","markdownLanguage","getCodeParser","languages","defaultLanguage","LanguageDescription","ParseContext","Context","spaceBefore","spaceAfter","item","maxWidth","doc","add","number","itemNumber","getContext","nodes","context","renumberList","changes","prev","insertNewlineContinueMarkup","dispatch","range","emptyLine","delTo","insert","EditorSelection","prevLine","quoted","continued","isMark","contextNodeForDelete","scan","deleteMarkupBackward","spaceEnd","markdownKeymap","htmlNoMatch","html","markdown","codeLanguages","defaultCodeLanguage","addKeymap","extensions","support","defaultCode","LanguageSupport","Prec","keymap"],"mappings":"whBAGA,MAAMA,CAAe,CACjB,YAAYC,EAEZC,EAAOC,EAAMC,EAAMC,EAAKC,EAAUC,EAAW,CACzC,KAAK,KAAON,EACZ,KAAK,MAAQC,EACb,KAAK,KAAOC,EACZ,KAAK,KAAOC,EACZ,KAAK,IAAMC,EACX,KAAK,SAAWC,EAChB,KAAK,UAAYC,EACjB,KAAK,SAAW,CAAC,CAACC,EAAS,YAAaJ,CAAI,CAAC,CAChD,CACD,OAAO,OAAOH,EAAMC,EAAOC,EAAMM,EAAYJ,EAAK,CAC9C,IAAID,EAAQK,GAAcA,GAAc,GAAKR,GAAQC,GAAS,GAAM,EACpE,OAAO,IAAIF,EAAeC,EAAMC,EAAOC,EAAMC,EAAMC,EAAK,GAAI,CAAA,CAAE,CACjE,CACD,SAASK,EAAOC,EAAK,CACbD,EAAM,KAAKF,EAAS,WAAW,GAAK,KAAK,OACzCE,EAAQ,IAAIE,EAAKF,EAAM,KAAMA,EAAM,SAAUA,EAAM,UAAWA,EAAM,OAAQ,KAAK,QAAQ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,GAAcuC,EAAeK,CAAW,EAAI,OAC5F,OAAAF,EAAW,KAAK5F,GAAU,CAAE,WAAAC,EAAY,WAAYqF,GAAY,SAAS,MAAQ,CAAA,CAAC,EAC9EK,GACAE,EAAQ,KAAKG,GAAK,KAAKC,GAAO,GAAGZ,EAAc,CAAC,CAAC,EAC9C,IAAIU,GAAgBlD,GAAOlL,EAAO,UAAUiO,CAAU,CAAC,EAAGC,CAAO,CAC5E","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-3e4003db.js b/gradio/templates/cdn/assets/index-3e4003db.js new file mode 100644 index 0000000000000000000000000000000000000000..6a9172626a60dfdccd858fdf7f4e739fc6ae0bed --- /dev/null +++ b/gradio/templates/cdn/assets/index-3e4003db.js @@ -0,0 +1,2 @@ +import{S as ae,e as oe,s as ne,J as K,K as d,p as A,M as X,n as F,A as I,ak as R,N as H,T as Q,B as pe,h as L,G as tt,O as U,Z as Ze,ar as Mt,z as k,u as V,v,y as G,V as Dt,C as zt,a7 as ke,ai as Lt,ao as nt,L as st,U as D,Q as q,Y as Ut,a1 as Bt,F as te,k as M,o as z,x as B,ap as Oe,aw as jt,m as ge,j as $,t as x,a9 as qt,ab as Ft,ac as Ht,ad as Nt,E as Wt,ae as Ot,q as Yt,r as Xt}from"./index-fda37c89.js";import{f as it,B as Pt}from"./Button-e3640f74.js";import{B as Tt}from"./BlockLabel-fe40816b.js";import{I as Ye}from"./Image-23929e47.js";import{C as Jt,i as Qt,U as Vt,W as Gt}from"./StaticImage.svelte_svelte_type_style_lang-b7fdcc8f.js";import{I as Ie}from"./IconButton-9e1f47e2.js";import{C as Zt,M as Xe}from"./ModifyUpload-3f2fd95a.js";import{U as Kt}from"./Upload-34ce8178.js";import{u as $t,S as xt}from"./ShareButton-50e150a5.js";import{E as en}from"./Empty-85ccd7df.js";import{D as tn}from"./Download-6021cc15.js";import"./Blocks-53d5f72d.js";import{U as nn}from"./UploadText-df690b17.js";import{E as ks}from"./Image-20833b5a.js";import"./ModifyUpload.svelte_svelte_type_style_lang-d2acacf0.js";function sn(t){let e,n,s;return{c(){e=K("svg"),n=K("path"),s=K("path"),d(n,"d","M28.828 3.172a4.094 4.094 0 0 0-5.656 0L4.05 22.292A6.954 6.954 0 0 0 2 27.242V30h2.756a6.952 6.952 0 0 0 4.95-2.05L28.828 8.829a3.999 3.999 0 0 0 0-5.657zM10.91 18.26l2.829 2.829l-2.122 2.121l-2.828-2.828zm-2.619 8.276A4.966 4.966 0 0 1 4.756 28H4v-.759a4.967 4.967 0 0 1 1.464-3.535l1.91-1.91l2.829 2.828zM27.415 7.414l-12.261 12.26l-2.829-2.828l12.262-12.26a2.047 2.047 0 0 1 2.828 0a2 2 0 0 1 0 2.828z"),d(n,"fill","currentColor"),d(s,"d","M6.5 15a3.5 3.5 0 0 1-2.475-5.974l3.5-3.5a1.502 1.502 0 0 0 0-2.121a1.537 1.537 0 0 0-2.121 0L3.415 5.394L2 3.98l1.99-1.988a3.585 3.585 0 0 1 4.95 0a3.504 3.504 0 0 1 0 4.949L5.439 10.44a1.502 1.502 0 0 0 0 2.121a1.537 1.537 0 0 0 2.122 0l4.024-4.024L13 9.95l-4.025 4.024A3.475 3.475 0 0 1 6.5 15z"),d(s,"fill","currentColor"),d(e,"width","100%"),d(e,"height","100%"),d(e,"viewBox","0 0 32 32")},m(i,r){A(i,e,r),X(e,n),X(e,s)},p:F,i:F,o:F,d(i){i&&I(e)}}}class ln extends ae{constructor(e){super(),oe(this,e,null,sn,ne,{})}}function rn(t){let e,n,s,i,r,a,o;return{c(){e=K("svg"),n=K("circle"),s=K("circle"),i=K("circle"),r=K("circle"),a=K("circle"),o=K("path"),d(n,"cx","10"),d(n,"cy","12"),d(n,"r","2"),d(n,"fill","currentColor"),d(s,"cx","16"),d(s,"cy","9"),d(s,"r","2"),d(s,"fill","currentColor"),d(i,"cx","22"),d(i,"cy","12"),d(i,"r","2"),d(i,"fill","currentColor"),d(r,"cx","23"),d(r,"cy","18"),d(r,"r","2"),d(r,"fill","currentColor"),d(a,"cx","19"),d(a,"cy","23"),d(a,"r","2"),d(a,"fill","currentColor"),d(o,"fill","currentColor"),d(o,"d","M16.54 2A14 14 0 0 0 2 16a4.82 4.82 0 0 0 6.09 4.65l1.12-.31a3 3 0 0 1 3.79 2.9V27a3 3 0 0 0 3 3a14 14 0 0 0 14-14.54A14.05 14.05 0 0 0 16.54 2Zm8.11 22.31A11.93 11.93 0 0 1 16 28a1 1 0 0 1-1-1v-3.76a5 5 0 0 0-5-5a5.07 5.07 0 0 0-1.33.18l-1.12.31A2.82 2.82 0 0 1 4 16A12 12 0 0 1 16.47 4A12.18 12.18 0 0 1 28 15.53a11.89 11.89 0 0 1-3.35 8.79Z"),d(e,"width","100%"),d(e,"height","100%"),d(e,"viewBox","0 0 32 32")},m(l,u){A(l,e,u),X(e,n),X(e,s),X(e,i),X(e,r),X(e,a),X(e,o)},p:F,i:F,o:F,d(l){l&&I(e)}}}class an extends ae{constructor(e){super(),oe(this,e,null,rn,ne,{})}}function on(t){let e,n;return{c(){e=K("svg"),n=K("path"),d(n,"fill","currentColor"),d(n,"d","M7 27h23v2H7zm20.38-16.49l-7.93-7.92a2 2 0 0 0-2.83 0l-14 14a2 2 0 0 0 0 2.83L7.13 24h9.59l10.66-10.66a2 2 0 0 0 0-2.83zM15.89 22H8l-4-4l6.31-6.31l7.93 7.92zm3.76-3.76l-7.92-7.93L18 4l8 7.93z"),d(e,"xmlns","http://www.w3.org/2000/svg"),d(e,"width","100%"),d(e,"height","100%"),d(e,"viewBox","0 0 32 32")},m(s,i){A(s,e,i),X(e,n)},p:F,i:F,o:F,d(s){s&&I(e)}}}class un extends ae{constructor(e){super(),oe(this,e,null,on,ne,{})}}function fn(t){let e,n;return{c(){e=K("svg"),n=K("path"),d(n,"d","M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"),d(e,"xmlns","http://www.w3.org/2000/svg"),d(e,"width","100%"),d(e,"height","100%"),d(e,"viewBox","0 0 24 24"),d(e,"fill","none"),d(e,"stroke","currentColor"),d(e,"stroke-width","1.5"),d(e,"stroke-linecap","round"),d(e,"stroke-linejoin","round"),d(e,"class","feather feather-edit-2")},m(s,i){A(s,e,i),X(e,n)},p:F,i:F,o:F,d(s){s&&I(e)}}}let lt=class extends ae{constructor(e){super(),oe(this,e,null,fn,ne,{})}};const St=t=>{let e=t.currentTarget;const n=e.getBoundingClientRect(),s=e.naturalWidth/n.width,i=e.naturalHeight/n.height;if(s>i){n.width;const o=e.naturalHeight/s,l=(n.height-o)/2;var r=Math.round((t.clientX-n.left)*s),a=Math.round((t.clientY-n.top-l)*s)}else{const o=e.naturalWidth/i;n.height;const l=(n.width-o)/2;var r=Math.round((t.clientX-n.left-l)*i),a=Math.round((t.clientY-n.top)*i)}return r<0||r>=e.naturalWidth||a<0||a>=e.naturalHeight?null:[r,a]};function _n(t){let e,n;return{c(){e=H("img"),Q(e.src,n=t[0])||d(e,"src",n),d(e,"alt","")},m(s,i){A(s,e,i),t[4](e)},p(s,[i]){i&1&&!Q(e.src,n=s[0])&&d(e,"src",n)},i:F,o:F,d(s){s&&I(e),t[4](null)}}}function hn(t,e,n){let{image:s}=e,i;const r=pe();let a;function o(){a.destroy()}function l(){a&&o(),a=new Jt(i,{autoCropArea:1,cropend(){const c=a.getCroppedCanvas().toDataURL();r("crop",c)}}),r("crop",s)}function u(c){L[c?"unshift":"push"](()=>{i=c,n(1,i)})}return t.$$set=c=>{"image"in c&&n(0,s=c.image)},[s,i,o,l,u]}class Et extends ae{constructor(e){super(),oe(this,e,hn,_n,ne,{image:0,destroy:2,create:3})}get image(){return this.$$.ctx[0]}set image(e){this.$$set({image:e}),R()}get destroy(){return this.$$.ctx[2]}get create(){return this.$$.ctx[3]}}class rt{constructor(e,n){this.x=e,this.y=n}}class at extends rt{update(e){this.x=e.x,this.y=e.y}moveByAngle(e,n){const s=e+Math.PI/2;this.x=this.x+Math.sin(s)*n,this.y=this.y-Math.cos(s)*n}equalsTo(e){return this.x===e.x&&this.y===e.y}getDifferenceTo(e){return new rt(this.x-e.x,this.y-e.y)}getDistanceTo(e){const n=this.getDifferenceTo(e);return Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}getAngleTo(e){const n=this.getDifferenceTo(e);return Math.atan2(n.y,n.x)}toObject(){return{x:this.x,y:this.y}}}const cn=30;class mn{constructor({radius:e=cn,enabled:n=!0,initialPoint:s={x:0,y:0}}={}){this.radius=e,this._isEnabled=n,this.pointer=new at(s.x,s.y),this.brush=new at(s.x,s.y),this.angle=0,this.distance=0,this._hasMoved=!1}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}isEnabled(){return this._isEnabled}setRadius(e){this.radius=e}getRadius(){return this.radius}getBrushCoordinates(){return this.brush.toObject()}getPointerCoordinates(){return this.pointer.toObject()}getBrush(){return this.brush}getPointer(){return this.pointer}getAngle(){return this.angle}getDistance(){return this.distance}brushHasMoved(){return this._hasMoved}update(e,{both:n=!1}={}){return this._hasMoved=!1,this.pointer.equalsTo(e)&&!n?!1:(this.pointer.update(e),n?(this._hasMoved=!0,this.brush.update(e),!0):(this._isEnabled?(this.distance=this.pointer.getDistanceTo(this.brush),this.angle=this.pointer.getAngleTo(this.brush),this.distance>this.radius&&(this.brush.moveByAngle(this.angle,this.distance-this.radius),this._hasMoved=!0)):(this.distance=0,this.angle=0,this.brush.update(e),this._hasMoved=!0),!0))}}function ot(t,e,n){const s=t.slice();return s[61]=e[n].name,s[62]=e[n].zIndex,s[63]=e[n].opacity,s[64]=e,s[65]=n,s}function ut(t){let e,n,s;return{c(){e=H("div"),e.textContent="Start drawing",d(e,"class","start-prompt svelte-yigbas")},m(i,r){A(i,e,r),s=!0},i(i){s||(i&&Ze(()=>{s&&(n||(n=nt(e,it,{duration:50},!0)),n.run(1))}),s=!0)},o(i){i&&(n||(n=nt(e,it,{duration:50},!1)),n.run(0)),s=!1},d(i){i&&I(e),i&&n&&n.end()}}}function ft(t){let e,n=t[61],s,i;const r=()=>t[31](e,n),a=()=>t[31](null,n);return{c(){e=H("canvas"),d(e,"key",t[61]),st(e,"z-index",t[62]),d(e,"class","svelte-yigbas"),D(e,"lr",t[5]),D(e,"tb",!t[5]),st(e,"opacity",t[63])},m(o,l){A(o,e,l),r(),s||(i=[q(e,"mousedown",t[61]==="interface"?t[7]:void 0),q(e,"mousemove",t[61]==="interface"?t[8]:void 0),q(e,"mouseup",t[61]==="interface"?t[9]:void 0),q(e,"mouseout",t[61]==="interface"?t[9]:void 0),q(e,"blur",t[61]==="interface"?t[9]:void 0),q(e,"touchstart",t[61]==="interface"?t[7]:void 0),q(e,"touchmove",t[61]==="interface"?t[8]:void 0),q(e,"touchend",t[61]==="interface"?t[9]:void 0),q(e,"touchcancel",t[61]==="interface"?t[9]:void 0),q(e,"click",Ut(t[30]))],s=!0)},p(o,l){t=o,n!==t[61]&&(a(),n=t[61],r()),l[0]&32&&D(e,"lr",t[5]),l[0]&32&&D(e,"tb",!t[5])},d(o){o&&I(e),a(),s=!1,Bt(i)}}}function gn(t){let e,n,s,i=t[4]===0&&ut(),r=tt(t[6]),a=[];for(let o=0;ot[33].call(e))},m(o,l){A(o,e,l),i&&i.m(e,null),X(e,n);for(let u=0;u{i=null}),G()),l[0]&993){r=tt(o[6]);let u;for(u=0;uO?(m=p[0],C=p[0]/O,j=(p[1]-C)/2):(h=0,j=0,m=p[0],C=p[1]),y.temp.drawImage(a,h,j,m,C)}zt(async()=>{Object.keys(E).forEach(m=>{n(27,y[m]=E[m].getContext("2d"),y)}),await ke(),a&&(a.addEventListener("load",m=>{b==="webcam"?(y.temp.save(),y.temp.translate(f,0),y.temp.scale(-1,1),y.temp.drawImage(a,0,0),y.temp.restore()):ue(),y.drawing.drawImage(E.temp,0,0,f,_),ce()}),setTimeout(()=>{b==="webcam"?(y.temp.save(),y.temp.translate(f,0),y.temp.scale(-1,1),y.temp.drawImage(a,0,0),y.temp.restore()):ue(),y.drawing.drawImage(E.temp,0,0,f,_),be({lines:Y.slice()}),ce()},100)),n(29,W=new mn({radius:u*.05,enabled:!0,initialPoint:{x:f/2,y:_/2}})),ie=new Qt((m,C,...T)=>{Re()}),ie.observe(se),Be(),n(25,S=!0),requestAnimationFrame(()=>{me(),requestAnimationFrame(()=>{we()})})});function me(){const m=f/2,C=_/2;W.update({x:m,y:C},{both:!0}),W.update({x:m,y:C},{both:!1}),Z=!0,_e=!0}Lt(()=>{n(25,S=!1),ie.unobserve(se)});function re(m){Fe(),a&&(b==="webcam"?(y.temp.save(),y.temp.translate(f,0),y.temp.scale(-1,1),y.temp.drawImage(a,0,0),y.temp.restore()):ue(),(!Y||!Y.length)&&y.drawing.drawImage(E.temp,0,0,f,_)),be({lines:m}),n(4,ee=m.length),n(28,Y=m),y.drawing.drawImage(E.temp,0,0,f,_),Y.length==0&&i("clear")}function ye(){re([]),ce()}function Ce(){const m=Y.slice(0,-1);re(m),ce()}let be=({lines:m})=>{m.forEach(C=>{const{points:T,brush_color:O,brush_radius:h}=C;Ue({points:T,brush_color:O,brush_radius:h,mask:o==="mask"})}),qe(),o==="mask"&&je()},Me=m=>{m.preventDefault(),le=!0;const{x:C,y:T}=De(m);m.touches&&m.touches.length>0&&W.update({x:C,y:T},{both:!0}),Le(C,T),n(4,ee+=1)},ve=m=>{m.preventDefault();const{x:C,y:T}=De(m);Le(C,T)},ze=m=>{m.preventDefault(),ve(m),he=!1,le=!1,qe(),o==="mask"&&je()},w=0,Te=0,Se=0,Ee=!1,Re=async()=>{if(p&&se){const T=se?.getBoundingClientRect(),O=p[0]/p[1],h=T.width/T.height;n(5,Ee=O{Te=_,w=f,Se=g},10),await ke(),we()},Ae=async(m,C,T,O=!0)=>{if(!S)return;await ke();const h=window.devicePixelRatio||1;m.width=C.width*(O?h:1),m.height=C.height*(O?h:1);const j=m.getContext("2d");O&&j.scale(h,h),m.style.width=`${T.width}px`,m.style.height=`${T.height}px`},De=m=>{const C=E.interface.getBoundingClientRect();let T=m.clientX,O=m.clientY;return m.changedTouches&&m.changedTouches.length>0&&(T=m.changedTouches[0].clientX,O=m.changedTouches[0].clientY),{x:(T-C.left)/C.width*f,y:(O-C.top)/C.height*_}},Le=(m,C)=>{W.update({x:m,y:C});const T=!W.isEnabled();(le&&!he||T&&le)&&(he=!0,J.push(W.brush.toObject())),he&&(J.push(W.brush.toObject()),Ue({points:J,brush_color:l,brush_radius:u,mask:o==="mask"})),Z=!0},Ue=({points:m,brush_color:C,brush_radius:T,mask:O})=>{if(!m||m.length<2)return;let h=O?y.mask:y.temp;h.lineJoin="round",h.lineCap="round",h.strokeStyle=C,h.lineWidth=T;let j=m[0],Ne=m[1];h.moveTo(Ne.x,Ne.y),h.beginPath();for(var We=1,Rt=m.length;We{J.length<1||(J.length=0,ce())},qe=()=>{J.length<1||(Y.push({points:J.slice(),brush_color:l,brush_radius:u}),o!=="mask"&&(J.length=0),y.drawing.drawImage(E.temp,0,0,f,_),ce())},ce=()=>{const m=He();i("change",m)};function we(){return n(28,Y=[]),Fe(),n(4,ee=0),!0}function Fe(){_e=!0,y.temp.clearRect(0,0,f,_),n(27,y.temp.fillStyle=o==="mask"?"transparent":"#FFFFFF",y),y.temp.fillRect(0,0,f,_),o==="mask"&&y.mask.clearRect(0,0,E.mask.width,E.mask.height)}let Be=({once:m=!1}={})=>{if(Z||_e){const C=W.getPointerCoordinates(),T=W.getBrushCoordinates();Pe(y.interface,C,T),Z=!1,_e=!1}m||window.requestAnimationFrame(()=>{Be()})},Pe=(m,C,T)=>{m.clearRect(0,0,f,_),m.beginPath(),m.fillStyle=l,m.arc(T.x,T.y,u/2,0,Math.PI*2,!0),m.fill(),m.beginPath(),m.fillStyle=dn,m.arc(T.x,T.y,s,0,Math.PI*2,!0),m.fill()};function He(){return o==="mask"?E.mask.toDataURL("image/png"):E.drawing.toDataURL("image/jpg")}function Je(m){te.call(this,t,m)}function Qe(m,C){L[m?"unshift":"push"](()=>{E[C]=m,n(0,E)})}function Ve(m){L[m?"unshift":"push"](()=>{se=m,n(3,se)})}function Ge(){fe=this.offsetWidth,N=this.offsetHeight,n(1,fe),n(2,N)}return t.$$set=m=>{"value"in m&&n(13,r=m.value),"value_img"in m&&n(14,a=m.value_img),"mode"in m&&n(15,o=m.mode),"brush_color"in m&&n(16,l=m.brush_color),"brush_radius"in m&&n(10,u=m.brush_radius),"mask_opacity"in m&&n(17,c=m.mask_opacity),"source"in m&&n(18,b=m.source),"width"in m&&n(11,f=m.width),"height"in m&&n(12,_=m.height),"container_height"in m&&n(19,g=m.container_height),"shape"in m&&n(20,p=m.shape)},t.$$.update=()=>{t.$$.dirty[0]&1054720&&p&&(f||_)&&(n(11,f=p[0]),n(12,_=p[1])),t.$$.dirty[0]&33562624&&S&&!r&&we(),t.$$.dirty[0]&503601153&&S&&a!==P&&(n(26,P=a),we(),setTimeout(()=>{b==="webcam"?(y.temp.save(),y.temp.translate(f,0),y.temp.scale(-1,1),y.temp.drawImage(a,0,0),y.temp.restore()):ue(),y.drawing.drawImage(E.temp,0,0,f,_),be({lines:Y.slice()}),ce()},50)),t.$$.dirty[0]&536871936&&W&&(me(),W.setRadius(u*.05)),t.$$.dirty[0]&6144&&(f||_)&&Re(),t.$$.dirty[0]&1024&&(s=u*.075)},[E,fe,N,se,ee,Ee,de,Me,ve,ze,u,f,_,r,a,o,l,c,b,g,p,ye,Ce,we,He,S,P,y,Y,W,Je,Qe,Ve,Ge]}class Ke extends ae{constructor(e){super(),oe(this,e,wn,gn,ne,{value:13,value_img:14,mode:15,brush_color:16,brush_radius:10,mask_opacity:17,source:18,width:11,height:12,container_height:19,shape:20,clear_mask:21,undo:22,clear:23,get_image_data:24},null,[-1,-1,-1])}get clear_mask(){return this.$$.ctx[21]}get undo(){return this.$$.ctx[22]}get clear(){return this.$$.ctx[23]}get get_image_data(){return this.$$.ctx[24]}}function _t(t){let e,n;return e=new Ie({props:{Icon:un,label:"Clear"}}),e.$on("click",t[3]),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},p:F,i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function kn(t){let e,n,s,i,r,a;n=new Ie({props:{Icon:Vt,label:"Undo"}}),n.$on("click",t[2]);let o=t[0]&&_t(t);return r=new Ie({props:{Icon:Zt,label:"Remove Image"}}),r.$on("click",t[4]),{c(){e=H("div"),M(n.$$.fragment),s=U(),o&&o.c(),i=U(),M(r.$$.fragment),d(e,"class","svelte-s6ybro")},m(l,u){A(l,e,u),z(n,e,null),X(e,s),o&&o.m(e,null),X(e,i),z(r,e,null),a=!0},p(l,[u]){l[0]?o?(o.p(l,u),u&1&&k(o,1)):(o=_t(l),o.c(),k(o,1),o.m(e,i)):o&&(V(),v(o,1,1,()=>{o=null}),G())},i(l){a||(k(n.$$.fragment,l),k(o),k(r.$$.fragment,l),a=!0)},o(l){v(n.$$.fragment,l),v(o),v(r.$$.fragment,l),a=!1},d(l){l&&I(e),B(n),o&&o.d(),B(r)}}}function pn(t,e,n){const s=pe();let{show_eraser:i=!1}=e;const r=()=>s("undo"),a=l=>{s("clear_mask"),l.stopPropagation()},o=l=>{s("remove_image"),l.stopPropagation()};return t.$$set=l=>{"show_eraser"in l&&n(0,i=l.show_eraser)},[i,s,r,a,o]}class $e extends ae{constructor(e){super(),oe(this,e,pn,kn,ne,{show_eraser:0})}}function ht(t){let e,n,s,i,r;return{c(){e=H("input"),d(e,"aria-label","Brush radius"),d(e,"type","range"),d(e,"min",n=.5*(t[2]/t[6])),d(e,"max",s=75*(t[2]/t[6])),d(e,"class","svelte-p4aq0j")},m(a,o){A(a,e,o),Oe(e,t[0]),i||(r=[q(e,"change",t[10]),q(e,"input",t[10])],i=!0)},p(a,o){o&68&&n!==(n=.5*(a[2]/a[6]))&&d(e,"min",n),o&68&&s!==(s=75*(a[2]/a[6]))&&d(e,"max",s),o&1&&Oe(e,a[0])},d(a){a&&I(e),i=!1,Bt(r)}}}function ct(t){let e,n,s,i;n=new Ie({props:{Icon:an,label:"Select brush color"}}),n.$on("click",t[11]);let r=t[5]&&mt(t);return{c(){e=H("span"),M(n.$$.fragment),s=U(),r&&r.c(),d(e,"class","col svelte-p4aq0j")},m(a,o){A(a,e,o),z(n,e,null),X(e,s),r&&r.m(e,null),i=!0},p(a,o){a[5]?r?r.p(a,o):(r=mt(a),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(a){i||(k(n.$$.fragment,a),i=!0)},o(a){v(n.$$.fragment,a),i=!1},d(a){a&&I(e),B(n),r&&r.d()}}}function mt(t){let e,n,s;return{c(){e=H("input"),d(e,"aria-label","Brush color"),d(e,"type","color"),d(e,"class","svelte-p4aq0j")},m(i,r){A(i,e,r),Oe(e,t[1]),n||(s=q(e,"input",t[12]),n=!0)},p(i,r){r&2&&Oe(e,i[1])},d(i){i&&I(e),n=!1,s()}}}function vn(t){let e,n,s,i,r,a;s=new Ie({props:{Icon:ln,label:"Use brush"}}),s.$on("click",t[9]);let o=t[4]&&ht(t),l=t[3]!=="mask"&&ct(t);return{c(){e=H("div"),n=H("span"),M(s.$$.fragment),i=U(),o&&o.c(),r=U(),l&&l.c(),d(n,"class","brush svelte-p4aq0j"),d(e,"class","wrap svelte-p4aq0j")},m(u,c){A(u,e,c),X(e,n),z(s,n,null),X(n,i),o&&o.m(n,null),X(e,r),l&&l.m(e,null),a=!0},p(u,[c]){u[4]?o?o.p(u,c):(o=ht(u),o.c(),o.m(n,null)):o&&(o.d(1),o=null),u[3]!=="mask"?l?(l.p(u,c),c&8&&k(l,1)):(l=ct(u),l.c(),k(l,1),l.m(e,null)):l&&(V(),v(l,1,1,()=>{l=null}),G())},i(u){a||(k(s.$$.fragment,u),k(l),a=!0)},o(u){v(s.$$.fragment,u),v(l),a=!1},d(u){u&&I(e),B(s),o&&o.d(),l&&l.d()}}}function An(t,e,n){let s;pe();let i=!1,r=!1,{brush_radius:a=20}=e,{brush_color:o="#000"}=e,{container_height:l}=e,{img_width:u}=e,{img_height:c}=e,{mode:b="other"}=e;const f=()=>n(4,i=!i);function _(){a=jt(this.value),n(0,a)}const g=()=>n(5,r=!r);function p(){o=this.value,n(1,o)}return t.$$set=S=>{"brush_radius"in S&&n(0,a=S.brush_radius),"brush_color"in S&&n(1,o=S.brush_color),"container_height"in S&&n(7,l=S.container_height),"img_width"in S&&n(2,u=S.img_width),"img_height"in S&&n(8,c=S.img_height),"mode"in S&&n(3,b=S.mode)},t.$$.update=()=>{t.$$.dirty&388&&n(6,s=l*(u/c))},[a,o,u,b,i,r,s,l,c,f,_,g,p]}class xe extends ae{constructor(e){super(),oe(this,e,An,vn,ne,{brush_radius:0,brush_color:1,container_height:7,img_width:2,img_height:8,mode:3})}}function In(t){let e,n,s,i;return{c(){e=H("img"),Q(e.src,n=t[0].image||t[0])||d(e,"src",n),d(e,"alt",""),d(e,"class","svelte-p3y7hu"),D(e,"webcam",t[6]==="webcam"&&t[10]),D(e,"selectable",t[12])},m(r,a){A(r,e,a),s||(i=q(e,"click",t[30]),s=!0)},p(r,a){a[0]&1&&!Q(e.src,n=r[0].image||r[0])&&d(e,"src",n),a[0]&1088&&D(e,"webcam",r[6]==="webcam"&&r[10]),a[0]&4096&&D(e,"selectable",r[12])},i:F,o:F,d(r){r&&I(e),s=!1,i()}}}function yn(t){let e=t[23],n,s,i,r=gt(t),a=t[17]>0&&dt(t);return{c(){r.c(),n=U(),a&&a.c(),s=ge()},m(o,l){r.m(o,l),A(o,n,l),a&&a.m(o,l),A(o,s,l),i=!0},p(o,l){l[0]&8388608&&ne(e,e=o[23])?(r.d(1),r=gt(o),r.c(),r.m(n.parentNode,n)):r.p(o,l),o[17]>0?a?(a.p(o,l),l[0]&131072&&k(a,1)):(a=dt(o),a.c(),k(a,1),a.m(s.parentNode,s)):a&&(V(),v(a,1,1,()=>{a=null}),G())},i(o){i||(k(a),i=!0)},o(o){v(a),i=!1},d(o){o&&(I(n),I(s)),r.d(o),a&&a.d(o)}}}function Cn(t){let e,n,s,i,r,a,o;return e=new Xe({props:{editable:!0}}),e.$on("edit",t[53]),e.$on("clear",t[25]),{c(){M(e.$$.fragment),n=U(),s=H("img"),Q(s.src,i=t[0])||d(s,"src",i),d(s,"alt",""),d(s,"class","svelte-p3y7hu"),D(s,"selectable",t[12]),D(s,"webcam",t[6]==="webcam"&&t[10])},m(l,u){z(e,l,u),A(l,n,u),A(l,s,u),r=!0,a||(o=q(s,"click",t[30]),a=!0)},p(l,u){(!r||u[0]&1&&!Q(s.src,i=l[0]))&&d(s,"src",i),(!r||u[0]&4096)&&D(s,"selectable",l[12]),(!r||u[0]&1088)&&D(s,"webcam",l[6]==="webcam"&&l[10])},i(l){r||(k(e.$$.fragment,l),r=!0)},o(l){v(e.$$.fragment,l),r=!1},d(l){l&&(I(n),I(s)),B(e,l),a=!1,o()}}}function Mn(t){let e,n,s,i,r={image:t[0]};return e=new Et({props:r}),t[51](e),e.$on("crop",t[26]),s=new Xe({}),s.$on("clear",t[52]),{c(){M(e.$$.fragment),n=U(),M(s.$$.fragment)},m(a,o){z(e,a,o),A(a,n,o),z(s,a,o),i=!0},p(a,o){const l={};o[0]&1&&(l.image=a[0]),e.$set(l)},i(a){i||(k(e.$$.fragment,a),k(s.$$.fragment,a),i=!0)},o(a){v(e.$$.fragment,a),v(s.$$.fragment,a),i=!1},d(a){a&&I(n),t[51](null),B(e,a),B(s,a)}}}function zn(t){let e,n,s=t[6]==="webcam"&&!t[23]&&wt(t);return{c(){s&&s.c(),e=ge()},m(i,r){s&&s.m(i,r),A(i,e,r),n=!0},p(i,r){i[6]==="webcam"&&!i[23]?s?(s.p(i,r),r[0]&8388672&&k(s,1)):(s=wt(i),s.c(),k(s,1),s.m(e.parentNode,e)):s&&(V(),v(s,1,1,()=>{s=null}),G())},i(i){n||(k(s),n=!0)},o(i){v(s),n=!1},d(i){i&&I(e),s&&s.d(i)}}}function Bn(t){let e,n,s,i,r,a,o;e=new $e({}),e.$on("undo",t[43]),e.$on("remove_image",t[28]);let l=t[1]==="color-sketch"&&kt(t);function u(f){t[46](f)}function c(f){t[47](f)}let b={value:t[0],mode:t[19],width:t[17]||t[22],height:t[16]||t[21],container_height:t[18]||t[21],shape:t[7]};return t[2]!==void 0&&(b.brush_radius=t[2]),t[3]!==void 0&&(b.brush_color=t[3]),i=new Ke({props:b}),L.push(()=>$(i,"brush_radius",u)),L.push(()=>$(i,"brush_color",c)),t[48](i),i.$on("change",t[26]),i.$on("clear",t[28]),{c(){M(e.$$.fragment),n=U(),l&&l.c(),s=U(),M(i.$$.fragment)},m(f,_){z(e,f,_),A(f,n,_),l&&l.m(f,_),A(f,s,_),z(i,f,_),o=!0},p(f,_){f[1]==="color-sketch"?l?(l.p(f,_),_[0]&2&&k(l,1)):(l=kt(f),l.c(),k(l,1),l.m(s.parentNode,s)):l&&(V(),v(l,1,1,()=>{l=null}),G());const g={};_[0]&1&&(g.value=f[0]),_[0]&524288&&(g.mode=f[19]),_[0]&4325376&&(g.width=f[17]||f[22]),_[0]&2162688&&(g.height=f[16]||f[21]),_[0]&2359296&&(g.container_height=f[18]||f[21]),_[0]&128&&(g.shape=f[7]),!r&&_[0]&4&&(r=!0,g.brush_radius=f[2],x(()=>r=!1)),!a&&_[0]&8&&(a=!0,g.brush_color=f[3],x(()=>a=!1)),i.$set(g)},i(f){o||(k(e.$$.fragment,f),k(l),k(i.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(l),v(i.$$.fragment,f),o=!1},d(f){f&&(I(n),I(s)),B(e,f),l&&l.d(f),t[48](null),B(i,f)}}}function Tn(t){let e,n,s;function i(a){t[42](a)}let r={filetype:"image/*",include_file_metadata:!1,disable_click:!!t[0],$$slots:{default:[Un]},$$scope:{ctx:t}};return t[14]!==void 0&&(r.dragging=t[14]),e=new Kt({props:r}),L.push(()=>$(e,"dragging",i)),e.$on("load",t[24]),{c(){M(e.$$.fragment)},m(a,o){z(e,a,o),s=!0},p(a,o){const l={};o[0]&1&&(l.disable_click=!!a[0]),o[0]&16760271|o[2]&1&&(l.$$scope={dirty:o,ctx:a}),!n&&o[0]&16384&&(n=!0,l.dragging=a[14],x(()=>n=!1)),e.$set(l)},i(a){s||(k(e.$$.fragment,a),s=!0)},o(a){v(e.$$.fragment,a),s=!1},d(a){B(e,a)}}}function gt(t){let e,n,s,i;return{c(){e=H("img"),d(e,"class","absolute-img svelte-p3y7hu"),Q(e.src,n=t[23]||t[0]?.image||t[0])||d(e,"src",n),d(e,"alt",""),D(e,"webcam",t[6]==="webcam"&&t[10])},m(r,a){A(r,e,a),t[54](e),s||(i=q(e,"load",t[27]),s=!0)},p(r,a){a[0]&8388609&&!Q(e.src,n=r[23]||r[0]?.image||r[0])&&d(e,"src",n),a[0]&1088&&D(e,"webcam",r[6]==="webcam"&&r[10])},d(r){r&&I(e),t[54](null),s=!1,i()}}}function dt(t){let e,n,s,i,r,a,o,l;function u(_){t[56](_)}function c(_){t[57](_)}let b={value:t[0],mode:t[19],width:t[17]||t[22],height:t[16]||t[21],container_height:t[18]||t[21],value_img:t[20],source:t[6]};t[2]!==void 0&&(b.brush_radius=t[2]),t[3]!==void 0&&(b.brush_color=t[3]),e=new Ke({props:b}),t[55](e),L.push(()=>$(e,"brush_radius",u)),L.push(()=>$(e,"brush_color",c)),e.$on("change",t[26]),r=new $e({}),r.$on("undo",t[58]),r.$on("remove_image",t[28]);let f=(t[1]==="color-sketch"||t[1]==="sketch")&&bt(t);return{c(){M(e.$$.fragment),i=U(),M(r.$$.fragment),a=U(),f&&f.c(),o=ge()},m(_,g){z(e,_,g),A(_,i,g),z(r,_,g),A(_,a,g),f&&f.m(_,g),A(_,o,g),l=!0},p(_,g){const p={};g[0]&1&&(p.value=_[0]),g[0]&524288&&(p.mode=_[19]),g[0]&4325376&&(p.width=_[17]||_[22]),g[0]&2162688&&(p.height=_[16]||_[21]),g[0]&2359296&&(p.container_height=_[18]||_[21]),g[0]&1048576&&(p.value_img=_[20]),g[0]&64&&(p.source=_[6]),!n&&g[0]&4&&(n=!0,p.brush_radius=_[2],x(()=>n=!1)),!s&&g[0]&8&&(s=!0,p.brush_color=_[3],x(()=>s=!1)),e.$set(p),_[1]==="color-sketch"||_[1]==="sketch"?f?(f.p(_,g),g[0]&2&&k(f,1)):(f=bt(_),f.c(),k(f,1),f.m(o.parentNode,o)):f&&(V(),v(f,1,1,()=>{f=null}),G())},i(_){l||(k(e.$$.fragment,_),k(r.$$.fragment,_),k(f),l=!0)},o(_){v(e.$$.fragment,_),v(r.$$.fragment,_),v(f),l=!1},d(_){_&&(I(i),I(a),I(o)),t[55](null),B(e,_),B(r,_),f&&f.d(_)}}}function bt(t){let e,n,s,i;function r(l){t[59](l)}function a(l){t[60](l)}let o={container_height:t[18]||t[21],img_width:t[17]||t[22],img_height:t[16]||t[21],mode:t[19]};return t[2]!==void 0&&(o.brush_radius=t[2]),t[3]!==void 0&&(o.brush_color=t[3]),e=new xe({props:o}),L.push(()=>$(e,"brush_radius",r)),L.push(()=>$(e,"brush_color",a)),{c(){M(e.$$.fragment)},m(l,u){z(e,l,u),i=!0},p(l,u){const c={};u[0]&2359296&&(c.container_height=l[18]||l[21]),u[0]&4325376&&(c.img_width=l[17]||l[22]),u[0]&2162688&&(c.img_height=l[16]||l[21]),u[0]&524288&&(c.mode=l[19]),!n&&u[0]&4&&(n=!0,c.brush_radius=l[2],x(()=>n=!1)),!s&&u[0]&8&&(s=!0,c.brush_color=l[3],x(()=>s=!1)),e.$set(c)},i(l){i||(k(e.$$.fragment,l),i=!0)},o(l){v(e.$$.fragment,l),i=!1},d(l){B(e,l)}}}function wt(t){let e,n;return e=new Gt({props:{streaming:t[8],pending:t[9],mirror_webcam:t[10]}}),e.$on("capture",t[49]),e.$on("stream",t[26]),e.$on("error",t[50]),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},p(s,i){const r={};i[0]&256&&(r.streaming=s[8]),i[0]&512&&(r.pending=s[9]),i[0]&1024&&(r.mirror_webcam=s[10]),e.$set(r)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function kt(t){let e,n,s,i;function r(l){t[44](l)}function a(l){t[45](l)}let o={container_height:t[18]||t[21],img_width:t[17]||t[22],img_height:t[16]||t[21]};return t[2]!==void 0&&(o.brush_radius=t[2]),t[3]!==void 0&&(o.brush_color=t[3]),e=new xe({props:o}),L.push(()=>$(e,"brush_radius",r)),L.push(()=>$(e,"brush_color",a)),{c(){M(e.$$.fragment)},m(l,u){z(e,l,u),i=!0},p(l,u){const c={};u[0]&2359296&&(c.container_height=l[18]||l[21]),u[0]&4325376&&(c.img_width=l[17]||l[22]),u[0]&2162688&&(c.img_height=l[16]||l[21]),!n&&u[0]&4&&(n=!0,c.brush_radius=l[2],x(()=>n=!1)),!s&&u[0]&8&&(s=!0,c.brush_color=l[3],x(()=>s=!1)),e.$set(c)},i(l){i||(k(e.$$.fragment,l),i=!0)},o(l){v(e.$$.fragment,l),i=!1},d(l){B(e,l)}}}function Sn(t){let e,n,s,i;return{c(){e=H("img"),Q(e.src,n=t[0].image||t[0])||d(e,"src",n),d(e,"alt","hello"),d(e,"class","svelte-p3y7hu"),D(e,"webcam",t[6]==="webcam"&&t[10]),D(e,"selectable",t[12])},m(r,a){A(r,e,a),s||(i=q(e,"click",t[30]),s=!0)},p(r,a){a[0]&1&&!Q(e.src,n=r[0].image||r[0])&&d(e,"src",n),a[0]&1088&&D(e,"webcam",r[6]==="webcam"&&r[10]),a[0]&4096&&D(e,"selectable",r[12])},i:F,o:F,d(r){r&&I(e),s=!1,i()}}}function En(t){let e=t[23],n,s,i,r=pt(t),a=t[17]>0&&vt(t);return{c(){r.c(),n=U(),a&&a.c(),s=ge()},m(o,l){r.m(o,l),A(o,n,l),a&&a.m(o,l),A(o,s,l),i=!0},p(o,l){l[0]&8388608&&ne(e,e=o[23])?(r.d(1),r=pt(o),r.c(),r.m(n.parentNode,n)):r.p(o,l),o[17]>0?a?(a.p(o,l),l[0]&131072&&k(a,1)):(a=vt(o),a.c(),k(a,1),a.m(s.parentNode,s)):a&&(V(),v(a,1,1,()=>{a=null}),G())},i(o){i||(k(a),i=!0)},o(o){v(a),i=!1},d(o){o&&(I(n),I(s)),r.d(o),a&&a.d(o)}}}function Rn(t){let e,n,s,i,r,a,o;return e=new Xe({props:{editable:!0}}),e.$on("edit",t[34]),e.$on("clear",t[25]),{c(){M(e.$$.fragment),n=U(),s=H("img"),Q(s.src,i=t[0])||d(s,"src",i),d(s,"alt",""),d(s,"class","svelte-p3y7hu"),D(s,"scale-x-[-1]",t[6]==="webcam"&&t[10]),D(s,"selectable",t[12])},m(l,u){z(e,l,u),A(l,n,u),A(l,s,u),r=!0,a||(o=q(s,"click",t[30]),a=!0)},p(l,u){(!r||u[0]&1&&!Q(s.src,i=l[0]))&&d(s,"src",i),(!r||u[0]&1088)&&D(s,"scale-x-[-1]",l[6]==="webcam"&&l[10]),(!r||u[0]&4096)&&D(s,"selectable",l[12])},i(l){r||(k(e.$$.fragment,l),r=!0)},o(l){v(e.$$.fragment,l),r=!1},d(l){l&&(I(n),I(s)),B(e,l),a=!1,o()}}}function Dn(t){let e,n,s,i,r={image:t[0]};return e=new Et({props:r}),t[32](e),e.$on("crop",t[26]),s=new Xe({}),s.$on("clear",t[33]),{c(){M(e.$$.fragment),n=U(),M(s.$$.fragment)},m(a,o){z(e,a,o),A(a,n,o),z(s,a,o),i=!0},p(a,o){const l={};o[0]&1&&(l.image=a[0]),e.$set(l)},i(a){i||(k(e.$$.fragment,a),k(s.$$.fragment,a),i=!0)},o(a){v(e.$$.fragment,a),v(s.$$.fragment,a),i=!1},d(a){a&&I(n),t[32](null),B(e,a),B(s,a)}}}function Ln(t){let e;const n=t[31].default,s=qt(n,t,t[62],null);return{c(){s&&s.c()},m(i,r){s&&s.m(i,r),e=!0},p(i,r){s&&s.p&&(!e||r[2]&1)&&Ft(s,n,i,i[62],e?Nt(n,i[62],r,null):Ht(i[62]),null)},i(i){e||(k(s,i),e=!0)},o(i){v(s,i),e=!1},d(i){s&&s.d(i)}}}function pt(t){let e,n,s,i;return{c(){e=H("img"),d(e,"class","absolute-img svelte-p3y7hu"),Q(e.src,n=t[23]||t[0]?.image||t[0])||d(e,"src",n),d(e,"alt",""),D(e,"webcam",t[6]==="webcam"&&t[10])},m(r,a){A(r,e,a),t[35](e),s||(i=q(e,"load",t[27]),s=!0)},p(r,a){a[0]&8388609&&!Q(e.src,n=r[23]||r[0]?.image||r[0])&&d(e,"src",n),a[0]&1088&&D(e,"webcam",r[6]==="webcam"&&r[10])},d(r){r&&I(e),t[35](null),s=!1,i()}}}function vt(t){let e,n,s,i,r,a,o,l;function u(_){t[37](_)}function c(_){t[38](_)}let b={value:t[0],mask_opacity:t[11],mode:t[19],width:t[17]||t[22],height:t[16]||t[21],container_height:t[18]||t[21],value_img:t[20],source:t[6],shape:t[7]};t[2]!==void 0&&(b.brush_radius=t[2]),t[3]!==void 0&&(b.brush_color=t[3]),e=new Ke({props:b}),t[36](e),L.push(()=>$(e,"brush_radius",u)),L.push(()=>$(e,"brush_color",c)),e.$on("change",t[26]),r=new $e({props:{show_eraser:t[20]}}),r.$on("undo",t[39]),r.$on("clear_mask",t[29]),r.$on("remove_image",t[28]);let f=(t[1]==="color-sketch"||t[1]==="sketch")&&At(t);return{c(){M(e.$$.fragment),i=U(),M(r.$$.fragment),a=U(),f&&f.c(),o=ge()},m(_,g){z(e,_,g),A(_,i,g),z(r,_,g),A(_,a,g),f&&f.m(_,g),A(_,o,g),l=!0},p(_,g){const p={};g[0]&1&&(p.value=_[0]),g[0]&2048&&(p.mask_opacity=_[11]),g[0]&524288&&(p.mode=_[19]),g[0]&4325376&&(p.width=_[17]||_[22]),g[0]&2162688&&(p.height=_[16]||_[21]),g[0]&2359296&&(p.container_height=_[18]||_[21]),g[0]&1048576&&(p.value_img=_[20]),g[0]&64&&(p.source=_[6]),g[0]&128&&(p.shape=_[7]),!n&&g[0]&4&&(n=!0,p.brush_radius=_[2],x(()=>n=!1)),!s&&g[0]&8&&(s=!0,p.brush_color=_[3],x(()=>s=!1)),e.$set(p);const S={};g[0]&1048576&&(S.show_eraser=_[20]),r.$set(S),_[1]==="color-sketch"||_[1]==="sketch"?f?(f.p(_,g),g[0]&2&&k(f,1)):(f=At(_),f.c(),k(f,1),f.m(o.parentNode,o)):f&&(V(),v(f,1,1,()=>{f=null}),G())},i(_){l||(k(e.$$.fragment,_),k(r.$$.fragment,_),k(f),l=!0)},o(_){v(e.$$.fragment,_),v(r.$$.fragment,_),v(f),l=!1},d(_){_&&(I(i),I(a),I(o)),t[36](null),B(e,_),B(r,_),f&&f.d(_)}}}function At(t){let e,n,s,i;function r(l){t[40](l)}function a(l){t[41](l)}let o={container_height:t[18]||t[21],img_width:t[17]||t[22],img_height:t[16]||t[21],mode:t[19]};return t[2]!==void 0&&(o.brush_radius=t[2]),t[3]!==void 0&&(o.brush_color=t[3]),e=new xe({props:o}),L.push(()=>$(e,"brush_radius",r)),L.push(()=>$(e,"brush_color",a)),{c(){M(e.$$.fragment)},m(l,u){z(e,l,u),i=!0},p(l,u){const c={};u[0]&2359296&&(c.container_height=l[18]||l[21]),u[0]&4325376&&(c.img_width=l[17]||l[22]),u[0]&2162688&&(c.img_height=l[16]||l[21]),u[0]&524288&&(c.mode=l[19]),!n&&u[0]&4&&(n=!0,c.brush_radius=l[2],x(()=>n=!1)),!s&&u[0]&8&&(s=!0,c.brush_color=l[3],x(()=>s=!1)),e.$set(c)},i(l){i||(k(e.$$.fragment,l),i=!0)},o(l){v(e.$$.fragment,l),i=!1},d(l){B(e,l)}}}function Un(t){let e,n,s,i;const r=[Ln,Dn,Rn,En,Sn],a=[];function o(l,u){return l[0]===null&&!l[23]||l[8]?0:l[1]==="select"?1:l[1]==="editor"?2:(l[1]==="sketch"||l[1]==="color-sketch")&&(l[0]!==null||l[23])?3:4}return e=o(t),n=a[e]=r[e](t),{c(){n.c(),s=ge()},m(l,u){a[e].m(l,u),A(l,s,u),i=!0},p(l,u){let c=e;e=o(l),e===c?a[e].p(l,u):(V(),v(a[c],1,1,()=>{a[c]=null}),G(),n=a[e],n?n.p(l,u):(n=a[e]=r[e](l),n.c()),k(n,1),n.m(s.parentNode,s))},i(l){i||(k(n),i=!0)},o(l){v(n),i=!1},d(l){l&&I(s),a[e].d(l)}}}function jn(t){let e,n,s,i,r,a,o;e=new Tt({props:{show_label:t[5],Icon:t[6]==="canvas"?lt:Ye,label:t[4]||(t[6]==="canvas"?"Sketch":"Image")}});const l=[Tn,Bn,zn,Mn,Cn,yn,In],u=[];function c(b,f){return b[6]==="upload"?0:b[6]==="canvas"?1:b[0]===null&&!b[23]||b[8]?2:b[1]==="select"?3:b[1]==="editor"?4:(b[1]==="sketch"||b[1]==="color-sketch")&&(b[0]!==null||b[23])?5:6}return i=c(t),r=u[i]=l[i](t),{c(){M(e.$$.fragment),n=U(),s=H("div"),r.c(),d(s,"data-testid","image"),d(s,"class","image-container svelte-p3y7hu"),Ze(()=>t[61].call(s))},m(b,f){z(e,b,f),A(b,n,f),A(b,s,f),u[i].m(s,null),a=Mt(s,t[61].bind(s)),o=!0},p(b,f){const _={};f[0]&32&&(_.show_label=b[5]),f[0]&64&&(_.Icon=b[6]==="canvas"?lt:Ye),f[0]&80&&(_.label=b[4]||(b[6]==="canvas"?"Sketch":"Image")),e.$set(_);let g=i;i=c(b),i===g?u[i].p(b,f):(V(),v(u[g],1,1,()=>{u[g]=null}),G(),r=u[i],r?r.p(b,f):(r=u[i]=l[i](b),r.c()),k(r,1),r.m(s,null))},i(b){o||(k(e.$$.fragment,b),k(r),o=!0)},o(b){v(e.$$.fragment,b),v(r),o=!1},d(b){b&&(I(n),I(s)),B(e,b),u[i].d(),a()}}}function qn(t,e,n){let{$$slots:s={},$$scope:i}=e,{value:r}=e,{label:a=void 0}=e,{show_label:o}=e,{source:l="upload"}=e,{tool:u="editor"}=e,{shape:c}=e,{streaming:b=!1}=e,{pending:f=!1}=e,{mirror_webcam:_}=e,{brush_radius:g}=e,{brush_color:p="#000000"}=e,{mask_opacity:S}=e,{selectable:fe=!1}=e,N,P;r&&(l==="upload"||l==="webcam")&&u==="sketch"&&(r={image:r,mask:null});function de({detail:h}){u==="color-sketch"?n(23,re=h):n(0,r=(l==="upload"||l==="webcam")&&u==="sketch"?{image:h,mask:null}:h),J("upload",h)}function E({detail:h}){n(0,r=null),n(23,re=void 0),J("clear")}async function y({detail:h},j){ie==="mask"?l==="webcam"&&j?n(0,r={image:h,mask:null}):n(0,r={image:typeof r=="string"?r:r?.image||null,mask:h}):(l==="upload"||l==="webcam")&&u==="sketch"?n(0,r={image:h,mask:null}):n(0,r=h),await ke(),J(b?"stream":"edit")}const J=pe();let Y=!1;function Z(h){const j=h.currentTarget;n(17,W=j.naturalWidth),n(16,le=j.naturalHeight),n(18,se=j.getBoundingClientRect().height)}async function _e(){N.clear(),await ke(),n(0,r=null),n(23,re=void 0)}async function he(){N.clear_mask(),await ke()}let le=0,W=0,se=0,ie,ee,ue,me,re;zt(async()=>{u==="color-sketch"&&r&&typeof r=="string"&&(n(23,re=r),await ke(),Z({currentTarget:ee}))});const ye=h=>{let j=St(h);j&&J("select",{index:j,value:null})};function Ce(h){L[h?"unshift":"push"](()=>{P=h,n(13,P),n(0,r)})}const be=h=>(E(h),n(1,u="editor")),Me=()=>n(1,u="select");function ve(h){L[h?"unshift":"push"](()=>{ee=h,n(20,ee)})}function ze(h){L[h?"unshift":"push"](()=>{N=h,n(15,N)})}function w(h){g=h,n(2,g)}function Te(h){p=h,n(3,p)}const Se=()=>N.undo();function Ee(h){g=h,n(2,g)}function Re(h){p=h,n(3,p)}function Ae(h){Y=h,n(14,Y)}const De=()=>N.undo();function Le(h){g=h,n(2,g)}function Ue(h){p=h,n(3,p)}function je(h){g=h,n(2,g)}function qe(h){p=h,n(3,p)}function ce(h){L[h?"unshift":"push"](()=>{N=h,n(15,N)})}const we=h=>u==="color-sketch"?de(h):y(h,!0);function Fe(h){te.call(this,t,h)}function Be(h){L[h?"unshift":"push"](()=>{P=h,n(13,P),n(0,r)})}const Pe=h=>(E(h),n(1,u="editor")),He=()=>n(1,u="select");function Je(h){L[h?"unshift":"push"](()=>{ee=h,n(20,ee)})}function Qe(h){L[h?"unshift":"push"](()=>{N=h,n(15,N)})}function Ve(h){g=h,n(2,g)}function Ge(h){p=h,n(3,p)}const m=()=>N.undo();function C(h){g=h,n(2,g)}function T(h){p=h,n(3,p)}function O(){ue=this.offsetHeight,me=this.offsetWidth,n(21,ue),n(22,me)}return t.$$set=h=>{"value"in h&&n(0,r=h.value),"label"in h&&n(4,a=h.label),"show_label"in h&&n(5,o=h.show_label),"source"in h&&n(6,l=h.source),"tool"in h&&n(1,u=h.tool),"shape"in h&&n(7,c=h.shape),"streaming"in h&&n(8,b=h.streaming),"pending"in h&&n(9,f=h.pending),"mirror_webcam"in h&&n(10,_=h.mirror_webcam),"brush_radius"in h&&n(2,g=h.brush_radius),"brush_color"in h&&n(3,p=h.brush_color),"mask_opacity"in h&&n(11,S=h.mask_opacity),"selectable"in h&&n(12,fe=h.selectable),"$$scope"in h&&n(62,i=h.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16384&&J("drag",Y),t.$$.dirty[0]&66&&(l==="canvas"&&u==="sketch"?n(19,ie="bw-sketch"):u==="color-sketch"?n(19,ie="color-sketch"):(l==="upload"||l==="webcam")&&u==="sketch"?n(19,ie="mask"):n(19,ie="editor")),t.$$.dirty[0]&1&&(r===null||r.image===null&&r.mask===null)&&n(23,re=void 0),t.$$.dirty[0]&8193&&P&&(r?(n(13,P.image=r,P),P.create()):P.destroy())},[r,u,g,p,a,o,l,c,b,f,_,S,fe,P,Y,N,le,W,se,ie,ee,ue,me,re,de,E,y,Z,_e,he,ye,s,Ce,be,Me,ve,ze,w,Te,Se,Ee,Re,Ae,De,Le,Ue,je,qe,ce,we,Fe,Be,Pe,He,Je,Qe,Ve,Ge,m,C,T,O,i]}let Fn=class extends ae{constructor(e){super(),oe(this,e,qn,jn,ne,{value:0,label:4,show_label:5,source:6,tool:1,shape:7,streaming:8,pending:9,mirror_webcam:10,brush_radius:2,brush_color:3,mask_opacity:11,selectable:12},null,[-1,-1,-1])}};function Hn(t){let e,n,s,i,r,a,o,l,u=t[3]&&It(t),c=t[5]&&yt(t);return{c(){e=H("div"),u&&u.c(),n=U(),c&&c.c(),s=U(),i=H("img"),d(e,"class","icon-buttons svelte-1btp92j"),Q(i.src,r=t[0])||d(i,"src",r),d(i,"alt",""),d(i,"class","svelte-1btp92j"),D(i,"selectable",t[4])},m(b,f){A(b,e,f),u&&u.m(e,null),X(e,n),c&&c.m(e,null),A(b,s,f),A(b,i,f),a=!0,o||(l=q(i,"click",t[6]),o=!0)},p(b,f){b[3]?u?(u.p(b,f),f&8&&k(u,1)):(u=It(b),u.c(),k(u,1),u.m(e,n)):u&&(V(),v(u,1,1,()=>{u=null}),G()),b[5]?c?(c.p(b,f),f&32&&k(c,1)):(c=yt(b),c.c(),k(c,1),c.m(e,null)):c&&(V(),v(c,1,1,()=>{c=null}),G()),(!a||f&1&&!Q(i.src,r=b[0]))&&d(i,"src",r),(!a||f&16)&&D(i,"selectable",b[4])},i(b){a||(k(u),k(c),a=!0)},o(b){v(u),v(c),a=!1},d(b){b&&(I(e),I(s),I(i)),u&&u.d(),c&&c.d(),o=!1,l()}}}function Nn(t){let e,n;return e=new en({props:{unpadded_box:!0,size:"large",$$slots:{default:[Wn]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},p(s,i){const r={};i&2048&&(r.$$scope={dirty:i,ctx:s}),e.$set(r)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function It(t){let e,n,s;return n=new Ie({props:{Icon:tn,label:"Download"}}),{c(){e=H("a"),M(n.$$.fragment),d(e,"href",t[0]),d(e,"target",window.__is_colab__?"_blank":null),d(e,"download","image")},m(i,r){A(i,e,r),z(n,e,null),s=!0},p(i,r){(!s||r&1)&&d(e,"href",i[0])},i(i){s||(k(n.$$.fragment,i),s=!0)},o(i){v(n.$$.fragment,i),s=!1},d(i){i&&I(e),B(n)}}}function yt(t){let e,n;return e=new xt({props:{formatter:t[7],value:t[0]}}),e.$on("share",t[8]),e.$on("error",t[9]),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},p(s,i){const r={};i&1&&(r.value=s[0]),e.$set(r)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function Wn(t){let e,n;return e=new Ye({}),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function On(t){let e,n,s,i,r,a;e=new Tt({props:{show_label:t[2],Icon:Ye,label:t[1]||"Image"}});const o=[Nn,Hn],l=[];function u(c,b){return c[0]===null?0:1}return s=u(t),i=l[s]=o[s](t),{c(){M(e.$$.fragment),n=U(),i.c(),r=ge()},m(c,b){z(e,c,b),A(c,n,b),l[s].m(c,b),A(c,r,b),a=!0},p(c,[b]){const f={};b&4&&(f.show_label=c[2]),b&2&&(f.label=c[1]||"Image"),e.$set(f);let _=s;s=u(c),s===_?l[s].p(c,b):(V(),v(l[_],1,1,()=>{l[_]=null}),G(),i=l[s],i?i.p(c,b):(i=l[s]=o[s](c),i.c()),k(i,1),i.m(r.parentNode,r))},i(c){a||(k(e.$$.fragment,c),k(i),a=!0)},o(c){v(e.$$.fragment,c),v(i),a=!1},d(c){c&&(I(n),I(r)),B(e,c),l[s].d(c)}}}function Yn(t,e,n){let{value:s}=e,{label:i=void 0}=e,{show_label:r}=e,{show_download_button:a=!0}=e,{selectable:o=!1}=e,{show_share_button:l=!1}=e;const u=pe(),c=g=>{let p=St(g);p&&u("select",{index:p,value:null})},b=async g=>g?``:"";function f(g){te.call(this,t,g)}function _(g){te.call(this,t,g)}return t.$$set=g=>{"value"in g&&n(0,s=g.value),"label"in g&&n(1,i=g.label),"show_label"in g&&n(2,r=g.show_label),"show_download_button"in g&&n(3,a=g.show_download_button),"selectable"in g&&n(4,o=g.selectable),"show_share_button"in g&&n(5,l=g.show_share_button)},t.$$.update=()=>{t.$$.dirty&1&&s&&u("change",s)},[s,i,r,a,o,l,c,b,f,_]}class Xn extends ae{constructor(e){super(),oe(this,e,Yn,On,ne,{value:0,label:1,show_label:2,show_download_button:3,selectable:4,show_share_button:5})}}function Pn(t){let e,n,s;function i(a){t[30](a)}let r={brush_radius:t[16],brush_color:t[17],shape:t[15],source:t[5],tool:t[6],selectable:t[19],mask_opacity:t[18],label:t[7],show_label:t[8],pending:t[11],streaming:t[10],mirror_webcam:t[14],$$slots:{default:[Qn]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.value=t[0]),e=new Fn({props:r}),L.push(()=>$(e,"value",i)),e.$on("edit",t[31]),e.$on("clear",t[32]),e.$on("stream",t[33]),e.$on("drag",t[34]),e.$on("upload",t[35]),e.$on("select",t[36]),e.$on("share",t[37]),e.$on("error",t[38]),{c(){M(e.$$.fragment)},m(a,o){z(e,a,o),s=!0},p(a,o){const l={};o[0]&65536&&(l.brush_radius=a[16]),o[0]&131072&&(l.brush_color=a[17]),o[0]&32768&&(l.shape=a[15]),o[0]&32&&(l.source=a[5]),o[0]&64&&(l.tool=a[6]),o[0]&524288&&(l.selectable=a[19]),o[0]&262144&&(l.mask_opacity=a[18]),o[0]&128&&(l.label=a[7]),o[0]&256&&(l.show_label=a[8]),o[0]&2048&&(l.pending=a[11]),o[0]&1024&&(l.streaming=a[10]),o[0]&16384&&(l.mirror_webcam=a[14]),o[1]&256&&(l.$$scope={dirty:o,ctx:a}),!n&&o[0]&1&&(n=!0,l.value=a[0],x(()=>n=!1)),e.$set(l)},i(a){s||(k(e.$$.fragment,a),s=!0)},o(a){v(e.$$.fragment,a),s=!1},d(a){B(e,a)}}}function Jn(t){let e,n;return e=new Xn({props:{value:t[0],label:t[7],show_label:t[8],show_download_button:t[9],selectable:t[19],show_share_button:t[24]}}),e.$on("select",t[27]),e.$on("share",t[28]),e.$on("error",t[29]),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},p(s,i){const r={};i[0]&1&&(r.value=s[0]),i[0]&128&&(r.label=s[7]),i[0]&256&&(r.show_label=s[8]),i[0]&512&&(r.show_download_button=s[9]),i[0]&524288&&(r.selectable=s[19]),i[0]&16777216&&(r.show_share_button=s[24]),e.$set(r)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function Qn(t){let e,n;return e=new nn({props:{type:"image"}}),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},p:F,i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}function Vn(t){let e,n,s,i,r,a;const o=[t[1]];let l={};for(let f=0;f{c[p]=null}),G(),i=c[s],i?i.p(f,_):(i=c[s]=u[s](f),i.c()),k(i,1),i.m(r.parentNode,r))},i(f){a||(k(e.$$.fragment,f),k(i),a=!0)},o(f){v(e.$$.fragment,f),v(i),a=!1},d(f){f&&(I(n),I(r)),B(e,f),c[s].d(f)}}}function Gn(t){let e,n;return e=new Pt({props:{visible:t[4],variant:t[23]==="dynamic"&&t[0]===null&&t[5]==="upload"?"dashed":"solid",border_mode:t[25]?"focus":"base",padding:!1,elem_id:t[2],elem_classes:t[3],height:t[12]||(t[5]==="webcam"||t[23]==="static"?void 0:Ct),width:t[13],allow_overflow:!1,container:t[20],scale:t[21],min_width:t[22],$$slots:{default:[Vn]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(s,i){z(e,s,i),n=!0},p(s,i){const r={};i[0]&16&&(r.visible=s[4]),i[0]&8388641&&(r.variant=s[23]==="dynamic"&&s[0]===null&&s[5]==="upload"?"dashed":"solid"),i[0]&33554432&&(r.border_mode=s[25]?"focus":"base"),i[0]&4&&(r.elem_id=s[2]),i[0]&8&&(r.elem_classes=s[3]),i[0]&8392736&&(r.height=s[12]||(s[5]==="webcam"||s[23]==="static"?void 0:Ct)),i[0]&8192&&(r.width=s[13]),i[0]&1048576&&(r.container=s[20]),i[0]&2097152&&(r.scale=s[21]),i[0]&4194304&&(r.min_width=s[22]),i[0]&59756515|i[1]&256&&(r.$$scope={dirty:i,ctx:s}),e.$set(r)},i(s){n||(k(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){B(e,s)}}}const Ct=240;function Zn(t,e,n){let{elem_id:s=""}=e,{elem_classes:i=[]}=e,{visible:r=!0}=e,{value:a=null}=e,{source:o="upload"}=e,{tool:l="editor"}=e,{label:u}=e,{show_label:c}=e,{show_download_button:b}=e,{streaming:f}=e,{pending:_}=e,{height:g}=e,{width:p}=e,{mirror_webcam:S}=e,{shape:fe}=e,{brush_radius:N}=e,{brush_color:P}=e,{mask_opacity:de}=e,{selectable:E=!1}=e,{container:y=!0}=e,{scale:J=null}=e,{min_width:Y=void 0}=e,{loading_status:Z}=e,{mode:_e}=e,{show_share_button:he=!1}=e;const le=pe();let W;function se(w){te.call(this,t,w)}function ie(w){te.call(this,t,w)}function ee(w){te.call(this,t,w)}function ue(w){a=w,n(0,a)}function me(w){te.call(this,t,w)}function re(w){te.call(this,t,w)}function ye(w){te.call(this,t,w)}const Ce=({detail:w})=>n(25,W=w);function be(w){te.call(this,t,w)}function Me(w){te.call(this,t,w)}function ve(w){te.call(this,t,w)}const ze=({detail:w})=>{n(1,Z=Z||{}),n(1,Z.status="error",Z),le("error",w)};return t.$$set=w=>{"elem_id"in w&&n(2,s=w.elem_id),"elem_classes"in w&&n(3,i=w.elem_classes),"visible"in w&&n(4,r=w.visible),"value"in w&&n(0,a=w.value),"source"in w&&n(5,o=w.source),"tool"in w&&n(6,l=w.tool),"label"in w&&n(7,u=w.label),"show_label"in w&&n(8,c=w.show_label),"show_download_button"in w&&n(9,b=w.show_download_button),"streaming"in w&&n(10,f=w.streaming),"pending"in w&&n(11,_=w.pending),"height"in w&&n(12,g=w.height),"width"in w&&n(13,p=w.width),"mirror_webcam"in w&&n(14,S=w.mirror_webcam),"shape"in w&&n(15,fe=w.shape),"brush_radius"in w&&n(16,N=w.brush_radius),"brush_color"in w&&n(17,P=w.brush_color),"mask_opacity"in w&&n(18,de=w.mask_opacity),"selectable"in w&&n(19,E=w.selectable),"container"in w&&n(20,y=w.container),"scale"in w&&n(21,J=w.scale),"min_width"in w&&n(22,Y=w.min_width),"loading_status"in w&&n(1,Z=w.loading_status),"mode"in w&&n(23,_e=w.mode),"show_share_button"in w&&n(24,he=w.show_share_button)},t.$$.update=()=>{t.$$.dirty[0]&1&&n(0,a=a||null),t.$$.dirty[0]&1&&le("change")},[a,Z,s,i,r,o,l,u,c,b,f,_,g,p,S,fe,N,P,de,E,y,J,Y,_e,he,W,le,se,ie,ee,ue,me,re,ye,Ce,be,Me,ve,ze]}class Kn extends ae{constructor(e){super(),oe(this,e,Zn,Gn,ne,{elem_id:2,elem_classes:3,visible:4,value:0,source:5,tool:6,label:7,show_label:8,show_download_button:9,streaming:10,pending:11,height:12,width:13,mirror_webcam:14,shape:15,brush_radius:16,brush_color:17,mask_opacity:18,selectable:19,container:20,scale:21,min_width:22,loading_status:1,mode:23,show_share_button:24},null,[-1,-1])}get elem_id(){return this.$$.ctx[2]}set elem_id(e){this.$$set({elem_id:e}),R()}get elem_classes(){return this.$$.ctx[3]}set elem_classes(e){this.$$set({elem_classes:e}),R()}get visible(){return this.$$.ctx[4]}set visible(e){this.$$set({visible:e}),R()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),R()}get source(){return this.$$.ctx[5]}set source(e){this.$$set({source:e}),R()}get tool(){return this.$$.ctx[6]}set tool(e){this.$$set({tool:e}),R()}get label(){return this.$$.ctx[7]}set label(e){this.$$set({label:e}),R()}get show_label(){return this.$$.ctx[8]}set show_label(e){this.$$set({show_label:e}),R()}get show_download_button(){return this.$$.ctx[9]}set show_download_button(e){this.$$set({show_download_button:e}),R()}get streaming(){return this.$$.ctx[10]}set streaming(e){this.$$set({streaming:e}),R()}get pending(){return this.$$.ctx[11]}set pending(e){this.$$set({pending:e}),R()}get height(){return this.$$.ctx[12]}set height(e){this.$$set({height:e}),R()}get width(){return this.$$.ctx[13]}set width(e){this.$$set({width:e}),R()}get mirror_webcam(){return this.$$.ctx[14]}set mirror_webcam(e){this.$$set({mirror_webcam:e}),R()}get shape(){return this.$$.ctx[15]}set shape(e){this.$$set({shape:e}),R()}get brush_radius(){return this.$$.ctx[16]}set brush_radius(e){this.$$set({brush_radius:e}),R()}get brush_color(){return this.$$.ctx[17]}set brush_color(e){this.$$set({brush_color:e}),R()}get mask_opacity(){return this.$$.ctx[18]}set mask_opacity(e){this.$$set({mask_opacity:e}),R()}get selectable(){return this.$$.ctx[19]}set selectable(e){this.$$set({selectable:e}),R()}get container(){return this.$$.ctx[20]}set container(e){this.$$set({container:e}),R()}get scale(){return this.$$.ctx[21]}set scale(e){this.$$set({scale:e}),R()}get min_width(){return this.$$.ctx[22]}set min_width(e){this.$$set({min_width:e}),R()}get loading_status(){return this.$$.ctx[1]}set loading_status(e){this.$$set({loading_status:e}),R()}get mode(){return this.$$.ctx[23]}set mode(e){this.$$set({mode:e}),R()}get show_share_button(){return this.$$.ctx[24]}set show_share_button(e){this.$$set({show_share_button:e}),R()}}const ms=Kn,gs=["static","dynamic"],ds=t=>({type:{payload:"string"},description:{payload:"image data as base64 string"},example_data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=="});export{ms as Component,ks as ExampleComponent,ds as document,gs as modes}; +//# sourceMappingURL=index-3e4003db.js.map diff --git a/gradio/templates/cdn/assets/index-3e4003db.js.map b/gradio/templates/cdn/assets/index-3e4003db.js.map new file mode 100644 index 0000000000000000000000000000000000000000..486e60081500278eadc30af7be7c63a67fa6a79c --- /dev/null +++ b/gradio/templates/cdn/assets/index-3e4003db.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-3e4003db.js","sources":["../../../../js/icons/src/Brush.svelte","../../../../js/icons/src/Color.svelte","../../../../js/icons/src/Erase.svelte","../../../../js/icons/src/Sketch.svelte","../../../../js/image/src/utils.ts","../../../../js/image/src/Cropper.svelte","../../../../node_modules/.pnpm/lazy-brush@1.0.1/node_modules/lazy-brush/src/Point.js","../../../../node_modules/.pnpm/lazy-brush@1.0.1/node_modules/lazy-brush/src/LazyPoint.js","../../../../node_modules/.pnpm/lazy-brush@1.0.1/node_modules/lazy-brush/src/LazyBrush.js","../../../../js/image/src/Sketch.svelte","../../../../js/image/src/ModifySketch.svelte","../../../../js/image/src/SketchSettings.svelte","../../../../js/image/src/Image.svelte","../../../../js/image/src/StaticImage.svelte","../../../../js/app/src/components/Image/Image.svelte","../../../../js/app/src/components/Image/index.ts"],"sourcesContent":["\n\t\n\t\n\n","\n\t\n\t\n\t\n\t\n\t\n\t\n\n","\n","\n\t\n\n","export const get_coordinates_of_clicked_image = (\n\tevt: MouseEvent\n): [number, number] | null => {\n\tlet image = evt.currentTarget as HTMLImageElement;\n\n\tconst imageRect = image.getBoundingClientRect();\n\tconst xScale = image.naturalWidth / imageRect.width;\n\tconst yScale = image.naturalHeight / imageRect.height;\n\tif (xScale > yScale) {\n\t\tconst displayed_width = imageRect.width;\n\t\tconst displayed_height = image.naturalHeight / xScale;\n\t\tconst y_offset = (imageRect.height - displayed_height) / 2;\n\t\tvar x = Math.round((evt.clientX - imageRect.left) * xScale);\n\t\tvar y = Math.round((evt.clientY - imageRect.top - y_offset) * xScale);\n\t} else {\n\t\tconst displayed_width = image.naturalWidth / yScale;\n\t\tconst displayed_height = imageRect.height;\n\t\tconst x_offset = (imageRect.width - displayed_width) / 2;\n\t\tvar x = Math.round((evt.clientX - imageRect.left - x_offset) * yScale);\n\t\tvar y = Math.round((evt.clientY - imageRect.top) * yScale);\n\t}\n\tif (x < 0 || x >= image.naturalWidth || y < 0 || y >= image.naturalHeight) {\n\t\treturn null;\n\t}\n\treturn [x, y];\n};\n","\n\n\n\n\"\"\n","class Point {\n /**\n *\n * @param {number} x\n * @param {number} y\n */\n constructor(x, y) {\n this.x = x\n this.y = y\n }\n}\n\nexport default Point\n","import Point from './Point'\n\nclass LazyPoint extends Point {\n /**\n * Update the x and y values\n *\n * @param {Point} point\n */\n update (point) {\n this.x = point.x\n this.y = point.y\n }\n\n /**\n * Move the point to another position using an angle and distance\n *\n * @param {number} angle The angle in radians\n * @param {number} distance How much the point should be moved\n */\n moveByAngle (angle, distance) {\n // Rotate the angle based on the browser coordinate system ([0,0] in the top left)\n const angleRotated = angle + (Math.PI / 2)\n\n this.x = this.x + (Math.sin(angleRotated) * distance),\n this.y = this.y - (Math.cos(angleRotated) * distance)\n }\n\n /**\n * Check if this point is the same as another point\n *\n * @param {Point} point\n * @returns {boolean}\n */\n equalsTo (point) {\n return this.x === point.x && this.y === point.y\n }\n\n /**\n * Get the difference for x and y axis to another point\n *\n * @param {Point} point\n * @returns {Point}\n */\n getDifferenceTo (point) {\n return new Point(this.x - point.x, this.y - point.y)\n }\n\n /**\n * Calculate distance to another point\n *\n * @param {Point} point\n * @returns {Point}\n */\n getDistanceTo (point) {\n const diff = this.getDifferenceTo(point)\n\n return Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2))\n }\n\n /**\n * Calculate the angle to another point\n *\n * @param {Point} point\n * @returns {Point}\n */\n getAngleTo (point) {\n const diff = this.getDifferenceTo(point)\n\n return Math.atan2(diff.y, diff.x)\n }\n\n /**\n * Return a simple object with x and y properties\n *\n * @returns {object}\n */\n toObject () {\n return {\n x: this.x,\n y: this.y\n }\n }\n}\n\nexport default LazyPoint\n","import LazyPoint from './LazyPoint'\nconst RADIUS_DEFAULT = 30\n\nclass LazyBrush {\n /**\n * constructor\n *\n * @param {object} settings\n * @param {number} settings.radius The radius for the lazy area\n * @param {boolean} settings.enabled\n */\n constructor ({ radius = RADIUS_DEFAULT, enabled = true, initialPoint = { x: 0, y: 0 }} = {}) {\n this.radius = radius\n this._isEnabled = enabled\n\n this.pointer = new LazyPoint(initialPoint.x, initialPoint.y)\n this.brush = new LazyPoint(initialPoint.x, initialPoint.y)\n\n this.angle = 0\n this.distance = 0\n this._hasMoved = false\n }\n\n /**\n * Enable lazy brush calculations.\n *\n */\n enable () {\n this._isEnabled = true\n }\n\n /**\n * Disable lazy brush calculations.\n *\n */\n disable () {\n this._isEnabled = false\n }\n\n /**\n * @returns {boolean}\n */\n isEnabled () {\n return this._isEnabled\n }\n\n /**\n * Update the radius\n *\n * @param {number} radius\n */\n setRadius (radius) {\n this.radius = radius\n }\n\n /**\n * Return the current radius\n *\n * @returns {number}\n */\n getRadius () {\n return this.radius\n }\n\n /**\n * Return the brush coordinates as a simple object\n *\n * @returns {object}\n */\n getBrushCoordinates () {\n return this.brush.toObject()\n }\n\n /**\n * Return the pointer coordinates as a simple object\n *\n * @returns {object}\n */\n getPointerCoordinates () {\n return this.pointer.toObject()\n }\n\n /**\n * Return the brush as a LazyPoint\n *\n * @returns {LazyPoint}\n */\n getBrush () {\n return this.brush\n }\n\n /**\n * Return the pointer as a LazyPoint\n *\n * @returns {LazyPoint}\n */\n getPointer () {\n return this.pointer\n }\n\n /**\n * Return the angle between pointer and brush\n *\n * @returns {number} Angle in radians\n */\n getAngle () {\n return this.angle\n }\n\n /**\n * Return the distance between pointer and brush\n *\n * @returns {number} Distance in pixels\n */\n getDistance () {\n return this.distance\n }\n\n /**\n * Return if the previous update has moved the brush.\n *\n * @returns {boolean} Whether the brush moved previously.\n */\n brushHasMoved () {\n return this._hasMoved\n }\n\n /**\n * Updates the pointer point and calculates the new brush point.\n *\n * @param {Point} newPointerPoint\n * @param {Object} options\n * @param {Boolean} options.both Force update pointer and brush\n * @returns {Boolean} Whether any of the two points changed\n */\n update (newPointerPoint, { both = false } = {}) {\n this._hasMoved = false\n if (this.pointer.equalsTo(newPointerPoint) && !both) {\n return false\n }\n\n this.pointer.update(newPointerPoint)\n\n if (both) {\n this._hasMoved = true\n this.brush.update(newPointerPoint)\n return true\n }\n\n if (this._isEnabled) {\n this.distance = this.pointer.getDistanceTo(this.brush)\n this.angle = this.pointer.getAngleTo(this.brush)\n\n if (this.distance > this.radius) {\n this.brush.moveByAngle(this.angle, this.distance - this.radius)\n this._hasMoved = true\n }\n } else {\n this.distance = 0\n this.angle = 0\n this.brush.update(newPointerPoint)\n this._hasMoved = true\n }\n\n return true\n }\n}\n\nexport default LazyBrush\n\n","\n\n\n\t{#if line_count === 0}\n\t\t
    \n\t\t\tStart drawing\n\t\t
    \n\t{/if}\n\t{#each canvas_types as { name, zIndex, opacity }}\n\t\t\n\t{/each}\n\n\n\n","\n\n
    \n\t dispatch(\"undo\")} />\n\n\t{#if show_eraser}\n\t\t {\n\t\t\t\tdispatch(\"clear_mask\");\n\t\t\t\tevent.stopPropagation();\n\t\t\t}}\n\t\t/>\n\t{/if}\n\n\t {\n\t\t\tdispatch(\"remove_image\");\n\t\t\tevent.stopPropagation();\n\t\t}}\n\t/>\n
    \n\n\n","\n\n
    \n\t\n\t\t (show_size = !show_size)}\n\t\t/>\n\t\t{#if show_size}\n\t\t\t\n\t\t{/if}\n\t\n\n\t{#if mode !== \"mask\"}\n\t\t\n\t\t\t (show_col = !show_col)}\n\t\t\t/>\n\t\t\t{#if show_col}\n\t\t\t\t\n\t\t\t{/if}\n\t\t\n\t{/if}\n
    \n\n\n","\n\n\n\n\n\t{#if source === \"upload\"}\n\t\t\n\t\t\t{#if (value === null && !static_image) || streaming}\n\t\t\t\t\n\t\t\t{:else if tool === \"select\"}\n\t\t\t\t\n\t\t\t\t (handle_clear(e), (tool = \"editor\"))} />\n\t\t\t{:else if tool === \"editor\"}\n\t\t\t\t (tool = \"select\")}\n\t\t\t\t\ton:clear={handle_clear}\n\t\t\t\t\teditable\n\t\t\t\t/>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t{:else if (tool === \"sketch\" || tool === \"color-sketch\") && (value !== null || static_image)}\n\t\t\t\t{#key static_image}\n\t\t\t\t\t\n\t\t\t\t{/key}\n\t\t\t\t{#if img_width > 0}\n\t\t\t\t\t\n\t\t\t\t\t sketch.undo()}\n\t\t\t\t\t\ton:clear_mask={handle_mask_clear}\n\t\t\t\t\t\ton:remove_image={handle_sketch_clear}\n\t\t\t\t\t/>\n\t\t\t\t\t{#if tool === \"color-sketch\" || tool === \"sketch\"}\n\t\t\t\t\t\t\n\t\t\t\t\t{/if}\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\t\n\t\t\t\t\n\t\t\t{/if}\n\t\t\n\t{:else if source === \"canvas\"}\n\t\t sketch.undo()}\n\t\t\ton:remove_image={handle_sketch_clear}\n\t\t/>\n\t\t{#if tool === \"color-sketch\"}\n\t\t\t\n\t\t{/if}\n\t\t\n\t{:else if (value === null && !static_image) || streaming}\n\t\t{#if source === \"webcam\" && !static_image}\n\t\t\t\n\t\t\t\t\ttool === \"color-sketch\" ? handle_upload(e) : handle_save(e, true)}\n\t\t\t\ton:stream={handle_save}\n\t\t\t\ton:error\n\t\t\t\t{streaming}\n\t\t\t\t{pending}\n\t\t\t\t{mirror_webcam}\n\t\t\t/>\n\t\t{/if}\n\t{:else if tool === \"select\"}\n\t\t\n\t\t (handle_clear(e), (tool = \"editor\"))} />\n\t{:else if tool === \"editor\"}\n\t\t (tool = \"select\")}\n\t\t\ton:clear={handle_clear}\n\t\t\teditable\n\t\t/>\n\n\t\t\n\t\t\n\t{:else if (tool === \"sketch\" || tool === \"color-sketch\") && (value !== null || static_image)}\n\t\t{#key static_image}\n\t\t\t\n\t\t{/key}\n\t\t{#if img_width > 0}\n\t\t\t\n\t\t\t sketch.undo()}\n\t\t\t\ton:remove_image={handle_sketch_clear}\n\t\t\t/>\n\t\t\t{#if tool === \"color-sketch\" || tool === \"sketch\"}\n\t\t\t\t\n\t\t\t{/if}\n\t\t{/if}\n\t{:else}\n\t\t\n\t\t\n\t{/if}\n\n\n\n","\n\n\n{#if value === null}\n\t\n{:else}\n\t
    \n\t\t{#if show_download_button}\n\t\t\n\t\t\t\n\t\t\n\t\t{/if}\n\t\t{#if show_share_button}\n\t\t\t {\n\t\t\t\t\tif (!value) return \"\";\n\t\t\t\t\tlet url = await uploadToHuggingFace(value, \"base64\");\n\t\t\t\t\treturn ``;\n\t\t\t\t}}\n\t\t\t\t{value}\n\t\t\t/>\n\t\t{/if}\n\t
    \n\t\n\t\"\"\n{/if}\n\n\n","\n\n\n\n\n\t\n\t{#if mode === \"static\"}\n\t\t\n\t{:else}\n\t\t (dragging = detail)}\n\t\t\ton:upload\n\t\t\ton:select\n\t\t\ton:share\n\t\t\ton:error={({ detail }) => {\n\t\t\t\tloading_status = loading_status || {};\n\t\t\t\tloading_status.status = \"error\";\n\t\t\t\tdispatch(\"error\", detail);\n\t\t\t}}\n\t\t\t{label}\n\t\t\t{show_label}\n\t\t\t{pending}\n\t\t\t{streaming}\n\t\t\t{mirror_webcam}\n\t\t>\n\t\t\t\n\t\t\n\t{/if}\n\n","export { default as Component } from \"./Image.svelte\";\nexport { default as ExampleComponent } from \"../Dataset/ExampleComponents/Image.svelte\";\nexport const modes = [\"static\", \"dynamic\"];\n\nexport const document = (config: Record) => ({\n\ttype: {\n\t\tpayload: \"string\"\n\t},\n\tdescription: {\n\t\tpayload: \"image data as base64 string\"\n\t},\n\texample_data:\n\t\t\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==\"\n});\n"],"names":["insert","target","svg","anchor","append","path0","path1","circle0","circle1","circle2","circle3","circle4","path","get_coordinates_of_clicked_image","evt","image","imageRect","xScale","yScale","displayed_height","y_offset","x","y","displayed_width","x_offset","ctx","attr","img","img_src_value","$$props","el","dispatch","createEventDispatcher","cropper","destroy","create","Cropper","image_data","$$value","Point","LazyPoint","point","angle","distance","angleRotated","diff","RADIUS_DEFAULT","LazyBrush","radius","enabled","initialPoint","newPointerPoint","both","div","div_transition","create_bidirectional_transition","fade","canvas_1","listen","if_block","create_if_block","i","catenary_color","mid_point","p1","p2","value","value_img","mode","brush_color","brush_radius","mask_opacity","source","width","height","container_height","shape","mounted","canvas_width","canvas_height","last_value_img","canvas_types","canvas","points","lines","mouse_has_moved","values_changed","is_drawing","is_pressing","lazy","canvas_container","canvas_observer","line_count","draw_cropped_image","_width","_height","shape_ratio","image_ratio","onMount","key","tick","_","trigger_on_change","draw_lines","$$invalidate","ResizeObserver","entries","observer","rest","handle_canvas_resize","loop","init","clear","initX","initY","onDestroy","redraw_image","_lines","clear_canvas","clear_mask","undo","line","_points","draw_points","saveLine","save_mask_line","handle_draw_start","e","get_pointer_pos","handle_pointer_move","handle_draw_move","handle_draw_end","old_width","old_height","old_container_height","add_lr_border","container_ratio","dimensions","container_dimensions","set_canvas_size","container","scale","dpr","rect","clientX","clientY","is_disabled","mask","target_ctx","len","midPoint","get_image_data","once","pointer","brush","draw_interface","brush_dot","name","Erase","Undo","Clear","show_eraser","click_handler","event","input","Color","create_if_block_1","span","Brush","create_if_block_2","if_block1","show_size","show_col","img_width","img_height","to_number","click_handler_1","create_if_block_14","create_if_block_10","create_if_block_8","dirty","sketch_1_changes","src_url_equal","create_if_block_15","sketchsettings_changes","create_if_block_5","create_if_block_6","SketchIcon","Image","blocklabel_changes","label","show_label","tool","streaming","pending","mirror_webcam","selectable","sketch","handle_upload","detail","static_image","handle_clear","handle_save","initial","dragging","handle_image_load","element","handle_sketch_clear","handle_mask_clear","max_height","max_width","handle_click","coordinates","clear_handler","edit_handler","undo_handler","undo_handler_1","clear_handler_1","edit_handler_1","undo_handler_2","Download","a","show_download_button","show_share_button","uploadToHuggingFace","FIXED_HEIGHT","block_changes","elem_id","elem_classes","visible","min_width","loading_status","modes","document","config"],"mappings":"y/DAAAA,EASKC,EAAAC,EAAAC,CAAA,EARJC,EAGCF,EAAAG,CAAA,EACDD,EAGCF,EAAAI,CAAA,mhCCRFN,EAUKC,EAAAC,EAAAC,CAAA,EATJC,EAAmDF,EAAAK,CAAA,EACnDH,EAAkDF,EAAAM,CAAA,EAClDJ,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uB,EAAA/C,GACvB,aAAAyC,CAAoB,EAAAzC,GACpB,YAAAwC,CAAmB,EAAAxC,GACnB,aAAA0C,EAAoB,EAAA1C,EACpB,CAAA,WAAAuK,EAAa,EAAK,EAAAvK,EAClB,CAAA,UAAA+G,EAAY,EAAI,EAAA/G,EAChB,CAAA,MAAAgH,EAAuB,IAAI,EAAAhH,EAC3B,CAAA,UAAAyM,EAAgC,MAAS,EAAAzM,GACzC,eAAA0M,CAA6B,EAAA1M,GAC7B,KAAAuC,EAA0B,EAAAvC,EAC1B,CAAA,kBAAAkM,GAAoB,EAAK,EAAAlM,EAE9B,MAAAE,GAAWC,SAMb4K,6OAiDU,OAAAL,CAAM,IAAA/F,EAAA,GAAQoG,EAAWL,CAAM,gHAI9B,OAAAA,KAAM,CAClB/F,EAAA,EAAA+H,EAAiBA,GAAc,CAAA,CAAA,MAC/BA,EAAe,OAAS,QAAOA,CAAA,EAC/BxM,GAAS,QAASwK,CAAM,k9BArDxBrI,EAASA,GAAQ,IAAY,mBAJtBnC,GAAS,QAAQ,klFCxCfyM,GAAQ,CAAC,SAAU,SAAS,EAE5BC,GAAYC,IAAiC,CACzD,KAAM,CACL,QAAS,QACV,EACA,YAAa,CACZ,QAAS,6BACV,EACA,aACC,oHACF","x_google_ignoreList":[6,7,8]} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-3f5735f4.js b/gradio/templates/cdn/assets/index-3f5735f4.js new file mode 100644 index 0000000000000000000000000000000000000000..17f24f7126f530d905d1999edcc11b55af439b84 --- /dev/null +++ b/gradio/templates/cdn/assets/index-3f5735f4.js @@ -0,0 +1,6 @@ +import{S as M,e as V,s as H,J as R,K as k,p as _,M as v,n as w,A as m,N as y,O as T,U as Z,u as B,v as b,y as C,z as d,P as h,R as A,m as L,G as E,V as Y,Q as q,k as O,o as N,x as S,ai as W,Z as X,$ as x,B as ee,E as te,ae as le,q as ne,r as ie}from"./index-fda37c89.js";import{f as se,B as oe}from"./Button-e3640f74.js";import{C as re,a as ce}from"./Copy-be466f7f.js";import{E as ae}from"./Empty-85ccd7df.js";import{B as fe}from"./BlockLabel-fe40816b.js";import"./Blocks-53d5f72d.js";function ue(a){let e,t;return{c(){e=R("svg"),t=R("path"),k(t,"fill","currentColor"),k(t,"d","M5 3h2v2H5v5a2 2 0 0 1-2 2a2 2 0 0 1 2 2v5h2v2H5c-1.07-.27-2-.9-2-2v-4a2 2 0 0 0-2-2H0v-2h1a2 2 0 0 0 2-2V5a2 2 0 0 1 2-2m14 0a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1v2h-1a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-2v-2h2v-5a2 2 0 0 1 2-2a2 2 0 0 1-2-2V5h-2V3h2m-7 12a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m-4 0a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m8 0a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1Z"),k(e,"xmlns","http://www.w3.org/2000/svg"),k(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),k(e,"aria-hidden","true"),k(e,"role","img"),k(e,"class","iconify iconify--mdi"),k(e,"width","100%"),k(e,"height","100%"),k(e,"preserveAspectRatio","xMidYMid meet"),k(e,"viewBox","0 0 24 24")},m(l,i){_(l,e,i),v(e,t)},p:w,i:w,o:w,d(l){l&&m(e)}}}let F=class extends M{constructor(e){super(),V(this,e,null,ue,H,{})}};function $(a,e,t){const l=a.slice();return l[5]=e[t],l[7]=t,l}function z(a,e,t){const l=a.slice();return l[5]=e[t],l[7]=t,l}function _e(a){let e,t;return{c(){e=y("div"),t=h(a[1]),k(e,"class","json-item svelte-1kspdo")},m(l,i){_(l,e,i),v(e,t)},p(l,i){i&2&&A(t,l[1])},i:w,o:w,d(l){l&&m(e)}}}function me(a){let e,t;return{c(){e=y("div"),t=h(a[1]),k(e,"class","json-item number svelte-1kspdo")},m(l,i){_(l,e,i),v(e,t)},p(l,i){i&2&&A(t,l[1])},i:w,o:w,d(l){l&&m(e)}}}function de(a){let e,t=a[1].toLocaleString()+"",l;return{c(){e=y("div"),l=h(t),k(e,"class","json-item bool svelte-1kspdo")},m(i,r){_(i,e,r),v(e,l)},p(i,r){r&2&&t!==(t=i[1].toLocaleString()+"")&&A(l,t)},i:w,o:w,d(i){i&&m(e)}}}function be(a){let e,t,l,i;return{c(){e=y("div"),t=h('"'),l=h(a[1]),i=h('"'),k(e,"class","json-item string svelte-1kspdo")},m(r,o){_(r,e,o),v(e,t),v(e,l),v(e,i)},p(r,o){o&2&&A(l,r[1])},i:w,o:w,d(r){r&&m(e)}}}function pe(a){let e;return{c(){e=y("div"),e.textContent="null",k(e,"class","json-item null svelte-1kspdo")},m(t,l){_(t,e,l)},p:w,i:w,o:w,d(t){t&&m(e)}}}function ke(a){let e,t,l,i;const r=[ge,ve],o=[];function f(n,s){return n[0]?0:1}return e=f(a),t=o[e]=r[e](a),{c(){t.c(),l=L()},m(n,s){o[e].m(n,s),_(n,l,s),i=!0},p(n,s){let c=e;e=f(n),e===c?o[e].p(n,s):(B(),b(o[c],1,1,()=>{o[c]=null}),C(),t=o[e],t?t.p(n,s):(t=o[e]=r[e](n),t.c()),d(t,1),t.m(l.parentNode,l))},i(n){i||(d(t),i=!0)},o(n){b(t),i=!1},d(n){n&&m(l),o[e].d(n)}}}function he(a){let e,t,l,i;const r=[ye,we],o=[];function f(n,s){return n[0]?0:1}return e=f(a),t=o[e]=r[e](a),{c(){t.c(),l=L()},m(n,s){o[e].m(n,s),_(n,l,s),i=!0},p(n,s){let c=e;e=f(n),e===c?o[e].p(n,s):(B(),b(o[c],1,1,()=>{o[c]=null}),C(),t=o[e],t?t.p(n,s):(t=o[e]=r[e](n),t.c()),d(t,1),t.m(l.parentNode,l))},i(n){i||(d(t),i=!0)},o(n){b(t),i=!1},d(n){n&&m(l),o[e].d(n)}}}function ve(a){let e,t,l,i,r=E(Object.entries(a[1])),o=[];for(let n=0;nb(o[n],1,1,()=>{o[n]=null});return{c(){e=h(`{ + `),t=y("div");for(let n=0;nb(o[n],1,1,()=>{o[n]=null});return{c(){e=h(`[ + `),t=y("div");for(let n=0;n{n[j]=null}),C(),r=n[i],r?r.p(c,u):(r=n[i]=f[i](c),r.c()),d(r,1),r.m(l,null))},i(c){o||(d(r),o=!0)},o(c){b(r),o=!1},d(c){c&&(m(e),m(t),m(l)),n[i].d()}}}function Oe(a,e,t){let{value:l}=e,{depth:i}=e,{collapsed:r=i>4}=e;const o=()=>{t(0,r=!1)},f=()=>{t(0,r=!1)};return a.$$set=n=>{"value"in n&&t(1,l=n.value),"depth"in n&&t(2,i=n.depth),"collapsed"in n&&t(0,r=n.collapsed)},[r,l,i,o,f]}class D extends M{constructor(e){super(),V(this,e,Oe,je,H,{value:1,depth:2,collapsed:0})}}function Ne(a){let e,t;return e=new ae({props:{$$slots:{default:[Je]},$$scope:{ctx:a}}}),{c(){O(e.$$.fragment)},m(l,i){N(e,l,i),t=!0},p(l,i){const r={};i&32&&(r.$$scope={dirty:i,ctx:l}),e.$set(r)},i(l){t||(d(e.$$.fragment,l),t=!0)},o(l){b(e.$$.fragment,l),t=!1},d(l){S(e,l)}}}function Se(a){let e,t,l,i,r,o,f,n,s;const c=[Ce,Be],u=[];function j(g,J){return g[1]?0:1}return t=j(a),l=u[t]=c[t](a),o=new D({props:{value:a[0],depth:0}}),{c(){e=y("button"),l.c(),i=T(),r=y("div"),O(o.$$.fragment),k(e,"class","svelte-1trjy9a"),k(r,"class","json-holder svelte-1trjy9a")},m(g,J){_(g,e,J),u[t].m(e,null),_(g,i,J),_(g,r,J),N(o,r,null),f=!0,n||(s=q(e,"click",a[2]),n=!0)},p(g,J){let p=t;t=j(g),t!==p&&(B(),b(u[p],1,1,()=>{u[p]=null}),C(),l=u[t],l||(l=u[t]=c[t](g),l.c()),d(l,1),l.m(e,null));const P={};J&1&&(P.value=g[0]),o.$set(P)},i(g){f||(d(l),d(o.$$.fragment,g),f=!0)},o(g){b(l),b(o.$$.fragment,g),f=!1},d(g){g&&(m(e),m(i),m(r)),u[t].d(),S(o),n=!1,s()}}}function Je(a){let e,t;return e=new F({}),{c(){O(e.$$.fragment)},m(l,i){N(e,l,i),t=!0},i(l){t||(d(e.$$.fragment,l),t=!0)},o(l){b(e.$$.fragment,l),t=!1},d(l){S(e,l)}}}function Be(a){let e,t,l;return t=new re({}),{c(){e=y("span"),O(t.$$.fragment),k(e,"class","copy-text")},m(i,r){_(i,e,r),N(t,e,null),l=!0},i(i){l||(d(t.$$.fragment,i),l=!0)},o(i){b(t.$$.fragment,i),l=!1},d(i){i&&m(e),S(t)}}}function Ce(a){let e,t,l,i;return t=new ce({}),{c(){e=y("span"),O(t.$$.fragment)},m(r,o){_(r,e,o),N(t,e,null),i=!0},i(r){i||(d(t.$$.fragment,r),r&&(l||X(()=>{l=x(e,se,{duration:300}),l.start()})),i=!0)},o(r){b(t.$$.fragment,r),i=!1},d(r){r&&m(e),S(t)}}}function Te(a){let e,t,l,i,r;const o=[Se,Ne],f=[];function n(s,c){return c&1&&(e=null),e==null&&(e=!!(s[0]&&s[0]!=='""'&&!Ae(s[0]))),e?0:1}return t=n(a,-1),l=f[t]=o[t](a),{c(){l.c(),i=L()},m(s,c){f[t].m(s,c),_(s,i,c),r=!0},p(s,[c]){let u=t;t=n(s,c),t===u?f[t].p(s,c):(B(),b(f[u],1,1,()=>{f[u]=null}),C(),l=f[t],l?l.p(s,c):(l=f[t]=o[t](s),l.c()),d(l,1),l.m(i.parentNode,i))},i(s){r||(d(l),r=!0)},o(s){b(l),r=!1},d(s){s&&m(i),f[t].d(s)}}}function Ae(a){return a&&Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}function Ee(a,e,t){let{value:l={}}=e,i=!1,r;function o(){t(1,i=!0),r&&clearTimeout(r),r=setTimeout(()=>{t(1,i=!1)},1e3)}async function f(){"clipboard"in navigator&&(await navigator.clipboard.writeText(JSON.stringify(l,null,2)),o())}return W(()=>{r&&clearTimeout(r)}),a.$$set=n=>{"value"in n&&t(0,l=n.value)},[l,i,f]}class Me extends M{constructor(e){super(),V(this,e,Ee,Te,H,{value:0})}}function U(a){let e,t;return e=new fe({props:{Icon:F,show_label:a[6],label:a[5],float:!1,disable:a[7]===!1}}),{c(){O(e.$$.fragment)},m(l,i){N(e,l,i),t=!0},p(l,i){const r={};i&64&&(r.show_label=l[6]),i&32&&(r.label=l[5]),i&128&&(r.disable=l[7]===!1),e.$set(r)},i(l){t||(d(e.$$.fragment,l),t=!0)},o(l){b(e.$$.fragment,l),t=!1},d(l){S(e,l)}}}function Ve(a){let e,t,l,i,r,o=a[5]&&U(a);const f=[a[4]];let n={};for(let s=0;s{o=null}),C());const u=c&16?ne(f,[ie(s[4])]):{};t.$set(u);const j={};c&8&&(j.value=s[3]),i.$set(j)},i(s){r||(d(o),d(t.$$.fragment,s),d(i.$$.fragment,s),r=!0)},o(s){b(o),b(t.$$.fragment,s),b(i.$$.fragment,s),r=!1},d(s){s&&(m(e),m(l)),o&&o.d(s),S(t,s),S(i,s)}}}function He(a){let e,t;return e=new oe({props:{visible:a[2],test_id:"json",elem_id:a[0],elem_classes:a[1],container:a[7],scale:a[8],min_width:a[9],padding:!1,$$slots:{default:[Ve]},$$scope:{ctx:a}}}),{c(){O(e.$$.fragment)},m(l,i){N(e,l,i),t=!0},p(l,[i]){const r={};i&4&&(r.visible=l[2]),i&1&&(r.elem_id=l[0]),i&2&&(r.elem_classes=l[1]),i&128&&(r.container=l[7]),i&256&&(r.scale=l[8]),i&512&&(r.min_width=l[9]),i&4344&&(r.$$scope={dirty:i,ctx:l}),e.$set(r)},i(l){t||(d(e.$$.fragment,l),t=!0)},o(l){b(e.$$.fragment,l),t=!1},d(l){S(e,l)}}}function Le(a,e,t){let{elem_id:l=""}=e,{elem_classes:i=[]}=e,{visible:r=!0}=e,{value:o}=e,f,{loading_status:n}=e,{label:s}=e,{show_label:c}=e,{container:u=!0}=e,{scale:j=null}=e,{min_width:g=void 0}=e;const J=ee();return a.$$set=p=>{"elem_id"in p&&t(0,l=p.elem_id),"elem_classes"in p&&t(1,i=p.elem_classes),"visible"in p&&t(2,r=p.visible),"value"in p&&t(3,o=p.value),"loading_status"in p&&t(4,n=p.loading_status),"label"in p&&t(5,s=p.label),"show_label"in p&&t(6,c=p.show_label),"container"in p&&t(7,u=p.container),"scale"in p&&t(8,j=p.scale),"min_width"in p&&t(9,g=p.min_width)},a.$$.update=()=>{a.$$.dirty&1032&&o!==f&&(t(10,f=o),J("change"))},[l,i,r,o,n,s,c,u,j,g,f]}class qe extends M{constructor(e){super(),V(this,e,Le,He,H,{elem_id:0,elem_classes:1,visible:2,value:3,loading_status:4,label:5,show_label:6,container:7,scale:8,min_width:9})}}const Ie=qe,Ke=["static"],Qe=a=>({type:{payload:"Object | Array"},description:{payload:"JSON object"}});export{Ie as Component,Qe as document,Ke as modes}; +//# sourceMappingURL=index-3f5735f4.js.map diff --git a/gradio/templates/cdn/assets/index-3f5735f4.js.map b/gradio/templates/cdn/assets/index-3f5735f4.js.map new file mode 100644 index 0000000000000000000000000000000000000000..29d1739a15c4e5e2c93714210b35889ad522f1a4 --- /dev/null +++ b/gradio/templates/cdn/assets/index-3f5735f4.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-3f5735f4.js","sources":["../../../../js/icons/src/JSON.svelte","../../../../js/json/src/JSONNode.svelte","../../../../js/json/src/JSON.svelte","../../../../js/app/src/components/Json/Json.svelte","../../../../js/app/src/components/Json/index.ts"],"sourcesContent":["\n\t\n\n","\n\n\n
    \n\t{#if value instanceof Array}\n\t\t{#if collapsed}\n\t\t\t {\n\t\t\t\t\tcollapsed = false;\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\texpand {value.length} children\n\t\t\t\n\t\t{:else}\n\t\t\t[\n\t\t\t
    \n\t\t\t\t{#each value as node, i}\n\t\t\t\t\t
    \n\t\t\t\t\t\t{i}: \n\t\t\t\t\t\t{#if i !== value.length - 1}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t
    \n\t\t\t\t{/each}\n\t\t\t
    \n\t\t\t]\n\t\t{/if}\n\t{:else if value instanceof Object}\n\t\t{#if collapsed}\n\t\t\t {\n\t\t\t\t\tcollapsed = false;\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{+{Object.keys(value).length} items}\n\t\t\t\n\t\t{:else}\n\t\t\t{\n\t\t\t
    \n\t\t\t\t{#each Object.entries(value) as node, i}\n\t\t\t\t\t
    \n\t\t\t\t\t\t{node[0]}: {#if i !== Object.keys(value).length - 1},\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t
    \n\t\t\t\t{/each}\n\t\t\t
    \n\t\t\t}\n\t\t{/if}\n\t{:else if value === null}\n\t\t
    null
    \n\t{:else if typeof value === \"string\"}\n\t\t
    \n\t\t\t\"{value}\"\n\t\t
    \n\t{:else if typeof value === \"boolean\"}\n\t\t
    \n\t\t\t{value.toLocaleString()}\n\t\t
    \n\t{:else if typeof value === \"number\"}\n\t\t
    \n\t\t\t{value}\n\t\t
    \n\t{:else}\n\t\t
    \n\t\t\t{value}\n\t\t
    \n\t{/if}\n
    \n\n\n","\n\n{#if value && value !== '\"\"' && !is_empty(value)}\n\t\n\t
    \n\t\t\n\t
    \n{:else}\n\t\n\t\t\n\t\n{/if}\n\n\n","\n\n\n\t{#if label}\n\t\t\n\t{/if}\n\n\t\n\n\t\n\n","export { default as Component } from \"./Json.svelte\";\nexport const modes = [\"static\"];\n\nexport const document = (config: Record) => ({\n\ttype: {\n\t\tpayload: \"Object | Array\"\n\t},\n\tdescription: {\n\t\tpayload: \"JSON object\"\n\t}\n});\n"],"names":["insert","target","svg","anchor","append","path","ctx","div","t_value","dirty","set_data","t","i","each_blocks","t1_value","button","t1","t0_value","current","t0","jsonnode_changes","span","if_block","create_if_block_2","toggle_class","value","$$props","depth","collapsed","$$invalidate","span_intro","create_in_transition","fade","show_if","is_empty","obj","copied","timer","copy_feedback","handle_copy","onDestroy","JSONIcon","blocklabel_changes","create_if_block","elem_id","elem_classes","visible","old_value","loading_status","label","show_label","container","scale","min_width","dispatch","createEventDispatcher","modes","document","config"],"mappings":"ixCAAAA,EAeKC,EAAAC,EAAAC,CAAA,EAJJC,EAGCF,EAAAG,CAAA,iRC4DEC,EAAK,CAAA,CAAA,iDADPN,EAEKC,EAAAM,EAAAJ,CAAA,0BADHG,EAAK,CAAA,CAAA,2EAJLA,EAAK,CAAA,CAAA,wDADPN,EAEKC,EAAAM,EAAAJ,CAAA,0BADHG,EAAK,CAAA,CAAA,+CAJLE,EAAAF,KAAM,eAAc,EAAA,sFADtBN,EAEKC,EAAAM,EAAAJ,CAAA,iBADHM,EAAA,GAAAD,KAAAA,EAAAF,KAAM,eAAc,EAAA,KAAAI,EAAAC,EAAAH,CAAA,+EALO,GAC3B,MAACF,EAAK,CAAA,CAAA,MAAC,GACT,wDAFAN,EAEKC,EAAAM,EAAAJ,CAAA,wCADFG,EAAK,CAAA,CAAA,8IAHRN,EAAqCC,EAAAM,EAAAJ,CAAA,qGA3BhCG,EAAS,CAAA,EAAA,6WAvBTA,EAAS,CAAA,EAAA,qUAkCL,OAAO,QAAQA,EAAK,CAAA,CAAA,CAAA,uBAAzB,OAAIM,GAAA,yEAHF;AAAA,IAEL,sDAaK;AAAA,KAEN,yDAfCZ,EAaKC,EAAAM,EAAAJ,CAAA,qFAZG,OAAO,QAAQG,EAAK,CAAA,CAAA,CAAA,oBAAzB,OAAIM,GAAA,EAAA,yGAAJ,OAAIA,EAAAC,EAAA,OAAAD,GAAA,yCAAJ,OAAIA,GAAA,6IALEE,EAAA,OAAO,KAAKR,MAAO,OAAM,wCADlC,IACQ,aAA2B,SACnC,UANAN,EAMQC,EAAAc,EAAAZ,CAAA,6DADCM,EAAA,GAAAK,KAAAA,EAAA,OAAO,KAAKR,MAAO,OAAM,KAAAI,EAAAM,EAAAF,CAAA,sEAatB,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AK,UAAUd,EAAO,KAAM,CAAC,CAAA,EACjEa,KAYF,OAAAE,EAAS,IAAA,CACJH,GAAO,aAAaA,CAAK,+KCOtBI,mCAGC,GACE,QAAAnC,OAAc,oHAAdG,EAAA,MAAAiC,EAAA,QAAApC,OAAc,6HANpBA,EAAK,CAAA,GAAAqC,EAAArC,CAAA,WAUSA,EAAc,CAAA,CAAA,+OAV5BA,EAAK,CAAA,+HAUSA,EAAc,CAAA,CAAA,CAAA,CAAA,mXAZxB,gZA9BE,GAAA,CAAA,QAAAsC,EAAkB,EAAE,EAAAlB,GACpB,aAAAmB,EAAY,EAAA,EAAAnB,EACZ,CAAA,QAAAoB,EAAmB,EAAI,EAAApB,GACvB,MAAAD,CAAU,EAAAC,EACjBqB,GACO,eAAAC,CAA6B,EAAAtB,GAC7B,MAAAuB,CAAa,EAAAvB,GACb,WAAAwB,CAAmB,EAAAxB,EACnB,CAAA,UAAAyB,EAAqB,EAAI,EAAAzB,EACzB,CAAA,MAAA0B,EAAuB,IAAI,EAAA1B,EAC3B,CAAA,UAAA2B,EAAgC,MAAS,EAAA3B,EAE9C,MAAA4B,EAAWC,qZAGZ9B,IAAUsB,IACblB,EAAA,GAAAkB,EAAYtB,CAAK,EACjB6B,EAAS,QAAQ,wNC1BPE,GAAQ,CAAC,QAAQ,EAEjBC,GAAYC,IAAiC,CACzD,KAAM,CACL,QAAS,gBACV,EACA,YAAa,CACZ,QAAS,aACV,CACD"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-45824fdf.js b/gradio/templates/cdn/assets/index-45824fdf.js new file mode 100644 index 0000000000000000000000000000000000000000..d7771b50cc6ca795da9a90e8273f294648db7978 --- /dev/null +++ b/gradio/templates/cdn/assets/index-45824fdf.js @@ -0,0 +1,2 @@ +import{S as M,e as z,s as E,G as A,N as b,k as T,O as y,K as u,p as v,o as B,M as h,z as R,v as N,A as k,x as I,V as j,P as C,R as q,J as D,U as O,T as K,am as _e,h as P,m as se,u as oe,y as ae,f as V,q as ge,r as he,E as me}from"./index-fda37c89.js";import"./Button-e3640f74.js";import{B as G}from"./BlockTitle-44d14959.js";import"./Info-ff627956.js";const w=i=>{var e=null;return i<0?e=[52,152,219]:e=[231,76,60],be(de(Math.abs(i),[255,255,255],e))},de=(i,e,t)=>{i>1&&(i=1),i=Math.sqrt(i);var n=[0,0,0],s;for(s=0;s<3;s++)n[s]=Math.round(e[s]*(1-i)+t[s]*i);return n},be=i=>"rgb("+i[0]+", "+i[1]+", "+i[2]+")",x=(i,e,t,n,s)=>{var o=n/s,c=e/t,l=0,r=0,f=i?o>c:o{"interpretation"in o&&t(0,n=o.interpretation),"label"in o&&t(1,s=o.label)},[n,s]}class we extends M{constructor(e){super(),z(this,e,pe,ke,E,{interpretation:0,label:1})}}function Q(i,e,t){const n=i.slice();return n[3]=e[t],n[5]=t,n}function ye(i){let e;return{c(){e=C(i[2])},m(t,n){v(t,e,n)},p(t,n){n&4&&q(e,t[2])},d(t){t&&k(e)}}}function W(i){let e,t=i[3]+"",n,s,o;return{c(){e=b("li"),n=C(t),s=y(),u(e,"class","dropdown-item svelte-1cqwepf"),u(e,"style",o="background-color: "+w(i[0][i[5]]))},m(c,l){v(c,e,l),h(e,n),h(e,s)},p(c,l){l&2&&t!==(t=c[3]+"")&&q(n,t),l&1&&o!==(o="background-color: "+w(c[0][c[5]]))&&u(e,"style",o)},d(c){c&&k(e)}}}function Se(i){let e,t,n,s,o;t=new G({props:{$$slots:{default:[ye]},$$scope:{ctx:i}}});let c=A(i[1]),l=[];for(let r=0;r{"interpretation"in c&&t(0,n=c.interpretation),"choices"in c&&t(1,s=c.choices),"label"in c&&t(2,o=c.label)},[n,s,o]}class qe extends M{constructor(e){super(),z(this,e,Ce,Se,E,{interpretation:0,choices:1,label:2})}}function Re(i){let e;return{c(){e=C(i[0])},m(t,n){v(t,e,n)},p(t,n){n&1&&q(e,t[0])},d(t){t&&k(e)}}}function Ae(i){let e,t,n,s,o,c,l,r,f,a,_,g,m;return t=new G({props:{$$slots:{default:[Re]},$$scope:{ctx:i}}}),{c(){e=b("div"),T(t.$$.fragment),n=y(),s=b("button"),o=b("div"),l=y(),r=b("div"),f=D("svg"),a=D("line"),_=D("line"),u(o,"class","checkbox svelte-1nw19ca"),u(o,"style",c="background-color: "+w(i[2][0])),u(a,"x1","-7.5"),u(a,"y1","0"),u(a,"x2","-2.5"),u(a,"y2","5"),u(a,"stroke","black"),u(a,"stroke-width","4"),u(a,"stroke-linecap","round"),u(_,"x1","-2.5"),u(_,"y1","5"),u(_,"x2","7.5"),u(_,"y2","-7.5"),u(_,"stroke","black"),u(_,"stroke-width","4"),u(_,"stroke-linecap","round"),u(f,"viewBox","-10 -10 20 20"),u(f,"class","svelte-1nw19ca"),u(r,"class","checkbox svelte-1nw19ca"),u(r,"style",g="background-color: "+w(i[2][1])),u(s,"class","checkbox-item svelte-1nw19ca"),O(s,"selected",i[1]),u(e,"class","input-checkbox svelte-1nw19ca")},m(d,p){v(d,e,p),B(t,e,null),h(e,n),h(e,s),h(s,o),h(s,l),h(s,r),h(r,f),h(f,a),h(f,_),m=!0},p(d,[p]){const S={};p&9&&(S.$$scope={dirty:p,ctx:d}),t.$set(S),(!m||p&4&&c!==(c="background-color: "+w(d[2][0])))&&u(o,"style",c),(!m||p&4&&g!==(g="background-color: "+w(d[2][1])))&&u(r,"style",g),(!m||p&2)&&O(s,"selected",d[1])},i(d){m||(R(t.$$.fragment,d),m=!0)},o(d){N(t.$$.fragment,d),m=!1},d(d){d&&k(e),I(t)}}}function Ne(i,e,t){let{label:n=""}=e,{original:s}=e,{interpretation:o}=e;return i.$$set=c=>{"label"in c&&t(0,n=c.label),"original"in c&&t(1,s=c.original),"interpretation"in c&&t(2,o=c.interpretation)},[n,s,o]}class Te extends M{constructor(e){super(),z(this,e,Ne,Ae,E,{label:0,original:1,interpretation:2})}}function X(i,e,t){const n=i.slice();return n[4]=e[t],n[6]=t,n}function Be(i){let e;return{c(){e=C(i[3])},m(t,n){v(t,e,n)},p(t,n){n&8&&q(e,t[3])},d(t){t&&k(e)}}}function Y(i){let e,t,n,s,o,c,l,r,f,a,_=i[4]+"",g,m;return{c(){e=b("button"),t=b("div"),s=y(),o=b("div"),c=D("svg"),l=D("line"),r=D("line"),a=y(),g=C(_),m=y(),u(t,"class","checkbox svelte-1cbhr6k"),u(t,"style",n="background-color: "+w(i[1][i[6]][0])),u(l,"x1","-7.5"),u(l,"y1","0"),u(l,"x2","-2.5"),u(l,"y2","5"),u(l,"stroke","black"),u(l,"stroke-width","4"),u(l,"stroke-linecap","round"),u(r,"x1","-2.5"),u(r,"y1","5"),u(r,"x2","7.5"),u(r,"y2","-7.5"),u(r,"stroke","black"),u(r,"stroke-width","4"),u(r,"stroke-linecap","round"),u(c,"viewBox","-10 -10 20 20"),u(c,"class","svelte-1cbhr6k"),u(o,"class","checkbox svelte-1cbhr6k"),u(o,"style",f="background-color: "+w(i[1][i[6]][1])),u(e,"class","checkbox-item svelte-1cbhr6k"),O(e,"selected",i[0].includes(i[4]))},m(d,p){v(d,e,p),h(e,t),h(e,s),h(e,o),h(o,c),h(c,l),h(c,r),h(e,a),h(e,g),h(e,m)},p(d,p){p&2&&n!==(n="background-color: "+w(d[1][d[6]][0]))&&u(t,"style",n),p&2&&f!==(f="background-color: "+w(d[1][d[6]][1]))&&u(o,"style",f),p&4&&_!==(_=d[4]+"")&&q(g,_),p&5&&O(e,"selected",d[0].includes(d[4]))},d(d){d&&k(e)}}}function Ie(i){let e,t,n,s;t=new G({props:{$$slots:{default:[Be]},$$scope:{ctx:i}}});let o=A(i[2]),c=[];for(let l=0;l{"original"in l&&t(0,n=l.original),"interpretation"in l&&t(1,s=l.interpretation),"choices"in l&&t(2,o=l.choices),"label"in l&&t(3,c=l.label)},[n,s,o,c]}class ze extends M{constructor(e){super(),z(this,e,Me,Ie,E,{original:0,interpretation:1,choices:2,label:3})}}function Z(i,e,t){const n=i.slice();return n[6]=e[t],n}function Ee(i){let e;return{c(){e=C(i[5])},m(t,n){v(t,e,n)},p(t,n){n&32&&q(e,t[5])},d(t){t&&k(e)}}}function $(i){let e,t;return{c(){e=b("div"),u(e,"style",t="background-color: "+w(i[6])),u(e,"class","svelte-1sxprr7")},m(n,s){v(n,e,s)},p(n,s){s&2&&t!==(t="background-color: "+w(n[6]))&&u(e,"style",t)},d(n){n&&k(e)}}}function Ge(i){let e,t,n,s,o,c,l,r,f,a;t=new G({props:{$$slots:{default:[Ee]},$$scope:{ctx:i}}});let _=A(i[1]),g=[];for(let m=0;m<_.length;m+=1)g[m]=$(Z(i,_,m));return{c(){e=b("div"),T(t.$$.fragment),n=y(),s=b("input"),o=y(),c=b("div");for(let m=0;m{"original"in f&&t(0,n=f.original),"interpretation"in f&&t(1,s=f.interpretation),"minimum"in f&&t(2,o=f.minimum),"maximum"in f&&t(3,c=f.maximum),"step"in f&&t(4,l=f.step),"label"in f&&t(5,r=f.label)},[n,s,o,c,l,r]}class De extends M{constructor(e){super(),z(this,e,je,Ge,E,{original:0,interpretation:1,minimum:2,maximum:3,step:4,label:5})}}function ee(i,e,t){const n=i.slice();return n[4]=e[t],n[6]=t,n}function Oe(i){let e;return{c(){e=C(i[3])},m(t,n){v(t,e,n)},p(t,n){n&8&&q(e,t[3])},d(t){t&&k(e)}}}function te(i){let e,t,n,s,o=i[4]+"",c,l;return{c(){e=b("button"),t=b("div"),s=y(),c=C(o),l=y(),u(t,"class","radio-circle svelte-1nekfre"),u(t,"style",n="background-color: "+w(i[1][i[6]])),u(e,"class","radio-item svelte-1nekfre"),O(e,"selected",i[0]===i[4])},m(r,f){v(r,e,f),h(e,t),h(e,s),h(e,c),h(e,l)},p(r,f){f&2&&n!==(n="background-color: "+w(r[1][r[6]]))&&u(t,"style",n),f&4&&o!==(o=r[4]+"")&&q(c,o),f&5&&O(e,"selected",r[0]===r[4])},d(r){r&&k(e)}}}function Ue(i){let e,t,n,s;t=new G({props:{$$slots:{default:[Oe]},$$scope:{ctx:i}}});let o=A(i[2]),c=[];for(let l=0;l{"original"in l&&t(0,n=l.original),"interpretation"in l&&t(1,s=l.interpretation),"choices"in l&&t(2,o=l.choices),"label"in l&&t(3,c=l.label)},[n,s,o,c]}class Je extends M{constructor(e){super(),z(this,e,Fe,Ue,E,{original:0,interpretation:1,choices:2,label:3})}}function Ke(i){let e;return{c(){e=C(i[1])},m(t,n){v(t,e,n)},p(t,n){n&2&&q(e,t[1])},d(t){t&&k(e)}}}function Pe(i){let e,t,n,s,o,c,l,r,f,a;return t=new G({props:{$$slots:{default:[Ke]},$$scope:{ctx:i}}}),{c(){e=b("div"),T(t.$$.fragment),n=y(),s=b("div"),o=b("div"),c=b("canvas"),l=y(),r=b("img"),u(o,"class","interpretation svelte-h0dntu"),K(r.src,f=i[0])||u(r,"src",f),u(r,"class","svelte-h0dntu"),u(s,"class","image-preview svelte-h0dntu"),u(e,"class","input-image")},m(_,g){v(_,e,g),B(t,e,null),h(e,n),h(e,s),h(s,o),h(o,c),i[6](c),h(s,l),h(s,r),i[7](r),a=!0},p(_,[g]){const m={};g&514&&(m.$$scope={dirty:g,ctx:_}),t.$set(m),(!a||g&1&&!K(r.src,f=_[0]))&&u(r,"src",f)},i(_){a||(R(t.$$.fragment,_),a=!0)},o(_){N(t.$$.fragment,_),a=!1},d(_){_&&k(e),I(t),i[6](null),i[7](null)}}}function Ve(i,e,t){let{original:n}=e,{interpretation:s}=e,{shape:o}=e,{label:c=""}=e,l,r;const f=(g,m,d,p)=>{var S=d/g[0].length,U=p/g.length,F=0;g.forEach(function(fe){var J=0;fe.forEach(function(ue){m.fillStyle=w(ue),m.fillRect(J*S,F*U,S,U),J++}),F++})};_e(()=>{let g=x(!0,r.width,r.height,r.naturalWidth,r.naturalHeight);o&&(g=x(!0,g.width,g.height,o[0],o[1]));let m=g.width,d=g.height;l.setAttribute("height",`${d}`),l.setAttribute("width",`${m}`),f(s,l.getContext("2d"),m,d)});function a(g){P[g?"unshift":"push"](()=>{l=g,t(2,l)})}function _(g){P[g?"unshift":"push"](()=>{r=g,t(3,r)})}return i.$$set=g=>{"original"in g&&t(0,n=g.original),"interpretation"in g&&t(4,s=g.interpretation),"shape"in g&&t(5,o=g.shape),"label"in g&&t(1,c=g.label)},[n,c,l,r,s,o,a,_]}class xe extends M{constructor(e){super(),z(this,e,Ve,Pe,E,{original:0,interpretation:4,shape:5,label:1})}}function le(i,e,t){const n=i.slice();return n[2]=e[t],n}function He(i){let e;return{c(){e=C(i[1])},m(t,n){v(t,e,n)},p(t,n){n&2&&q(e,t[1])},d(t){t&&k(e)}}}function ne(i){let e,t;return{c(){e=b("div"),u(e,"class","item svelte-13lmfcp"),u(e,"style",t="background-color: "+w(i[2]))},m(n,s){v(n,e,s)},p(n,s){s&1&&t!==(t="background-color: "+w(n[2]))&&u(e,"style",t)},d(n){n&&k(e)}}}function Le(i){let e,t,n,s,o;t=new G({props:{$$slots:{default:[He]},$$scope:{ctx:i}}});let c=A(i[0]),l=[];for(let r=0;r{"interpretation"in o&&t(0,n=o.interpretation),"label"in o&&t(1,s=o.label)},[n,s]}class We extends M{constructor(e){super(),z(this,e,Qe,Le,E,{interpretation:0,label:1})}}function ie(i,e,t){const n=i.slice();return n[2]=e[t][0],n[3]=e[t][1],n}function Xe(i){let e;return{c(){e=C(i[0])},m(t,n){v(t,e,n)},p(t,n){n&1&&q(e,t[0])},d(t){t&&k(e)}}}function re(i){let e,t=i[2]+"",n,s,o;return{c(){e=b("span"),n=C(t),s=y(),u(e,"class","text-span svelte-15c0u2m"),u(e,"style",o="background-color: "+w(i[3]))},m(c,l){v(c,e,l),h(e,n),h(e,s)},p(c,l){l&2&&t!==(t=c[2]+"")&&q(n,t),l&2&&o!==(o="background-color: "+w(c[3]))&&u(e,"style",o)},d(c){c&&k(e)}}}function Ye(i){let e,t,n,s;t=new G({props:{$$slots:{default:[Xe]},$$scope:{ctx:i}}});let o=A(i[1]),c=[];for(let l=0;l{"label"in o&&t(0,n=o.label),"interpretation"in o&&t(1,s=o.interpretation)},[n,s]}class $e extends M{constructor(e){super(),z(this,e,Ze,Ye,E,{label:0,interpretation:1})}}const et={audio:We,dropdown:qe,checkbox:Te,checkboxgroup:ze,number:we,slider:De,radio:Je,image:xe,textbox:$e};function ce(i){let e,t,n;const s=[i[0],{original:i[1].original},{interpretation:i[1].interpretation}];var o=i[2];function c(l){let r={};for(let f=0;f{I(a,1)}),ae()}o?(e=V(o,c()),T(e.$$.fragment),R(e.$$.fragment,1),B(e,t.parentNode,t)):e=null}else o&&e.$set(f)},i(l){n||(e&&R(e.$$.fragment,l),n=!0)},o(l){e&&N(e.$$.fragment,l),n=!1},d(l){l&&k(t),e&&I(e,l)}}}function tt(i){let e,t,n=i[1]&&ce(i);return{c(){n&&n.c(),e=se()},m(s,o){n&&n.m(s,o),v(s,e,o),t=!0},p(s,[o]){s[1]?n?(n.p(s,o),o&2&&R(n,1)):(n=ce(s),n.c(),R(n,1),n.m(e.parentNode,e)):n&&(oe(),N(n,1,1,()=>{n=null}),ae())},i(s){t||(R(n),t=!0)},o(s){N(n),t=!1},d(s){s&&k(e),n&&n.d(s)}}}function lt(i,e,t){let n,{component:s}=e,{component_props:o}=e,{value:c}=e;return i.$$set=l=>{"component"in l&&t(3,s=l.component),"component_props"in l&&t(0,o=l.component_props),"value"in l&&t(1,c=l.value)},i.$$.update=()=>{i.$$.dirty&8&&t(2,n=et[s])},[o,c,n,s]}class nt extends M{constructor(e){super(),z(this,e,lt,tt,E,{component:3,component_props:0,value:1})}}const ot=nt,at=["dynamic"];export{ot as Component,at as modes}; +//# sourceMappingURL=index-45824fdf.js.map diff --git a/gradio/templates/cdn/assets/index-45824fdf.js.map b/gradio/templates/cdn/assets/index-45824fdf.js.map new file mode 100644 index 0000000000000000000000000000000000000000..0f46d6fbf86a9c0e755e8cddac64dcb67c9edeaf --- /dev/null +++ b/gradio/templates/cdn/assets/index-45824fdf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-45824fdf.js","sources":["../../../../js/app/src/components/Interpretation/utils.ts","../../../../js/app/src/components/Interpretation/InterpretationComponents/Number.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/Dropdown.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/Checkbox.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/CheckboxGroup.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/Slider.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/Radio.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/Image.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/Audio.svelte","../../../../js/app/src/components/Interpretation/InterpretationComponents/Textbox.svelte","../../../../js/app/src/components/Interpretation/directory.ts","../../../../js/app/src/components/Interpretation/Interpretation.svelte","../../../../js/app/src/components/Interpretation/index.ts"],"sourcesContent":["export const getSaliencyColor = (value: number): string => {\n\tvar color: [number, number, number] | null = null;\n\tif (value < 0) {\n\t\tcolor = [52, 152, 219];\n\t} else {\n\t\tcolor = [231, 76, 60];\n\t}\n\treturn colorToString(interpolate(Math.abs(value), [255, 255, 255], color));\n};\n\nconst interpolate = (\n\tval: number,\n\trgb1: [number, number, number],\n\trgb2: [number, number, number]\n): [number, number, number] => {\n\tif (val > 1) {\n\t\tval = 1;\n\t}\n\tval = Math.sqrt(val);\n\tvar rgb: [number, number, number] = [0, 0, 0];\n\tvar i;\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = Math.round(rgb1[i] * (1.0 - val) + rgb2[i] * val);\n\t}\n\treturn rgb;\n};\n\nconst colorToString = (rgb: [number, number, number]): string => {\n\treturn \"rgb(\" + rgb[0] + \", \" + rgb[1] + \", \" + rgb[2] + \")\";\n};\n\nexport const getObjectFitSize = (\n\tcontains: boolean /* true = contain, false = cover */,\n\tcontainerWidth: number,\n\tcontainerHeight: number,\n\twidth: number,\n\theight: number\n) => {\n\tvar doRatio = width / height;\n\tvar cRatio = containerWidth / containerHeight;\n\tvar targetWidth = 0;\n\tvar targetHeight = 0;\n\tvar test = contains ? doRatio > cRatio : doRatio < cRatio;\n\n\tif (test) {\n\t\ttargetWidth = containerWidth;\n\t\ttargetHeight = targetWidth / doRatio;\n\t} else {\n\t\ttargetHeight = containerHeight;\n\t\ttargetWidth = targetHeight * doRatio;\n\t}\n\n\treturn {\n\t\twidth: targetWidth,\n\t\theight: targetHeight,\n\t\tx: (containerWidth - targetWidth) / 2,\n\t\ty: (containerHeight - targetHeight) / 2\n\t};\n};\n","\n\n
    \n\t{label}\n\t
    \n\t\t{#each interpretation as interpret_value}\n\t\t\t\n\t\t\t\t{interpret_value[0]}\n\t\t\t
    \n\t\t{/each}\n\t
    \n\n\n\n","\n\n
    \n\t{label}\n\t
      \n\t\t{#each choices as choice, i}\n\t\t\t\n\t\t\t\t{choice}\n\t\t\t\n\t\t{/each}\n\t
    \n
    \n\n\n","\n\n
    \n\t{label}\n\t
    \n\t\n\n\n\n","\n\n
    \n\t{label}\n\t{#each choices as choice, i}\n\t\t
    \n\t\t\t{choice}\n\t\t\n\t{/each}\n\n\n\n","\n\n
    \n\t{label}\n\t\n\t
    \n\t\t{#each interpretation as interpret_value}\n\t\t\t
    \n\t\t{/each}\n\t
    \n\t
    \n\t\t{original}\n\t
    \n
    \n\n\n","\n\n
    \n\t{label}\n\t{#each choices as choice, i}\n\t\t\n\t{/each}\n
    \n\n\n","\n\n
    \n\t{label}\n\t
    \n\t\t\n\t\t
    \n\t\t\t\n\t\t
    \n\t\t\n\t\t\n\t
    \n
    \n\n\n","\n\n
    \n\t{label}\n\t
    \n\t\t{#each interpretation as interpret_value}\n\t\t\t\n\t\t{/each}\n\t
    \n
    \n\n\n","\n\n
    \n\t{label}\n\t{#each interpretation as [text, saliency]}\n\t\t\n\t\t\t{text}\n\t\t\n\t{/each}\n
    \n\n\n","import InterpretationNumber from \"./InterpretationComponents/Number.svelte\";\nimport InterpretationDropdown from \"./InterpretationComponents/Dropdown.svelte\";\nimport InterpretationCheckbox from \"./InterpretationComponents/Checkbox.svelte\";\nimport InterpretationCheckboxGroup from \"./InterpretationComponents/CheckboxGroup.svelte\";\nimport InterpretationSlider from \"./InterpretationComponents/Slider.svelte\";\nimport InterpretationRadio from \"./InterpretationComponents/Radio.svelte\";\nimport InterpretationImage from \"./InterpretationComponents/Image.svelte\";\nimport InterpretationAudio from \"./InterpretationComponents/Audio.svelte\";\nimport InterpretationTextbox from \"./InterpretationComponents/Textbox.svelte\";\n\nexport const component_map = {\n\taudio: InterpretationAudio,\n\tdropdown: InterpretationDropdown,\n\tcheckbox: InterpretationCheckbox,\n\tcheckboxgroup: InterpretationCheckboxGroup,\n\tnumber: InterpretationNumber,\n\tslider: InterpretationSlider,\n\tradio: InterpretationRadio,\n\timage: InterpretationImage,\n\ttextbox: InterpretationTextbox\n};\n","\n\n{#if value}\n\t\n{/if}\n","export { default as Component } from \"./Interpretation.svelte\";\nexport const modes = [\"dynamic\"];\n"],"names":["getSaliencyColor","value","color","colorToString","interpolate","val","rgb1","rgb2","rgb","i","getObjectFitSize","contains","containerWidth","containerHeight","width","height","doRatio","cRatio","targetWidth","targetHeight","test","ctx","t0_value","attr","div","div_style_value","insert","target","anchor","dirty","set_data","t0","div1","append","div0","interpretation","$$props","label","li","li_style_value","ul","choices","div0_style_value","div1_style_value","div2","button","svg","line0","line1","current","original","t2","t2_value","input","minimum","maximum","step","toggle_class","t1","t1_value","img","img_src_value","canvas","shape","saliency_layer","image","paintSaliency","data","cell_width","cell_height","r","row","c","cell","afterUpdate","size","$$value","span","component_map","InterpretationAudio","InterpretationDropdown","InterpretationCheckbox","InterpretationCheckboxGroup","InterpretationNumber","InterpretationSlider","InterpretationRadio","InterpretationImage","InterpretationTextbox","create_if_block","component","component_props","$$invalidate","_component","modes"],"mappings":"gWAAa,MAAAA,EAAoBC,GAA0B,CAC1D,IAAIC,EAAyC,KAC7C,OAAID,EAAQ,EACHC,EAAA,CAAC,GAAI,IAAK,GAAG,EAEbA,EAAA,CAAC,IAAK,GAAI,EAAE,EAEdC,GAAcC,GAAY,KAAK,IAAIH,CAAK,EAAG,CAAC,IAAK,IAAK,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wJAFPiB,EAUKC,EAAAH,EAAAI,CAAA,wJARGP,EAAc,CAAA,CAAA,oBAAnB,OAAIZ,GAAA,EAAA,mHAAJ,wHANS,GAAA,CAAA,MAAA4B,EAAgB,EAAE,EAAAD,GAClB,eAAAD,CAAuC,EAAAC,8LCM5C,MAAM0C,GAAgB,CAC5B,MAAOC,GACP,SAAUC,GACV,SAAUC,GACV,cAAeC,GACf,OAAQC,GACR,OAAQC,GACR,MAAOC,GACP,MAAOC,GACP,QAASC,EACV,oCCLMlE,EAAe,CAAA,EACT,CAAA,SAAAA,KAAM,QAAQ,GACR,eAAAA,KAAM,uBAHhBA,EAAU,CAAA,6MACZA,EAAe,CAAA,CAAA,EACTQ,EAAA,GAAA,CAAA,SAAAR,KAAM,QAAQ,QACR,eAAAA,KAAM,oCAHhBA,EAAU,CAAA,GAAA,uRAFbA,EAAK,CAAA,GAAAmE,GAAAnE,CAAA,yEAALA,EAAK,CAAA,oMAPE,UAAAoE,CAAqC,EAAArD,GACrC,gBAAAsD,CAAoC,EAAAtD,GACpC,MAAAnC,CAAU,EAAAmC,qKAElBuD,EAAA,EAAAC,EAAad,GAAcW,CAAS,CAAA,8HCR3BI,GAAQ,CAAC,SAAS"} \ No newline at end of file diff --git a/gradio/templates/cdn/assets/index-47a1fbd3.js b/gradio/templates/cdn/assets/index-47a1fbd3.js new file mode 100644 index 0000000000000000000000000000000000000000..6c11e914bddc5c71553b4aa6694d62d843ee09ba --- /dev/null +++ b/gradio/templates/cdn/assets/index-47a1fbd3.js @@ -0,0 +1,2 @@ +import{L as s}from"./index-10e05757.js";import{s as o,t as r,L as n,i as P,w as a,f as i,a as Q,b as p}from"./index-ea4e155c.js";import"./index-fda37c89.js";import"./Blocks-53d5f72d.js";import"./Button-e3640f74.js";import"./BlockLabel-fe40816b.js";import"./Empty-85ccd7df.js";import"./Copy-be466f7f.js";import"./Download-6021cc15.js";const c=o({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,",":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),g=s.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[c],skippedNodes:[0],repeatNodeCount:2,tokenData:"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),V=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=m(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function m(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const u=n.define({name:"json",parser:g.configure({props:[P.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":Q})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function $(){return new p(u)}export{$ as json,u as jsonLanguage,V as jsonParseLinter}; +//# sourceMappingURL=index-47a1fbd3.js.map diff --git a/gradio/templates/cdn/assets/index-47a1fbd3.js.map b/gradio/templates/cdn/assets/index-47a1fbd3.js.map new file mode 100644 index 0000000000000000000000000000000000000000..18863f3f70e76373e639cccb087c70316099ef82 --- /dev/null +++ b/gradio/templates/cdn/assets/index-47a1fbd3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-47a1fbd3.js","sources":["../../../../node_modules/.pnpm/@lezer+json@1.0.0/node_modules/@lezer/json/dist/index.es.js","../../../../node_modules/.pnpm/@codemirror+lang-json@6.0.1/node_modules/@codemirror/lang-json/dist/index.js"],"sourcesContent":["import { LRParser } from '@lezer/lr';\nimport { styleTags, tags } from '@lezer/highlight';\n\nconst jsonHighlighting = styleTags({\n String: tags.string,\n Number: tags.number,\n \"True False\": tags.bool,\n PropertyName: tags.propertyName,\n Null: tags.null,\n \",\": tags.separator,\n \"[ ]\": tags.squareBracket,\n \"{ }\": tags.brace\n});\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j\",\n stateData: \"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O\",\n goto: \"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R\",\n nodeNames: \"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array\",\n maxTerm: 25,\n nodeProps: [\n [\"openedBy\", 7,\"{\",12,\"[\"],\n [\"closedBy\", 8,\"}\",13,\"]\"]\n ],\n propSources: [jsonHighlighting],\n skippedNodes: [0],\n repeatNodeCount: 2,\n tokenData: \"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~\",\n tokenizers: [0],\n topRules: {\"JsonText\":[0,1]},\n tokenPrec: 0\n});\n\nexport { parser };\n","import { parser } from '@lezer/json';\nimport { LRLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';\n\n/**\nCalls\n[`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)\non the document and, if that throws an error, reports it as a\nsingle diagnostic.\n*/\nconst jsonParseLinter = () => (view) => {\n try {\n JSON.parse(view.state.doc.toString());\n }\n catch (e) {\n if (!(e instanceof SyntaxError))\n throw e;\n const pos = getErrorPosition(e, view.state.doc);\n return [{\n from: pos,\n message: e.message,\n severity: 'error',\n to: pos\n }];\n }\n return [];\n};\nfunction getErrorPosition(error, doc) {\n let m;\n if (m = error.message.match(/at position (\\d+)/))\n return Math.min(+m[1], doc.length);\n if (m = error.message.match(/at line (\\d+) column (\\d+)/))\n return Math.min(doc.line(+m[1]).from + (+m[2]) - 1, doc.length);\n return 0;\n}\n\n/**\nA language provider that provides JSON parsing.\n*/\nconst jsonLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"json\",\n parser: /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n Object: /*@__PURE__*/continuedIndent({ except: /^\\s*\\}/ }),\n Array: /*@__PURE__*/continuedIndent({ except: /^\\s*\\]/ })\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"Object Array\": foldInside\n })\n ]\n }),\n languageData: {\n closeBrackets: { brackets: [\"[\", \"{\", '\"'] },\n indentOnInput: /^\\s*[\\}\\]]$/\n }\n});\n/**\nJSON language support.\n*/\nfunction json() {\n return new LanguageSupport(jsonLanguage);\n}\n\nexport { json, jsonLanguage, jsonParseLinter };\n"],"names":["jsonHighlighting","styleTags","tags","parser","LRParser","jsonParseLinter","view","e","pos","getErrorPosition","error","doc","m","jsonLanguage","LRLanguage","indentNodeProp","continuedIndent","foldNodeProp","foldInside","json","LanguageSupport"],"mappings":"8UAGA,MAAMA,EAAmBC,EAAU,CACjC,OAAQC,EAAK,OACb,OAAQA,EAAK,OACb,aAAcA,EAAK,KACnB,aAAcA,EAAK,aACnB,KAAMA,EAAK,KACX,IAAKA,EAAK,UACV,MAAOA,EAAK,cACZ,MAAOA,EAAK,KACd,CAAC,EAGKC,EAASC,EAAS,YAAY,CAClC,QAAS,GACT,OAAQ,mRACR,UAAW,iGACX,KAAM,kFACN,UAAW,sFACX,QAAS,GACT,UAAW,CACT,CAAC,WAAY,EAAE,IAAI,GAAG,GAAG,EACzB,CAAC,WAAY,EAAE,IAAI,GAAG,GAAG,CAC1B,EACD,YAAa,CAACJ,CAAgB,EAC9B,aAAc,CAAC,CAAC,EAChB,gBAAiB,EACjB,UAAW,wkBACX,WAAY,CAAC,CAAC,EACd,SAAU,CAAC,SAAW,CAAC,EAAE,CAAC,CAAC,EAC3B,UAAW,CACb,CAAC,ECxBKK,EAAkB,IAAOC,GAAS,CACpC,GAAI,CACA,KAAK,MAAMA,EAAK,MAAM,IAAI,SAAQ,CAAE,CACvC,OACMC,EAAP,CACI,GAAI,EAAEA,aAAa,aACf,MAAMA,EACV,MAAMC,EAAMC,EAAiBF,EAAGD,EAAK,MAAM,GAAG,EAC9C,MAAO,CAAC,CACA,KAAME,EACN,QAASD,EAAE,QACX,SAAU,Q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