diff --git a/.github/workflows/update-frontend.yml b/.github/workflows/update-frontend.yml new file mode 100644 index 000000000..0c5774789 --- /dev/null +++ b/.github/workflows/update-frontend.yml @@ -0,0 +1,58 @@ +name: Update Frontend Release + +on: + workflow_dispatch: + inputs: + version: + description: "Frontend version to update to (e.g., 1.0.0)" + required: true + type: string + +jobs: + update-frontend: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout ComfyUI + uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install requirements + run: | + python -m pip install --upgrade pip + pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu + pip install -r requirements.txt + pip install wait-for-it + # Frontend asset will be downloaded to ComfyUI/web_custom_versions/Comfy-Org_ComfyUI_frontend/{version} + - name: Start ComfyUI server + run: | + python main.py --cpu --front-end-version Comfy-Org/ComfyUI_frontend@${{ github.event.inputs.version }} 2>&1 | tee console_output.log & + wait-for-it --service 127.0.0.1:8188 -t 30 + - name: Configure Git + run: | + git config --global user.name "GitHub Action" + git config --global user.email "action@github.com" + # Replace existing frontend content with the new version and remove .js.map files + # See https://github.com/Comfy-Org/ComfyUI_frontend/issues/2145 for why we remove .js.map files + - name: Update frontend content + run: | + rm -rf web/ + cp -r web_custom_versions/Comfy-Org_ComfyUI_frontend/${{ github.event.inputs.version }} web/ + rm web/**/*.js.map + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.PR_BOT_PAT }} + commit-message: "Update frontend to v${{ github.event.inputs.version }}" + title: "Frontend Update: v${{ github.event.inputs.version }}" + body: | + Automated PR to update frontend content to version ${{ github.event.inputs.version }} + + This PR was created automatically by the frontend update workflow. + branch: release-${{ github.event.inputs.version }} + base: master + labels: Frontend,dependencies diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 000000000..d9d488974 --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,58 @@ +name: Update Version File + +on: + pull_request: + paths: + - "pyproject.toml" + branches: + - master + +jobs: + update-version: + runs-on: ubuntu-latest + # Don't run on fork PRs + if: github.event.pull_request.head.repo.full_name == github.repository + permissions: + pull-requests: write + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + + - name: Update comfyui_version.py + run: | + # Read version from pyproject.toml and update comfyui_version.py + python -c ' + import tomllib + + # Read version from pyproject.toml + with open("pyproject.toml", "rb") as f: + config = tomllib.load(f) + version = config["project"]["version"] + + # Write version to comfyui_version.py + with open("comfyui_version.py", "w") as f: + f.write("# This file is automatically generated by the build process when version is\n") + f.write("# updated in pyproject.toml.\n") + f.write(f"__version__ = \"{version}\"\n") + ' + + - name: Commit changes + run: | + git config --local user.name "github-actions" + git config --local user.email "github-actions@github.com" + git fetch origin ${{ github.head_ref }} + git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }} + git add comfyui_version.py + git diff --quiet && git diff --staged --quiet || git commit -m "chore: Update comfyui_version.py to match pyproject.toml" + git push origin HEAD:${{ github.head_ref }} diff --git a/CODEOWNERS b/CODEOWNERS index db2c96418..802cb28c0 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -17,7 +17,7 @@ /app/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata # Frontend assets -/web/ @huchenlei @webfiltered @pythongosssss +/web/ @huchenlei @webfiltered @pythongosssss @yoland68 @robinjhuang # Extra nodes /comfy_extras/ @yoland68 @robinjhuang @huchenlei @pythongosssss @ltdrdata @Kosinkadink diff --git a/comfy/app/app_settings.py b/comfy/app/app_settings.py index a06b723ff..2068aa0c1 100644 --- a/comfy/app/app_settings.py +++ b/comfy/app/app_settings.py @@ -2,6 +2,7 @@ import json import os from aiohttp import web +import logging class AppSettings(): @@ -12,8 +13,12 @@ class AppSettings(): file = self.user_manager.get_request_user_filepath( request, "comfy.settings.json") if os.path.isfile(file): - with open(file) as f: - return json.load(f) + try: + with open(file) as f: + return json.load(f) + except: + logging.error(f"The user settings file is corrupted: {file}") + return {} else: return {} diff --git a/comfy/app/custom_node_manager.py b/comfy/app/custom_node_manager.py new file mode 100644 index 000000000..948290902 --- /dev/null +++ b/comfy/app/custom_node_manager.py @@ -0,0 +1,34 @@ +from __future__ import annotations + +import os +from ..cmd import folder_paths +import glob +from aiohttp import web + +class CustomNodeManager: + """ + Placeholder to refactor the custom node management features from ComfyUI-Manager. + Currently it only contains the custom workflow templates feature. + """ + def add_routes(self, routes, webapp, loadedModules): + + @routes.get("/workflow_templates") + async def get_workflow_templates(request): + """Returns a web response that contains the map of custom_nodes names and their associated workflow templates. The ones without templates are omitted.""" + files = [ + file + for folder in folder_paths.get_folder_paths("custom_nodes") + for file in glob.glob(os.path.join(folder, '*/example_workflows/*.json')) + ] + workflow_templates_dict = {} # custom_nodes folder name -> example workflow names + for file in files: + custom_nodes_name = os.path.basename(os.path.dirname(os.path.dirname(file))) + workflow_name = os.path.splitext(os.path.basename(file))[0] + workflow_templates_dict.setdefault(custom_nodes_name, []).append(workflow_name) + return web.json_response(workflow_templates_dict) + + # Serve workflow templates from custom nodes. + for module_name, module_dir in loadedModules: + workflows_dir = os.path.join(module_dir, 'example_workflows') + if os.path.exists(workflows_dir): + webapp.add_routes([web.static('/api/workflow_templates/' + module_name, workflows_dir)]) diff --git a/comfy/cmd/execution.py b/comfy/cmd/execution.py index 85285b26d..3387a5ab8 100644 --- a/comfy/cmd/execution.py +++ b/comfy/cmd/execution.py @@ -109,8 +109,7 @@ def get_input_data(inputs, class_def, unique_id, outputs=None, dynprompt=None, e missing_keys = {} for x in inputs: input_data = inputs[x] - input_type, input_category, input_info = get_input_info(class_def, x) - + input_type, input_category, input_info = get_input_info(class_def, x, valid_inputs) def mark_missing(): missing_keys[x] = True input_data_all[x] = (None,) @@ -667,7 +666,7 @@ def validate_inputs(prompt, item, validated: typing.Dict[str, ValidateInputsTupl received_types = {} for x in valid_inputs: - type_input, input_category, extra_info = get_input_info(obj_class, x) + type_input, input_category, extra_info = get_input_info(obj_class, x, class_inputs) assert extra_info is not None if x not in inputs: if input_category == "required": diff --git a/comfy/cmd/server.py b/comfy/cmd/server.py index 0a01c0f39..26c98961a 100644 --- a/comfy/cmd/server.py +++ b/comfy/cmd/server.py @@ -34,6 +34,7 @@ from .. import interruption, model_management from .. import node_helpers from .. import utils from ..api_server.routes.internal.internal_routes import InternalRoutes +from ..app.custom_node_manager import CustomNodeManager from ..app.frontend_management import FrontendManager from ..app.model_manager import ModelFileManager from ..app.user_manager import UserManager @@ -172,6 +173,7 @@ class PromptServer(ExecutorToClientProgress): self.address: str = "0.0.0.0" self.user_manager = UserManager() self.model_file_manager = ModelFileManager() + self.custom_node_manager = CustomNodeManager() self.internal_routes = InternalRoutes(self) # todo: this is probably read by custom nodes elsewhere self.supports: List[str] = ["custom_nodes_from_web"] @@ -528,7 +530,7 @@ class PromptServer(ExecutorToClientProgress): "os": os.name, "ram_total": ram_total, "ram_free": ram_free, - "comfyui_version": get_comfyui_version(), + "comfyui_version": __version__, "python_version": sys.version, "pytorch_version": torch_version, "embedded_python": os.path.split(os.path.split(sys.executable)[0])[1] == "python_embeded", @@ -922,6 +924,8 @@ class PromptServer(ExecutorToClientProgress): def add_routes(self): self.user_manager.add_routes(self.routes) self.model_file_manager.add_routes(self.routes) + # todo: needs to use module directories + self.custom_node_manager.add_routes(self.routes, self.app, {}) self.app.add_subapp('/internal', self.internal_routes.get_app()) # Prefix every route with /api for easier matching for delegation. @@ -938,6 +942,7 @@ class PromptServer(ExecutorToClientProgress): self.app.add_routes(api_routes) self.app.add_routes(self.routes) + # Add routes from web extensions. for name, dir in self.nodes.EXTENSION_WEB_DIRS.items(): self.app.add_routes([web.static('/extensions/' + name, dir, follow_symlinks=True)]) diff --git a/comfy/comfy_types/README.md b/comfy/comfy_types/README.md index 869851e7c..20a786a5e 100644 --- a/comfy/comfy_types/README.md +++ b/comfy/comfy_types/README.md @@ -5,7 +5,7 @@ This module provides type hinting and concrete convenience types for node develo If cloned to the custom_nodes directory of ComfyUI, types can be imported using: ```python -from comfy_types import IO, ComfyNodeABC, CheckLazyMixin +from comfy.comfy_types import IO, ComfyNodeABC, CheckLazyMixin class ExampleNode(ComfyNodeABC): @classmethod diff --git a/comfy/comfy_types/examples/example_nodes.py b/comfy/comfy_types/examples/example_nodes.py index b6465f39e..6e19c5451 100644 --- a/comfy/comfy_types/examples/example_nodes.py +++ b/comfy/comfy_types/examples/example_nodes.py @@ -1,12 +1,12 @@ -from comfy_types import IO, ComfyNodeABC, InputTypeDict +from comfy.comfy_types import IO, ComfyNodeABC, InputTypeDict from inspect import cleandoc class ExampleNode(ComfyNodeABC): """An example node that just adds 1 to an input integer. - * Requires an IDE configured with analysis paths etc to be worth looking at. - * Not intended for use in ComfyUI. + * Requires a modern IDE to provide any benefit (detail: an IDE configured with analysis paths etc). + * This node is intended as an example for developers only. """ DESCRIPTION = cleandoc(__doc__) diff --git a/comfy/extra_config.py b/comfy/extra_config.py index 666390e2d..d3603ec72 100644 --- a/comfy/extra_config.py +++ b/comfy/extra_config.py @@ -9,6 +9,7 @@ def load_extra_path_config(yaml_path): with open(yaml_path, 'r') as stream: config = yaml.safe_load(stream) + yaml_dir = os.path.dirname(os.path.abspath(yaml_path)) for c in config: conf = config[c] if conf is None: @@ -17,6 +18,8 @@ def load_extra_path_config(yaml_path): if "base_path" in conf: base_path = conf.pop("base_path") base_path = os.path.expandvars(os.path.expanduser(base_path)) + if not os.path.isabs(base_path): + base_path = os.path.abspath(os.path.join(yaml_dir, base_path)) is_default = False if "is_default" in conf: is_default = conf.pop("is_default") @@ -25,10 +28,9 @@ def load_extra_path_config(yaml_path): if len(y) == 0: continue full_path = y - if base_path is not None: + if base_path: full_path = os.path.join(base_path, full_path) elif not os.path.isabs(full_path): - yaml_dir = os.path.dirname(os.path.abspath(yaml_path)) full_path = os.path.abspath(os.path.join(yaml_dir, y)) logging.info("Adding extra search path {} {}".format(x, full_path)) folder_paths.add_model_folder_path(x, full_path, is_default=is_default) diff --git a/comfy/extra_samplers/uni_pc.py b/comfy/extra_samplers/uni_pc.py index 1be6274ff..5b744705c 100644 --- a/comfy/extra_samplers/uni_pc.py +++ b/comfy/extra_samplers/uni_pc.py @@ -226,7 +226,7 @@ def model_wrapper( The input `model` has the following format: `` model(x, t_input, **model_kwargs) -> noise | x_start | v | score - `` + `` The input `classifier_fn` has the following format: `` @@ -240,7 +240,7 @@ def model_wrapper( The input `model` has the following format: `` model(x, t_input, cond, **model_kwargs) -> noise | x_start | v | score - `` + `` And if cond == `unconditional_condition`, the model output is the unconditional DPM output. [4] Ho, Jonathan, and Tim Salimans. "Classifier-free diffusion guidance." @@ -254,7 +254,7 @@ def model_wrapper( `` def model_fn(x, t_continuous) -> noise: t_input = get_model_input_time(t_continuous) - return noise_pred(model, x, t_input, **model_kwargs) + return noise_pred(model, x, t_input, **model_kwargs) `` where `t_continuous` is the continuous time labels (i.e. epsilon to T). And we use `model_fn` for DPM-Solver. @@ -360,7 +360,7 @@ class UniPC: dynamic_thresholding_ratio=0.995, variant='bh1', ): - """Construct a UniPC. + """Construct a UniPC. We support both data_prediction and noise_prediction. """ @@ -374,7 +374,7 @@ class UniPC: def dynamic_thresholding_fn(self, x0, t=None): """ - The dynamic thresholding method. + The dynamic thresholding method. """ dims = x0.dim() p = self.dynamic_thresholding_ratio @@ -406,7 +406,7 @@ class UniPC: def model_fn(self, x, t): """ - Convert the model to the noise prediction model or the data prediction model. + Convert the model to the noise prediction model or the data prediction model. """ if self.predict_x0: return self.data_prediction_fn(x, t) @@ -463,7 +463,7 @@ class UniPC: def denoise_to_zero_fn(self, x, s): """ - Denoise at the final step, which is equivalent to solve the ODE from lambda_s to infty by first-order discretization. + Denoise at the final step, which is equivalent to solve the ODE from lambda_s to infty by first-order discretization. """ return self.data_prediction_fn(x, s) @@ -512,7 +512,7 @@ class UniPC: col = torch.ones_like(rks) for k in range(1, K + 1): C.append(col) - col = col * rks / (k + 1) + col = col * rks / (k + 1) C = torch.stack(C, dim=1) if len(D1s) > 0: @@ -628,7 +628,7 @@ class UniPC: R.append(torch.pow(rks, i - 1)) b.append(h_phi_k * factorial_i / B_h) factorial_i *= (i + 1) - h_phi_k = h_phi_k / hh - 1 / factorial_i + h_phi_k = h_phi_k / hh - 1 / factorial_i R = torch.stack(R) b = torch.tensor(b, device=x.device) diff --git a/comfy/graph.py b/comfy/graph.py index df342b5f6..a24f134ae 100644 --- a/comfy/graph.py +++ b/comfy/graph.py @@ -1,7 +1,8 @@ from typing import Optional from .cmd.execution import nodes -from .component_model.executor_types import DependencyCycleError, NodeInputError, NodeNotFoundError, DependencyExecutionErrorMessage +from .component_model.executor_types import DependencyCycleError, NodeInputError, NodeNotFoundError, \ + DependencyExecutionErrorMessage from .graph_utils import is_link @@ -49,8 +50,8 @@ class DynamicPrompt: return self.original_prompt -def get_input_info(class_def, input_name): - valid_inputs = class_def.INPUT_TYPES() +def get_input_info(class_def, input_name, valid_inputs=None): + valid_inputs = valid_inputs or class_def.INPUT_TYPES() input_info = None input_category = None if "required" in valid_inputs and input_name in valid_inputs["required"]: @@ -127,7 +128,7 @@ class TopologicalSort: if (include_lazy or not is_lazy) and not self.is_cached(from_node_id): node_ids.append(from_node_id) links.append((from_node_id, from_socket, unique_id)) - + for link in links: self.add_strong_link(*link) @@ -205,20 +206,20 @@ class ExecutionList(TopologicalSort): if is_output(node_id): return node_id - #This should handle the VAEDecode -> preview case + # This should handle the VAEDecode -> preview case for node_id in node_list: for blocked_node_id in self.blocking[node_id]: if is_output(blocked_node_id): return node_id - #This should handle the VAELoader -> VAEDecode -> preview case + # This should handle the VAELoader -> VAEDecode -> preview case for node_id in node_list: for blocked_node_id in self.blocking[node_id]: for blocked_node_id1 in self.blocking[blocked_node_id]: if is_output(blocked_node_id1): return node_id - #TODO: this function should be improved + # TODO: this function should be improved return node_list[0] def unstage_node_execution(self): diff --git a/comfy/hooks.py b/comfy/hooks.py index 1539d74b4..c3f8004b8 100644 --- a/comfy/hooks.py +++ b/comfy/hooks.py @@ -22,19 +22,36 @@ if TYPE_CHECKING: from .sd import CLIP +# ####################################################################################################### +# Hooks explanation +# ------------------- +# The purpose of hooks is to allow conds to influence sampling without the need for ComfyUI core code to +# make explicit special cases like it does for ControlNet and GLIGEN. +# +# This is necessary for nodes/features that are intended for use with masked or scheduled conds, or those +# that should run special code when a 'marked' cond is used in sampling. +# ####################################################################################################### + class EnumHookMode(enum.Enum): + ''' + Priority of hook memory optimization vs. speed, mostly related to WeightHooks. + + MinVram: No caching will occur for any operations related to hooks. + MaxSpeed: Excess VRAM (and RAM, once VRAM is sufficiently depleted) will be used to cache hook weights when switching hook groups. + ''' MinVram = "minvram" MaxSpeed = "maxspeed" class EnumHookType(enum.Enum): + ''' + Hook types, each of which has different expected behavior. + ''' Weight = "weight" - Patch = "patch" ObjectPatch = "object_patch" - AddModels = "add_models" - Callbacks = "callbacks" - Wrappers = "wrappers" - SetInjections = "add_injections" + AdditionalModels = "add_models" + TransformerOptions = "transformer_options" + Injections = "add_injections" class EnumWeightTarget(enum.Enum): @@ -42,62 +59,79 @@ class EnumWeightTarget(enum.Enum): Clip = "clip" +class EnumHookScope(enum.Enum): + ''' + Determines if hook should be limited in its influence over sampling. + + AllConditioning: hook will affect all conds used in sampling. + HookedOnly: hook will only affect the conds it was attached to. + ''' + AllConditioning = "all_conditioning" + HookedOnly = "hooked_only" + + class _HookRef: pass -# NOTE: this is an example of how the should_register function should look -def default_should_register(hook: 'Hook', model: 'ModelPatcher', model_options: dict, target: EnumWeightTarget, registered: list[Hook]): +def default_should_register(hook: Hook, model: ModelPatcher, model_options: dict, target_dict: dict[str], registered: HookGroup): + '''Example for how custom_should_register function can look like.''' return True +def create_target_dict(target: EnumWeightTarget = None, **kwargs) -> dict[str]: + '''Creates base dictionary for use with Hooks' target param.''' + d = {} + if target is not None: + d['target'] = target + d.update(kwargs) + return d + + class Hook: def __init__(self, hook_type: EnumHookType = None, hook_ref: _HookRef = None, hook_id: str = None, - hook_keyframe: 'HookKeyframeGroup' = None): + hook_keyframe: HookKeyframeGroup = None, hook_scope=EnumHookScope.AllConditioning): self.hook_type = hook_type + '''Enum identifying the general class of this hook.''' self.hook_ref = hook_ref if hook_ref else _HookRef() + '''Reference shared between hook clones that have the same value. Should NOT be modified.''' self.hook_id = hook_id + '''Optional string ID to identify hook; useful if need to consolidate duplicates at registration time.''' self.hook_keyframe = hook_keyframe if hook_keyframe else HookKeyframeGroup() + '''Keyframe storage that can be referenced to get strength for current sampling step.''' + self.hook_scope = hook_scope + '''Scope of where this hook should apply in terms of the conds used in sampling run.''' self.custom_should_register = default_should_register - self.auto_apply_to_nonpositive = False + '''Can be overriden with a compatible function to decide if this hook should be registered without the need to override .should_register''' @property def strength(self): return self.hook_keyframe.strength - def initialize_timesteps(self, model: 'BaseModel'): + def initialize_timesteps(self, model: BaseModel): self.reset() self.hook_keyframe.initialize_timesteps(model) def reset(self): self.hook_keyframe.reset() - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: Hook = subtype() + def clone(self): + c: Hook = self.__class__() c.hook_type = self.hook_type c.hook_ref = self.hook_ref c.hook_id = self.hook_id c.hook_keyframe = self.hook_keyframe + c.hook_scope = self.hook_scope c.custom_should_register = self.custom_should_register - # TODO: make this do something - c.auto_apply_to_nonpositive = self.auto_apply_to_nonpositive return c - def should_register(self, model: 'ModelPatcher', model_options: dict, target: EnumWeightTarget, registered: list[Hook]): - return self.custom_should_register(self, model, model_options, target, registered) + def should_register(self, model: ModelPatcher, model_options: dict, target_dict: dict[str], registered: HookGroup): + return self.custom_should_register(self, model, model_options, target_dict, registered) - def add_hook_patches(self, model: 'ModelPatcher', model_options: dict, target: EnumWeightTarget, registered: list[Hook]): + def add_hook_patches(self, model: ModelPatcher, model_options: dict, target_dict: dict[str], registered: HookGroup): raise NotImplementedError("add_hook_patches should be defined for Hook subclasses") - def on_apply(self, model: 'ModelPatcher', transformer_options: dict[str]): - pass - - def on_unapply(self, model: 'ModelPatcher', transformer_options: dict[str]): - pass - - def __eq__(self, other: 'Hook'): + def __eq__(self, other: Hook): return self.__class__ == other.__class__ and self.hook_ref == other.hook_ref def __hash__(self): @@ -105,13 +139,20 @@ class Hook: class WeightHook(Hook): + ''' + Hook responsible for tracking weights to be applied to some model/clip. + + Note, value of hook_scope is ignored and is treated as HookedOnly. + ''' + def __init__(self, strength_model=1.0, strength_clip=1.0): - super().__init__(hook_type=EnumHookType.Weight) + super().__init__(hook_type=EnumHookType.Weight, hook_scope=EnumHookScope.HookedOnly) self.weights: dict = None self.weights_clip: dict = None self.need_weight_init = True self._strength_model = strength_model self._strength_clip = strength_clip + self.hook_scope = EnumHookScope.HookedOnly # this value does not matter for WeightHooks, just for docs @property def strength_model(self): @@ -121,36 +162,36 @@ class WeightHook(Hook): def strength_clip(self): return self._strength_clip * self.strength - def add_hook_patches(self, model: 'ModelPatcher', model_options: dict, target: EnumWeightTarget, registered: list[Hook]): - if not self.should_register(model, model_options, target, registered): + def add_hook_patches(self, model: 'ModelPatcher', model_options: dict, target_dict: dict[str], registered: HookGroup): + if not self.should_register(model, model_options, target_dict, registered): return False weights = None - if target == EnumWeightTarget.Model: - strength = self._strength_model - else: + + target = target_dict.get('target', None) + if target == EnumWeightTarget.Clip: strength = self._strength_clip + else: + strength = self._strength_model if self.need_weight_init: key_map = {} - if target == EnumWeightTarget.Model: - key_map = model_lora_keys_unet(model.model, key_map) - else: + if target == EnumWeightTarget.Clip: key_map = model_lora_keys_clip(model.model, key_map) + else: + key_map = model_lora_keys_unet(model.model, key_map) weights = load_lora(self.weights, key_map, log_missing=False) else: - if target == EnumWeightTarget.Model: - weights = self.weights - else: + if target == EnumWeightTarget.Clip: weights = self.weights_clip + else: + weights = self.weights model.add_hook_patches(hook=self, patches=weights, strength_patch=strength) - registered.append(self) + registered.add(self) return True # TODO: add logs about any keys that were not applied - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: WeightHook = super().clone(subtype) + def clone(self): + c: WeightHook = super().clone() c.weights = self.weights c.weights_clip = self.weights_clip c.need_weight_init = self.need_weight_init @@ -159,133 +200,167 @@ class WeightHook(Hook): return c -class PatchHook(Hook): - def __init__(self): - super().__init__(hook_type=EnumHookType.Patch) - self.patches: dict = None - - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: PatchHook = super().clone(subtype) - c.patches = self.patches - return c - # TODO: add functionality - - class ObjectPatchHook(Hook): - def __init__(self): + def __init__(self, object_patches: dict[str] = None, + hook_scope=EnumHookScope.AllConditioning): super().__init__(hook_type=EnumHookType.ObjectPatch) - self.object_patches: dict = None + self.object_patches = object_patches + self.hook_scope = hook_scope - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: ObjectPatchHook = super().clone(subtype) + def clone(self): + c: ObjectPatchHook = super().clone() c.object_patches = self.object_patches return c - # TODO: add functionality + + def add_hook_patches(self, model: 'ModelPatcher', model_options: dict, target_dict: dict[str], registered: HookGroup): + raise NotImplementedError("ObjectPatchHook is not supported yet in ComfyUI.") -class AddModelsHook(Hook): - def __init__(self, key: str = None, models: list['ModelPatcher'] = None): - super().__init__(hook_type=EnumHookType.AddModels) - self.key = key +class AdditionalModelsHook(Hook): + ''' + Hook responsible for telling model management any additional models that should be loaded. + + Note, value of hook_scope is ignored and is treated as AllConditioning. + ''' + + def __init__(self, models: list['ModelPatcher'] = None, key: str = None): + super().__init__(hook_type=EnumHookType.AdditionalModels) self.models = models - self.append_when_same = True - - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: AddModelsHook = super().clone(subtype) - c.key = self.key - c.models = self.models.copy() if self.models else self.models - c.append_when_same = self.append_when_same - return c - # TODO: add functionality - - -class CallbackHook(Hook): - def __init__(self, key: str = None, callback: Callable = None): - super().__init__(hook_type=EnumHookType.Callbacks) self.key = key - self.callback = callback - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: CallbackHook = super().clone(subtype) + def clone(self): + c: AdditionalModelsHook = super().clone() + c.models = self.models.copy() if self.models else self.models c.key = self.key - c.callback = self.callback - return c - # TODO: add functionality - - -class WrapperHook(Hook): - def __init__(self, wrappers_dict: dict[str, dict[str, dict[str, list[Callable]]]] = None): - super().__init__(hook_type=EnumHookType.Wrappers) - self.wrappers_dict = wrappers_dict - - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: WrapperHook = super().clone(subtype) - c.wrappers_dict = self.wrappers_dict return c - def add_hook_patches(self, model: 'ModelPatcher', model_options: dict, target: EnumWeightTarget, registered: list[Hook]): - if not self.should_register(model, model_options, target, registered): + def add_hook_patches(self, model: ModelPatcher, model_options: dict, target_dict: dict[str], registered: HookGroup): + if not self.should_register(model, model_options, target_dict, registered): return False - add_model_options = {"transformer_options": self.wrappers_dict} - merge_nested_dicts(model_options, add_model_options, copy_dict1=False) - registered.append(self) + registered.add(self) return True -class SetInjectionsHook(Hook): - def __init__(self, key: str = None, injections: list['PatcherInjection'] = None): - super().__init__(hook_type=EnumHookType.SetInjections) +class TransformerOptionsHook(Hook): + ''' + Hook responsible for adding wrappers, callbacks, patches, or anything else related to transformer_options. + ''' + + def __init__(self, transformers_dict: dict[str, dict[str, dict[str, list[Callable]]]] = None, + hook_scope=EnumHookScope.AllConditioning): + super().__init__(hook_type=EnumHookType.TransformerOptions) + self.transformers_dict = transformers_dict + self.hook_scope = hook_scope + self._skip_adding = False + '''Internal value used to avoid double load of transformer_options when hook_scope is AllConditioning.''' + + def clone(self): + c: TransformerOptionsHook = super().clone() + c.transformers_dict = self.transformers_dict + c._skip_adding = self._skip_adding + return c + + def add_hook_patches(self, model: ModelPatcher, model_options: dict, target_dict: dict[str], registered: HookGroup): + if not self.should_register(model, model_options, target_dict, registered): + return False + # NOTE: to_load_options will be used to manually load patches/wrappers/callbacks from hooks + self._skip_adding = False + if self.hook_scope == EnumHookScope.AllConditioning: + add_model_options = {"transformer_options": self.transformers_dict, + "to_load_options": self.transformers_dict} + # skip_adding if included in AllConditioning to avoid double loading + self._skip_adding = True + else: + add_model_options = {"to_load_options": self.transformers_dict} + registered.add(self) + merge_nested_dicts(model_options, add_model_options, copy_dict1=False) + return True + + +def on_apply_hooks(self, model: 'ModelPatcher', transformer_options: dict[str]): + if not self._skip_adding: + merge_nested_dicts(transformer_options, self.transformers_dict, copy_dict1=False) + + +WrapperHook = TransformerOptionsHook +'''Only here for backwards compatibility, WrapperHook is identical to TransformerOptionsHook.''' + + +class InjectionsHook(Hook): + def __init__(self, key: str = None, injections: list[PatcherInjection] = None, + hook_scope=EnumHookScope.AllConditioning): + super().__init__(hook_type=EnumHookType.Injections) self.key = key self.injections = injections + self.hook_scope = hook_scope - def clone(self, subtype: Callable = None): - if subtype is None: - subtype = type(self) - c: SetInjectionsHook = super().clone(subtype) + def clone(self): + c: InjectionsHook = super().clone() c.key = self.key c.injections = self.injections.copy() if self.injections else self.injections return c - def add_hook_injections(self, model: 'ModelPatcher'): - # TODO: add functionality - pass + def add_hook_patches(self, model: ModelPatcher, model_options: dict, target_dict: dict[str], registered: HookGroup): + raise NotImplementedError("InjectionsHook is not supported yet in ComfyUI.") class HookGroup: + ''' + Stores groups of hooks, and allows them to be queried by type. + + To prevent breaking their functionality, never modify the underlying self.hooks or self._hook_dict vars directly; + always use the provided functions on HookGroup. + ''' + def __init__(self): self.hooks: list[Hook] = [] + self._hook_dict: dict[EnumHookType, list[Hook]] = {} + + def __len__(self): + return len(self.hooks) def add(self, hook: Hook): if hook not in self.hooks: self.hooks.append(hook) + self._hook_dict.setdefault(hook.hook_type, []).append(hook) + + def remove(self, hook: Hook): + if hook in self.hooks: + self.hooks.remove(hook) + self._hook_dict[hook.hook_type].remove(hook) + + def get_type(self, hook_type: EnumHookType): + return self._hook_dict.get(hook_type, []) def contains(self, hook: Hook): return hook in self.hooks + def is_subset_of(self, other: HookGroup): + self_hooks = set(self.hooks) + other_hooks = set(other.hooks) + return self_hooks.issubset(other_hooks) + + def new_with_common_hooks(self, other: HookGroup): + c = HookGroup() + for hook in self.hooks: + if other.contains(hook): + c.add(hook.clone()) + return c + def clone(self): c = HookGroup() for hook in self.hooks: c.add(hook.clone()) return c - def clone_and_combine(self, other: 'HookGroup'): + def clone_and_combine(self, other: HookGroup): c = self.clone() if other is not None: for hook in other.hooks: c.add(hook.clone()) return c - def set_keyframes_on_hooks(self, hook_kf: 'HookKeyframeGroup'): + def set_keyframes_on_hooks(self, hook_kf: HookKeyframeGroup): if hook_kf is None: hook_kf = HookKeyframeGroup() else: @@ -293,36 +368,29 @@ class HookGroup: for hook in self.hooks: hook.hook_keyframe = hook_kf - def get_dict_repr(self): - d: dict[EnumHookType, dict[Hook, None]] = {} - for hook in self.hooks: - with_type = d.setdefault(hook.hook_type, {}) - with_type[hook] = None - return d - def get_hooks_for_clip_schedule(self): scheduled_hooks: dict[Hook, list[tuple[tuple[float, float], HookKeyframe]]] = {} - for hook in self.hooks: - # only care about WeightHooks, for now - if hook.hook_type == EnumHookType.Weight: - hook_schedule = [] - # if no hook keyframes, assign default value - if len(hook.hook_keyframe.keyframes) == 0: - hook_schedule.append(((0.0, 1.0), None)) - scheduled_hooks[hook] = hook_schedule - continue - # find ranges of values - prev_keyframe = hook.hook_keyframe.keyframes[0] - for keyframe in hook.hook_keyframe.keyframes: - if keyframe.start_percent > prev_keyframe.start_percent and not math.isclose(keyframe.strength, prev_keyframe.strength): - hook_schedule.append(((prev_keyframe.start_percent, keyframe.start_percent), prev_keyframe)) - prev_keyframe = keyframe - elif keyframe.start_percent == prev_keyframe.start_percent: - prev_keyframe = keyframe - # create final range, assuming last start_percent was not 1.0 - if not math.isclose(prev_keyframe.start_percent, 1.0): - hook_schedule.append(((prev_keyframe.start_percent, 1.0), prev_keyframe)) + # only care about WeightHooks, for now + for hook in self.get_type(EnumHookType.Weight): + hook: WeightHook + hook_schedule = [] + # if no hook keyframes, assign default value + if len(hook.hook_keyframe.keyframes) == 0: + hook_schedule.append(((0.0, 1.0), None)) scheduled_hooks[hook] = hook_schedule + continue + # find ranges of values + prev_keyframe = hook.hook_keyframe.keyframes[0] + for keyframe in hook.hook_keyframe.keyframes: + if keyframe.start_percent > prev_keyframe.start_percent and not math.isclose(keyframe.strength, prev_keyframe.strength): + hook_schedule.append(((prev_keyframe.start_percent, keyframe.start_percent), prev_keyframe)) + prev_keyframe = keyframe + elif keyframe.start_percent == prev_keyframe.start_percent: + prev_keyframe = keyframe + # create final range, assuming last start_percent was not 1.0 + if not math.isclose(prev_keyframe.start_percent, 1.0): + hook_schedule.append(((prev_keyframe.start_percent, 1.0), prev_keyframe)) + scheduled_hooks[hook] = hook_schedule # hooks should not have their schedules in a list of tuples all_ranges: list[tuple[float, float]] = [] for range_kfs in scheduled_hooks.values(): @@ -384,6 +452,12 @@ class HookKeyframe: self.start_t = 999999999.9 self.guarantee_steps = guarantee_steps + def get_effective_guarantee_steps(self, max_sigma: torch.Tensor): + '''If keyframe starts before current sampling range (max_sigma), treat as 0.''' + if self.start_t > max_sigma: + return 0 + return self.guarantee_steps + def clone(self): c = HookKeyframe(strength=self.strength, start_percent=self.start_percent, guarantee_steps=self.guarantee_steps) @@ -427,6 +501,12 @@ class HookKeyframeGroup: else: self._current_keyframe = None + def has_guarantee_steps(self): + for kf in self.keyframes: + if kf.guarantee_steps > 0: + return True + return False + def has_index(self, index: int): return index >= 0 and index < len(self.keyframes) @@ -440,19 +520,20 @@ class HookKeyframeGroup: c._set_first_as_current() return c - def initialize_timesteps(self, model: 'BaseModel'): + def initialize_timesteps(self, model: BaseModel): for keyframe in self.keyframes: keyframe.start_t = model.model_sampling.percent_to_sigma(keyframe.start_percent) - def prepare_current_keyframe(self, curr_t: float) -> bool: + def prepare_current_keyframe(self, curr_t: float, transformer_options: dict[str, torch.Tensor]) -> bool: if self.is_empty(): return False if curr_t == self._curr_t: return False + max_sigma = torch.max(transformer_options["sample_sigmas"]) prev_index = self._current_index prev_strength = self._current_strength # if met guaranteed steps, look for next keyframe in case need to switch - if self._current_used_steps >= self._current_keyframe.guarantee_steps: + if self._current_used_steps >= self._current_keyframe.get_effective_guarantee_steps(max_sigma): # if has next index, loop through and see if need to switch if self.has_index(self._current_index + 1): for i in range(self._current_index + 1, len(self.keyframes)): @@ -465,7 +546,7 @@ class HookKeyframeGroup: self._current_keyframe = eval_c self._current_used_steps = 0 # if guarantee_steps greater than zero, stop searching for other keyframes - if self._current_keyframe.guarantee_steps > 0: + if self._current_keyframe.get_effective_guarantee_steps(max_sigma) > 0: break # if eval_c is outside the percent range, stop looking further else: @@ -531,6 +612,18 @@ def get_sorted_list_via_attr(objects: list, attr: str) -> list: return sorted_list +def create_transformer_options_from_hooks(model: 'ModelPatcher', hooks: HookGroup, transformer_options: dict[str] = None): + # if no hooks or is not a ModelPatcher for sampling, return empty dict + if hooks is None or model.is_clip: + return {} + if transformer_options is None: + transformer_options = {} + for hook in hooks.get_type(EnumHookType.TransformerOptions): + hook: TransformerOptionsHook + hook.on_apply_hooks(model, transformer_options) + return transformer_options + + def create_hook_lora(lora: dict[str, torch.Tensor], strength_model: float, strength_clip: float): hook_group = HookGroup() hook = WeightHook(strength_model=strength_model, strength_clip=strength_clip) @@ -559,7 +652,7 @@ def create_hook_model_as_lora(weights_model, weights_clip, strength_model: float return hook_group -def get_patch_weights_from_model(model: 'ModelPatcher', discard_model_sampling=True): +def get_patch_weights_from_model(model: ModelPatcher, discard_model_sampling=True): if model is None: return None patches_model: dict[str, torch.Tensor] = model.model.state_dict() @@ -572,7 +665,7 @@ def get_patch_weights_from_model(model: 'ModelPatcher', discard_model_sampling=T # NOTE: this function shows how to register weight hooks directly on the ModelPatchers -def load_hook_lora_for_models(model: 'ModelPatcher', clip: 'CLIP', lora: dict[str, torch.Tensor], +def load_hook_lora_for_models(model: ModelPatcher, clip: CLIP, lora: dict[str, torch.Tensor], strength_model: float, strength_clip: float): key_map = {} if model is not None: @@ -626,16 +719,18 @@ def _combine_hooks_from_values(c_dict: dict[str, HookGroup], values: dict[str, H c_dict[hooks_key] = cache[hooks_tuple] -def conditioning_set_values_with_hooks(conditioning, values: dict[str, HookGroup] = None, append_hooks=True): +def conditioning_set_values_with_hooks(conditioning, values: dict[str, HookGroup] = None, append_hooks=True, + cache: dict[tuple[HookGroup, HookGroup], HookGroup] = None): if values is None: values = {} c = [] - hooks_combine_cache: dict[tuple[HookGroup, HookGroup], HookGroup] = {} + if cache is None: + cache = {} for t in conditioning: n = [t[0], t[1].copy()] for k in values: if append_hooks and k == 'hooks': - _combine_hooks_from_values(n[1], values, hooks_combine_cache) + _combine_hooks_from_values(n[1], values, cache) else: n[1][k] = values[k] c.append(n) @@ -643,10 +738,10 @@ def conditioning_set_values_with_hooks(conditioning, values: dict[str, HookGroup return c -def set_hooks_for_conditioning(cond, hooks: HookGroup, append_hooks=True): +def set_hooks_for_conditioning(cond, hooks: HookGroup, append_hooks=True, cache: dict[tuple[HookGroup, HookGroup], HookGroup] = None): if hooks is None: return cond - return conditioning_set_values_with_hooks(cond, {'hooks': hooks}, append_hooks=append_hooks) + return conditioning_set_values_with_hooks(cond, {'hooks': hooks}, append_hooks=append_hooks, cache=cache) def set_timesteps_for_conditioning(cond, timestep_range: tuple[float, float]): @@ -686,9 +781,10 @@ def combine_with_new_conds(conds: list, new_conds: list): def set_conds_props(conds: list, strength: float, set_cond_area: str, mask: torch.Tensor = None, hooks: HookGroup = None, timesteps_range: tuple[float, float] = None, append_hooks=True): final_conds = [] + cache = {} for c in conds: # first, apply lora_hook to conditioning, if provided - c = set_hooks_for_conditioning(c, hooks, append_hooks=append_hooks) + c = set_hooks_for_conditioning(c, hooks, append_hooks=append_hooks, cache=cache) # next, apply mask to conditioning c = set_mask_for_conditioning(cond=c, mask=mask, strength=strength, set_cond_area=set_cond_area) # apply timesteps, if present @@ -701,9 +797,10 @@ def set_conds_props(conds: list, strength: float, set_cond_area: str, def set_conds_props_and_combine(conds: list, new_conds: list, strength: float = 1.0, set_cond_area: str = "default", mask: torch.Tensor = None, hooks: HookGroup = None, timesteps_range: tuple[float, float] = None, append_hooks=True): combined_conds = [] + cache = {} for c, masked_c in zip(conds, new_conds): # first, apply lora_hook to new conditioning, if provided - masked_c = set_hooks_for_conditioning(masked_c, hooks, append_hooks=append_hooks) + masked_c = set_hooks_for_conditioning(masked_c, hooks, append_hooks=append_hooks, cache=cache) # next, apply mask to new conditioning, if provided masked_c = set_mask_for_conditioning(cond=masked_c, mask=mask, set_cond_area=set_cond_area, strength=strength) # apply timesteps, if present @@ -716,9 +813,10 @@ def set_conds_props_and_combine(conds: list, new_conds: list, strength: float = def set_default_conds_and_combine(conds: list, new_conds: list, hooks: HookGroup = None, timesteps_range: tuple[float, float] = None, append_hooks=True): combined_conds = [] + cache = {} for c, new_c in zip(conds, new_conds): # first, apply lora_hook to new conditioning, if provided - new_c = set_hooks_for_conditioning(new_c, hooks, append_hooks=append_hooks) + new_c = set_hooks_for_conditioning(new_c, hooks, append_hooks=append_hooks, cache=cache) # next, add default_cond key to cond so that during sampling, it can be identified new_c = conditioning_set_values(new_c, {'default': True}) # apply timesteps, if present diff --git a/comfy/k_diffusion/sampling.py b/comfy/k_diffusion/sampling.py index 1ab747f56..dffc84a8d 100644 --- a/comfy/k_diffusion/sampling.py +++ b/comfy/k_diffusion/sampling.py @@ -71,8 +71,14 @@ def get_ancestral_step(sigma_from, sigma_to, eta=1.): return sigma_down, sigma_up -def default_noise_sampler(x): - return lambda sigma, sigma_next: torch.randn_like(x) +def default_noise_sampler(x, seed=None): + if seed is not None: + generator = torch.Generator(device=x.device) + generator.manual_seed(seed) + else: + generator = None + + return lambda sigma, sigma_next: torch.randn(x.size(), dtype=x.dtype, layout=x.layout, device=x.device, generator=generator) class BatchedBrownianTree: @@ -169,7 +175,8 @@ def sample_euler_ancestral(model, x, sigmas, extra_args=None, callback=None, dis return sample_euler_ancestral_RF(model, x, sigmas, extra_args, callback, disable, eta, s_noise, noise_sampler) """Ancestral sampling with Euler method steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) for i in trange(len(sigmas) - 1, disable=disable): denoised = model(x, sigmas[i] * s_in, **extra_args) @@ -190,7 +197,8 @@ def sample_euler_ancestral(model, x, sigmas, extra_args=None, callback=None, dis def sample_euler_ancestral_RF(model, x, sigmas, extra_args=None, callback=None, disable=None, eta=1.0, s_noise=1., noise_sampler=None): """Ancestral sampling with Euler method steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) for i in trange(len(sigmas) - 1, disable=disable): denoised = model(x, sigmas[i] * s_in, **extra_args) @@ -291,7 +299,8 @@ def sample_dpm_2_ancestral(model, x, sigmas, extra_args=None, callback=None, dis """Ancestral sampling with DPM-Solver second-order steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) for i in trange(len(sigmas) - 1, disable=disable): denoised = model(x, sigmas[i] * s_in, **extra_args) @@ -319,7 +328,8 @@ def sample_dpm_2_ancestral(model, x, sigmas, extra_args=None, callback=None, dis def sample_dpm_2_ancestral_RF(model, x, sigmas, extra_args=None, callback=None, disable=None, eta=1., s_noise=1., noise_sampler=None): """Ancestral sampling with DPM-Solver second-order steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) for i in trange(len(sigmas) - 1, disable=disable): denoised = model(x, sigmas[i] * s_in, **extra_args) @@ -469,7 +479,7 @@ class DPMSolver(nn.Module): return x_3, eps_cache def dpm_solver_fast(self, x, t_start, t_end, nfe, eta=0., s_noise=1., noise_sampler=None): - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + noise_sampler = default_noise_sampler(x, seed=self.extra_args.get("seed", None)) if noise_sampler is None else noise_sampler if not t_end > t_start and eta: raise ValueError('eta must be 0 for reverse sampling') @@ -508,7 +518,7 @@ class DPMSolver(nn.Module): return x def dpm_solver_adaptive(self, x, t_start, t_end, order=3, rtol=0.05, atol=0.0078, h_init=0.05, pcoeff=0., icoeff=1., dcoeff=0., accept_safety=0.81, eta=0., s_noise=1., noise_sampler=None): - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + noise_sampler = default_noise_sampler(x, seed=self.extra_args.get("seed", None)) if noise_sampler is None else noise_sampler if order not in {2, 3}: raise ValueError('order should be 2 or 3') forward = t_end > t_start @@ -595,7 +605,8 @@ def sample_dpmpp_2s_ancestral(model, x, sigmas, extra_args=None, callback=None, """Ancestral sampling with DPM-Solver++(2S) second-order steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) sigma_fn = lambda t: t.neg().exp() t_fn = lambda sigma: sigma.log().neg() @@ -629,7 +640,8 @@ def sample_dpmpp_2s_ancestral(model, x, sigmas, extra_args=None, callback=None, def sample_dpmpp_2s_ancestral_RF(model, x, sigmas, extra_args=None, callback=None, disable=None, eta=1., s_noise=1., noise_sampler=None): """Ancestral sampling with DPM-Solver++(2S) second-order steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) sigma_fn = lambda lbda: (lbda.exp() + 1) ** -1 lambda_fn = lambda sigma: ((1 - sigma) / sigma).log() @@ -893,7 +905,8 @@ def DDPMSampler_step(x, sigma, sigma_prev, noise, noise_sampler): def generic_step_sampler(model, x, sigmas, extra_args=None, callback=None, disable=None, noise_sampler=None, step_function=None): extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) for i in trange(len(sigmas) - 1, disable=disable): @@ -914,7 +927,8 @@ def sample_ddpm(model, x, sigmas, extra_args=None, callback=None, disable=None, @torch.no_grad() def sample_lcm(model, x, sigmas, extra_args=None, callback=None, disable=None, noise_sampler=None): extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler s_in = x.new_ones([x.shape[0]]) for i in trange(len(sigmas) - 1, disable=disable): denoised = model(x, sigmas[i] * s_in, **extra_args) @@ -1193,7 +1207,8 @@ def sample_euler_cfg_pp(model, x, sigmas, extra_args=None, callback=None, disabl def sample_euler_ancestral_cfg_pp(model, x, sigmas, extra_args=None, callback=None, disable=None, eta=1., s_noise=1., noise_sampler=None): """Ancestral sampling with Euler method steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler temp = [0] @@ -1222,7 +1237,8 @@ def sample_euler_ancestral_cfg_pp(model, x, sigmas, extra_args=None, callback=No def sample_dpmpp_2s_ancestral_cfg_pp(model, x, sigmas, extra_args=None, callback=None, disable=None, eta=1., s_noise=1., noise_sampler=None): """Ancestral sampling with DPM-Solver++(2S) second-order steps.""" extra_args = {} if extra_args is None else extra_args - noise_sampler = default_noise_sampler(x) if noise_sampler is None else noise_sampler + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler temp = [0] @@ -1293,3 +1309,74 @@ def sample_dpmpp_2m_cfg_pp(model, x, sigmas, extra_args=None, callback=None, dis x = denoised + denoised_mix + torch.exp(-h) * x old_uncond_denoised = uncond_denoised return x + +@torch.no_grad() +def res_multistep(model, x, sigmas, extra_args=None, callback=None, disable=None, s_churn=0., s_tmin=0., s_tmax=float('inf'), s_noise=1., noise_sampler=None, cfg_pp=False): + extra_args = {} if extra_args is None else extra_args + seed = extra_args.get("seed", None) + noise_sampler = default_noise_sampler(x, seed=seed) if noise_sampler is None else noise_sampler + s_in = x.new_ones([x.shape[0]]) + sigma_fn = lambda t: t.neg().exp() + t_fn = lambda sigma: sigma.log().neg() + phi1_fn = lambda t: torch.expm1(t) / t + phi2_fn = lambda t: (phi1_fn(t) - 1.0) / t + + old_denoised = None + uncond_denoised = None + def post_cfg_function(args): + nonlocal uncond_denoised + uncond_denoised = args["uncond_denoised"] + return args["denoised"] + + if cfg_pp: + model_options = extra_args.get("model_options", {}).copy() + extra_args["model_options"] = comfy.model_patcher.set_model_options_post_cfg_function(model_options, post_cfg_function, disable_cfg1_optimization=True) + + for i in trange(len(sigmas) - 1, disable=disable): + if s_churn > 0: + gamma = min(s_churn / (len(sigmas) - 1), 2**0.5 - 1) if s_tmin <= sigmas[i] <= s_tmax else 0.0 + sigma_hat = sigmas[i] * (gamma + 1) + else: + gamma = 0 + sigma_hat = sigmas[i] + + if gamma > 0: + eps = torch.randn_like(x) * s_noise + x = x + eps * (sigma_hat**2 - sigmas[i] ** 2) ** 0.5 + denoised = model(x, sigma_hat * s_in, **extra_args) + if callback is not None: + callback({"x": x, "i": i, "sigma": sigmas[i], "sigma_hat": sigma_hat, "denoised": denoised}) + if sigmas[i + 1] == 0 or old_denoised is None: + # Euler method + if cfg_pp: + d = to_d(x, sigma_hat, uncond_denoised) + x = denoised + d * sigmas[i + 1] + else: + d = to_d(x, sigma_hat, denoised) + dt = sigmas[i + 1] - sigma_hat + x = x + d * dt + else: + # Second order multistep method in https://arxiv.org/pdf/2308.02157 + t, t_next, t_prev = t_fn(sigmas[i]), t_fn(sigmas[i + 1]), t_fn(sigmas[i - 1]) + h = t_next - t + c2 = (t_prev - t) / h + + phi1_val, phi2_val = phi1_fn(-h), phi2_fn(-h) + b1 = torch.nan_to_num(phi1_val - 1.0 / c2 * phi2_val, nan=0.0) + b2 = torch.nan_to_num(1.0 / c2 * phi2_val, nan=0.0) + + if cfg_pp: + x = x + (denoised - uncond_denoised) + + x = (sigma_fn(t_next) / sigma_fn(t)) * x + h * (b1 * denoised + b2 * old_denoised) + + old_denoised = denoised + return x + +@torch.no_grad() +def sample_res_multistep(model, x, sigmas, extra_args=None, callback=None, disable=None, s_churn=0., s_tmin=0., s_tmax=float('inf'), s_noise=1., noise_sampler=None): + return res_multistep(model, x, sigmas, extra_args=extra_args, callback=callback, disable=disable, s_churn=s_churn, s_tmin=s_tmin, s_tmax=s_tmax, s_noise=s_noise, noise_sampler=noise_sampler, cfg_pp=False) + +@torch.no_grad() +def sample_res_multistep_cfg_pp(model, x, sigmas, extra_args=None, callback=None, disable=None, s_churn=0., s_tmin=0., s_tmax=float('inf'), s_noise=1., noise_sampler=None): + return res_multistep(model, x, sigmas, extra_args=extra_args, callback=callback, disable=disable, s_churn=s_churn, s_tmin=s_tmin, s_tmax=s_tmax, s_noise=s_noise, noise_sampler=noise_sampler, cfg_pp=True) diff --git a/comfy/latent_formats.py b/comfy/latent_formats.py index 1f070f175..ee57a5b48 100644 --- a/comfy/latent_formats.py +++ b/comfy/latent_formats.py @@ -4,6 +4,7 @@ import torch class LatentFormat: scale_factor = 1.0 latent_channels = 4 + latent_dimensions = 2 latent_rgb_factors = None latent_rgb_factors_bias = None taesd_decoder_name = None @@ -153,6 +154,7 @@ class SD3(LatentFormat): class StableAudio1(LatentFormat): latent_channels = 64 + latent_dimensions = 1 class Flux(SD3): @@ -191,6 +193,7 @@ class Flux(SD3): class Mochi(LatentFormat): latent_channels = 12 + latent_dimensions = 3 def __init__(self): self.scale_factor = 1.0 @@ -233,6 +236,8 @@ class Mochi(LatentFormat): class LTXV(LatentFormat): latent_channels = 128 + latent_dimensions = 3 + def __init__(self): self.latent_rgb_factors = [ [ 1.1202e-02, -6.3815e-04, -1.0021e-02], @@ -369,6 +374,7 @@ class LTXV(LatentFormat): class HunyuanVideo(LatentFormat): latent_channels = 16 + latent_dimensions = 3 scale_factor = 0.476986 latent_rgb_factors = [ [-0.0395, -0.0331, 0.0445], @@ -390,3 +396,28 @@ class HunyuanVideo(LatentFormat): ] latent_rgb_factors_bias = [ 0.0259, -0.0192, -0.0761] + +class Cosmos1CV8x8x8(LatentFormat): + latent_channels = 16 + latent_dimensions = 3 + + latent_rgb_factors = [ + [ 0.1817, 0.2284, 0.2423], + [-0.0586, -0.0862, -0.3108], + [-0.4703, -0.4255, -0.3995], + [ 0.0803, 0.1963, 0.1001], + [-0.0820, -0.1050, 0.0400], + [ 0.2511, 0.3098, 0.2787], + [-0.1830, -0.2117, -0.0040], + [-0.0621, -0.2187, -0.0939], + [ 0.3619, 0.1082, 0.1455], + [ 0.3164, 0.3922, 0.2575], + [ 0.1152, 0.0231, -0.0462], + [-0.1434, -0.3609, -0.3665], + [ 0.0635, 0.1471, 0.1680], + [-0.3635, -0.1963, -0.3248], + [-0.1865, 0.0365, 0.2346], + [ 0.0447, 0.0994, 0.0881] + ] + + latent_rgb_factors_bias = [-0.1223, -0.1889, -0.1976] diff --git a/comfy/ldm/cascade/stage_b.py b/comfy/ldm/cascade/stage_b.py index 7c3d8feab..773830956 100644 --- a/comfy/ldm/cascade/stage_b.py +++ b/comfy/ldm/cascade/stage_b.py @@ -138,7 +138,7 @@ class StageB(nn.Module): # nn.init.normal_(self.pixels_mapper[2].weight, std=0.02) # conditionings # torch.nn.init.xavier_uniform_(self.embedding[1].weight, 0.02) # inputs # nn.init.constant_(self.clf[1].weight, 0) # outputs - # + # # # blocks # for level_block in self.down_blocks + self.up_blocks: # for block in level_block: @@ -148,7 +148,7 @@ class StageB(nn.Module): # for layer in block.modules(): # if isinstance(layer, nn.Linear): # nn.init.constant_(layer.weight, 0) - # + # # def _init_weights(self, m): # if isinstance(m, (nn.Conv2d, nn.Linear)): # torch.nn.init.xavier_uniform_(m.weight) diff --git a/comfy/ldm/cascade/stage_c.py b/comfy/ldm/cascade/stage_c.py index c85da1f01..b952d0349 100644 --- a/comfy/ldm/cascade/stage_c.py +++ b/comfy/ldm/cascade/stage_c.py @@ -142,7 +142,7 @@ class StageC(nn.Module): # nn.init.normal_(self.clip_img_mapper.weight, std=0.02) # conditionings # torch.nn.init.xavier_uniform_(self.embedding[1].weight, 0.02) # inputs # nn.init.constant_(self.clf[1].weight, 0) # outputs - # + # # # blocks # for level_block in self.down_blocks + self.up_blocks: # for block in level_block: @@ -152,7 +152,7 @@ class StageC(nn.Module): # for layer in block.modules(): # if isinstance(layer, nn.Linear): # nn.init.constant_(layer.weight, 0) - # + # # def _init_weights(self, m): # if isinstance(m, (nn.Conv2d, nn.Linear)): # torch.nn.init.xavier_uniform_(m.weight) diff --git a/comfy/ldm/cosmos/blocks.py b/comfy/ldm/cosmos/blocks.py new file mode 100644 index 000000000..84fd6d839 --- /dev/null +++ b/comfy/ldm/cosmos/blocks.py @@ -0,0 +1,808 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import math +from typing import Optional +import logging + +import numpy as np +import torch +from einops import rearrange, repeat +from einops.layers.torch import Rearrange +from torch import nn + +from comfy.ldm.modules.diffusionmodules.mmdit import RMSNorm +from comfy.ldm.modules.attention import optimized_attention + + +def apply_rotary_pos_emb( + t: torch.Tensor, + freqs: torch.Tensor, +) -> torch.Tensor: + t_ = t.reshape(*t.shape[:-1], 2, -1).movedim(-2, -1).unsqueeze(-2).float() + t_out = freqs[..., 0] * t_[..., 0] + freqs[..., 1] * t_[..., 1] + t_out = t_out.movedim(-1, -2).reshape(*t.shape).type_as(t) + return t_out + + +def get_normalization(name: str, channels: int, weight_args={}): + if name == "I": + return nn.Identity() + elif name == "R": + return RMSNorm(channels, elementwise_affine=True, eps=1e-6, **weight_args) + else: + raise ValueError(f"Normalization {name} not found") + + +class BaseAttentionOp(nn.Module): + def __init__(self): + super().__init__() + + +class Attention(nn.Module): + """ + Generalized attention impl. + + Allowing for both self-attention and cross-attention configurations depending on whether a `context_dim` is provided. + If `context_dim` is None, self-attention is assumed. + + Parameters: + query_dim (int): Dimension of each query vector. + context_dim (int, optional): Dimension of each context vector. If None, self-attention is assumed. + heads (int, optional): Number of attention heads. Defaults to 8. + dim_head (int, optional): Dimension of each head. Defaults to 64. + dropout (float, optional): Dropout rate applied to the output of the attention block. Defaults to 0.0. + attn_op (BaseAttentionOp, optional): Custom attention operation to be used instead of the default. + qkv_bias (bool, optional): If True, adds a learnable bias to query, key, and value projections. Defaults to False. + out_bias (bool, optional): If True, adds a learnable bias to the output projection. Defaults to False. + qkv_norm (str, optional): A string representing normalization strategies for query, key, and value projections. + Defaults to "SSI". + qkv_norm_mode (str, optional): A string representing normalization mode for query, key, and value projections. + Defaults to 'per_head'. Only support 'per_head'. + + Examples: + >>> attn = Attention(query_dim=128, context_dim=256, heads=4, dim_head=32, dropout=0.1) + >>> query = torch.randn(10, 128) # Batch size of 10 + >>> context = torch.randn(10, 256) # Batch size of 10 + >>> output = attn(query, context) # Perform the attention operation + + Note: + https://github.com/MatthieuTPHR/diffusers/blob/d80b531ff8060ec1ea982b65a1b8df70f73aa67c/src/diffusers/models/attention.py#L223 + """ + + def __init__( + self, + query_dim: int, + context_dim=None, + heads=8, + dim_head=64, + dropout=0.0, + attn_op: Optional[BaseAttentionOp] = None, + qkv_bias: bool = False, + out_bias: bool = False, + qkv_norm: str = "SSI", + qkv_norm_mode: str = "per_head", + backend: str = "transformer_engine", + qkv_format: str = "bshd", + weight_args={}, + operations=None, + ) -> None: + super().__init__() + + self.is_selfattn = context_dim is None # self attention + + inner_dim = dim_head * heads + context_dim = query_dim if context_dim is None else context_dim + + self.heads = heads + self.dim_head = dim_head + self.qkv_norm_mode = qkv_norm_mode + self.qkv_format = qkv_format + + if self.qkv_norm_mode == "per_head": + norm_dim = dim_head + else: + raise ValueError(f"Normalization mode {self.qkv_norm_mode} not found, only support 'per_head'") + + self.backend = backend + + self.to_q = nn.Sequential( + operations.Linear(query_dim, inner_dim, bias=qkv_bias, **weight_args), + get_normalization(qkv_norm[0], norm_dim), + ) + self.to_k = nn.Sequential( + operations.Linear(context_dim, inner_dim, bias=qkv_bias, **weight_args), + get_normalization(qkv_norm[1], norm_dim), + ) + self.to_v = nn.Sequential( + operations.Linear(context_dim, inner_dim, bias=qkv_bias, **weight_args), + get_normalization(qkv_norm[2], norm_dim), + ) + + self.to_out = nn.Sequential( + operations.Linear(inner_dim, query_dim, bias=out_bias, **weight_args), + nn.Dropout(dropout), + ) + + def cal_qkv( + self, x, context=None, mask=None, rope_emb=None, **kwargs + ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]: + del kwargs + + + """ + self.to_q, self.to_k, self.to_v are nn.Sequential with projection + normalization layers. + Before 07/24/2024, these modules normalize across all heads. + After 07/24/2024, to support tensor parallelism and follow the common practice in the community, + we support to normalize per head. + To keep the checkpoint copatibility with the previous code, + we keep the nn.Sequential but call the projection and the normalization layers separately. + We use a flag `self.qkv_norm_mode` to control the normalization behavior. + The default value of `self.qkv_norm_mode` is "per_head", which means we normalize per head. + """ + if self.qkv_norm_mode == "per_head": + q = self.to_q[0](x) + context = x if context is None else context + k = self.to_k[0](context) + v = self.to_v[0](context) + q, k, v = map( + lambda t: rearrange(t, "s b (n c) -> b n s c", n=self.heads, c=self.dim_head), + (q, k, v), + ) + else: + raise ValueError(f"Normalization mode {self.qkv_norm_mode} not found, only support 'per_head'") + + q = self.to_q[1](q) + k = self.to_k[1](k) + v = self.to_v[1](v) + if self.is_selfattn and rope_emb is not None: # only apply to self-attention! + # apply_rotary_pos_emb inlined + q_shape = q.shape + q = q.reshape(*q.shape[:-1], 2, -1).movedim(-2, -1).unsqueeze(-2) + q = rope_emb[..., 0] * q[..., 0] + rope_emb[..., 1] * q[..., 1] + q = q.movedim(-1, -2).reshape(*q_shape).to(x.dtype) + + # apply_rotary_pos_emb inlined + k_shape = k.shape + k = k.reshape(*k.shape[:-1], 2, -1).movedim(-2, -1).unsqueeze(-2) + k = rope_emb[..., 0] * k[..., 0] + rope_emb[..., 1] * k[..., 1] + k = k.movedim(-1, -2).reshape(*k_shape).to(x.dtype) + return q, k, v + + def forward( + self, + x, + context=None, + mask=None, + rope_emb=None, + **kwargs, + ): + """ + Args: + x (Tensor): The query tensor of shape [B, Mq, K] + context (Optional[Tensor]): The key tensor of shape [B, Mk, K] or use x as context [self attention] if None + """ + q, k, v = self.cal_qkv(x, context, mask, rope_emb=rope_emb, **kwargs) + out = optimized_attention(q, k, v, self.heads, skip_reshape=True, mask=mask, skip_output_reshape=True) + del q, k, v + out = rearrange(out, " b n s c -> s b (n c)") + return self.to_out(out) + + +class FeedForward(nn.Module): + """ + Transformer FFN with optional gating + + Parameters: + d_model (int): Dimensionality of input features. + d_ff (int): Dimensionality of the hidden layer. + dropout (float, optional): Dropout rate applied after the activation function. Defaults to 0.1. + activation (callable, optional): The activation function applied after the first linear layer. + Defaults to nn.ReLU(). + is_gated (bool, optional): If set to True, incorporates gating mechanism to the feed-forward layer. + Defaults to False. + bias (bool, optional): If set to True, adds a bias to the linear layers. Defaults to True. + + Example: + >>> ff = FeedForward(d_model=512, d_ff=2048) + >>> x = torch.randn(64, 10, 512) # Example input tensor + >>> output = ff(x) + >>> print(output.shape) # Expected shape: (64, 10, 512) + """ + + def __init__( + self, + d_model: int, + d_ff: int, + dropout: float = 0.1, + activation=nn.ReLU(), + is_gated: bool = False, + bias: bool = False, + weight_args={}, + operations=None, + ) -> None: + super().__init__() + + self.layer1 = operations.Linear(d_model, d_ff, bias=bias, **weight_args) + self.layer2 = operations.Linear(d_ff, d_model, bias=bias, **weight_args) + + self.dropout = nn.Dropout(dropout) + self.activation = activation + self.is_gated = is_gated + if is_gated: + self.linear_gate = operations.Linear(d_model, d_ff, bias=False, **weight_args) + + def forward(self, x: torch.Tensor): + g = self.activation(self.layer1(x)) + if self.is_gated: + x = g * self.linear_gate(x) + else: + x = g + assert self.dropout.p == 0.0, "we skip dropout" + return self.layer2(x) + + +class GPT2FeedForward(FeedForward): + def __init__(self, d_model: int, d_ff: int, dropout: float = 0.1, bias: bool = False, weight_args={}, operations=None): + super().__init__( + d_model=d_model, + d_ff=d_ff, + dropout=dropout, + activation=nn.GELU(), + is_gated=False, + bias=bias, + weight_args=weight_args, + operations=operations, + ) + + def forward(self, x: torch.Tensor): + assert self.dropout.p == 0.0, "we skip dropout" + + x = self.layer1(x) + x = self.activation(x) + x = self.layer2(x) + + return x + + +def modulate(x, shift, scale): + return x * (1 + scale.unsqueeze(1)) + shift.unsqueeze(1) + + +class Timesteps(nn.Module): + def __init__(self, num_channels): + super().__init__() + self.num_channels = num_channels + + def forward(self, timesteps): + half_dim = self.num_channels // 2 + exponent = -math.log(10000) * torch.arange(half_dim, dtype=torch.float32, device=timesteps.device) + exponent = exponent / (half_dim - 0.0) + + emb = torch.exp(exponent) + emb = timesteps[:, None].float() * emb[None, :] + + sin_emb = torch.sin(emb) + cos_emb = torch.cos(emb) + emb = torch.cat([cos_emb, sin_emb], dim=-1) + + return emb + + +class TimestepEmbedding(nn.Module): + def __init__(self, in_features: int, out_features: int, use_adaln_lora: bool = False, weight_args={}, operations=None): + super().__init__() + logging.debug( + f"Using AdaLN LoRA Flag: {use_adaln_lora}. We enable bias if no AdaLN LoRA for backward compatibility." + ) + self.linear_1 = operations.Linear(in_features, out_features, bias=not use_adaln_lora, **weight_args) + self.activation = nn.SiLU() + self.use_adaln_lora = use_adaln_lora + if use_adaln_lora: + self.linear_2 = operations.Linear(out_features, 3 * out_features, bias=False, **weight_args) + else: + self.linear_2 = operations.Linear(out_features, out_features, bias=True, **weight_args) + + def forward(self, sample: torch.Tensor) -> torch.Tensor: + emb = self.linear_1(sample) + emb = self.activation(emb) + emb = self.linear_2(emb) + + if self.use_adaln_lora: + adaln_lora_B_3D = emb + emb_B_D = sample + else: + emb_B_D = emb + adaln_lora_B_3D = None + + return emb_B_D, adaln_lora_B_3D + + +class FourierFeatures(nn.Module): + """ + Implements a layer that generates Fourier features from input tensors, based on randomly sampled + frequencies and phases. This can help in learning high-frequency functions in low-dimensional problems. + + [B] -> [B, D] + + Parameters: + num_channels (int): The number of Fourier features to generate. + bandwidth (float, optional): The scaling factor for the frequency of the Fourier features. Defaults to 1. + normalize (bool, optional): If set to True, the outputs are scaled by sqrt(2), usually to normalize + the variance of the features. Defaults to False. + + Example: + >>> layer = FourierFeatures(num_channels=256, bandwidth=0.5, normalize=True) + >>> x = torch.randn(10, 256) # Example input tensor + >>> output = layer(x) + >>> print(output.shape) # Expected shape: (10, 256) + """ + + def __init__(self, num_channels, bandwidth=1, normalize=False): + super().__init__() + self.register_buffer("freqs", 2 * np.pi * bandwidth * torch.randn(num_channels), persistent=True) + self.register_buffer("phases", 2 * np.pi * torch.rand(num_channels), persistent=True) + self.gain = np.sqrt(2) if normalize else 1 + + def forward(self, x, gain: float = 1.0): + """ + Apply the Fourier feature transformation to the input tensor. + + Args: + x (torch.Tensor): The input tensor. + gain (float, optional): An additional gain factor applied during the forward pass. Defaults to 1. + + Returns: + torch.Tensor: The transformed tensor, with Fourier features applied. + """ + in_dtype = x.dtype + x = x.to(torch.float32).ger(self.freqs.to(torch.float32)).add(self.phases.to(torch.float32)) + x = x.cos().mul(self.gain * gain).to(in_dtype) + return x + + +class PatchEmbed(nn.Module): + """ + PatchEmbed is a module for embedding patches from an input tensor by applying either 3D or 2D convolutional layers, + depending on the . This module can process inputs with temporal (video) and spatial (image) dimensions, + making it suitable for video and image processing tasks. It supports dividing the input into patches + and embedding each patch into a vector of size `out_channels`. + + Parameters: + - spatial_patch_size (int): The size of each spatial patch. + - temporal_patch_size (int): The size of each temporal patch. + - in_channels (int): Number of input channels. Default: 3. + - out_channels (int): The dimension of the embedding vector for each patch. Default: 768. + - bias (bool): If True, adds a learnable bias to the output of the convolutional layers. Default: True. + """ + + def __init__( + self, + spatial_patch_size, + temporal_patch_size, + in_channels=3, + out_channels=768, + bias=True, + weight_args={}, + operations=None, + ): + super().__init__() + self.spatial_patch_size = spatial_patch_size + self.temporal_patch_size = temporal_patch_size + + self.proj = nn.Sequential( + Rearrange( + "b c (t r) (h m) (w n) -> b t h w (c r m n)", + r=temporal_patch_size, + m=spatial_patch_size, + n=spatial_patch_size, + ), + operations.Linear( + in_channels * spatial_patch_size * spatial_patch_size * temporal_patch_size, out_channels, bias=bias, **weight_args + ), + ) + self.out = nn.Identity() + + def forward(self, x): + """ + Forward pass of the PatchEmbed module. + + Parameters: + - x (torch.Tensor): The input tensor of shape (B, C, T, H, W) where + B is the batch size, + C is the number of channels, + T is the temporal dimension, + H is the height, and + W is the width of the input. + + Returns: + - torch.Tensor: The embedded patches as a tensor, with shape b t h w c. + """ + assert x.dim() == 5 + _, _, T, H, W = x.shape + assert H % self.spatial_patch_size == 0 and W % self.spatial_patch_size == 0 + assert T % self.temporal_patch_size == 0 + x = self.proj(x) + return self.out(x) + + +class FinalLayer(nn.Module): + """ + The final layer of video DiT. + """ + + def __init__( + self, + hidden_size, + spatial_patch_size, + temporal_patch_size, + out_channels, + use_adaln_lora: bool = False, + adaln_lora_dim: int = 256, + weight_args={}, + operations=None, + ): + super().__init__() + self.norm_final = operations.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6, **weight_args) + self.linear = operations.Linear( + hidden_size, spatial_patch_size * spatial_patch_size * temporal_patch_size * out_channels, bias=False, **weight_args + ) + self.hidden_size = hidden_size + self.n_adaln_chunks = 2 + self.use_adaln_lora = use_adaln_lora + if use_adaln_lora: + self.adaLN_modulation = nn.Sequential( + nn.SiLU(), + operations.Linear(hidden_size, adaln_lora_dim, bias=False, **weight_args), + operations.Linear(adaln_lora_dim, self.n_adaln_chunks * hidden_size, bias=False, **weight_args), + ) + else: + self.adaLN_modulation = nn.Sequential( + nn.SiLU(), operations.Linear(hidden_size, self.n_adaln_chunks * hidden_size, bias=False, **weight_args) + ) + + def forward( + self, + x_BT_HW_D, + emb_B_D, + adaln_lora_B_3D: Optional[torch.Tensor] = None, + ): + if self.use_adaln_lora: + assert adaln_lora_B_3D is not None + shift_B_D, scale_B_D = (self.adaLN_modulation(emb_B_D) + adaln_lora_B_3D[:, : 2 * self.hidden_size]).chunk( + 2, dim=1 + ) + else: + shift_B_D, scale_B_D = self.adaLN_modulation(emb_B_D).chunk(2, dim=1) + + B = emb_B_D.shape[0] + T = x_BT_HW_D.shape[0] // B + shift_BT_D, scale_BT_D = repeat(shift_B_D, "b d -> (b t) d", t=T), repeat(scale_B_D, "b d -> (b t) d", t=T) + x_BT_HW_D = modulate(self.norm_final(x_BT_HW_D), shift_BT_D, scale_BT_D) + + x_BT_HW_D = self.linear(x_BT_HW_D) + return x_BT_HW_D + + +class VideoAttn(nn.Module): + """ + Implements video attention with optional cross-attention capabilities. + + This module processes video features while maintaining their spatio-temporal structure. It can perform + self-attention within the video features or cross-attention with external context features. + + Parameters: + x_dim (int): Dimension of input feature vectors + context_dim (Optional[int]): Dimension of context features for cross-attention. None for self-attention + num_heads (int): Number of attention heads + bias (bool): Whether to include bias in attention projections. Default: False + qkv_norm_mode (str): Normalization mode for query/key/value projections. Must be "per_head". Default: "per_head" + x_format (str): Format of input tensor. Must be "BTHWD". Default: "BTHWD" + + Input shape: + - x: (T, H, W, B, D) video features + - context (optional): (M, B, D) context features for cross-attention + where: + T: temporal dimension + H: height + W: width + B: batch size + D: feature dimension + M: context sequence length + """ + + def __init__( + self, + x_dim: int, + context_dim: Optional[int], + num_heads: int, + bias: bool = False, + qkv_norm_mode: str = "per_head", + x_format: str = "BTHWD", + weight_args={}, + operations=None, + ) -> None: + super().__init__() + self.x_format = x_format + + self.attn = Attention( + x_dim, + context_dim, + num_heads, + x_dim // num_heads, + qkv_bias=bias, + qkv_norm="RRI", + out_bias=bias, + qkv_norm_mode=qkv_norm_mode, + qkv_format="sbhd", + weight_args=weight_args, + operations=operations, + ) + + def forward( + self, + x: torch.Tensor, + context: Optional[torch.Tensor] = None, + crossattn_mask: Optional[torch.Tensor] = None, + rope_emb_L_1_1_D: Optional[torch.Tensor] = None, + ) -> torch.Tensor: + """ + Forward pass for video attention. + + Args: + x (Tensor): Input tensor of shape (B, T, H, W, D) or (T, H, W, B, D) representing batches of video data. + context (Tensor): Context tensor of shape (B, M, D) or (M, B, D), + where M is the sequence length of the context. + crossattn_mask (Optional[Tensor]): An optional mask for cross-attention mechanisms. + rope_emb_L_1_1_D (Optional[Tensor]): + Rotary positional embedding tensor of shape (L, 1, 1, D). L == THW for current video training. + + Returns: + Tensor: The output tensor with applied attention, maintaining the input shape. + """ + + x_T_H_W_B_D = x + context_M_B_D = context + T, H, W, B, D = x_T_H_W_B_D.shape + x_THW_B_D = rearrange(x_T_H_W_B_D, "t h w b d -> (t h w) b d") + x_THW_B_D = self.attn( + x_THW_B_D, + context_M_B_D, + crossattn_mask, + rope_emb=rope_emb_L_1_1_D, + ) + x_T_H_W_B_D = rearrange(x_THW_B_D, "(t h w) b d -> t h w b d", h=H, w=W) + return x_T_H_W_B_D + + +def adaln_norm_state(norm_state, x, scale, shift): + normalized = norm_state(x) + return normalized * (1 + scale) + shift + + +class DITBuildingBlock(nn.Module): + """ + A building block for the DiT (Diffusion Transformer) architecture that supports different types of + attention and MLP operations with adaptive layer normalization. + + Parameters: + block_type (str): Type of block - one of: + - "cross_attn"/"ca": Cross-attention + - "full_attn"/"fa": Full self-attention + - "mlp"/"ff": MLP/feedforward block + x_dim (int): Dimension of input features + context_dim (Optional[int]): Dimension of context features for cross-attention + num_heads (int): Number of attention heads + mlp_ratio (float): MLP hidden dimension multiplier. Default: 4.0 + bias (bool): Whether to use bias in layers. Default: False + mlp_dropout (float): Dropout rate for MLP. Default: 0.0 + qkv_norm_mode (str): QKV normalization mode. Default: "per_head" + x_format (str): Input tensor format. Default: "BTHWD" + use_adaln_lora (bool): Whether to use AdaLN-LoRA. Default: False + adaln_lora_dim (int): Dimension for AdaLN-LoRA. Default: 256 + """ + + def __init__( + self, + block_type: str, + x_dim: int, + context_dim: Optional[int], + num_heads: int, + mlp_ratio: float = 4.0, + bias: bool = False, + mlp_dropout: float = 0.0, + qkv_norm_mode: str = "per_head", + x_format: str = "BTHWD", + use_adaln_lora: bool = False, + adaln_lora_dim: int = 256, + weight_args={}, + operations=None + ) -> None: + block_type = block_type.lower() + + super().__init__() + self.x_format = x_format + if block_type in ["cross_attn", "ca"]: + self.block = VideoAttn( + x_dim, + context_dim, + num_heads, + bias=bias, + qkv_norm_mode=qkv_norm_mode, + x_format=self.x_format, + weight_args=weight_args, + operations=operations, + ) + elif block_type in ["full_attn", "fa"]: + self.block = VideoAttn( + x_dim, None, num_heads, bias=bias, qkv_norm_mode=qkv_norm_mode, x_format=self.x_format, weight_args=weight_args, operations=operations + ) + elif block_type in ["mlp", "ff"]: + self.block = GPT2FeedForward(x_dim, int(x_dim * mlp_ratio), dropout=mlp_dropout, bias=bias, weight_args=weight_args, operations=operations) + else: + raise ValueError(f"Unknown block type: {block_type}") + + self.block_type = block_type + self.use_adaln_lora = use_adaln_lora + + self.norm_state = nn.LayerNorm(x_dim, elementwise_affine=False, eps=1e-6) + self.n_adaln_chunks = 3 + if use_adaln_lora: + self.adaLN_modulation = nn.Sequential( + nn.SiLU(), + operations.Linear(x_dim, adaln_lora_dim, bias=False, **weight_args), + operations.Linear(adaln_lora_dim, self.n_adaln_chunks * x_dim, bias=False, **weight_args), + ) + else: + self.adaLN_modulation = nn.Sequential(nn.SiLU(), operations.Linear(x_dim, self.n_adaln_chunks * x_dim, bias=False, **weight_args)) + + def forward( + self, + x: torch.Tensor, + emb_B_D: torch.Tensor, + crossattn_emb: torch.Tensor, + crossattn_mask: Optional[torch.Tensor] = None, + rope_emb_L_1_1_D: Optional[torch.Tensor] = None, + adaln_lora_B_3D: Optional[torch.Tensor] = None, + ) -> torch.Tensor: + """ + Forward pass for dynamically configured blocks with adaptive normalization. + + Args: + x (Tensor): Input tensor of shape (B, T, H, W, D) or (T, H, W, B, D). + emb_B_D (Tensor): Embedding tensor for adaptive layer normalization modulation. + crossattn_emb (Tensor): Tensor for cross-attention blocks. + crossattn_mask (Optional[Tensor]): Optional mask for cross-attention. + rope_emb_L_1_1_D (Optional[Tensor]): + Rotary positional embedding tensor of shape (L, 1, 1, D). L == THW for current video training. + + Returns: + Tensor: The output tensor after processing through the configured block and adaptive normalization. + """ + if self.use_adaln_lora: + shift_B_D, scale_B_D, gate_B_D = (self.adaLN_modulation(emb_B_D) + adaln_lora_B_3D).chunk( + self.n_adaln_chunks, dim=1 + ) + else: + shift_B_D, scale_B_D, gate_B_D = self.adaLN_modulation(emb_B_D).chunk(self.n_adaln_chunks, dim=1) + + shift_1_1_1_B_D, scale_1_1_1_B_D, gate_1_1_1_B_D = ( + shift_B_D.unsqueeze(0).unsqueeze(0).unsqueeze(0), + scale_B_D.unsqueeze(0).unsqueeze(0).unsqueeze(0), + gate_B_D.unsqueeze(0).unsqueeze(0).unsqueeze(0), + ) + + if self.block_type in ["mlp", "ff"]: + x = x + gate_1_1_1_B_D * self.block( + adaln_norm_state(self.norm_state, x, scale_1_1_1_B_D, shift_1_1_1_B_D), + ) + elif self.block_type in ["full_attn", "fa"]: + x = x + gate_1_1_1_B_D * self.block( + adaln_norm_state(self.norm_state, x, scale_1_1_1_B_D, shift_1_1_1_B_D), + context=None, + rope_emb_L_1_1_D=rope_emb_L_1_1_D, + ) + elif self.block_type in ["cross_attn", "ca"]: + x = x + gate_1_1_1_B_D * self.block( + adaln_norm_state(self.norm_state, x, scale_1_1_1_B_D, shift_1_1_1_B_D), + context=crossattn_emb, + crossattn_mask=crossattn_mask, + rope_emb_L_1_1_D=rope_emb_L_1_1_D, + ) + else: + raise ValueError(f"Unknown block type: {self.block_type}") + + return x + + +class GeneralDITTransformerBlock(nn.Module): + """ + A wrapper module that manages a sequence of DITBuildingBlocks to form a complete transformer layer. + Each block in the sequence is specified by a block configuration string. + + Parameters: + x_dim (int): Dimension of input features + context_dim (int): Dimension of context features for cross-attention blocks + num_heads (int): Number of attention heads + block_config (str): String specifying block sequence (e.g. "ca-fa-mlp" for cross-attention, + full-attention, then MLP) + mlp_ratio (float): MLP hidden dimension multiplier. Default: 4.0 + x_format (str): Input tensor format. Default: "BTHWD" + use_adaln_lora (bool): Whether to use AdaLN-LoRA. Default: False + adaln_lora_dim (int): Dimension for AdaLN-LoRA. Default: 256 + + The block_config string uses "-" to separate block types: + - "ca"/"cross_attn": Cross-attention block + - "fa"/"full_attn": Full self-attention block + - "mlp"/"ff": MLP/feedforward block + + Example: + block_config = "ca-fa-mlp" creates a sequence of: + 1. Cross-attention block + 2. Full self-attention block + 3. MLP block + """ + + def __init__( + self, + x_dim: int, + context_dim: int, + num_heads: int, + block_config: str, + mlp_ratio: float = 4.0, + x_format: str = "BTHWD", + use_adaln_lora: bool = False, + adaln_lora_dim: int = 256, + weight_args={}, + operations=None + ): + super().__init__() + self.blocks = nn.ModuleList() + self.x_format = x_format + for block_type in block_config.split("-"): + self.blocks.append( + DITBuildingBlock( + block_type, + x_dim, + context_dim, + num_heads, + mlp_ratio, + x_format=self.x_format, + use_adaln_lora=use_adaln_lora, + adaln_lora_dim=adaln_lora_dim, + weight_args=weight_args, + operations=operations, + ) + ) + + def forward( + self, + x: torch.Tensor, + emb_B_D: torch.Tensor, + crossattn_emb: torch.Tensor, + crossattn_mask: Optional[torch.Tensor] = None, + rope_emb_L_1_1_D: Optional[torch.Tensor] = None, + adaln_lora_B_3D: Optional[torch.Tensor] = None, + ) -> torch.Tensor: + for block in self.blocks: + x = block( + x, + emb_B_D, + crossattn_emb, + crossattn_mask, + rope_emb_L_1_1_D=rope_emb_L_1_1_D, + adaln_lora_B_3D=adaln_lora_B_3D, + ) + return x diff --git a/comfy/ldm/cosmos/cosmos_tokenizer/layers3d.py b/comfy/ldm/cosmos/cosmos_tokenizer/layers3d.py new file mode 100644 index 000000000..9a3ebed6a --- /dev/null +++ b/comfy/ldm/cosmos/cosmos_tokenizer/layers3d.py @@ -0,0 +1,1041 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. +"""The model definition for 3D layers + +Adapted from: https://github.com/lucidrains/magvit2-pytorch/blob/ +9f49074179c912736e617d61b32be367eb5f993a/magvit2_pytorch/magvit2_pytorch.py#L889 + +[MIT License Copyright (c) 2023 Phil Wang] +https://github.com/lucidrains/magvit2-pytorch/blob/ +9f49074179c912736e617d61b32be367eb5f993a/LICENSE +""" +import math +from typing import Tuple, Union + +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F +import logging + +from comfy.ldm.modules.diffusionmodules.model import vae_attention + +from .patching import ( + Patcher, + Patcher3D, + UnPatcher, + UnPatcher3D, +) +from .utils import ( + CausalNormalize, + batch2space, + batch2time, + cast_tuple, + is_odd, + nonlinearity, + replication_pad, + space2batch, + time2batch, +) + +import comfy.ops +ops = comfy.ops.disable_weight_init + +_LEGACY_NUM_GROUPS = 32 + + +class CausalConv3d(nn.Module): + def __init__( + self, + chan_in: int = 1, + chan_out: int = 1, + kernel_size: Union[int, Tuple[int, int, int]] = 3, + pad_mode: str = "constant", + **kwargs, + ): + super().__init__() + kernel_size = cast_tuple(kernel_size, 3) + + time_kernel_size, height_kernel_size, width_kernel_size = kernel_size + + assert is_odd(height_kernel_size) and is_odd(width_kernel_size) + + dilation = kwargs.pop("dilation", 1) + stride = kwargs.pop("stride", 1) + time_stride = kwargs.pop("time_stride", 1) + time_dilation = kwargs.pop("time_dilation", 1) + padding = kwargs.pop("padding", 1) + + self.pad_mode = pad_mode + time_pad = time_dilation * (time_kernel_size - 1) + (1 - time_stride) + self.time_pad = time_pad + + self.spatial_pad = (padding, padding, padding, padding) + + stride = (time_stride, stride, stride) + dilation = (time_dilation, dilation, dilation) + self.conv3d = ops.Conv3d( + chan_in, + chan_out, + kernel_size, + stride=stride, + dilation=dilation, + **kwargs, + ) + + def _replication_pad(self, x: torch.Tensor) -> torch.Tensor: + x_prev = x[:, :, :1, ...].repeat(1, 1, self.time_pad, 1, 1) + x = torch.cat([x_prev, x], dim=2) + padding = self.spatial_pad + (0, 0) + return F.pad(x, padding, mode=self.pad_mode, value=0.0) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + x = self._replication_pad(x) + return self.conv3d(x) + + +class CausalUpsample3d(nn.Module): + def __init__(self, in_channels: int) -> None: + super().__init__() + self.conv = CausalConv3d( + in_channels, in_channels, kernel_size=3, stride=1, padding=1 + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + x = x.repeat_interleave(2, dim=3).repeat_interleave(2, dim=4) + time_factor = 1.0 + 1.0 * (x.shape[2] > 1) + if isinstance(time_factor, torch.Tensor): + time_factor = time_factor.item() + x = x.repeat_interleave(int(time_factor), dim=2) + # TODO(freda): Check if this causes temporal inconsistency. + # Shoule reverse the order of the following two ops, + # better perf and better temporal smoothness. + x = self.conv(x) + return x[..., int(time_factor - 1) :, :, :] + + +class CausalDownsample3d(nn.Module): + def __init__(self, in_channels: int) -> None: + super().__init__() + self.conv = CausalConv3d( + in_channels, + in_channels, + kernel_size=3, + stride=2, + time_stride=2, + padding=0, + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + pad = (0, 1, 0, 1, 0, 0) + x = F.pad(x, pad, mode="constant", value=0) + x = replication_pad(x) + x = self.conv(x) + return x + + +class CausalHybridUpsample3d(nn.Module): + def __init__( + self, + in_channels: int, + spatial_up: bool = True, + temporal_up: bool = True, + **kwargs, + ) -> None: + super().__init__() + self.spatial_up = spatial_up + self.temporal_up = temporal_up + if not self.spatial_up and not self.temporal_up: + return + + self.conv1 = CausalConv3d( + in_channels, + in_channels, + kernel_size=(3, 1, 1), + stride=1, + time_stride=1, + padding=0, + ) + self.conv2 = CausalConv3d( + in_channels, + in_channels, + kernel_size=(1, 3, 3), + stride=1, + time_stride=1, + padding=1, + ) + self.conv3 = CausalConv3d( + in_channels, + in_channels, + kernel_size=1, + stride=1, + time_stride=1, + padding=0, + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + if not self.spatial_up and not self.temporal_up: + return x + + # hybrid upsample temporally. + if self.temporal_up: + time_factor = 1.0 + 1.0 * (x.shape[2] > 1) + if isinstance(time_factor, torch.Tensor): + time_factor = time_factor.item() + x = x.repeat_interleave(int(time_factor), dim=2) + x = x[..., int(time_factor - 1) :, :, :] + x = self.conv1(x) + x + + # hybrid upsample spatially. + if self.spatial_up: + x = x.repeat_interleave(2, dim=3).repeat_interleave(2, dim=4) + x = self.conv2(x) + x + + # final 1x1x1 conv. + x = self.conv3(x) + return x + + +class CausalHybridDownsample3d(nn.Module): + def __init__( + self, + in_channels: int, + spatial_down: bool = True, + temporal_down: bool = True, + **kwargs, + ) -> None: + super().__init__() + self.spatial_down = spatial_down + self.temporal_down = temporal_down + if not self.spatial_down and not self.temporal_down: + return + + self.conv1 = CausalConv3d( + in_channels, + in_channels, + kernel_size=(1, 3, 3), + stride=2, + time_stride=1, + padding=0, + ) + self.conv2 = CausalConv3d( + in_channels, + in_channels, + kernel_size=(3, 1, 1), + stride=1, + time_stride=2, + padding=0, + ) + self.conv3 = CausalConv3d( + in_channels, + in_channels, + kernel_size=1, + stride=1, + time_stride=1, + padding=0, + ) + + + def forward(self, x: torch.Tensor) -> torch.Tensor: + if not self.spatial_down and not self.temporal_down: + return x + + # hybrid downsample spatially. + if self.spatial_down: + pad = (0, 1, 0, 1, 0, 0) + x = F.pad(x, pad, mode="constant", value=0) + x1 = self.conv1(x) + x2 = F.avg_pool3d(x, kernel_size=(1, 2, 2), stride=(1, 2, 2)) + x = x1 + x2 + + # hybrid downsample temporally. + if self.temporal_down: + x = replication_pad(x) + x1 = self.conv2(x) + x2 = F.avg_pool3d(x, kernel_size=(2, 1, 1), stride=(2, 1, 1)) + x = x1 + x2 + + # final 1x1x1 conv. + x = self.conv3(x) + return x + + +class CausalResnetBlock3d(nn.Module): + def __init__( + self, + *, + in_channels: int, + out_channels: int = None, + dropout: float, + num_groups: int, + ) -> None: + super().__init__() + self.in_channels = in_channels + out_channels = in_channels if out_channels is None else out_channels + + self.norm1 = CausalNormalize(in_channels, num_groups=num_groups) + self.conv1 = CausalConv3d( + in_channels, out_channels, kernel_size=3, stride=1, padding=1 + ) + self.norm2 = CausalNormalize(out_channels, num_groups=num_groups) + self.dropout = torch.nn.Dropout(dropout) + self.conv2 = CausalConv3d( + out_channels, out_channels, kernel_size=3, stride=1, padding=1 + ) + self.nin_shortcut = ( + CausalConv3d(in_channels, out_channels, kernel_size=1, stride=1, padding=0) + if in_channels != out_channels + else nn.Identity() + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + h = x + h = self.norm1(h) + h = nonlinearity(h) + h = self.conv1(h) + + h = self.norm2(h) + h = nonlinearity(h) + h = self.dropout(h) + h = self.conv2(h) + x = self.nin_shortcut(x) + + return x + h + + +class CausalResnetBlockFactorized3d(nn.Module): + def __init__( + self, + *, + in_channels: int, + out_channels: int = None, + dropout: float, + num_groups: int, + ) -> None: + super().__init__() + self.in_channels = in_channels + out_channels = in_channels if out_channels is None else out_channels + + self.norm1 = CausalNormalize(in_channels, num_groups=1) + self.conv1 = nn.Sequential( + CausalConv3d( + in_channels, + out_channels, + kernel_size=(1, 3, 3), + stride=1, + padding=1, + ), + CausalConv3d( + out_channels, + out_channels, + kernel_size=(3, 1, 1), + stride=1, + padding=0, + ), + ) + self.norm2 = CausalNormalize(out_channels, num_groups=num_groups) + self.dropout = torch.nn.Dropout(dropout) + self.conv2 = nn.Sequential( + CausalConv3d( + out_channels, + out_channels, + kernel_size=(1, 3, 3), + stride=1, + padding=1, + ), + CausalConv3d( + out_channels, + out_channels, + kernel_size=(3, 1, 1), + stride=1, + padding=0, + ), + ) + self.nin_shortcut = ( + CausalConv3d(in_channels, out_channels, kernel_size=1, stride=1, padding=0) + if in_channels != out_channels + else nn.Identity() + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + h = x + h = self.norm1(h) + h = nonlinearity(h) + h = self.conv1(h) + + h = self.norm2(h) + h = nonlinearity(h) + h = self.dropout(h) + h = self.conv2(h) + x = self.nin_shortcut(x) + + return x + h + + +class CausalAttnBlock(nn.Module): + def __init__(self, in_channels: int, num_groups: int) -> None: + super().__init__() + + self.norm = CausalNormalize(in_channels, num_groups=num_groups) + self.q = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + self.k = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + self.v = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + self.proj_out = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + + self.optimized_attention = vae_attention() + + def forward(self, x: torch.Tensor) -> torch.Tensor: + h_ = x + h_ = self.norm(h_) + q = self.q(h_) + k = self.k(h_) + v = self.v(h_) + + # compute attention + q, batch_size = time2batch(q) + k, batch_size = time2batch(k) + v, batch_size = time2batch(v) + + b, c, h, w = q.shape + h_ = self.optimized_attention(q, k, v) + + h_ = batch2time(h_, batch_size) + h_ = self.proj_out(h_) + return x + h_ + + +class CausalTemporalAttnBlock(nn.Module): + def __init__(self, in_channels: int, num_groups: int) -> None: + super().__init__() + + self.norm = CausalNormalize(in_channels, num_groups=num_groups) + self.q = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + self.k = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + self.v = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + self.proj_out = CausalConv3d( + in_channels, in_channels, kernel_size=1, stride=1, padding=0 + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + h_ = x + h_ = self.norm(h_) + q = self.q(h_) + k = self.k(h_) + v = self.v(h_) + + # compute attention + q, batch_size, height = space2batch(q) + k, _, _ = space2batch(k) + v, _, _ = space2batch(v) + + bhw, c, t = q.shape + q = q.permute(0, 2, 1) # (bhw, t, c) + k = k.permute(0, 2, 1) # (bhw, t, c) + v = v.permute(0, 2, 1) # (bhw, t, c) + + w_ = torch.bmm(q, k.permute(0, 2, 1)) # (bhw, t, t) + w_ = w_ * (int(c) ** (-0.5)) + + # Apply causal mask + mask = torch.tril(torch.ones_like(w_)) + w_ = w_.masked_fill(mask == 0, float("-inf")) + w_ = F.softmax(w_, dim=2) + + # attend to values + h_ = torch.bmm(w_, v) # (bhw, t, c) + h_ = h_.permute(0, 2, 1).reshape(bhw, c, t) # (bhw, c, t) + + h_ = batch2space(h_, batch_size, height) + h_ = self.proj_out(h_) + return x + h_ + + +class EncoderBase(nn.Module): + def __init__( + self, + in_channels: int, + channels: int, + channels_mult: list[int], + num_res_blocks: int, + attn_resolutions: list[int], + dropout: float, + resolution: int, + z_channels: int, + **ignore_kwargs, + ) -> None: + super().__init__() + self.num_resolutions = len(channels_mult) + self.num_res_blocks = num_res_blocks + + # Patcher. + patch_size = ignore_kwargs.get("patch_size", 1) + self.patcher = Patcher( + patch_size, ignore_kwargs.get("patch_method", "rearrange") + ) + in_channels = in_channels * patch_size * patch_size + + # downsampling + self.conv_in = CausalConv3d( + in_channels, channels, kernel_size=3, stride=1, padding=1 + ) + + # num of groups for GroupNorm, num_groups=1 for LayerNorm. + num_groups = ignore_kwargs.get("num_groups", _LEGACY_NUM_GROUPS) + curr_res = resolution // patch_size + in_ch_mult = (1,) + tuple(channels_mult) + self.in_ch_mult = in_ch_mult + self.down = nn.ModuleList() + for i_level in range(self.num_resolutions): + block = nn.ModuleList() + attn = nn.ModuleList() + block_in = channels * in_ch_mult[i_level] + block_out = channels * channels_mult[i_level] + for _ in range(self.num_res_blocks): + block.append( + CausalResnetBlock3d( + in_channels=block_in, + out_channels=block_out, + dropout=dropout, + num_groups=num_groups, + ) + ) + block_in = block_out + if curr_res in attn_resolutions: + attn.append(CausalAttnBlock(block_in, num_groups=num_groups)) + down = nn.Module() + down.block = block + down.attn = attn + if i_level != self.num_resolutions - 1: + down.downsample = CausalDownsample3d(block_in) + curr_res = curr_res // 2 + self.down.append(down) + + # middle + self.mid = nn.Module() + self.mid.block_1 = CausalResnetBlock3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=num_groups, + ) + self.mid.attn_1 = CausalAttnBlock(block_in, num_groups=num_groups) + self.mid.block_2 = CausalResnetBlock3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=num_groups, + ) + + # end + self.norm_out = CausalNormalize(block_in, num_groups=num_groups) + self.conv_out = CausalConv3d( + block_in, z_channels, kernel_size=3, stride=1, padding=1 + ) + + def patcher3d(self, x: torch.Tensor) -> torch.Tensor: + x, batch_size = time2batch(x) + x = self.patcher(x) + x = batch2time(x, batch_size) + return x + + def forward(self, x: torch.Tensor) -> torch.Tensor: + x = self.patcher3d(x) + + # downsampling + hs = [self.conv_in(x)] + for i_level in range(self.num_resolutions): + for i_block in range(self.num_res_blocks): + h = self.down[i_level].block[i_block](hs[-1]) + if len(self.down[i_level].attn) > 0: + h = self.down[i_level].attn[i_block](h) + hs.append(h) + if i_level != self.num_resolutions - 1: + hs.append(self.down[i_level].downsample(hs[-1])) + else: + # temporal downsample (last level) + time_factor = 1 + 1 * (hs[-1].shape[2] > 1) + if isinstance(time_factor, torch.Tensor): + time_factor = time_factor.item() + hs[-1] = replication_pad(hs[-1]) + hs.append( + F.avg_pool3d( + hs[-1], + kernel_size=[time_factor, 1, 1], + stride=[2, 1, 1], + ) + ) + + # middle + h = hs[-1] + h = self.mid.block_1(h) + h = self.mid.attn_1(h) + h = self.mid.block_2(h) + + # end + h = self.norm_out(h) + h = nonlinearity(h) + h = self.conv_out(h) + return h + + +class DecoderBase(nn.Module): + def __init__( + self, + out_channels: int, + channels: int, + channels_mult: list[int], + num_res_blocks: int, + attn_resolutions: list[int], + dropout: float, + resolution: int, + z_channels: int, + **ignore_kwargs, + ): + super().__init__() + self.num_resolutions = len(channels_mult) + self.num_res_blocks = num_res_blocks + + # UnPatcher. + patch_size = ignore_kwargs.get("patch_size", 1) + self.unpatcher = UnPatcher( + patch_size, ignore_kwargs.get("patch_method", "rearrange") + ) + out_ch = out_channels * patch_size * patch_size + + block_in = channels * channels_mult[self.num_resolutions - 1] + curr_res = (resolution // patch_size) // 2 ** (self.num_resolutions - 1) + self.z_shape = (1, z_channels, curr_res, curr_res) + logging.debug( + "Working with z of shape {} = {} dimensions.".format( + self.z_shape, np.prod(self.z_shape) + ) + ) + + # z to block_in + self.conv_in = CausalConv3d( + z_channels, block_in, kernel_size=3, stride=1, padding=1 + ) + + # num of groups for GroupNorm, num_groups=1 for LayerNorm. + num_groups = ignore_kwargs.get("num_groups", _LEGACY_NUM_GROUPS) + + # middle + self.mid = nn.Module() + self.mid.block_1 = CausalResnetBlock3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=num_groups, + ) + self.mid.attn_1 = CausalAttnBlock(block_in, num_groups=num_groups) + self.mid.block_2 = CausalResnetBlock3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=num_groups, + ) + + # upsampling + self.up = nn.ModuleList() + for i_level in reversed(range(self.num_resolutions)): + block = nn.ModuleList() + attn = nn.ModuleList() + block_out = channels * channels_mult[i_level] + for _ in range(self.num_res_blocks + 1): + block.append( + CausalResnetBlock3d( + in_channels=block_in, + out_channels=block_out, + dropout=dropout, + num_groups=num_groups, + ) + ) + block_in = block_out + if curr_res in attn_resolutions: + attn.append(CausalAttnBlock(block_in, num_groups=num_groups)) + up = nn.Module() + up.block = block + up.attn = attn + if i_level != 0: + up.upsample = CausalUpsample3d(block_in) + curr_res = curr_res * 2 + self.up.insert(0, up) # prepend to get consistent order + + # end + self.norm_out = CausalNormalize(block_in, num_groups=num_groups) + self.conv_out = CausalConv3d( + block_in, out_ch, kernel_size=3, stride=1, padding=1 + ) + + def unpatcher3d(self, x: torch.Tensor) -> torch.Tensor: + x, batch_size = time2batch(x) + x = self.unpatcher(x) + x = batch2time(x, batch_size) + + return x + + def forward(self, z): + h = self.conv_in(z) + + # middle block. + h = self.mid.block_1(h) + h = self.mid.attn_1(h) + h = self.mid.block_2(h) + + # decoder blocks. + for i_level in reversed(range(self.num_resolutions)): + for i_block in range(self.num_res_blocks + 1): + h = self.up[i_level].block[i_block](h) + if len(self.up[i_level].attn) > 0: + h = self.up[i_level].attn[i_block](h) + if i_level != 0: + h = self.up[i_level].upsample(h) + else: + # temporal upsample (last level) + time_factor = 1.0 + 1.0 * (h.shape[2] > 1) + if isinstance(time_factor, torch.Tensor): + time_factor = time_factor.item() + h = h.repeat_interleave(int(time_factor), dim=2) + h = h[..., int(time_factor - 1) :, :, :] + + h = self.norm_out(h) + h = nonlinearity(h) + h = self.conv_out(h) + h = self.unpatcher3d(h) + return h + + +class EncoderFactorized(nn.Module): + def __init__( + self, + in_channels: int, + channels: int, + channels_mult: list[int], + num_res_blocks: int, + attn_resolutions: list[int], + dropout: float, + resolution: int, + z_channels: int, + spatial_compression: int = 8, + temporal_compression: int = 8, + **ignore_kwargs, + ) -> None: + super().__init__() + self.num_resolutions = len(channels_mult) + self.num_res_blocks = num_res_blocks + + # Patcher. + patch_size = ignore_kwargs.get("patch_size", 1) + self.patcher3d = Patcher3D( + patch_size, ignore_kwargs.get("patch_method", "haar") + ) + in_channels = in_channels * patch_size * patch_size * patch_size + + # calculate the number of downsample operations + self.num_spatial_downs = int(math.log2(spatial_compression)) - int( + math.log2(patch_size) + ) + assert ( + self.num_spatial_downs <= self.num_resolutions + ), f"Spatially downsample {self.num_resolutions} times at most" + + self.num_temporal_downs = int(math.log2(temporal_compression)) - int( + math.log2(patch_size) + ) + assert ( + self.num_temporal_downs <= self.num_resolutions + ), f"Temporally downsample {self.num_resolutions} times at most" + + # downsampling + self.conv_in = nn.Sequential( + CausalConv3d( + in_channels, + channels, + kernel_size=(1, 3, 3), + stride=1, + padding=1, + ), + CausalConv3d( + channels, channels, kernel_size=(3, 1, 1), stride=1, padding=0 + ), + ) + + curr_res = resolution // patch_size + in_ch_mult = (1,) + tuple(channels_mult) + self.in_ch_mult = in_ch_mult + self.down = nn.ModuleList() + for i_level in range(self.num_resolutions): + block = nn.ModuleList() + attn = nn.ModuleList() + block_in = channels * in_ch_mult[i_level] + block_out = channels * channels_mult[i_level] + for _ in range(self.num_res_blocks): + block.append( + CausalResnetBlockFactorized3d( + in_channels=block_in, + out_channels=block_out, + dropout=dropout, + num_groups=1, + ) + ) + block_in = block_out + if curr_res in attn_resolutions: + attn.append( + nn.Sequential( + CausalAttnBlock(block_in, num_groups=1), + CausalTemporalAttnBlock(block_in, num_groups=1), + ) + ) + down = nn.Module() + down.block = block + down.attn = attn + if i_level != self.num_resolutions - 1: + spatial_down = i_level < self.num_spatial_downs + temporal_down = i_level < self.num_temporal_downs + down.downsample = CausalHybridDownsample3d( + block_in, + spatial_down=spatial_down, + temporal_down=temporal_down, + ) + curr_res = curr_res // 2 + self.down.append(down) + + # middle + self.mid = nn.Module() + self.mid.block_1 = CausalResnetBlockFactorized3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=1, + ) + self.mid.attn_1 = nn.Sequential( + CausalAttnBlock(block_in, num_groups=1), + CausalTemporalAttnBlock(block_in, num_groups=1), + ) + self.mid.block_2 = CausalResnetBlockFactorized3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=1, + ) + + # end + self.norm_out = CausalNormalize(block_in, num_groups=1) + self.conv_out = nn.Sequential( + CausalConv3d( + block_in, z_channels, kernel_size=(1, 3, 3), stride=1, padding=1 + ), + CausalConv3d( + z_channels, + z_channels, + kernel_size=(3, 1, 1), + stride=1, + padding=0, + ), + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + x = self.patcher3d(x) + + # downsampling + h = self.conv_in(x) + for i_level in range(self.num_resolutions): + for i_block in range(self.num_res_blocks): + h = self.down[i_level].block[i_block](h) + if len(self.down[i_level].attn) > 0: + h = self.down[i_level].attn[i_block](h) + if i_level != self.num_resolutions - 1: + h = self.down[i_level].downsample(h) + + # middle + h = self.mid.block_1(h) + h = self.mid.attn_1(h) + h = self.mid.block_2(h) + + # end + h = self.norm_out(h) + h = nonlinearity(h) + h = self.conv_out(h) + return h + + +class DecoderFactorized(nn.Module): + def __init__( + self, + out_channels: int, + channels: int, + channels_mult: list[int], + num_res_blocks: int, + attn_resolutions: list[int], + dropout: float, + resolution: int, + z_channels: int, + spatial_compression: int = 8, + temporal_compression: int = 8, + **ignore_kwargs, + ): + super().__init__() + self.num_resolutions = len(channels_mult) + self.num_res_blocks = num_res_blocks + + # UnPatcher. + patch_size = ignore_kwargs.get("patch_size", 1) + self.unpatcher3d = UnPatcher3D( + patch_size, ignore_kwargs.get("patch_method", "haar") + ) + out_ch = out_channels * patch_size * patch_size * patch_size + + # calculate the number of upsample operations + self.num_spatial_ups = int(math.log2(spatial_compression)) - int( + math.log2(patch_size) + ) + assert ( + self.num_spatial_ups <= self.num_resolutions + ), f"Spatially upsample {self.num_resolutions} times at most" + self.num_temporal_ups = int(math.log2(temporal_compression)) - int( + math.log2(patch_size) + ) + assert ( + self.num_temporal_ups <= self.num_resolutions + ), f"Temporally upsample {self.num_resolutions} times at most" + + block_in = channels * channels_mult[self.num_resolutions - 1] + curr_res = (resolution // patch_size) // 2 ** (self.num_resolutions - 1) + self.z_shape = (1, z_channels, curr_res, curr_res) + logging.debug( + "Working with z of shape {} = {} dimensions.".format( + self.z_shape, np.prod(self.z_shape) + ) + ) + + # z to block_in + self.conv_in = nn.Sequential( + CausalConv3d( + z_channels, block_in, kernel_size=(1, 3, 3), stride=1, padding=1 + ), + CausalConv3d( + block_in, block_in, kernel_size=(3, 1, 1), stride=1, padding=0 + ), + ) + + # middle + self.mid = nn.Module() + self.mid.block_1 = CausalResnetBlockFactorized3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=1, + ) + self.mid.attn_1 = nn.Sequential( + CausalAttnBlock(block_in, num_groups=1), + CausalTemporalAttnBlock(block_in, num_groups=1), + ) + self.mid.block_2 = CausalResnetBlockFactorized3d( + in_channels=block_in, + out_channels=block_in, + dropout=dropout, + num_groups=1, + ) + + legacy_mode = ignore_kwargs.get("legacy_mode", False) + # upsampling + self.up = nn.ModuleList() + for i_level in reversed(range(self.num_resolutions)): + block = nn.ModuleList() + attn = nn.ModuleList() + block_out = channels * channels_mult[i_level] + for _ in range(self.num_res_blocks + 1): + block.append( + CausalResnetBlockFactorized3d( + in_channels=block_in, + out_channels=block_out, + dropout=dropout, + num_groups=1, + ) + ) + block_in = block_out + if curr_res in attn_resolutions: + attn.append( + nn.Sequential( + CausalAttnBlock(block_in, num_groups=1), + CausalTemporalAttnBlock(block_in, num_groups=1), + ) + ) + up = nn.Module() + up.block = block + up.attn = attn + if i_level != 0: + # The layer index for temporal/spatial downsampling performed + # in the encoder should correspond to the layer index in + # reverse order where upsampling is performed in the decoder. + # If you've a pre-trained model, you can simply finetune. + i_level_reverse = self.num_resolutions - i_level - 1 + if legacy_mode: + temporal_up = i_level_reverse < self.num_temporal_ups + else: + temporal_up = 0 < i_level_reverse < self.num_temporal_ups + 1 + spatial_up = temporal_up or ( + i_level_reverse < self.num_spatial_ups + and self.num_spatial_ups > self.num_temporal_ups + ) + up.upsample = CausalHybridUpsample3d( + block_in, spatial_up=spatial_up, temporal_up=temporal_up + ) + curr_res = curr_res * 2 + self.up.insert(0, up) # prepend to get consistent order + + # end + self.norm_out = CausalNormalize(block_in, num_groups=1) + self.conv_out = nn.Sequential( + CausalConv3d(block_in, out_ch, kernel_size=(1, 3, 3), stride=1, padding=1), + CausalConv3d(out_ch, out_ch, kernel_size=(3, 1, 1), stride=1, padding=0), + ) + + def forward(self, z): + h = self.conv_in(z) + + # middle block. + h = self.mid.block_1(h) + h = self.mid.attn_1(h) + h = self.mid.block_2(h) + + # decoder blocks. + for i_level in reversed(range(self.num_resolutions)): + for i_block in range(self.num_res_blocks + 1): + h = self.up[i_level].block[i_block](h) + if len(self.up[i_level].attn) > 0: + h = self.up[i_level].attn[i_block](h) + if i_level != 0: + h = self.up[i_level].upsample(h) + + h = self.norm_out(h) + h = nonlinearity(h) + h = self.conv_out(h) + h = self.unpatcher3d(h) + return h diff --git a/comfy/ldm/cosmos/cosmos_tokenizer/patching.py b/comfy/ldm/cosmos/cosmos_tokenizer/patching.py new file mode 100644 index 000000000..87a53a1d9 --- /dev/null +++ b/comfy/ldm/cosmos/cosmos_tokenizer/patching.py @@ -0,0 +1,377 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. +"""The patcher and unpatcher implementation for 2D and 3D data. + +The idea of Haar wavelet is to compute LL, LH, HL, HH component as two 1D convolutions. +One on the rows and one on the columns. +For example, in 1D signal, we have [a, b], then the low-freq compoenent is [a + b] / 2 and high-freq is [a - b] / 2. +We can use a 1D convolution with kernel [1, 1] and stride 2 to represent the L component. +For H component, we can use a 1D convolution with kernel [1, -1] and stride 2. +Although in principle, we typically only do additional Haar wavelet over the LL component. But here we do it for all + as we need to support downsampling for more than 2x. +For example, 4x downsampling can be done by 2x Haar and additional 2x Haar, and the shape would be. + [3, 256, 256] -> [12, 128, 128] -> [48, 64, 64] +""" + +import torch +import torch.nn.functional as F +from einops import rearrange + +_WAVELETS = { + "haar": torch.tensor([0.7071067811865476, 0.7071067811865476]), + "rearrange": torch.tensor([1.0, 1.0]), +} +_PERSISTENT = False + + +class Patcher(torch.nn.Module): + """A module to convert image tensors into patches using torch operations. + + The main difference from `class Patching` is that this module implements + all operations using torch, rather than python or numpy, for efficiency purpose. + + It's bit-wise identical to the Patching module outputs, with the added + benefit of being torch.jit scriptable. + """ + + def __init__(self, patch_size=1, patch_method="haar"): + super().__init__() + self.patch_size = patch_size + self.patch_method = patch_method + self.register_buffer( + "wavelets", _WAVELETS[patch_method], persistent=_PERSISTENT + ) + self.range = range(int(torch.log2(torch.tensor(self.patch_size)).item())) + self.register_buffer( + "_arange", + torch.arange(_WAVELETS[patch_method].shape[0]), + persistent=_PERSISTENT, + ) + for param in self.parameters(): + param.requires_grad = False + + def forward(self, x): + if self.patch_method == "haar": + return self._haar(x) + elif self.patch_method == "rearrange": + return self._arrange(x) + else: + raise ValueError("Unknown patch method: " + self.patch_method) + + def _dwt(self, x, mode="reflect", rescale=False): + dtype = x.dtype + h = self.wavelets.to(device=x.device) + + n = h.shape[0] + g = x.shape[1] + hl = h.flip(0).reshape(1, 1, -1).repeat(g, 1, 1) + hh = (h * ((-1) ** self._arange.to(device=x.device))).reshape(1, 1, -1).repeat(g, 1, 1) + hh = hh.to(dtype=dtype) + hl = hl.to(dtype=dtype) + + x = F.pad(x, pad=(n - 2, n - 1, n - 2, n - 1), mode=mode).to(dtype) + xl = F.conv2d(x, hl.unsqueeze(2), groups=g, stride=(1, 2)) + xh = F.conv2d(x, hh.unsqueeze(2), groups=g, stride=(1, 2)) + xll = F.conv2d(xl, hl.unsqueeze(3), groups=g, stride=(2, 1)) + xlh = F.conv2d(xl, hh.unsqueeze(3), groups=g, stride=(2, 1)) + xhl = F.conv2d(xh, hl.unsqueeze(3), groups=g, stride=(2, 1)) + xhh = F.conv2d(xh, hh.unsqueeze(3), groups=g, stride=(2, 1)) + + out = torch.cat([xll, xlh, xhl, xhh], dim=1) + if rescale: + out = out / 2 + return out + + def _haar(self, x): + for _ in self.range: + x = self._dwt(x, rescale=True) + return x + + def _arrange(self, x): + x = rearrange( + x, + "b c (h p1) (w p2) -> b (c p1 p2) h w", + p1=self.patch_size, + p2=self.patch_size, + ).contiguous() + return x + + +class Patcher3D(Patcher): + """A 3D discrete wavelet transform for video data, expects 5D tensor, i.e. a batch of videos.""" + + def __init__(self, patch_size=1, patch_method="haar"): + super().__init__(patch_method=patch_method, patch_size=patch_size) + self.register_buffer( + "patch_size_buffer", + patch_size * torch.ones([1], dtype=torch.int32), + persistent=_PERSISTENT, + ) + + def _dwt(self, x, wavelet, mode="reflect", rescale=False): + dtype = x.dtype + h = self.wavelets.to(device=x.device) + + n = h.shape[0] + g = x.shape[1] + hl = h.flip(0).reshape(1, 1, -1).repeat(g, 1, 1) + hh = (h * ((-1) ** self._arange.to(device=x.device))).reshape(1, 1, -1).repeat(g, 1, 1) + hh = hh.to(dtype=dtype) + hl = hl.to(dtype=dtype) + + # Handles temporal axis. + x = F.pad( + x, pad=(max(0, n - 2), n - 1, n - 2, n - 1, n - 2, n - 1), mode=mode + ).to(dtype) + xl = F.conv3d(x, hl.unsqueeze(3).unsqueeze(4), groups=g, stride=(2, 1, 1)) + xh = F.conv3d(x, hh.unsqueeze(3).unsqueeze(4), groups=g, stride=(2, 1, 1)) + + # Handles spatial axes. + xll = F.conv3d(xl, hl.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)) + xlh = F.conv3d(xl, hh.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)) + xhl = F.conv3d(xh, hl.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)) + xhh = F.conv3d(xh, hh.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)) + + xlll = F.conv3d(xll, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + xllh = F.conv3d(xll, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + xlhl = F.conv3d(xlh, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + xlhh = F.conv3d(xlh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + xhll = F.conv3d(xhl, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + xhlh = F.conv3d(xhl, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + xhhl = F.conv3d(xhh, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + xhhh = F.conv3d(xhh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)) + + out = torch.cat([xlll, xllh, xlhl, xlhh, xhll, xhlh, xhhl, xhhh], dim=1) + if rescale: + out = out / (2 * torch.sqrt(torch.tensor(2.0))) + return out + + def _haar(self, x): + xi, xv = torch.split(x, [1, x.shape[2] - 1], dim=2) + x = torch.cat([xi.repeat_interleave(self.patch_size, dim=2), xv], dim=2) + for _ in self.range: + x = self._dwt(x, "haar", rescale=True) + return x + + def _arrange(self, x): + xi, xv = torch.split(x, [1, x.shape[2] - 1], dim=2) + x = torch.cat([xi.repeat_interleave(self.patch_size, dim=2), xv], dim=2) + x = rearrange( + x, + "b c (t p1) (h p2) (w p3) -> b (c p1 p2 p3) t h w", + p1=self.patch_size, + p2=self.patch_size, + p3=self.patch_size, + ).contiguous() + return x + + +class UnPatcher(torch.nn.Module): + """A module to convert patches into image tensorsusing torch operations. + + The main difference from `class Unpatching` is that this module implements + all operations using torch, rather than python or numpy, for efficiency purpose. + + It's bit-wise identical to the Unpatching module outputs, with the added + benefit of being torch.jit scriptable. + """ + + def __init__(self, patch_size=1, patch_method="haar"): + super().__init__() + self.patch_size = patch_size + self.patch_method = patch_method + self.register_buffer( + "wavelets", _WAVELETS[patch_method], persistent=_PERSISTENT + ) + self.range = range(int(torch.log2(torch.tensor(self.patch_size)).item())) + self.register_buffer( + "_arange", + torch.arange(_WAVELETS[patch_method].shape[0]), + persistent=_PERSISTENT, + ) + for param in self.parameters(): + param.requires_grad = False + + def forward(self, x): + if self.patch_method == "haar": + return self._ihaar(x) + elif self.patch_method == "rearrange": + return self._iarrange(x) + else: + raise ValueError("Unknown patch method: " + self.patch_method) + + def _idwt(self, x, wavelet="haar", mode="reflect", rescale=False): + dtype = x.dtype + h = self.wavelets.to(device=x.device) + n = h.shape[0] + + g = x.shape[1] // 4 + hl = h.flip([0]).reshape(1, 1, -1).repeat([g, 1, 1]) + hh = (h * ((-1) ** self._arange.to(device=x.device))).reshape(1, 1, -1).repeat(g, 1, 1) + hh = hh.to(dtype=dtype) + hl = hl.to(dtype=dtype) + + xll, xlh, xhl, xhh = torch.chunk(x.to(dtype), 4, dim=1) + + # Inverse transform. + yl = torch.nn.functional.conv_transpose2d( + xll, hl.unsqueeze(3), groups=g, stride=(2, 1), padding=(n - 2, 0) + ) + yl += torch.nn.functional.conv_transpose2d( + xlh, hh.unsqueeze(3), groups=g, stride=(2, 1), padding=(n - 2, 0) + ) + yh = torch.nn.functional.conv_transpose2d( + xhl, hl.unsqueeze(3), groups=g, stride=(2, 1), padding=(n - 2, 0) + ) + yh += torch.nn.functional.conv_transpose2d( + xhh, hh.unsqueeze(3), groups=g, stride=(2, 1), padding=(n - 2, 0) + ) + y = torch.nn.functional.conv_transpose2d( + yl, hl.unsqueeze(2), groups=g, stride=(1, 2), padding=(0, n - 2) + ) + y += torch.nn.functional.conv_transpose2d( + yh, hh.unsqueeze(2), groups=g, stride=(1, 2), padding=(0, n - 2) + ) + + if rescale: + y = y * 2 + return y + + def _ihaar(self, x): + for _ in self.range: + x = self._idwt(x, "haar", rescale=True) + return x + + def _iarrange(self, x): + x = rearrange( + x, + "b (c p1 p2) h w -> b c (h p1) (w p2)", + p1=self.patch_size, + p2=self.patch_size, + ) + return x + + +class UnPatcher3D(UnPatcher): + """A 3D inverse discrete wavelet transform for video wavelet decompositions.""" + + def __init__(self, patch_size=1, patch_method="haar"): + super().__init__(patch_method=patch_method, patch_size=patch_size) + + def _idwt(self, x, wavelet="haar", mode="reflect", rescale=False): + dtype = x.dtype + h = self.wavelets.to(device=x.device) + + g = x.shape[1] // 8 # split into 8 spatio-temporal filtered tesnors. + hl = h.flip([0]).reshape(1, 1, -1).repeat([g, 1, 1]) + hh = (h * ((-1) ** self._arange.to(device=x.device))).reshape(1, 1, -1).repeat(g, 1, 1) + hl = hl.to(dtype=dtype) + hh = hh.to(dtype=dtype) + + xlll, xllh, xlhl, xlhh, xhll, xhlh, xhhl, xhhh = torch.chunk(x, 8, dim=1) + del x + + # Height height transposed convolutions. + xll = F.conv_transpose3d( + xlll, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xlll + + xll += F.conv_transpose3d( + xllh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xllh + + xlh = F.conv_transpose3d( + xlhl, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xlhl + + xlh += F.conv_transpose3d( + xlhh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xlhh + + xhl = F.conv_transpose3d( + xhll, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xhll + + xhl += F.conv_transpose3d( + xhlh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xhlh + + xhh = F.conv_transpose3d( + xhhl, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xhhl + + xhh += F.conv_transpose3d( + xhhh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2) + ) + del xhhh + + # Handles width transposed convolutions. + xl = F.conv_transpose3d( + xll, hl.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1) + ) + del xll + + xl += F.conv_transpose3d( + xlh, hh.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1) + ) + del xlh + + xh = F.conv_transpose3d( + xhl, hl.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1) + ) + del xhl + + xh += F.conv_transpose3d( + xhh, hh.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1) + ) + del xhh + + # Handles time axis transposed convolutions. + x = F.conv_transpose3d( + xl, hl.unsqueeze(3).unsqueeze(4), groups=g, stride=(2, 1, 1) + ) + del xl + + x += F.conv_transpose3d( + xh, hh.unsqueeze(3).unsqueeze(4), groups=g, stride=(2, 1, 1) + ) + + if rescale: + x = x * (2 * torch.sqrt(torch.tensor(2.0))) + return x + + def _ihaar(self, x): + for _ in self.range: + x = self._idwt(x, "haar", rescale=True) + x = x[:, :, self.patch_size - 1 :, ...] + return x + + def _iarrange(self, x): + x = rearrange( + x, + "b (c p1 p2 p3) t h w -> b c (t p1) (h p2) (w p3)", + p1=self.patch_size, + p2=self.patch_size, + p3=self.patch_size, + ) + x = x[:, :, self.patch_size - 1 :, ...] + return x diff --git a/comfy/ldm/cosmos/cosmos_tokenizer/utils.py b/comfy/ldm/cosmos/cosmos_tokenizer/utils.py new file mode 100644 index 000000000..3af8d0d05 --- /dev/null +++ b/comfy/ldm/cosmos/cosmos_tokenizer/utils.py @@ -0,0 +1,112 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. +"""Shared utilities for the networks module.""" + +from typing import Any + +import torch +from einops import rearrange + + +import comfy.ops +ops = comfy.ops.disable_weight_init + +def time2batch(x: torch.Tensor) -> tuple[torch.Tensor, int]: + batch_size = x.shape[0] + return rearrange(x, "b c t h w -> (b t) c h w"), batch_size + + +def batch2time(x: torch.Tensor, batch_size: int) -> torch.Tensor: + return rearrange(x, "(b t) c h w -> b c t h w", b=batch_size) + + +def space2batch(x: torch.Tensor) -> tuple[torch.Tensor, int]: + batch_size, height = x.shape[0], x.shape[-2] + return rearrange(x, "b c t h w -> (b h w) c t"), batch_size, height + + +def batch2space(x: torch.Tensor, batch_size: int, height: int) -> torch.Tensor: + return rearrange(x, "(b h w) c t -> b c t h w", b=batch_size, h=height) + + +def cast_tuple(t: Any, length: int = 1) -> Any: + return t if isinstance(t, tuple) else ((t,) * length) + + +def replication_pad(x): + return torch.cat([x[:, :, :1, ...], x], dim=2) + + +def divisible_by(num: int, den: int) -> bool: + return (num % den) == 0 + + +def is_odd(n: int) -> bool: + return not divisible_by(n, 2) + + +def nonlinearity(x): + return x * torch.sigmoid(x) + + +def Normalize(in_channels, num_groups=32): + return ops.GroupNorm( + num_groups=num_groups, num_channels=in_channels, eps=1e-6, affine=True + ) + + +class CausalNormalize(torch.nn.Module): + def __init__(self, in_channels, num_groups=1): + super().__init__() + self.norm = ops.GroupNorm( + num_groups=num_groups, + num_channels=in_channels, + eps=1e-6, + affine=True, + ) + self.num_groups = num_groups + + def forward(self, x): + # if num_groups !=1, we apply a spatio-temporal groupnorm for backward compatibility purpose. + # All new models should use num_groups=1, otherwise causality is not guaranteed. + if self.num_groups == 1: + x, batch_size = time2batch(x) + return batch2time(self.norm(x), batch_size) + return self.norm(x) + + +def exists(v): + return v is not None + + +def default(*args): + for arg in args: + if exists(arg): + return arg + return None + + +def round_ste(z: torch.Tensor) -> torch.Tensor: + """Round with straight through gradients.""" + zhat = z.round() + return z + (zhat - z).detach() + + +def log(t, eps=1e-5): + return t.clamp(min=eps).log() + + +def entropy(prob): + return (-prob * log(prob)).sum(dim=-1) diff --git a/comfy/ldm/cosmos/model.py b/comfy/ldm/cosmos/model.py new file mode 100644 index 000000000..1205838b5 --- /dev/null +++ b/comfy/ldm/cosmos/model.py @@ -0,0 +1,514 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. + +""" +A general implementation of adaln-modulated VIT-like~(DiT) transformer for video processing. +""" + +from typing import Optional, Tuple + +import torch +from einops import rearrange +from torch import nn +from torchvision import transforms + +from enum import Enum +import logging + +from comfy.ldm.modules.diffusionmodules.mmdit import RMSNorm + +from .blocks import ( + FinalLayer, + GeneralDITTransformerBlock, + PatchEmbed, + TimestepEmbedding, + Timesteps, +) + +from .position_embedding import LearnablePosEmbAxis, VideoRopePosition3DEmb + + +class DataType(Enum): + IMAGE = "image" + VIDEO = "video" + + +class GeneralDIT(nn.Module): + """ + A general implementation of adaln-modulated VIT-like~(DiT) transformer for video processing. + + Args: + max_img_h (int): Maximum height of the input images. + max_img_w (int): Maximum width of the input images. + max_frames (int): Maximum number of frames in the video sequence. + in_channels (int): Number of input channels (e.g., RGB channels for color images). + out_channels (int): Number of output channels. + patch_spatial (tuple): Spatial resolution of patches for input processing. + patch_temporal (int): Temporal resolution of patches for input processing. + concat_padding_mask (bool): If True, includes a mask channel in the input to handle padding. + block_config (str): Configuration of the transformer block. See Notes for supported block types. + model_channels (int): Base number of channels used throughout the model. + num_blocks (int): Number of transformer blocks. + num_heads (int): Number of heads in the multi-head attention layers. + mlp_ratio (float): Expansion ratio for MLP blocks. + block_x_format (str): Format of input tensor for transformer blocks ('BTHWD' or 'THWBD'). + crossattn_emb_channels (int): Number of embedding channels for cross-attention. + use_cross_attn_mask (bool): Whether to use mask in cross-attention. + pos_emb_cls (str): Type of positional embeddings. + pos_emb_learnable (bool): Whether positional embeddings are learnable. + pos_emb_interpolation (str): Method for interpolating positional embeddings. + affline_emb_norm (bool): Whether to normalize affine embeddings. + use_adaln_lora (bool): Whether to use AdaLN-LoRA. + adaln_lora_dim (int): Dimension for AdaLN-LoRA. + rope_h_extrapolation_ratio (float): Height extrapolation ratio for RoPE. + rope_w_extrapolation_ratio (float): Width extrapolation ratio for RoPE. + rope_t_extrapolation_ratio (float): Temporal extrapolation ratio for RoPE. + extra_per_block_abs_pos_emb (bool): Whether to use extra per-block absolute positional embeddings. + extra_per_block_abs_pos_emb_type (str): Type of extra per-block positional embeddings. + extra_h_extrapolation_ratio (float): Height extrapolation ratio for extra embeddings. + extra_w_extrapolation_ratio (float): Width extrapolation ratio for extra embeddings. + extra_t_extrapolation_ratio (float): Temporal extrapolation ratio for extra embeddings. + + Notes: + Supported block types in block_config: + * cross_attn, ca: Cross attention + * full_attn: Full attention on all flattened tokens + * mlp, ff: Feed forward block + """ + + def __init__( + self, + max_img_h: int, + max_img_w: int, + max_frames: int, + in_channels: int, + out_channels: int, + patch_spatial: tuple, + patch_temporal: int, + concat_padding_mask: bool = True, + # attention settings + block_config: str = "FA-CA-MLP", + model_channels: int = 768, + num_blocks: int = 10, + num_heads: int = 16, + mlp_ratio: float = 4.0, + block_x_format: str = "BTHWD", + # cross attention settings + crossattn_emb_channels: int = 1024, + use_cross_attn_mask: bool = False, + # positional embedding settings + pos_emb_cls: str = "sincos", + pos_emb_learnable: bool = False, + pos_emb_interpolation: str = "crop", + affline_emb_norm: bool = False, # whether or not to normalize the affine embedding + use_adaln_lora: bool = False, + adaln_lora_dim: int = 256, + rope_h_extrapolation_ratio: float = 1.0, + rope_w_extrapolation_ratio: float = 1.0, + rope_t_extrapolation_ratio: float = 1.0, + extra_per_block_abs_pos_emb: bool = False, + extra_per_block_abs_pos_emb_type: str = "sincos", + extra_h_extrapolation_ratio: float = 1.0, + extra_w_extrapolation_ratio: float = 1.0, + extra_t_extrapolation_ratio: float = 1.0, + image_model=None, + device=None, + dtype=None, + operations=None, + ) -> None: + super().__init__() + self.max_img_h = max_img_h + self.max_img_w = max_img_w + self.max_frames = max_frames + self.in_channels = in_channels + self.out_channels = out_channels + self.patch_spatial = patch_spatial + self.patch_temporal = patch_temporal + self.num_heads = num_heads + self.num_blocks = num_blocks + self.model_channels = model_channels + self.use_cross_attn_mask = use_cross_attn_mask + self.concat_padding_mask = concat_padding_mask + # positional embedding settings + self.pos_emb_cls = pos_emb_cls + self.pos_emb_learnable = pos_emb_learnable + self.pos_emb_interpolation = pos_emb_interpolation + self.affline_emb_norm = affline_emb_norm + self.rope_h_extrapolation_ratio = rope_h_extrapolation_ratio + self.rope_w_extrapolation_ratio = rope_w_extrapolation_ratio + self.rope_t_extrapolation_ratio = rope_t_extrapolation_ratio + self.extra_per_block_abs_pos_emb = extra_per_block_abs_pos_emb + self.extra_per_block_abs_pos_emb_type = extra_per_block_abs_pos_emb_type.lower() + self.extra_h_extrapolation_ratio = extra_h_extrapolation_ratio + self.extra_w_extrapolation_ratio = extra_w_extrapolation_ratio + self.extra_t_extrapolation_ratio = extra_t_extrapolation_ratio + self.dtype = dtype + weight_args = {"device": device, "dtype": dtype} + + in_channels = in_channels + 1 if concat_padding_mask else in_channels + self.x_embedder = PatchEmbed( + spatial_patch_size=patch_spatial, + temporal_patch_size=patch_temporal, + in_channels=in_channels, + out_channels=model_channels, + bias=False, + weight_args=weight_args, + operations=operations, + ) + + self.build_pos_embed(device=device, dtype=dtype) + self.block_x_format = block_x_format + self.use_adaln_lora = use_adaln_lora + self.adaln_lora_dim = adaln_lora_dim + self.t_embedder = nn.ModuleList( + [Timesteps(model_channels), + TimestepEmbedding(model_channels, model_channels, use_adaln_lora=use_adaln_lora, weight_args=weight_args, operations=operations),] + ) + + self.blocks = nn.ModuleDict() + + for idx in range(num_blocks): + self.blocks[f"block{idx}"] = GeneralDITTransformerBlock( + x_dim=model_channels, + context_dim=crossattn_emb_channels, + num_heads=num_heads, + block_config=block_config, + mlp_ratio=mlp_ratio, + x_format=self.block_x_format, + use_adaln_lora=use_adaln_lora, + adaln_lora_dim=adaln_lora_dim, + weight_args=weight_args, + operations=operations, + ) + + if self.affline_emb_norm: + logging.debug("Building affine embedding normalization layer") + self.affline_norm = RMSNorm(model_channels, elementwise_affine=True, eps=1e-6) + else: + self.affline_norm = nn.Identity() + + self.final_layer = FinalLayer( + hidden_size=self.model_channels, + spatial_patch_size=self.patch_spatial, + temporal_patch_size=self.patch_temporal, + out_channels=self.out_channels, + use_adaln_lora=self.use_adaln_lora, + adaln_lora_dim=self.adaln_lora_dim, + weight_args=weight_args, + operations=operations, + ) + + def build_pos_embed(self, device=None, dtype=None): + if self.pos_emb_cls == "rope3d": + cls_type = VideoRopePosition3DEmb + else: + raise ValueError(f"Unknown pos_emb_cls {self.pos_emb_cls}") + + logging.debug(f"Building positional embedding with {self.pos_emb_cls} class, impl {cls_type}") + kwargs = dict( + model_channels=self.model_channels, + len_h=self.max_img_h // self.patch_spatial, + len_w=self.max_img_w // self.patch_spatial, + len_t=self.max_frames // self.patch_temporal, + is_learnable=self.pos_emb_learnable, + interpolation=self.pos_emb_interpolation, + head_dim=self.model_channels // self.num_heads, + h_extrapolation_ratio=self.rope_h_extrapolation_ratio, + w_extrapolation_ratio=self.rope_w_extrapolation_ratio, + t_extrapolation_ratio=self.rope_t_extrapolation_ratio, + device=device, + ) + self.pos_embedder = cls_type( + **kwargs, + ) + + if self.extra_per_block_abs_pos_emb: + assert self.extra_per_block_abs_pos_emb_type in [ + "learnable", + ], f"Unknown extra_per_block_abs_pos_emb_type {self.extra_per_block_abs_pos_emb_type}" + kwargs["h_extrapolation_ratio"] = self.extra_h_extrapolation_ratio + kwargs["w_extrapolation_ratio"] = self.extra_w_extrapolation_ratio + kwargs["t_extrapolation_ratio"] = self.extra_t_extrapolation_ratio + kwargs["device"] = device + kwargs["dtype"] = dtype + self.extra_pos_embedder = LearnablePosEmbAxis( + **kwargs, + ) + + def prepare_embedded_sequence( + self, + x_B_C_T_H_W: torch.Tensor, + fps: Optional[torch.Tensor] = None, + padding_mask: Optional[torch.Tensor] = None, + latent_condition: Optional[torch.Tensor] = None, + latent_condition_sigma: Optional[torch.Tensor] = None, + ) -> Tuple[torch.Tensor, Optional[torch.Tensor]]: + """ + Prepares an embedded sequence tensor by applying positional embeddings and handling padding masks. + + Args: + x_B_C_T_H_W (torch.Tensor): video + fps (Optional[torch.Tensor]): Frames per second tensor to be used for positional embedding when required. + If None, a default value (`self.base_fps`) will be used. + padding_mask (Optional[torch.Tensor]): current it is not used + + Returns: + Tuple[torch.Tensor, Optional[torch.Tensor]]: + - A tensor of shape (B, T, H, W, D) with the embedded sequence. + - An optional positional embedding tensor, returned only if the positional embedding class + (`self.pos_emb_cls`) includes 'rope'. Otherwise, None. + + Notes: + - If `self.concat_padding_mask` is True, a padding mask channel is concatenated to the input tensor. + - The method of applying positional embeddings depends on the value of `self.pos_emb_cls`. + - If 'rope' is in `self.pos_emb_cls` (case insensitive), the positional embeddings are generated using + the `self.pos_embedder` with the shape [T, H, W]. + - If "fps_aware" is in `self.pos_emb_cls`, the positional embeddings are generated using the + `self.pos_embedder` with the fps tensor. + - Otherwise, the positional embeddings are generated without considering fps. + """ + if self.concat_padding_mask: + if padding_mask is not None: + padding_mask = transforms.functional.resize( + padding_mask, list(x_B_C_T_H_W.shape[-2:]), interpolation=transforms.InterpolationMode.NEAREST + ) + else: + padding_mask = torch.zeros((x_B_C_T_H_W.shape[0], 1, x_B_C_T_H_W.shape[-2], x_B_C_T_H_W.shape[-1]), dtype=x_B_C_T_H_W.dtype, device=x_B_C_T_H_W.device) + + x_B_C_T_H_W = torch.cat( + [x_B_C_T_H_W, padding_mask.unsqueeze(1).repeat(1, 1, x_B_C_T_H_W.shape[2], 1, 1)], dim=1 + ) + x_B_T_H_W_D = self.x_embedder(x_B_C_T_H_W) + + if self.extra_per_block_abs_pos_emb: + extra_pos_emb = self.extra_pos_embedder(x_B_T_H_W_D, fps=fps, device=x_B_C_T_H_W.device) + else: + extra_pos_emb = None + + if "rope" in self.pos_emb_cls.lower(): + return x_B_T_H_W_D, self.pos_embedder(x_B_T_H_W_D, fps=fps, device=x_B_C_T_H_W.device), extra_pos_emb + + if "fps_aware" in self.pos_emb_cls: + x_B_T_H_W_D = x_B_T_H_W_D + self.pos_embedder(x_B_T_H_W_D, fps=fps, device=x_B_C_T_H_W.device) # [B, T, H, W, D] + else: + x_B_T_H_W_D = x_B_T_H_W_D + self.pos_embedder(x_B_T_H_W_D, device=x_B_C_T_H_W.device) # [B, T, H, W, D] + + return x_B_T_H_W_D, None, extra_pos_emb + + def decoder_head( + self, + x_B_T_H_W_D: torch.Tensor, + emb_B_D: torch.Tensor, + crossattn_emb: torch.Tensor, + origin_shape: Tuple[int, int, int, int, int], # [B, C, T, H, W] + crossattn_mask: Optional[torch.Tensor] = None, + adaln_lora_B_3D: Optional[torch.Tensor] = None, + ) -> torch.Tensor: + del crossattn_emb, crossattn_mask + B, C, T_before_patchify, H_before_patchify, W_before_patchify = origin_shape + x_BT_HW_D = rearrange(x_B_T_H_W_D, "B T H W D -> (B T) (H W) D") + x_BT_HW_D = self.final_layer(x_BT_HW_D, emb_B_D, adaln_lora_B_3D=adaln_lora_B_3D) + # This is to ensure x_BT_HW_D has the correct shape because + # when we merge T, H, W into one dimension, x_BT_HW_D has shape (B * T * H * W, 1*1, D). + x_BT_HW_D = x_BT_HW_D.view( + B * T_before_patchify // self.patch_temporal, + H_before_patchify // self.patch_spatial * W_before_patchify // self.patch_spatial, + -1, + ) + x_B_D_T_H_W = rearrange( + x_BT_HW_D, + "(B T) (H W) (p1 p2 t C) -> B C (T t) (H p1) (W p2)", + p1=self.patch_spatial, + p2=self.patch_spatial, + H=H_before_patchify // self.patch_spatial, + W=W_before_patchify // self.patch_spatial, + t=self.patch_temporal, + B=B, + ) + return x_B_D_T_H_W + + def forward_before_blocks( + self, + x: torch.Tensor, + timesteps: torch.Tensor, + crossattn_emb: torch.Tensor, + crossattn_mask: Optional[torch.Tensor] = None, + fps: Optional[torch.Tensor] = None, + image_size: Optional[torch.Tensor] = None, + padding_mask: Optional[torch.Tensor] = None, + scalar_feature: Optional[torch.Tensor] = None, + data_type: Optional[DataType] = DataType.VIDEO, + latent_condition: Optional[torch.Tensor] = None, + latent_condition_sigma: Optional[torch.Tensor] = None, + **kwargs, + ) -> torch.Tensor: + """ + Args: + x: (B, C, T, H, W) tensor of spatial-temp inputs + timesteps: (B, ) tensor of timesteps + crossattn_emb: (B, N, D) tensor of cross-attention embeddings + crossattn_mask: (B, N) tensor of cross-attention masks + """ + del kwargs + assert isinstance( + data_type, DataType + ), f"Expected DataType, got {type(data_type)}. We need discuss this flag later." + original_shape = x.shape + x_B_T_H_W_D, rope_emb_L_1_1_D, extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D = self.prepare_embedded_sequence( + x, + fps=fps, + padding_mask=padding_mask, + latent_condition=latent_condition, + latent_condition_sigma=latent_condition_sigma, + ) + # logging affline scale information + affline_scale_log_info = {} + + timesteps_B_D, adaln_lora_B_3D = self.t_embedder[1](self.t_embedder[0](timesteps.flatten()).to(x.dtype)) + affline_emb_B_D = timesteps_B_D + affline_scale_log_info["timesteps_B_D"] = timesteps_B_D.detach() + + if scalar_feature is not None: + raise NotImplementedError("Scalar feature is not implemented yet.") + + affline_scale_log_info["affline_emb_B_D"] = affline_emb_B_D.detach() + affline_emb_B_D = self.affline_norm(affline_emb_B_D) + + if self.use_cross_attn_mask: + if crossattn_mask is not None and not torch.is_floating_point(crossattn_mask): + crossattn_mask = (crossattn_mask - 1).to(x.dtype) * torch.finfo(x.dtype).max + crossattn_mask = crossattn_mask[:, None, None, :] # .to(dtype=torch.bool) # [B, 1, 1, length] + else: + crossattn_mask = None + + if self.blocks["block0"].x_format == "THWBD": + x = rearrange(x_B_T_H_W_D, "B T H W D -> T H W B D") + if extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D is not None: + extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D = rearrange( + extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D, "B T H W D -> T H W B D" + ) + crossattn_emb = rearrange(crossattn_emb, "B M D -> M B D") + + if crossattn_mask: + crossattn_mask = rearrange(crossattn_mask, "B M -> M B") + + elif self.blocks["block0"].x_format == "BTHWD": + x = x_B_T_H_W_D + else: + raise ValueError(f"Unknown x_format {self.blocks[0].x_format}") + output = { + "x": x, + "affline_emb_B_D": affline_emb_B_D, + "crossattn_emb": crossattn_emb, + "crossattn_mask": crossattn_mask, + "rope_emb_L_1_1_D": rope_emb_L_1_1_D, + "adaln_lora_B_3D": adaln_lora_B_3D, + "original_shape": original_shape, + "extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D": extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D, + } + return output + + def forward( + self, + x: torch.Tensor, + timesteps: torch.Tensor, + context: torch.Tensor, + attention_mask: Optional[torch.Tensor] = None, + # crossattn_emb: torch.Tensor, + # crossattn_mask: Optional[torch.Tensor] = None, + fps: Optional[torch.Tensor] = None, + image_size: Optional[torch.Tensor] = None, + padding_mask: Optional[torch.Tensor] = None, + scalar_feature: Optional[torch.Tensor] = None, + data_type: Optional[DataType] = DataType.VIDEO, + latent_condition: Optional[torch.Tensor] = None, + latent_condition_sigma: Optional[torch.Tensor] = None, + condition_video_augment_sigma: Optional[torch.Tensor] = None, + **kwargs, + ): + """ + Args: + x: (B, C, T, H, W) tensor of spatial-temp inputs + timesteps: (B, ) tensor of timesteps + crossattn_emb: (B, N, D) tensor of cross-attention embeddings + crossattn_mask: (B, N) tensor of cross-attention masks + condition_video_augment_sigma: (B,) used in lvg(long video generation), we add noise with this sigma to + augment condition input, the lvg model will condition on the condition_video_augment_sigma value; + we need forward_before_blocks pass to the forward_before_blocks function. + """ + + crossattn_emb = context + crossattn_mask = attention_mask + + inputs = self.forward_before_blocks( + x=x, + timesteps=timesteps, + crossattn_emb=crossattn_emb, + crossattn_mask=crossattn_mask, + fps=fps, + image_size=image_size, + padding_mask=padding_mask, + scalar_feature=scalar_feature, + data_type=data_type, + latent_condition=latent_condition, + latent_condition_sigma=latent_condition_sigma, + condition_video_augment_sigma=condition_video_augment_sigma, + **kwargs, + ) + x, affline_emb_B_D, crossattn_emb, crossattn_mask, rope_emb_L_1_1_D, adaln_lora_B_3D, original_shape = ( + inputs["x"], + inputs["affline_emb_B_D"], + inputs["crossattn_emb"], + inputs["crossattn_mask"], + inputs["rope_emb_L_1_1_D"], + inputs["adaln_lora_B_3D"], + inputs["original_shape"], + ) + extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D = inputs["extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D"].to(x.dtype) + del inputs + + if extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D is not None: + assert ( + x.shape == extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D.shape + ), f"{x.shape} != {extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D.shape} {original_shape}" + + for _, block in self.blocks.items(): + assert ( + self.blocks["block0"].x_format == block.x_format + ), f"First block has x_format {self.blocks[0].x_format}, got {block.x_format}" + + if extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D is not None: + x += extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D + x = block( + x, + affline_emb_B_D, + crossattn_emb, + crossattn_mask, + rope_emb_L_1_1_D=rope_emb_L_1_1_D, + adaln_lora_B_3D=adaln_lora_B_3D, + ) + + x_B_T_H_W_D = rearrange(x, "T H W B D -> B T H W D") + + x_B_D_T_H_W = self.decoder_head( + x_B_T_H_W_D=x_B_T_H_W_D, + emb_B_D=affline_emb_B_D, + crossattn_emb=None, + origin_shape=original_shape, + crossattn_mask=None, + adaln_lora_B_3D=adaln_lora_B_3D, + ) + + return x_B_D_T_H_W diff --git a/comfy/ldm/cosmos/position_embedding.py b/comfy/ldm/cosmos/position_embedding.py new file mode 100644 index 000000000..cf45ab0e3 --- /dev/null +++ b/comfy/ldm/cosmos/position_embedding.py @@ -0,0 +1,208 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. + +from typing import List, Optional + +import torch +from einops import rearrange, repeat +from torch import nn +import math + + +def normalize(x: torch.Tensor, dim: Optional[List[int]] = None, eps: float = 0) -> torch.Tensor: + """ + Normalizes the input tensor along specified dimensions such that the average square norm of elements is adjusted. + + Args: + x (torch.Tensor): The input tensor to normalize. + dim (list, optional): The dimensions over which to normalize. If None, normalizes over all dimensions except the first. + eps (float, optional): A small constant to ensure numerical stability during division. + + Returns: + torch.Tensor: The normalized tensor. + """ + if dim is None: + dim = list(range(1, x.ndim)) + norm = torch.linalg.vector_norm(x, dim=dim, keepdim=True, dtype=torch.float32) + norm = torch.add(eps, norm, alpha=math.sqrt(norm.numel() / x.numel())) + return x / norm.to(x.dtype) + + +class VideoPositionEmb(nn.Module): + def forward(self, x_B_T_H_W_C: torch.Tensor, fps=Optional[torch.Tensor], device=None) -> torch.Tensor: + """ + It delegates the embedding generation to generate_embeddings function. + """ + B_T_H_W_C = x_B_T_H_W_C.shape + embeddings = self.generate_embeddings(B_T_H_W_C, fps=fps, device=device) + + return embeddings + + def generate_embeddings(self, B_T_H_W_C: torch.Size, fps=Optional[torch.Tensor], device=None): + raise NotImplementedError + + +class VideoRopePosition3DEmb(VideoPositionEmb): + def __init__( + self, + *, # enforce keyword arguments + head_dim: int, + len_h: int, + len_w: int, + len_t: int, + base_fps: int = 24, + h_extrapolation_ratio: float = 1.0, + w_extrapolation_ratio: float = 1.0, + t_extrapolation_ratio: float = 1.0, + device=None, + **kwargs, # used for compatibility with other positional embeddings; unused in this class + ): + del kwargs + super().__init__() + self.register_buffer("seq", torch.arange(max(len_h, len_w, len_t), dtype=torch.float, device=device)) + self.base_fps = base_fps + self.max_h = len_h + self.max_w = len_w + + dim = head_dim + dim_h = dim // 6 * 2 + dim_w = dim_h + dim_t = dim - 2 * dim_h + assert dim == dim_h + dim_w + dim_t, f"bad dim: {dim} != {dim_h} + {dim_w} + {dim_t}" + self.register_buffer( + "dim_spatial_range", + torch.arange(0, dim_h, 2, device=device)[: (dim_h // 2)].float() / dim_h, + persistent=False, + ) + self.register_buffer( + "dim_temporal_range", + torch.arange(0, dim_t, 2, device=device)[: (dim_t // 2)].float() / dim_t, + persistent=False, + ) + + self.h_ntk_factor = h_extrapolation_ratio ** (dim_h / (dim_h - 2)) + self.w_ntk_factor = w_extrapolation_ratio ** (dim_w / (dim_w - 2)) + self.t_ntk_factor = t_extrapolation_ratio ** (dim_t / (dim_t - 2)) + + def generate_embeddings( + self, + B_T_H_W_C: torch.Size, + fps: Optional[torch.Tensor] = None, + h_ntk_factor: Optional[float] = None, + w_ntk_factor: Optional[float] = None, + t_ntk_factor: Optional[float] = None, + device=None, + ): + """ + Generate embeddings for the given input size. + + Args: + B_T_H_W_C (torch.Size): Input tensor size (Batch, Time, Height, Width, Channels). + fps (Optional[torch.Tensor], optional): Frames per second. Defaults to None. + h_ntk_factor (Optional[float], optional): Height NTK factor. If None, uses self.h_ntk_factor. + w_ntk_factor (Optional[float], optional): Width NTK factor. If None, uses self.w_ntk_factor. + t_ntk_factor (Optional[float], optional): Time NTK factor. If None, uses self.t_ntk_factor. + + Returns: + Not specified in the original code snippet. + """ + h_ntk_factor = h_ntk_factor if h_ntk_factor is not None else self.h_ntk_factor + w_ntk_factor = w_ntk_factor if w_ntk_factor is not None else self.w_ntk_factor + t_ntk_factor = t_ntk_factor if t_ntk_factor is not None else self.t_ntk_factor + + h_theta = 10000.0 * h_ntk_factor + w_theta = 10000.0 * w_ntk_factor + t_theta = 10000.0 * t_ntk_factor + + h_spatial_freqs = 1.0 / (h_theta**self.dim_spatial_range.to(device=device)) + w_spatial_freqs = 1.0 / (w_theta**self.dim_spatial_range.to(device=device)) + temporal_freqs = 1.0 / (t_theta**self.dim_temporal_range.to(device=device)) + + B, T, H, W, _ = B_T_H_W_C + uniform_fps = (fps is None) or isinstance(fps, (int, float)) or (fps.min() == fps.max()) + assert ( + uniform_fps or B == 1 or T == 1 + ), "For video batch, batch size should be 1 for non-uniform fps. For image batch, T should be 1" + assert ( + H <= self.max_h and W <= self.max_w + ), f"Input dimensions (H={H}, W={W}) exceed the maximum dimensions (max_h={self.max_h}, max_w={self.max_w})" + half_emb_h = torch.outer(self.seq[:H].to(device=device), h_spatial_freqs) + half_emb_w = torch.outer(self.seq[:W].to(device=device), w_spatial_freqs) + + # apply sequence scaling in temporal dimension + if fps is None: # image case + half_emb_t = torch.outer(self.seq[:T].to(device=device), temporal_freqs) + else: + half_emb_t = torch.outer(self.seq[:T].to(device=device) / fps * self.base_fps, temporal_freqs) + + half_emb_h = torch.stack([torch.cos(half_emb_h), -torch.sin(half_emb_h), torch.sin(half_emb_h), torch.cos(half_emb_h)], dim=-1) + half_emb_w = torch.stack([torch.cos(half_emb_w), -torch.sin(half_emb_w), torch.sin(half_emb_w), torch.cos(half_emb_w)], dim=-1) + half_emb_t = torch.stack([torch.cos(half_emb_t), -torch.sin(half_emb_t), torch.sin(half_emb_t), torch.cos(half_emb_t)], dim=-1) + + em_T_H_W_D = torch.cat( + [ + repeat(half_emb_t, "t d x -> t h w d x", h=H, w=W), + repeat(half_emb_h, "h d x -> t h w d x", t=T, w=W), + repeat(half_emb_w, "w d x -> t h w d x", t=T, h=H), + ] + , dim=-2, + ) + + return rearrange(em_T_H_W_D, "t h w d (i j) -> (t h w) d i j", i=2, j=2).float() + + +class LearnablePosEmbAxis(VideoPositionEmb): + def __init__( + self, + *, # enforce keyword arguments + interpolation: str, + model_channels: int, + len_h: int, + len_w: int, + len_t: int, + device=None, + dtype=None, + **kwargs, + ): + """ + Args: + interpolation (str): we curretly only support "crop", ideally when we need extrapolation capacity, we should adjust frequency or other more advanced methods. they are not implemented yet. + """ + del kwargs # unused + super().__init__() + self.interpolation = interpolation + assert self.interpolation in ["crop"], f"Unknown interpolation method {self.interpolation}" + + self.pos_emb_h = nn.Parameter(torch.empty(len_h, model_channels, device=device, dtype=dtype)) + self.pos_emb_w = nn.Parameter(torch.empty(len_w, model_channels, device=device, dtype=dtype)) + self.pos_emb_t = nn.Parameter(torch.empty(len_t, model_channels, device=device, dtype=dtype)) + + + def generate_embeddings(self, B_T_H_W_C: torch.Size, fps=Optional[torch.Tensor], device=None) -> torch.Tensor: + B, T, H, W, _ = B_T_H_W_C + if self.interpolation == "crop": + emb_h_H = self.pos_emb_h[:H].to(device=device) + emb_w_W = self.pos_emb_w[:W].to(device=device) + emb_t_T = self.pos_emb_t[:T].to(device=device) + emb = ( + repeat(emb_t_T, "t d-> b t h w d", b=B, h=H, w=W) + + repeat(emb_h_H, "h d-> b t h w d", b=B, t=T, w=W) + + repeat(emb_w_W, "w d-> b t h w d", b=B, t=T, h=H) + ) + assert list(emb.shape)[:4] == [B, T, H, W], f"bad shape: {list(emb.shape)[:4]} != {B, T, H, W}" + else: + raise ValueError(f"Unknown interpolation method {self.interpolation}") + + return normalize(emb, dim=-1, eps=1e-6) diff --git a/comfy/ldm/cosmos/vae.py b/comfy/ldm/cosmos/vae.py new file mode 100644 index 000000000..c8db68612 --- /dev/null +++ b/comfy/ldm/cosmos/vae.py @@ -0,0 +1,124 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. +"""The causal continuous video tokenizer with VAE or AE formulation for 3D data..""" + +import logging +import torch +from torch import nn +from enum import Enum + +from .cosmos_tokenizer.layers3d import ( + EncoderFactorized, + DecoderFactorized, + CausalConv3d, +) + + +class IdentityDistribution(torch.nn.Module): + def __init__(self): + super().__init__() + + def forward(self, parameters): + return parameters, (torch.tensor([0.0]), torch.tensor([0.0])) + + +class GaussianDistribution(torch.nn.Module): + def __init__(self, min_logvar: float = -30.0, max_logvar: float = 20.0): + super().__init__() + self.min_logvar = min_logvar + self.max_logvar = max_logvar + + def sample(self, mean, logvar): + std = torch.exp(0.5 * logvar) + return mean + std * torch.randn_like(mean) + + def forward(self, parameters): + mean, logvar = torch.chunk(parameters, 2, dim=1) + logvar = torch.clamp(logvar, self.min_logvar, self.max_logvar) + return self.sample(mean, logvar), (mean, logvar) + + +class ContinuousFormulation(Enum): + VAE = GaussianDistribution + AE = IdentityDistribution + + +class CausalContinuousVideoTokenizer(nn.Module): + def __init__( + self, z_channels: int, z_factor: int, latent_channels: int, **kwargs + ) -> None: + super().__init__() + self.name = kwargs.get("name", "CausalContinuousVideoTokenizer") + self.latent_channels = latent_channels + self.sigma_data = 0.5 + + # encoder_name = kwargs.get("encoder", Encoder3DType.BASE.name) + self.encoder = EncoderFactorized( + z_channels=z_factor * z_channels, **kwargs + ) + if kwargs.get("temporal_compression", 4) == 4: + kwargs["channels_mult"] = [2, 4] + # decoder_name = kwargs.get("decoder", Decoder3DType.BASE.name) + self.decoder = DecoderFactorized( + z_channels=z_channels, **kwargs + ) + + self.quant_conv = CausalConv3d( + z_factor * z_channels, + z_factor * latent_channels, + kernel_size=1, + padding=0, + ) + self.post_quant_conv = CausalConv3d( + latent_channels, z_channels, kernel_size=1, padding=0 + ) + + # formulation_name = kwargs.get("formulation", ContinuousFormulation.AE.name) + self.distribution = IdentityDistribution() # ContinuousFormulation[formulation_name].value() + + num_parameters = sum(param.numel() for param in self.parameters()) + logging.debug(f"model={self.name}, num_parameters={num_parameters:,}") + logging.debug( + f"z_channels={z_channels}, latent_channels={self.latent_channels}." + ) + + latent_temporal_chunk = 16 + self.latent_mean = nn.Parameter(torch.zeros([self.latent_channels * latent_temporal_chunk], dtype=torch.float32)) + self.latent_std = nn.Parameter(torch.ones([self.latent_channels * latent_temporal_chunk], dtype=torch.float32)) + + + def encode(self, x): + h = self.encoder(x) + moments = self.quant_conv(h) + z, posteriors = self.distribution(moments) + latent_ch = z.shape[1] + latent_t = z.shape[2] + dtype = z.dtype + mean = self.latent_mean.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=dtype, device=z.device) + std = self.latent_std.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=dtype, device=z.device) + return ((z - mean) / std) * self.sigma_data + + def decode(self, z): + in_dtype = z.dtype + latent_ch = z.shape[1] + latent_t = z.shape[2] + mean = self.latent_mean.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device) + std = self.latent_std.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device) + + z = z / self.sigma_data + z = z * std + mean + z = self.post_quant_conv(z) + return self.decoder(z) + diff --git a/comfy/ldm/flux/layers.py b/comfy/ldm/flux/layers.py index ff44e9f76..85e44551d 100644 --- a/comfy/ldm/flux/layers.py +++ b/comfy/ldm/flux/layers.py @@ -231,8 +231,7 @@ class SingleStreamBlock(nn.Module): def forward(self, x: Tensor, vec: Tensor, pe: Tensor, attn_mask=None) -> Tensor: mod, _ = self.modulation(vec) - x_mod = (1 + mod.scale) * self.pre_norm(x) + mod.shift - qkv, mlp = torch.split(self.linear1(x_mod), [3 * self.hidden_size, self.mlp_hidden_dim], dim=-1) + qkv, mlp = torch.split(self.linear1((1 + mod.scale) * self.pre_norm(x) + mod.shift), [3 * self.hidden_size, self.mlp_hidden_dim], dim=-1) qkv = qkv.view(qkv.shape[0], qkv.shape[1], 3, self.num_heads, -1).permute(2, 0, 3, 1, 4) q, k, v = torch.unbind(qkv, dim=0) diff --git a/comfy/ldm/flux/math.py b/comfy/ldm/flux/math.py index d80f3db7f..7418e79b2 100644 --- a/comfy/ldm/flux/math.py +++ b/comfy/ldm/flux/math.py @@ -5,8 +5,15 @@ from torch import Tensor from ..modules.attention import optimized_attention from ... import model_management + def attention(q: Tensor, k: Tensor, v: Tensor, pe: Tensor, mask=None) -> Tensor: - q, k = apply_rope(q, k, pe) + q_shape = q.shape + k_shape = k.shape + + q = q.float().reshape(*q.shape[:-1], -1, 1, 2) + k = k.float().reshape(*k.shape[:-1], -1, 1, 2) + q = (pe[..., 0] * q[..., 0] + pe[..., 1] * q[..., 1]).reshape(*q_shape).type_as(v) + k = (pe[..., 0] * k[..., 0] + pe[..., 1] * k[..., 1]).reshape(*k_shape).type_as(v) heads = q.shape[1] x = optimized_attention(q, k, v, heads, skip_reshape=True, mask=mask) diff --git a/comfy/ldm/hydit/attn_layers.py b/comfy/ldm/hydit/attn_layers.py index 981a55d21..93a916681 100644 --- a/comfy/ldm/hydit/attn_layers.py +++ b/comfy/ldm/hydit/attn_layers.py @@ -159,7 +159,7 @@ class CrossAttention(nn.Module): q = q.transpose(-2, -3).contiguous() # q -> B, L1, H, C - B, H, L1, C k = k.transpose(-2, -3).contiguous() # k -> B, L2, H, C - B, H, C, L2 - v = v.transpose(-2, -3).contiguous() + v = v.transpose(-2, -3).contiguous() context = optimized_attention(q, k, v, self.num_heads, skip_reshape=True, attn_precision=self.attn_precision) diff --git a/comfy/ldm/lightricks/model.py b/comfy/ldm/lightricks/model.py index ca0fb6053..ebccbbd1f 100644 --- a/comfy/ldm/lightricks/model.py +++ b/comfy/ldm/lightricks/model.py @@ -457,9 +457,8 @@ class LTXVModel(torch.nn.Module): x = self.patchify_proj(x) timestep = timestep * 1000.0 - attention_mask = 1.0 - attention_mask.to(x.dtype).reshape((attention_mask.shape[0], 1, -1, attention_mask.shape[-1])) - attention_mask = attention_mask.masked_fill(attention_mask.to(torch.bool), float("-inf")) # not sure about this - # attention_mask = (context != 0).any(dim=2).to(dtype=x.dtype) + if attention_mask is not None and not torch.is_floating_point(attention_mask): + attention_mask = (attention_mask - 1).to(x.dtype).reshape((attention_mask.shape[0], 1, -1, attention_mask.shape[-1])) * torch.finfo(x.dtype).max pe = precompute_freqs_cis(indices_grid, dim=self.inner_dim, out_dtype=x.dtype) diff --git a/comfy/ldm/modules/attention.py b/comfy/ldm/modules/attention.py index 43c522688..a373681ec 100644 --- a/comfy/ldm/modules/attention.py +++ b/comfy/ldm/modules/attention.py @@ -98,7 +98,7 @@ def Normalize(in_channels, dtype=None, device=None): return torch.nn.GroupNorm(num_groups=32, num_channels=in_channels, eps=1e-6, affine=True, dtype=dtype, device=device) -def attention_basic(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False): +def attention_basic(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False, skip_output_reshape=False): attn_precision = get_attn_precision(attn_precision) if skip_reshape: @@ -151,16 +151,23 @@ def attention_basic(q, k, v, heads, mask=None, attn_precision=None, skip_reshape sim = sim.softmax(dim=-1) out = einsum('b i j, b j d -> b i d', sim.to(v.dtype), v) - out = ( - out.unsqueeze(0) - .reshape(b, heads, -1, dim_head) - .permute(0, 2, 1, 3) - .reshape(b, -1, heads * dim_head) - ) + + if skip_output_reshape: + out = ( + out.unsqueeze(0) + .reshape(b, heads, -1, dim_head) + ) + else: + out = ( + out.unsqueeze(0) + .reshape(b, heads, -1, dim_head) + .permute(0, 2, 1, 3) + .reshape(b, -1, heads * dim_head) + ) return out -def attention_sub_quad(query, key, value, heads, mask=None, attn_precision=None, skip_reshape=False): +def attention_sub_quad(query, key, value, heads, mask=None, attn_precision=None, skip_reshape=False, skip_output_reshape=False): attn_precision = get_attn_precision(attn_precision) if skip_reshape: @@ -223,12 +230,14 @@ def attention_sub_quad(query, key, value, heads, mask=None, attn_precision=None, ) hidden_states = hidden_states.to(dtype) - - hidden_states = hidden_states.unflatten(0, (-1, heads)).transpose(1, 2).flatten(start_dim=2) + if skip_output_reshape: + hidden_states = hidden_states.unflatten(0, (-1, heads)) + else: + hidden_states = hidden_states.unflatten(0, (-1, heads)).transpose(1, 2).flatten(start_dim=2) return hidden_states -def attention_split(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False): +def attention_split(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False, skip_output_reshape=False): attn_precision = get_attn_precision(attn_precision) if skip_reshape: @@ -334,16 +343,22 @@ def attention_split(q, k, v, heads, mask=None, attn_precision=None, skip_reshape del q, k, v - r1 = ( - r1.unsqueeze(0) - .reshape(b, heads, -1, dim_head) - .permute(0, 2, 1, 3) - .reshape(b, -1, heads * dim_head) - ) + if skip_output_reshape: + r1 = ( + r1.unsqueeze(0) + .reshape(b, heads, -1, dim_head) + ) + else: + r1 = ( + r1.unsqueeze(0) + .reshape(b, heads, -1, dim_head) + .permute(0, 2, 1, 3) + .reshape(b, -1, heads * dim_head) + ) return r1 -def attention_xformers(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False): +def attention_xformers(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False, skip_output_reshape=False): b = q.shape[0] dim_head = q.shape[-1] # check to make sure xformers isn't broken @@ -392,9 +407,12 @@ def attention_xformers(q, k, v, heads, mask=None, attn_precision=None, skip_resh out = xformers.ops.memory_efficient_attention(q, k, v, attn_bias=mask) # pylint: disable=possibly-used-before-assignment - out = ( - out.reshape(b, -1, heads * dim_head) - ) + if skip_output_reshape: + out = out.permute(0, 2, 1, 3) + else: + out = ( + out.reshape(b, -1, heads * dim_head) + ) return out @@ -438,7 +456,7 @@ def pytorch_style_decl(func): return wrapper -def attention_pytorch(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False): +def attention_pytorch(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False, skip_output_reshape=False): if skip_reshape: b, _, _, dim_head = q.shape else: @@ -459,9 +477,10 @@ def attention_pytorch(q, k, v, heads, mask=None, attn_precision=None, skip_resha if SDP_BATCH_LIMIT >= b: out = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False) - out = ( - out.transpose(1, 2).reshape(b, -1, heads * dim_head) - ) + if not skip_output_reshape: + out = ( + out.transpose(1, 2).reshape(b, -1, heads * dim_head) + ) else: out = torch.empty((b, q.shape[2], heads * dim_head), dtype=q.dtype, layout=q.layout, device=q.device) for i in range(0, b, SDP_BATCH_LIMIT): @@ -480,7 +499,7 @@ def attention_pytorch(q, k, v, heads, mask=None, attn_precision=None, skip_resha return out -def attention_sage(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False): +def attention_sage(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False, skip_output_reshape=False): if skip_reshape: b, _, _, dim_head = q.shape tensor_layout="HND" @@ -503,11 +522,15 @@ def attention_sage(q, k, v, heads, mask=None, attn_precision=None, skip_reshape= out = sageattn(q, k, v, attn_mask=mask, is_causal=False, tensor_layout=tensor_layout) if tensor_layout == "HND": - out = ( - out.transpose(1, 2).reshape(b, -1, heads * dim_head) - ) + if not skip_output_reshape: + out = ( + out.transpose(1, 2).reshape(b, -1, heads * dim_head) + ) else: - out = out.reshape(b, -1, heads * dim_head) + if skip_output_reshape: + out = out.transpose(1, 2) + else: + out = out.reshape(b, -1, heads * dim_head) return out diff --git a/comfy/ldm/modules/diffusionmodules/model.py b/comfy/ldm/modules/diffusionmodules/model.py index c3330b777..46107a130 100644 --- a/comfy/ldm/modules/diffusionmodules/model.py +++ b/comfy/ldm/modules/diffusionmodules/model.py @@ -302,6 +302,18 @@ def pytorch_attention(q, k, v): return out +def vae_attention(): + if model_management.xformers_enabled_vae(): + logging.info("Using xformers attention in VAE") + return xformers_attention + elif model_management.pytorch_attention_enabled(): + logging.info("Using pytorch attention in VAE") + return pytorch_attention + else: + logging.info("Using split attention in VAE") + return normal_attention + + class AttnBlock(nn.Module): def __init__(self, in_channels, conv_op=ops.Conv2d): super().__init__() @@ -329,15 +341,7 @@ class AttnBlock(nn.Module): stride=1, padding=0) - if model_management.xformers_enabled_vae(): - logging.debug("Using xformers attention in VAE") - self.optimized_attention = xformers_attention - elif model_management.pytorch_attention_enabled(): - logging.debug("Using pytorch attention in VAE") - self.optimized_attention = pytorch_attention - else: - logging.debug("Using split attention in VAE") - self.optimized_attention = normal_attention + self.optimized_attention = vae_attention() def forward(self, x): h_ = x diff --git a/comfy/ldm/modules/sub_quadratic_attention.py b/comfy/ldm/modules/sub_quadratic_attention.py index 86ab29462..c26c21693 100644 --- a/comfy/ldm/modules/sub_quadratic_attention.py +++ b/comfy/ldm/modules/sub_quadratic_attention.py @@ -17,10 +17,10 @@ import math import logging try: - from typing import Optional, NamedTuple, List, Protocol + from typing import Optional, NamedTuple, List, Protocol except ImportError: - from typing import Optional, NamedTuple, List - from typing_extensions import Protocol + from typing import Optional, NamedTuple, List + from typing_extensions import Protocol from typing import List diff --git a/comfy/ldm/util.py b/comfy/ldm/util.py index 2ed4aa2ab..30b4b4721 100644 --- a/comfy/ldm/util.py +++ b/comfy/ldm/util.py @@ -194,4 +194,4 @@ class AdamWwithEMAandWings(optim.Optimizer): for param, ema_param in zip(params_with_grad, ema_params_with_grad): ema_param.mul_(cur_ema_decay).add_(param.float(), alpha=1 - cur_ema_decay) - return loss \ No newline at end of file + return loss diff --git a/comfy/model_base.py b/comfy/model_base.py index 262a3e8c7..53524a364 100644 --- a/comfy/model_base.py +++ b/comfy/model_base.py @@ -33,6 +33,7 @@ from .ldm.audio.embedders import NumberConditioner from .ldm.aura.mmdit import MMDiT as AuraMMDiT from .ldm.cascade.stage_b import StageB from .ldm.cascade.stage_c import StageC +from .ldm.cosmos.model import GeneralDIT from .ldm.flux import model as flux_model from .ldm.genmo.joint_model.asymm_models_joint import AsymmDiTJoint from .ldm.hunyuan_video.model import HunyuanVideo as HunyuanVideoModel @@ -206,7 +207,8 @@ class BaseModel(torch.nn.Module): if len(denoise_mask.shape) == len(noise.shape): denoise_mask = denoise_mask[:, :1] - denoise_mask = denoise_mask.reshape((-1, 1, denoise_mask.shape[-2], denoise_mask.shape[-1])) + num_dim = noise.ndim - 2 + denoise_mask = denoise_mask.reshape((-1, 1) + tuple(denoise_mask.shape[-num_dim:])) if denoise_mask.shape[-2:] != noise.shape[-2:]: denoise_mask = utils.common_upscale(denoise_mask, noise.shape[-1], noise.shape[-2], "bilinear", "center") denoise_mask = utils.resize_to_batch_size(denoise_mask.round(), noise.shape[0]) @@ -217,11 +219,15 @@ class BaseModel(torch.nn.Module): cond_concat.append(denoise_mask.to(device)) elif ck == "masked_image": cond_concat.append(concat_latent_image.to(device)) # NOTE: the latent_image should be masked by the mask in pixel space + elif ck == "mask_inverted": + cond_concat.append(1.0 - denoise_mask.to(device)) else: if ck == "mask": cond_concat.append(torch.ones_like(noise)[:, :1]) elif ck == "masked_image": cond_concat.append(self.blank_inpaint_image_like(noise)) + elif ck == "mask_inverted": + cond_concat.append(torch.zeros_like(noise)[:, :1]) data = torch.cat(cond_concat, dim=1) return data return None @@ -312,6 +318,9 @@ class BaseModel(torch.nn.Module): self.blank_inpaint_image_like = blank_inpaint_image_like + def scale_latent_inpaint(self, sigma, noise, latent_image, **kwargs): + return self.model_sampling.noise_scaling(sigma.reshape([sigma.shape[0]] + [1] * (len(noise.shape) - 1)), noise, latent_image) + def memory_required(self, input_shape): if model_management.xformers_enabled() or model_management.pytorch_attention_flash_attention(): dtype = self.get_dtype() @@ -891,3 +900,31 @@ class HunyuanVideo(BaseModel): out['c_crossattn'] = conds.CONDRegular(cross_attn) out['guidance'] = conds.CONDRegular(torch.FloatTensor([kwargs.get("guidance", 6.0)])) return out + + +class CosmosVideo(BaseModel): + def __init__(self, model_config, model_type=ModelType.EDM, image_to_video=False, device=None): + super().__init__(model_config, model_type, device=device, unet_model=GeneralDIT) + self.image_to_video = image_to_video + if self.image_to_video: + self.concat_keys = ("mask_inverted",) + + def extra_conds(self, **kwargs): + out = super().extra_conds(**kwargs) + attention_mask = kwargs.get("attention_mask", None) + if attention_mask is not None: + out['attention_mask'] = conds.CONDRegular(attention_mask) + cross_attn = kwargs.get("cross_attn", None) + if cross_attn is not None: + out['c_crossattn'] = conds.CONDRegular(cross_attn) + + out['fps'] = conds.CONDConstant(kwargs.get("frame_rate", None)) + return out + + def scale_latent_inpaint(self, sigma, noise, latent_image, **kwargs): + sigma = sigma.reshape([sigma.shape[0]] + [1] * (len(noise.shape) - 1)) + sigma_noise_augmentation = 0 # TODO + if sigma_noise_augmentation != 0: + latent_image = latent_image + noise + latent_image = self.model_sampling.calculate_input(torch.tensor([sigma_noise_augmentation], device=latent_image.device, dtype=latent_image.dtype), latent_image) + return latent_image * ((sigma ** 2 + self.model_sampling.sigma_data ** 2) ** 0.5) diff --git a/comfy/model_detection.py b/comfy/model_detection.py index cbf987ed3..3da3737a4 100644 --- a/comfy/model_detection.py +++ b/comfy/model_detection.py @@ -243,6 +243,51 @@ def detect_unet_config(state_dict, key_prefix): dit_config["micro_condition"] = False return dit_config + if '{}blocks.block0.blocks.0.block.attn.to_q.0.weight'.format(key_prefix) in state_dict_keys: + dit_config = {} + dit_config["image_model"] = "cosmos" + dit_config["max_img_h"] = 240 + dit_config["max_img_w"] = 240 + dit_config["max_frames"] = 128 + concat_padding_mask = True + dit_config["in_channels"] = (state_dict['{}x_embedder.proj.1.weight'.format(key_prefix)].shape[1] // 4) - int(concat_padding_mask) + dit_config["out_channels"] = 16 + dit_config["patch_spatial"] = 2 + dit_config["patch_temporal"] = 1 + dit_config["model_channels"] = state_dict['{}blocks.block0.blocks.0.block.attn.to_q.0.weight'.format(key_prefix)].shape[0] + dit_config["block_config"] = "FA-CA-MLP" + dit_config["concat_padding_mask"] = concat_padding_mask + dit_config["pos_emb_cls"] = "rope3d" + dit_config["pos_emb_learnable"] = False + dit_config["pos_emb_interpolation"] = "crop" + dit_config["block_x_format"] = "THWBD" + dit_config["affline_emb_norm"] = True + dit_config["use_adaln_lora"] = True + dit_config["adaln_lora_dim"] = 256 + + if dit_config["model_channels"] == 4096: + # 7B + dit_config["num_blocks"] = 28 + dit_config["num_heads"] = 32 + dit_config["extra_per_block_abs_pos_emb"] = True + dit_config["rope_h_extrapolation_ratio"] = 1.0 + dit_config["rope_w_extrapolation_ratio"] = 1.0 + dit_config["rope_t_extrapolation_ratio"] = 2.0 + dit_config["extra_per_block_abs_pos_emb_type"] = "learnable" + else: # 5120 + # 14B + dit_config["num_blocks"] = 36 + dit_config["num_heads"] = 40 + dit_config["extra_per_block_abs_pos_emb"] = True + dit_config["rope_h_extrapolation_ratio"] = 2.0 + dit_config["rope_w_extrapolation_ratio"] = 2.0 + dit_config["rope_t_extrapolation_ratio"] = 2.0 + dit_config["extra_h_extrapolation_ratio"] = 2.0 + dit_config["extra_w_extrapolation_ratio"] = 2.0 + dit_config["extra_t_extrapolation_ratio"] = 2.0 + dit_config["extra_per_block_abs_pos_emb_type"] = "learnable" + return dit_config + if '{}input_blocks.0.0.weight'.format(key_prefix) not in state_dict_keys: return None @@ -399,6 +444,7 @@ def model_config_from_unet(state_dict, unet_key_prefix, use_base_if_no_match=Fal def unet_prefix_from_state_dict(state_dict): candidates = ["model.diffusion_model.", # ldm/sgm models "model.model.", # audio models + "net.", #cosmos ] counts = {k: 0 for k in candidates} for k in state_dict: diff --git a/comfy/model_management.py b/comfy/model_management.py index 3bbcda278..12525fac7 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -1296,9 +1296,8 @@ def _soft_empty_cache(force=False): elif is_ascend_npu(): torch.npu.empty_cache() # pylint: disable=no-member elif torch.cuda.is_available(): - if force or is_nvidia(): # This seems to make things worse on ROCm so I only do it for cuda - torch.cuda.empty_cache() - torch.cuda.ipc_collect() + torch.cuda.empty_cache() + torch.cuda.ipc_collect() def unload_all_models(): @@ -1306,8 +1305,8 @@ def unload_all_models(): free_memory(1e30, get_torch_device()) -def resolve_lowvram_weight(weight, model, key): # TODO: remove - logger.warning("The comfy.model_management.resolve_lowvram_weight function will be removed soon, please stop using it.") +@_deprecate_method(version="*", message="The comfy.model_management.resolve_lowvram_weight function will be removed soon, please stop using it.") +def resolve_lowvram_weight(weight, model, key): return weight diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index 3544dc5d5..bedb6b2af 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -22,8 +22,8 @@ import copy import inspect import logging import uuid -from typing import Callable, Optional from math import isclose +from typing import Callable, Optional import torch import torch.nn @@ -32,10 +32,10 @@ from humanize import naturalsize from . import model_management, lora from . import patcher_extension from . import utils -from .component_model.deprecation import _deprecate_method from .comfy_types import UnetWrapperFunction +from .component_model.deprecation import _deprecate_method from .float import stochastic_rounding -from .hooks import EnumHookMode, _HookRef, HookGroup, EnumHookType, Hook, WeightHook, EnumWeightTarget +from .hooks import EnumHookMode, _HookRef, HookGroup, EnumHookType, WeightHook, create_transformer_options_from_hooks from .lora_types import PatchDict, PatchDictKey, PatchTuple, PatchWeightTuple, ModelPatchesDictValue from .model_base import BaseModel from .model_management_types import ModelManageable, MemoryMeasurements, ModelOptions @@ -225,7 +225,7 @@ class ModelPatcher(ModelManageable): self.injections: dict[str, list[PatcherInjection]] = {} self.hook_patches: dict[_HookRef] = {} - self.hook_patches_backup: dict[_HookRef] = {} + self.hook_patches_backup: dict[_HookRef] = None self.hook_backup: dict[str, tuple[torch.Tensor, torch.device]] = {} self.cached_hook_patches: dict[HookGroup, dict[str, torch.Tensor | tuple[torch.Tensor, torch.device]]] = {} self.current_hooks: Optional[HookGroup] = None @@ -318,7 +318,7 @@ class ModelPatcher(ModelManageable): n.injections[k] = i.copy() # hooks n.hook_patches = create_hook_patches_clone(self.hook_patches) - n.hook_patches_backup = create_hook_patches_clone(self.hook_patches_backup) + n.hook_patches_backup = create_hook_patches_clone(self.hook_patches_backup) if self.hook_patches_backup else self.hook_patches_backup for group in self.cached_hook_patches: n.cached_hook_patches[group] = {} for k in self.cached_hook_patches[group]: @@ -437,7 +437,20 @@ class ModelPatcher(ModelManageable): def add_object_patch(self, name, obj): self.object_patches[name] = obj - def get_model_object(self, name): + def get_model_object(self, name: str) -> torch.nn.Module: + """Retrieves a nested attribute from an object using dot notation considering + object patches. + + Args: + name (str): The attribute path using dot notation (e.g. "model.layer.weight") + + Returns: + The value of the requested attribute + + Example: + patcher = ModelPatcher() + weight = patcher.get_model_object("layer1.conv.weight") + """ if name in self.object_patches: return self.object_patches[name] else: @@ -836,7 +849,7 @@ class ModelPatcher(ModelManageable): else: return f"" - @_deprecate_method(version="0.3.2",message="WARNING the ModelPatcher.calculate_weight function is deprecated, please use: comfy.lora.calculate_weight instead") + @_deprecate_method(version="0.3.2", message="WARNING the ModelPatcher.calculate_weight function is deprecated, please use: comfy.lora.calculate_weight instead") def calculate_weight(self, patches, weight, key, intermediate_dtype=torch.float32): return lora.calculate_weight(patches, weight, key, intermediate_dtype=intermediate_dtype) @@ -906,6 +919,9 @@ class ModelPatcher(ModelManageable): if key in self.injections: self.injections.pop(key) + def get_injections(self, key: str): + return self.injections.get(key, None) + def set_additional_models(self, key: str, models: list['ModelPatcher']): self.additional_models[key] = models @@ -976,18 +992,19 @@ class ModelPatcher(ModelManageable): callback(self, timestep) def restore_hook_patches(self): - if len(self.hook_patches_backup) > 0: + if self.hook_patches_backup is not None: self.hook_patches = self.hook_patches_backup - self.hook_patches_backup = {} + self.hook_patches_backup = None def set_hook_mode(self, hook_mode: EnumHookMode): self.hook_mode = hook_mode - def prepare_hook_patches_current_keyframe(self, t: torch.Tensor, hook_group: HookGroup): + def prepare_hook_patches_current_keyframe(self, t: torch.Tensor, hook_group: HookGroup, model_options: dict[str]): curr_t = t[0] reset_current_hooks = False + transformer_options = model_options.get("transformer_options", {}) for hook in hook_group.hooks: - changed = hook.hook_keyframe.prepare_current_keyframe(curr_t=curr_t) + changed = hook.hook_keyframe.prepare_current_keyframe(curr_t=curr_t, transformer_options=transformer_options) # if keyframe changed, remove any cached HookGroups that contain hook with the same hook_ref; # this will cause the weights to be recalculated when sampling if changed: @@ -1003,25 +1020,26 @@ class ModelPatcher(ModelManageable): if reset_current_hooks: self.patch_hooks(None) - def register_all_hook_patches(self, hooks_dict: dict[EnumHookType, dict[Hook, None]], target: EnumWeightTarget, model_options: dict = None): + def register_all_hook_patches(self, hooks: HookGroup, target_dict: dict[str], model_options: dict = None, + registered: HookGroup = None): self.restore_hook_patches() - registered_hooks: list[Hook] = [] - # handle WrapperHooks, if model_options provided - if model_options is not None: - for hook in hooks_dict.get(EnumHookType.Wrappers, {}): - hook.add_hook_patches(self, model_options, target, registered_hooks) + if registered is None: + registered = HookGroup() # handle WeightHooks weight_hooks_to_register: list[WeightHook] = [] - for hook in hooks_dict.get(EnumHookType.Weight, {}): + for hook in hooks.get_type(EnumHookType.Weight): if hook.hook_ref not in self.hook_patches: weight_hooks_to_register.append(hook) + else: + registered.add(hook) if len(weight_hooks_to_register) > 0: # clone hook_patches to become backup so that any non-dynamic hooks will return to their original state self.hook_patches_backup = create_hook_patches_clone(self.hook_patches) for hook in weight_hooks_to_register: - hook.add_hook_patches(self, model_options, target, registered_hooks) + hook.add_hook_patches(self, model_options, target_dict, registered) for callback in self.get_all_callbacks(CallbacksMP.ON_REGISTER_ALL_HOOK_PATCHES): - callback(self, hooks_dict, target) + callback(self, hooks, target_dict, model_options, registered) + return registered def add_hook_patches(self, hook: WeightHook, patches, strength_patch=1.0, strength_model=1.0): with self.use_ejected(): @@ -1069,14 +1087,14 @@ class ModelPatcher(ModelManageable): combined_patches[key] = current_patches return combined_patches - def apply_hooks(self, hooks: HookGroup, transformer_options: dict = None, force_apply=False): + def apply_hooks(self, hooks: Optional[HookGroup], transformer_options: dict = None, force_apply=False): # TODO: return transformer_options dict with any additions from hooks if self.current_hooks == hooks and (not force_apply or (not self.is_clip and hooks is None)): - return {} + return create_transformer_options_from_hooks(self, hooks, transformer_options) self.patch_hooks(hooks=hooks) for callback in self.get_all_callbacks(CallbacksMP.ON_APPLY_HOOKS): callback(self, hooks) - return {} + return create_transformer_options_from_hooks(self, hooks, transformer_options) def patch_hooks(self, hooks: HookGroup | None): with self.use_ejected(): @@ -1171,7 +1189,6 @@ class ModelPatcher(ModelManageable): keys = list(self.hook_backup.keys()) for k in keys: utils.copy_to_param(self.model, k, self.hook_backup[k][0].to(device=self.hook_backup[k][1])) - self.hook_backup.clear() self.current_hooks = None diff --git a/comfy/nodes/base_nodes.py b/comfy/nodes/base_nodes.py index 8f2197035..de3df8e03 100644 --- a/comfy/nodes/base_nodes.py +++ b/comfy/nodes/base_nodes.py @@ -311,7 +311,7 @@ class VAEDecodeTiled: temporal_compression = vae.temporal_compression_decode() if temporal_compression is not None: temporal_size = max(2, temporal_size // temporal_compression) - temporal_overlap = min(1, temporal_size // 2, temporal_overlap // temporal_compression) + temporal_overlap = max(1, min(temporal_size // 2, temporal_overlap // temporal_compression)) else: temporal_size = None temporal_overlap = None @@ -944,16 +944,19 @@ class CLIPLoader: @classmethod def INPUT_TYPES(s): return {"required": { "clip_name": (get_filename_list_with_downloadable("text_encoders", KNOWN_CLIP_MODELS),), - "type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart"], ), + "type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart", "cosmos"], ), + }, + "optional": { + "device": (["default", "cpu"], {"advanced": True}), }} RETURN_TYPES = ("CLIP",) FUNCTION = "load_clip" CATEGORY = "advanced/loaders" - DESCRIPTION = "[Recipes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5" + DESCRIPTION = "[Recipes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5\ncosmos: old t5 xxl" - def load_clip(self, clip_name, type="stable_diffusion"): + def load_clip(self, clip_name, type="stable_diffusion", device="default"): clip_type = sd.CLIPType.STABLE_DIFFUSION if type == "stable_cascade": clip_type = sd.CLIPType.STABLE_CASCADE @@ -970,8 +973,12 @@ class CLIPLoader: else: logging.warning(f"Unknown clip type argument passed: {type} for model {clip_name}") + model_options = {} + if device == "cpu": + model_options["load_device"] = model_options["offload_device"] = torch.device("cpu") + clip_path = get_or_download("text_encoders", clip_name, KNOWN_CLIP_MODELS) - clip = sd.load_clip(ckpt_paths=[clip_path], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type) + clip = sd.load_clip(ckpt_paths=[clip_path], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type, model_options=model_options) return (clip,) class DualCLIPLoader: @@ -980,6 +987,9 @@ class DualCLIPLoader: return {"required": { "clip_name1": (get_filename_list_with_downloadable("text_encoders"),), "clip_name2": ( get_filename_list_with_downloadable("text_encoders"),), "type": (["sdxl", "sd3", "flux", "hunyuan_video"], ), + }, + "optional": { + "device": (["default", "cpu"], {"advanced": True}), }} RETURN_TYPES = ("CLIP",) FUNCTION = "load_clip" @@ -988,7 +998,7 @@ class DualCLIPLoader: DESCRIPTION = "[Recipes]\n\nsdxl: clip-l, clip-g\nsd3: clip-l, clip-g / clip-l, t5 / clip-g, t5\nflux: clip-l, t5" - def load_clip(self, clip_name1, clip_name2, type): + def load_clip(self, clip_name1, clip_name2, type, device="default"): clip_path1 = get_or_download("text_encoders", clip_name1) clip_path2 = get_or_download("text_encoders", clip_name2) if type == "sdxl": @@ -1002,7 +1012,11 @@ class DualCLIPLoader: else: raise ValueError(f"Unknown clip type argument passed: {type} for model {clip_name1} and {clip_name2}") - clip = sd.load_clip(ckpt_paths=[clip_path1, clip_path2], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type) + model_options = {} + if device == "cpu": + model_options["load_device"] = model_options["offload_device"] = torch.device("cpu") + + clip = sd.load_clip(ckpt_paths=[clip_path1, clip_path2], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type, model_options=model_options) return (clip,) class CLIPVisionLoader: diff --git a/comfy/patcher_extension.py b/comfy/patcher_extension.py index 8367977a0..859758244 100644 --- a/comfy/patcher_extension.py +++ b/comfy/patcher_extension.py @@ -96,12 +96,12 @@ class WrapperExecutor: self.wrappers = wrappers.copy() self.idx = idx self.is_last = idx == len(wrappers) - + def __call__(self, *args, **kwargs): """Calls the next wrapper or original function, whichever is appropriate.""" new_executor = self._create_next_executor() return new_executor.execute(*args, **kwargs) - + def execute(self, *args, **kwargs): """Used to initiate executor internally - DO NOT use this if you received executor in wrapper.""" args = list(args) @@ -121,7 +121,7 @@ class WrapperExecutor: @classmethod def new_executor(cls, original: Callable, wrappers: list[Callable], idx=0): return cls(original, class_obj=None, wrappers=wrappers, idx=idx) - + @classmethod def new_class_executor(cls, original: Callable, class_obj: object, wrappers: list[Callable], idx=0): return cls(original, class_obj, wrappers, idx=idx) diff --git a/comfy/sample.py b/comfy/sample.py index 0f63e673f..0173c1ca9 100644 --- a/comfy/sample.py +++ b/comfy/sample.py @@ -27,9 +27,11 @@ def prepare_noise(latent_image, seed, noise_inds=None): return noises def fix_empty_latent_channels(model, latent_image): - latent_channels = model.get_model_object("latent_format").latent_channels #Resize the empty latent image so it has the right number of channels - if latent_channels != latent_image.shape[1] and torch.count_nonzero(latent_image) == 0: - latent_image = utils.repeat_to_batch_size(latent_image, latent_channels, dim=1) + latent_format = model.get_model_object("latent_format") #Resize the empty latent image so it has the right number of channels + if latent_format.latent_channels != latent_image.shape[1] and torch.count_nonzero(latent_image) == 0: + latent_image = utils.repeat_to_batch_size(latent_image, latent_format.latent_channels, dim=1) + if latent_format.latent_dimensions == 3 and latent_image.ndim == 4: + latent_image = latent_image.unsqueeze(2) return latent_image @_deprecate_method(version="0.3.2", message="Warning: comfy.sample.prepare_sampling isn't used anymore and can be removed") diff --git a/comfy/sampler_helpers.py b/comfy/sampler_helpers.py index 510aee1f5..e3f6b8ee2 100644 --- a/comfy/sampler_helpers.py +++ b/comfy/sampler_helpers.py @@ -1,13 +1,15 @@ import uuid -from .controlnet import ControlBase from . import conds from . import model_management from . import patcher_extension from . import utils -from .hooks import EnumHookType, EnumWeightTarget, HookGroup, Hook +from .controlnet import ControlBase +from .hooks import EnumHookType, EnumWeightTarget, HookGroup, AdditionalModelsHook, create_target_dict, \ + TransformerOptionsHook from .model_base import BaseModel from .model_patcher import ModelPatcher +from .patcher_extension import merge_nested_dicts def prepare_mask(noise_mask, shape, device): @@ -25,15 +27,13 @@ def get_models_from_cond(cond, model_type): return models -def get_hooks_from_cond(cond, hooks_dict: dict[EnumHookType, dict[Hook, None]]): +def get_hooks_from_cond(cond, full_hooks: HookGroup): # get hooks from conds, and collect cnets so they can be checked for extra_hooks cnets: list[ControlBase] = [] for c in cond: if 'hooks' in c: for hook in c['hooks'].hooks: - hook: Hook - with_type = hooks_dict.setdefault(hook.hook_type, {}) - with_type[hook] = None + full_hooks.add(hook) if 'control' in c: cnets.append(c['control']) @@ -45,16 +45,15 @@ def get_hooks_from_cond(cond, hooks_dict: dict[EnumHookType, dict[Hook, None]]): return get_extra_hooks_from_cnet(cnet.previous_controlnet, _list) hooks_list = [] - cnets = set(cnets) - for base_cnet in cnets: + cnets_s = set(cnets) + for base_cnet in cnets_s: get_extra_hooks_from_cnet(base_cnet, hooks_list) extra_hooks = HookGroup.combine_all_hooks(hooks_list) if extra_hooks is not None: for hook in extra_hooks.hooks: - with_type = hooks_dict.setdefault(hook.hook_type, {}) - with_type[hook] = None + full_hooks.add(hook) - return hooks_dict + return full_hooks def convert_cond(cond): @@ -76,13 +75,11 @@ def get_additional_models(conds, dtype): cnets: list[ControlBase] = [] gligen = [] add_models = [] - hooks: dict[EnumHookType, dict[Hook, None]] = {} for k in conds: cnets += get_models_from_cond(conds[k], "control") gligen += get_models_from_cond(conds[k], "gligen") add_models += get_models_from_cond(conds[k], "additional_models") - get_hooks_from_cond(conds[k], hooks) control_nets = set(cnets) @@ -93,12 +90,22 @@ def get_additional_models(conds, dtype): inference_memory += m.inference_memory_requirements(dtype) gligen = [x[1] for x in gligen] - hook_models = [x.model for x in hooks.get(EnumHookType.AddModels, {}).keys()] - models = control_models + gligen + add_models + hook_models + models = control_models + gligen + add_models return models, inference_memory +def get_additional_models_from_model_options(model_options: dict[str] = None): + """loads additional models from registered AddModels hooks""" + models = [] + if model_options is not None and "registered_hooks" in model_options: + registered: HookGroup = model_options["registered_hooks"] + for hook in registered.get_type(EnumHookType.AdditionalModels): + hook: AdditionalModelsHook + models.extend(hook.models) + return models + + def cleanup_additional_models(models): """cleanup additional models that were loaded""" for m in models: @@ -106,9 +113,10 @@ def cleanup_additional_models(models): m.cleanup() -def prepare_sampling(model: 'ModelPatcher', noise_shape, conds): - real_model: 'BaseModel' = None +def prepare_sampling(model: ModelPatcher, noise_shape, conds, model_options=None): + real_model: BaseModel = None models, inference_memory = get_additional_models(conds, model.model_dtype()) + models += get_additional_models_from_model_options(model_options) models += model.get_nested_additional_models() # TODO: does this require inference_memory update? memory_required = model.memory_required([noise_shape[0] * 2] + list(noise_shape[1:])) + inference_memory minimum_memory_required = model.memory_required([noise_shape[0]] + list(noise_shape[1:])) + inference_memory @@ -129,12 +137,35 @@ def cleanup_models(conds, models): def prepare_model_patcher(model: 'ModelPatcher', conds, model_options: dict): + ''' + Registers hooks from conds. + ''' # check for hooks in conds - if not registered, see if can be applied - hooks = {} + hooks = HookGroup() for k in conds: get_hooks_from_cond(conds[k], hooks) # add wrappers and callbacks from ModelPatcher to transformer_options model_options["transformer_options"]["wrappers"] = patcher_extension.copy_nested_dicts(model.wrappers) model_options["transformer_options"]["callbacks"] = patcher_extension.copy_nested_dicts(model.callbacks) - # register hooks on model/model_options - model.register_all_hook_patches(hooks, EnumWeightTarget.Model, model_options) + # begin registering hooks + registered = HookGroup() + target_dict = create_target_dict(EnumWeightTarget.Model) + # handle all TransformerOptionsHooks + for hook in hooks.get_type(EnumHookType.TransformerOptions): + hook: TransformerOptionsHook + hook.add_hook_patches(model, model_options, target_dict, registered) + # handle all AddModelsHooks + for hook in hooks.get_type(EnumHookType.AdditionalModels): + hook: AdditionalModelsHook + hook.add_hook_patches(model, model_options, target_dict, registered) + # handle all WeightHooks by registering on ModelPatcher + model.register_all_hook_patches(hooks, target_dict, model_options, registered) + # add registered_hooks onto model_options for further reference + if len(registered) > 0: + model_options["registered_hooks"] = registered + # merge original wrappers and callbacks with hooked wrappers and callbacks + to_load_options: dict[str] = model_options.setdefault("to_load_options", {}) + for wc_name in ["wrappers", "callbacks"]: + merge_nested_dicts(to_load_options.setdefault(wc_name, {}), model_options["transformer_options"][wc_name], + copy_dict1=False) + return to_load_options diff --git a/comfy/sampler_names.py b/comfy/sampler_names.py index f605a65bb..80c5bb459 100644 --- a/comfy/sampler_names.py +++ b/comfy/sampler_names.py @@ -1,5 +1,6 @@ KSAMPLER_NAMES = ["euler", "euler_ancestral", "heun", "heunpp2", "dpm_2", "dpm_2_ancestral", "lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_sde", "dpmpp_sde_gpu", "dpmpp_2m", "dpmpp_2m_sde", "dpmpp_2m_sde_gpu", "dpmpp_3m_sde", "dpmpp_3m_sde_gpu", "ddpm", "lcm"] -SCHEDULER_NAMES = ["normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform", "beta", "linear_quadratic"] + +SCHEDULER_NAMES = ["normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform", "beta", "linear_quadratic", "kl_optimal"] SAMPLER_NAMES = KSAMPLER_NAMES + ["ddim", "uni_pc", "uni_pc_bh2"] diff --git a/comfy/samplers.py b/comfy/samplers.py index 6b5a2ef5a..2af594925 100644 --- a/comfy/samplers.py +++ b/comfy/samplers.py @@ -3,6 +3,8 @@ from __future__ import annotations import collections import logging import math +from functools import partial +from typing import NamedTuple, Callable import numpy import scipy.stats @@ -152,7 +154,7 @@ def cond_cat(c_list): return out -def finalize_default_conds(model: BaseModel, hooked_to_run: dict[HookGroup, list[tuple[tuple, int]]], default_conds: list[list[dict]], x_in, timestep): +def finalize_default_conds(model: BaseModel, hooked_to_run: dict[HookGroup, list[tuple[tuple, int]]], default_conds: list[list[dict]], x_in, timestep, model_options): # need to figure out remaining unmasked area for conds default_mults = [] for _ in default_conds: @@ -191,7 +193,7 @@ def finalize_default_conds(model: BaseModel, hooked_to_run: dict[HookGroup, list # replace p's mult with calculated mult p = p._replace(mult=mult) if p.hooks is not None: - model.current_patcher.prepare_hook_patches_current_keyframe(timestep, p.hooks) + model.current_patcher.prepare_hook_patches_current_keyframe(timestep, p.hooks, model_options) hooked_to_run.setdefault(p.hooks, list()) hooked_to_run[p.hooks] += [(p, i)] @@ -228,13 +230,13 @@ def _calc_cond_batch(model: BaseModel, conds, x_in: torch.Tensor, timestep: torc if p is None: continue if p.hooks is not None: - model.current_patcher.prepare_hook_patches_current_keyframe(timestep, p.hooks) + model.current_patcher.prepare_hook_patches_current_keyframe(timestep, p.hooks, model_options) hooked_to_run.setdefault(p.hooks, list()) hooked_to_run[p.hooks] += [(p, i)] default_conds.append(default_c) if has_default_conds: - finalize_default_conds(model, hooked_to_run, default_conds, x_in, timestep) + finalize_default_conds(model, hooked_to_run, default_conds, x_in, timestep, model_options) model.current_patcher.prepare_state(timestep) @@ -395,7 +397,7 @@ class KSamplerX0Inpaint: if "denoise_mask_function" in model_options: denoise_mask = model_options["denoise_mask_function"](sigma, denoise_mask, extra_options={"model": self.inner_model, "sigmas": self.sigmas}) latent_mask = 1. - denoise_mask - x = x * denoise_mask + self.inner_model.inner_model.model_sampling.noise_scaling(sigma.reshape([sigma.shape[0]] + [1] * (len(self.noise.shape) - 1)), self.noise, self.latent_image) * latent_mask + x = x * denoise_mask + self.inner_model.inner_model.scale_latent_inpaint(x=x, sigma=sigma, noise=self.noise, latent_image=self.latent_image) * latent_mask out = self.inner_model(x, sigma, model_options=model_options, seed=seed) if denoise_mask is not None: out = out * denoise_mask + self.latent_image * latent_mask @@ -493,6 +495,14 @@ def linear_quadratic_schedule(model_sampling, steps, threshold_noise=0.025, line return torch.FloatTensor(sigma_schedule) * model_sampling.sigma_max.cpu() +# Referenced from https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15608 +def kl_optimal_scheduler(n: int, sigma_min: float, sigma_max: float) -> torch.Tensor: + adj_idxs = torch.arange(n, dtype=torch.float).div_(n - 1) + sigmas = adj_idxs.new_zeros(n + 1) + sigmas[:-1] = (adj_idxs * math.atan(sigma_min) + (1 - adj_idxs) * math.atan(sigma_max)).tan_() + return sigmas + + def get_mask_aabb(masks): if masks.numel() == 0: return torch.zeros((0, 4), device=masks.device, dtype=torch.int) @@ -714,7 +724,7 @@ class Sampler: KSAMPLER_NAMES = ["euler", "euler_cfg_pp", "euler_ancestral", "euler_ancestral_cfg_pp", "heun", "heunpp2", "dpm_2", "dpm_2_ancestral", "lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_2s_ancestral_cfg_pp", "dpmpp_sde", "dpmpp_sde_gpu", "dpmpp_2m", "dpmpp_2m_cfg_pp", "dpmpp_2m_sde", "dpmpp_2m_sde_gpu", "dpmpp_3m_sde", "dpmpp_3m_sde_gpu", "ddpm", "lcm", - "ipndm", "ipndm_v", "deis"] + "ipndm", "ipndm_v", "deis", "res_multistep", "res_multistep_cfg_pp"] class KSAMPLER(Sampler): @@ -841,6 +851,34 @@ def preprocess_conds_hooks(conds: dict[str, list[dict[str]]]): cond['hooks'] = hooks +def filter_registered_hooks_on_conds(conds: dict[str, list[dict[str]]], model_options: dict[str]): + '''Modify 'hooks' on conds so that only hooks that were registered remain. Properly accounts for + HookGroups that have the same reference.''' + registered: hooks.HookGroup = model_options.get('registered_hooks', None) + # if None were registered, make sure all hooks are cleaned from conds + if registered is None: + for k in conds: + for kk in conds[k]: + kk.pop('hooks', None) + return + # find conds that contain hooks to be replaced - group by common HookGroup refs + hook_replacement: dict[hooks.HookGroup, list[dict]] = {} + for k in conds: + for kk in conds[k]: + hooks: hooks.HookGroup = kk.get('hooks', None) + if hooks is not None: + if not hooks.is_subset_of(registered): + to_replace = hook_replacement.setdefault(hooks, []) + to_replace.append(kk) + # for each hook to replace, create a new proper HookGroup and assign to all common conds + for hooks, conds_to_modify in hook_replacement.items(): + new_hooks = hooks.new_with_common_hooks(registered) + if len(new_hooks) == 0: + new_hooks = None + for kk in conds_to_modify: + kk['hooks'] = new_hooks + + def get_total_hook_groups_in_conds(conds: dict[str, list[dict[str]]]): hooks_set = set() for k in conds: @@ -849,9 +887,58 @@ def get_total_hook_groups_in_conds(conds: dict[str, list[dict[str]]]): return len(hooks_set) +def cast_to_load_options(model_options: dict[str], device=None, dtype=None): + ''' + If any patches from hooks, wrappers, or callbacks have .to to be called, call it. + ''' + if model_options is None: + return + to_load_options = model_options.get("to_load_options", None) + if to_load_options is None: + return + + casts = [] + if device is not None: + casts.append(device) + if dtype is not None: + casts.append(dtype) + # if nothing to apply, do nothing + if len(casts) == 0: + return + + # try to call .to on patches + if "patches" in to_load_options: + patches = to_load_options["patches"] + for name in patches: + patch_list = patches[name] + for i in range(len(patch_list)): + if hasattr(patch_list[i], "to"): + for cast in casts: + patch_list[i] = patch_list[i].to(cast) + if "patches_replace" in to_load_options: + patches = to_load_options["patches_replace"] + for name in patches: + patch_list = patches[name] + for k in patch_list: + if hasattr(patch_list[k], "to"): + for cast in casts: + patch_list[k] = patch_list[k].to(cast) + # try to call .to on any wrappers/callbacks + wrappers_and_callbacks = ["wrappers", "callbacks"] + for wc_name in wrappers_and_callbacks: + if wc_name in to_load_options: + wc: dict[str, list] = to_load_options[wc_name] + for wc_dict in wc.values(): + for wc_list in wc_dict.values(): + for i in range(len(wc_list)): + if hasattr(wc_list[i], "to"): + for cast in casts: + wc_list[i] = wc_list[i].to(cast) + + class CFGGuider: - def __init__(self, model_patcher): - self.model_patcher: 'ModelPatcher' = model_patcher + def __init__(self, model_patcher: ModelPatcher): + self.model_patcher = model_patcher self.model_options = model_patcher.model_options self.original_conds = {} self.cfg = 1.0 @@ -878,7 +965,9 @@ class CFGGuider: self.conds = process_conds(self.inner_model, noise, self.conds, device, latent_image, denoise_mask, seed) - extra_args = {"model_options": model_patcher.create_model_options_clone(self.model_options), "seed": seed} + extra_model_options = model_patcher.create_model_options_clone(self.model_options) + extra_model_options.setdefault("transformer_options", {})["sample_sigmas"] = sigmas + extra_args = {"model_options": extra_model_options, "seed": seed} executor = patcher_extension.WrapperExecutor.new_class_executor( sampler.sample, @@ -889,7 +978,7 @@ class CFGGuider: return self.inner_model.process_latent_out(samples.to(torch.float32)) def outer_sample(self, noise, latent_image, sampler: KSAMPLER, sigmas, denoise_mask=None, callback=None, disable_pbar=False, seed=None): - self.inner_model, self.conds, self.loaded_models = sampler_helpers.prepare_sampling(self.model_patcher, noise.shape, self.conds) + self.inner_model, self.conds, self.loaded_models = sampler_helpers.prepare_sampling(self.model_patcher, noise.shape, self.conds, self.model_options) device = self.model_patcher.load_device if denoise_mask is not None: @@ -898,6 +987,7 @@ class CFGGuider: noise = noise.to(device) latent_image = latent_image.to(device) sigmas = sigmas.to(device) + cast_to_load_options(self.model_options, device=device, dtype=self.model_patcher.model_dtype()) try: self.model_patcher.pre_run() @@ -927,6 +1017,7 @@ class CFGGuider: if get_total_hook_groups_in_conds(self.conds) <= 1: self.model_patcher.hook_mode = EnumHookMode.MinVram sampler_helpers.prepare_model_patcher(self.model_patcher, self.conds, self.model_options) + filter_registered_hooks_on_conds(self.conds, self.model_options) executor = patcher_extension.WrapperExecutor.new_class_executor( self.outer_sample, self, @@ -934,6 +1025,7 @@ class CFGGuider: ) output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) finally: + cast_to_load_options(self.model_options, device=self.model_patcher.offload_device) self.model_options = orig_model_options self.model_patcher.hook_mode = orig_hook_mode self.model_patcher.restore_hook_patches() @@ -949,30 +1041,36 @@ def sample(model, noise, positive, negative, cfg, device, sampler, sigmas, model return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) -def calculate_sigmas(model_sampling, scheduler_name, steps): - sigmas = None +class SchedulerHandler(NamedTuple): + handler: Callable[..., torch.Tensor] + # Boolean indicates whether to call the handler like: + # scheduler_function(model_sampling, steps) or + # scheduler_function(n, sigma_min: float, sigma_max: float) + use_ms: bool = True - if scheduler_name == "karras": - sigmas = k_diffusion_sampling.get_sigmas_karras(n=steps, sigma_min=float(model_sampling.sigma_min), sigma_max=float(model_sampling.sigma_max)) - elif scheduler_name == "exponential": - sigmas = k_diffusion_sampling.get_sigmas_exponential(n=steps, sigma_min=float(model_sampling.sigma_min), sigma_max=float(model_sampling.sigma_max)) - elif scheduler_name == "normal": - sigmas = normal_scheduler(model_sampling, steps) - elif scheduler_name == "simple": - sigmas = simple_scheduler(model_sampling, steps) - elif scheduler_name == "ddim_uniform": - sigmas = ddim_scheduler(model_sampling, steps) - elif scheduler_name == "sgm_uniform": - sigmas = normal_scheduler(model_sampling, steps, sgm=True) - elif scheduler_name == "beta": - sigmas = beta_scheduler(model_sampling, steps) - elif scheduler_name == "linear_quadratic": - sigmas = linear_quadratic_schedule(model_sampling, steps) - if sigmas is None: - logging.error("error invalid scheduler {}".format(scheduler_name)) +SCHEDULER_HANDLERS = { + "normal": SchedulerHandler(normal_scheduler), + "karras": SchedulerHandler(k_diffusion_sampling.get_sigmas_karras, use_ms=False), + "exponential": SchedulerHandler(k_diffusion_sampling.get_sigmas_exponential, use_ms=False), + "sgm_uniform": SchedulerHandler(partial(normal_scheduler, sgm=True)), + "simple": SchedulerHandler(simple_scheduler), + "ddim_uniform": SchedulerHandler(ddim_scheduler), + "beta": SchedulerHandler(beta_scheduler), + "linear_quadratic": SchedulerHandler(linear_quadratic_schedule), + "kl_optimal": SchedulerHandler(kl_optimal_scheduler, use_ms=False), +} - return sigmas + +def calculate_sigmas(model_sampling: object, scheduler_name: str, steps: int) -> torch.Tensor: + handler = SCHEDULER_HANDLERS.get(scheduler_name) + if handler is None: + err = f"error invalid scheduler {scheduler_name}" + logging.error(err) + raise ValueError(err) + if handler.use_ms: + return handler.handler(model_sampling, steps) + return handler.handler(n=steps, sigma_min=float(model_sampling.sigma_min), sigma_max=float(model_sampling.sigma_max)) def sampler_object(name): diff --git a/comfy/sd.py b/comfy/sd.py index 1b13e06d5..3205c2187 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -25,6 +25,7 @@ from .hooks import EnumHookMode from .ldm.audio.autoencoder import AudioOobleckVAE from .ldm.cascade.stage_a import StageA from .ldm.cascade.stage_c_coder import StageC_coder +from .ldm.cosmos.vae import CausalContinuousVideoTokenizer from .ldm.flux.redux import ReduxImageEncoder from .ldm.genmo.vae import model as genmo_model from .ldm.lightricks.vae import causal_video_autoencoder as lightricks @@ -34,6 +35,7 @@ from .model_management import load_models_gpu from .t2i_adapter import adapter from .taesd import taesd from .text_encoders import aura_t5 +from .text_encoders import cosmos from .text_encoders import flux from .text_encoders import genmo from .text_encoders import hunyuan_video @@ -121,7 +123,7 @@ class CLIP: model_management.load_models_gpu([self.patcher], force_full_load=True) self.layer_idx = None self.use_clip_schedule = False - logger.info("CLIP model load device: {}, offload device: {}, current: {}, dtype: {}".format(load_device, offload_device, params['device'], dtype)) + logger.info("CLIP/text encoder model load device: {}, offload device: {}, current: {}, dtype: {}".format(load_device, offload_device, params['device'], dtype)) def clone(self): n = CLIP(no_init=True) @@ -388,6 +390,19 @@ class VAE: self.memory_used_decode = lambda shape, dtype: (1500 * shape[2] * shape[3] * shape[4] * (4 * 8 * 8)) * model_management.dtype_size(dtype) self.memory_used_encode = lambda shape, dtype: (900 * max(shape[2], 2) * shape[3] * shape[4]) * model_management.dtype_size(dtype) self.working_dtypes = [torch.bfloat16, torch.float16, torch.float32] + elif "decoder.unpatcher3d.wavelets" in sd: + self.upscale_ratio = (lambda a: max(0, a * 8 - 7), 8, 8) + self.upscale_index_formula = (8, 8, 8) + self.downscale_ratio = (lambda a: max(0, math.floor((a + 7) / 8)), 8, 8) + self.downscale_index_formula = (8, 8, 8) + self.latent_dim = 3 + self.latent_channels = 16 + ddconfig = {'z_channels': 16, 'latent_channels': self.latent_channels, 'z_factor': 1, 'resolution': 1024, 'in_channels': 3, 'out_channels': 3, 'channels': 128, 'channels_mult': [2, 4, 4], 'num_res_blocks': 2, 'attn_resolutions': [32], 'dropout': 0.0, 'patch_size': 4, 'num_groups': 1, 'temporal_compression': 8, 'spacial_compression': 8} + self.first_stage_model = CausalContinuousVideoTokenizer(**ddconfig) + # TODO: these values are a bit off because this is not a standard VAE + self.memory_used_decode = lambda shape, dtype: (50 * shape[2] * shape[3] * shape[4] * (8 * 8 * 8)) * model_management.dtype_size(dtype) + self.memory_used_encode = lambda shape, dtype: (50 * (round((shape[2] + 7) / 8) * 8) * shape[3] * shape[4]) * model_management.dtype_size(dtype) + self.working_dtypes = [torch.bfloat16, torch.float32] else: logger.warning("WARNING: No VAE weights detected, VAE not initalized.") self.first_stage_model = None @@ -533,7 +548,7 @@ class VAE: def encode(self, pixel_samples): pixel_samples = self.vae_encode_crop_pixels(pixel_samples) pixel_samples = pixel_samples.movedim(-1, 1) - if self.latent_dim == 3: + if self.latent_dim == 3 and pixel_samples.ndim < 5: pixel_samples = pixel_samples.movedim(1, 0).unsqueeze(0) try: memory_used = self.memory_used_encode(pixel_samples.shape, self.vae_dtype) @@ -600,7 +615,7 @@ class VAE: maximum = pixel_samples.shape[2] maximum = self.upscale_ratio[0](self.downscale_ratio[0](maximum)) - samples = self.encode_tiled_3d(pixel_samples[:,:,:maximum], **args) + samples = self.encode_tiled_3d(pixel_samples[:, :, :maximum], **args) else: raise ValueError(f"unsupported values dim {dims}") @@ -627,6 +642,7 @@ class VAE: except: return None + class StyleModel: def __init__(self, model, device="cpu"): self.model = model @@ -659,6 +675,7 @@ class CLIPType(Enum): LTXV = 8 HUNYUAN_VIDEO = 9 PIXART = 10 + COSMOS = 11 @dataclasses.dataclass @@ -686,6 +703,7 @@ class TEModel(Enum): T5_XL = 5 T5_BASE = 6 LLAMA3_8 = 7 + T5_XXL_OLD = 8 def detect_te_model(sd): @@ -701,6 +719,8 @@ def detect_te_model(sd): return TEModel.T5_XXL elif weight.shape[-1] == 2048: return TEModel.T5_XL + if 'encoder.block.23.layer.1.DenseReluDense.wi.weight' in sd: + return TEModel.T5_XXL_OLD if "encoder.block.0.layer.0.SelfAttention.k.weight" in sd: return TEModel.T5_BASE if "model.layers.0.post_attention_layernorm.weight" in sd: @@ -710,9 +730,10 @@ def detect_te_model(sd): def t5xxl_detect(clip_data): weight_name = "encoder.block.23.layer.1.DenseReluDense.wi_1.weight" + weight_name_old = "encoder.block.23.layer.1.DenseReluDense.wi.weight" for sd in clip_data: - if weight_name in sd: + if weight_name in sd or weight_name_old in sd: return sd3_clip.t5_xxl_detect(sd) return {} @@ -771,6 +792,9 @@ def load_text_encoder_state_dicts(state_dicts=[], embedding_directory=None, clip else: # CLIPType.MOCHI clip_target.clip = genmo.mochi_te(**t5xxl_detect(clip_data)) clip_target.tokenizer = genmo.MochiT5Tokenizer + elif te_model == TEModel.T5_XXL_OLD: + clip_target.clip = cosmos.te(**t5xxl_detect(clip_data)) + clip_target.tokenizer = cosmos.CosmosT5Tokenizer elif te_model == TEModel.T5_XL: clip_target.clip = aura_t5.AuraT5Model clip_target.tokenizer = aura_t5.AuraT5Tokenizer diff --git a/comfy/sd1_clip.py b/comfy/sd1_clip.py index c1de6f974..b05c03f73 100644 --- a/comfy/sd1_clip.py +++ b/comfy/sd1_clip.py @@ -463,13 +463,10 @@ def load_embed(embedding_name, embedding_directory, embedding_size, embed_key=No import safetensors.torch embed = safetensors.torch.load_file(embed_path, device="cpu") else: - if 'weights_only' in torch.load.__code__.co_varnames: - try: - embed = torch.load(embed_path, weights_only=True, map_location="cpu") - except: - embed_out = safe_load_embed_zip(embed_path) - else: - embed = torch.load(embed_path, map_location="cpu") + try: + embed = torch.load(embed_path, weights_only=True, map_location="cpu") + except: + embed_out = safe_load_embed_zip(embed_path) except Exception: logging.warning("{}\n\nerror loading embedding, skipping loading: {}".format(traceback.format_exc(), embedding_name)) return None diff --git a/comfy/supported_models.py b/comfy/supported_models.py index 70aab3506..670330850 100644 --- a/comfy/supported_models.py +++ b/comfy/supported_models.py @@ -8,6 +8,7 @@ from . import sdxl_clip from . import supported_models_base from . import utils from .text_encoders import aura_t5 +from .text_encoders import cosmos from .text_encoders import flux from .text_encoders import genmo from .text_encoders import hunyuan_video @@ -819,7 +820,7 @@ class HunyuanVideo(supported_models_base.BASE): unet_extra_config = {} latent_format = latent_formats.HunyuanVideo - memory_usage_factor = 2.0 # TODO + memory_usage_factor = 1.8 # TODO supported_inference_dtypes = [torch.bfloat16, torch.float32] @@ -858,6 +859,49 @@ class HunyuanVideo(supported_models_base.BASE): return supported_models_base.ClipTarget(hunyuan_video.HunyuanVideoTokenizer, hunyuan_video.hunyuan_video_clip(**hunyuan_detect)) -models = [Stable_Zero123, SD15_instructpix2pix, SD15, SD20, SD21UnclipL, SD21UnclipH, SDXL_instructpix2pix, SDXLRefiner, SDXL, SSD1B, KOALA_700M, KOALA_1B, Segmind_Vega, SD_X4Upscaler, Stable_Cascade_C, Stable_Cascade_B, SV3D_u, SV3D_p, SD3, StableAudio, AuraFlow, PixArtAlpha, PixArtSigma, HunyuanDiT, HunyuanDiT1, FluxInpaint, Flux, FluxSchnell, GenmoMochi, LTXV, HunyuanVideo] +class CosmosT2V(supported_models_base.BASE): + unet_config = { + "image_model": "cosmos", + "in_channels": 16, + } + + sampling_settings = { + "sigma_data": 0.5, + "sigma_max": 80.0, + "sigma_min": 0.002, + } + + unet_extra_config = {} + latent_format = latent_formats.Cosmos1CV8x8x8 + + memory_usage_factor = 1.6 # TODO + + supported_inference_dtypes = [torch.bfloat16, torch.float16, torch.float32] # TODO + + vae_key_prefix = ["vae."] + text_encoder_key_prefix = ["text_encoders."] + + def get_model(self, state_dict, prefix="", device=None): + out = model_base.CosmosVideo(self, device=device) + return out + + def clip_target(self, state_dict={}): + pref = self.text_encoder_key_prefix[0] + t5_detect = sd3_clip.t5_xxl_detect(state_dict, "{}t5xxl.transformer.".format(pref)) + return supported_models_base.ClipTarget(cosmos.CosmosT5Tokenizer, cosmos.te(**t5_detect)) + + +class CosmosI2V(CosmosT2V): + unet_config = { + "image_model": "cosmos", + "in_channels": 17, + } + + def get_model(self, state_dict, prefix="", device=None): + out = model_base.CosmosVideo(self, image_to_video=True, device=device) + return out + + +models = [Stable_Zero123, SD15_instructpix2pix, SD15, SD20, SD21UnclipL, SD21UnclipH, SDXL_instructpix2pix, SDXLRefiner, SDXL, SSD1B, KOALA_700M, KOALA_1B, Segmind_Vega, SD_X4Upscaler, Stable_Cascade_C, Stable_Cascade_B, SV3D_u, SV3D_p, SD3, StableAudio, AuraFlow, PixArtAlpha, PixArtSigma, HunyuanDiT, HunyuanDiT1, FluxInpaint, Flux, FluxSchnell, GenmoMochi, LTXV, HunyuanVideo, CosmosT2V, CosmosI2V] models += [SVD_img2vid] diff --git a/comfy/text_encoders/cosmos.py b/comfy/text_encoders/cosmos.py new file mode 100644 index 000000000..5441c8952 --- /dev/null +++ b/comfy/text_encoders/cosmos.py @@ -0,0 +1,42 @@ +from comfy import sd1_clip +import comfy.text_encoders.t5 +import os +from transformers import T5TokenizerFast + + +class T5XXLModel(sd1_clip.SDClipModel): + def __init__(self, device="cpu", layer="last", layer_idx=None, dtype=None, attention_mask=True, model_options={}): + textmodel_json_config = os.path.join(os.path.dirname(os.path.realpath(__file__)), "t5_old_config_xxl.json") + t5xxl_scaled_fp8 = model_options.get("t5xxl_scaled_fp8", None) + if t5xxl_scaled_fp8 is not None: + model_options = model_options.copy() + model_options["scaled_fp8"] = t5xxl_scaled_fp8 + + super().__init__(device=device, layer=layer, layer_idx=layer_idx, textmodel_json_config=textmodel_json_config, dtype=dtype, special_tokens={"end": 1, "pad": 0}, model_class=comfy.text_encoders.t5.T5, enable_attention_masks=attention_mask, return_attention_masks=attention_mask, zero_out_masked=attention_mask, model_options=model_options) + +class CosmosT5XXL(sd1_clip.SD1ClipModel): + def __init__(self, device="cpu", dtype=None, model_options={}): + super().__init__(device=device, dtype=dtype, name="t5xxl", clip_model=T5XXLModel, model_options=model_options) + + +class T5XXLTokenizer(sd1_clip.SDTokenizer): + def __init__(self, embedding_directory=None, tokenizer_data={}): + tokenizer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "t5_tokenizer") + super().__init__(tokenizer_path, embedding_directory=embedding_directory, pad_with_end=False, embedding_size=1024, embedding_key='t5xxl', tokenizer_class=T5TokenizerFast, has_start_token=False, pad_to_max_length=False, max_length=99999999, min_length=512) + + +class CosmosT5Tokenizer(sd1_clip.SD1Tokenizer): + def __init__(self, embedding_directory=None, tokenizer_data={}): + super().__init__(embedding_directory=embedding_directory, tokenizer_data=tokenizer_data, clip_name="t5xxl", tokenizer=T5XXLTokenizer) + + +def te(dtype_t5=None, t5xxl_scaled_fp8=None): + class CosmosTEModel_(CosmosT5XXL): + def __init__(self, device="cpu", dtype=None, model_options={}): + if t5xxl_scaled_fp8 is not None and "t5xxl_scaled_fp8" not in model_options: + model_options = model_options.copy() + model_options["t5xxl_scaled_fp8"] = t5xxl_scaled_fp8 + if dtype is None: + dtype = dtype_t5 + super().__init__(device=device, dtype=dtype, model_options=model_options) + return CosmosTEModel_ diff --git a/comfy/text_encoders/t5.py b/comfy/text_encoders/t5.py index d9ddbc05e..de940e90f 100644 --- a/comfy/text_encoders/t5.py +++ b/comfy/text_encoders/t5.py @@ -239,8 +239,9 @@ class T5(torch.nn.Module): super().__init__() self.num_layers = config_dict["num_layers"] model_dim = config_dict["d_model"] + inner_dim = config_dict["d_kv"] * config_dict["num_heads"] - self.encoder = T5Stack(self.num_layers, model_dim, model_dim, config_dict["d_ff"], config_dict["dense_act_fn"], config_dict["is_gated_act"], config_dict["num_heads"], config_dict["model_type"] != "umt5", dtype, device, operations) + self.encoder = T5Stack(self.num_layers, model_dim, inner_dim, config_dict["d_ff"], config_dict["dense_act_fn"], config_dict["is_gated_act"], config_dict["num_heads"], config_dict["model_type"] != "umt5", dtype, device, operations) self.dtype = dtype self.shared = operations.Embedding(config_dict["vocab_size"], model_dim, device=device, dtype=dtype) diff --git a/comfy/text_encoders/t5_old_config_xxl.json b/comfy/text_encoders/t5_old_config_xxl.json new file mode 100644 index 000000000..c9fdd7782 --- /dev/null +++ b/comfy/text_encoders/t5_old_config_xxl.json @@ -0,0 +1,22 @@ +{ + "d_ff": 65536, + "d_kv": 128, + "d_model": 1024, + "decoder_start_token_id": 0, + "dropout_rate": 0.1, + "eos_token_id": 1, + "dense_act_fn": "relu", + "initializer_factor": 1.0, + "is_encoder_decoder": true, + "is_gated_act": false, + "layer_norm_epsilon": 1e-06, + "model_type": "t5", + "num_decoder_layers": 24, + "num_heads": 128, + "num_layers": 24, + "output_past": true, + "pad_token_id": 0, + "relative_attention_num_buckets": 32, + "tie_word_embeddings": false, + "vocab_size": 32128 +} diff --git a/comfy/utils.py b/comfy/utils.py index bf00efda1..912face36 100644 --- a/comfy/utils.py +++ b/comfy/utils.py @@ -29,7 +29,6 @@ import sys import warnings from contextlib import contextmanager from pathlib import Path -from pickle import UnpicklingError from typing import Optional, Any import numpy as np @@ -40,7 +39,7 @@ from einops import rearrange from torch.nn.functional import interpolate from tqdm import tqdm -from . import checkpoint_pickle, interruption +from . import interruption, checkpoint_pickle from .component_model import files from .component_model.deprecation import _deprecate_method from .component_model.executor_types import ExecutorToClientProgress, ProgressMessage @@ -49,6 +48,23 @@ from .execution_context import current_execution_context logger = logging.getLogger(__name__) +ALWAYS_SAFE_LOAD = False +if hasattr(torch.serialization, "add_safe_globals"): # TODO: this was added in pytorch 2.4, the unsafe path should be removed once earlier versions are deprecated + class ModelCheckpoint: + pass + + + ModelCheckpoint.__module__ = "pytorch_lightning.callbacks.model_checkpoint" + + from numpy.core.multiarray import scalar + from numpy import dtype + from numpy.dtypes import Float64DType + from _codecs import encode + + torch.serialization.add_safe_globals([ModelCheckpoint, scalar, dtype, Float64DType, encode]) + ALWAYS_SAFE_LOAD = True + logging.info("Checkpoint files will always be loaded safely.") + # deprecate PROGRESS_BAR_ENABLED def _get_progress_bar_enabled(): @@ -86,7 +102,7 @@ def load_torch_file(ckpt: str, safe_load=False, device=None): sd.update(safetensors.torch.load_file(str(checkpoint_file), device=device.type)) else: try: - if safe_load: + if safe_load or ALWAYS_SAFE_LOAD: if not 'weights_only' in torch.load.__code__.co_varnames: logger.warning("Warning torch.load doesn't support weights_only on this pytorch version, loading unsafely.") safe_load = False @@ -778,7 +794,25 @@ def copy_to_param(obj, attr, value): prev.data.copy_(value) -def get_attr(obj, attr): +def get_attr(obj, attr: str): + """Retrieves a nested attribute from an object using dot notation. + + Args: + obj: The object to get the attribute from + attr (str): The attribute path using dot notation (e.g. "model.layer.weight") + + Returns: + The value of the requested attribute + + Example: + model = MyModel() + weight = get_attr(model, "layer1.conv.weight") + # Equivalent to: model.layer1.conv.weight + + Important: + Always prefer `comfy.model_patcher.ModelPatcher.get_model_object` when + accessing nested model objects under `ModelPatcher.model`. + """ attrs = attr.split(".") for name in attrs: obj = getattr(obj, name) @@ -982,7 +1016,7 @@ def tiled_scale_multidim(samples, function, tile=(64, 64), overlap=8, upscale_am out = torch.zeros([s.shape[0], out_channels] + mult_list_upscale(s.shape[2:]), device=output_device) out_div = torch.zeros([s.shape[0], out_channels] + mult_list_upscale(s.shape[2:]), device=output_device) - positions = [range(0, s.shape[d + 2], tile[d] - overlap[d]) if s.shape[d + 2] > tile[d] else [0] for d in range(dims)] + positions = [range(0, s.shape[d + 2] - overlap[d], tile[d] - overlap[d]) if s.shape[d + 2] > tile[d] else [0] for d in range(dims)] for it in itertools.product(*positions): s_in = s diff --git a/comfy/web/assets/BaseViewTemplate-BNGF4K22.js b/comfy/web/assets/BaseViewTemplate-BNGF4K22.js new file mode 100644 index 000000000..b03956141 --- /dev/null +++ b/comfy/web/assets/BaseViewTemplate-BNGF4K22.js @@ -0,0 +1,23 @@ +import { d as defineComponent, o as openBlock, f as createElementBlock, J as renderSlot, T as normalizeClass } from "./index-DjNHn37O.js"; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "BaseViewTemplate", + props: { + dark: { type: Boolean, default: false } + }, + setup(__props) { + const props = __props; + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", { + class: normalizeClass(["font-sans w-screen h-screen flex items-center justify-center pointer-events-auto overflow-auto", [ + props.dark ? "text-neutral-300 bg-neutral-900 dark-theme" : "text-neutral-900 bg-neutral-300" + ]]) + }, [ + renderSlot(_ctx.$slots, "default") + ], 2); + }; + } +}); +export { + _sfc_main as _ +}; +//# sourceMappingURL=BaseViewTemplate-BNGF4K22.js.map diff --git a/comfy/web/assets/DownloadGitView-DeC7MBzG.js b/comfy/web/assets/DownloadGitView-DeC7MBzG.js new file mode 100644 index 000000000..b1c237fa4 --- /dev/null +++ b/comfy/web/assets/DownloadGitView-DeC7MBzG.js @@ -0,0 +1,75 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/DownloadGitView-UPm4J-4m.js +import { a as defineComponent, o as openBlock, f as createElementBlock, z as createBaseVNode, a5 as toDisplayString, g as createVNode, y as unref, C as script, bS as useRouter } from "./index-BK27PIiK.js"; +const _hoisted_1 = { class: "font-sans w-screen h-screen mx-0 grid place-items-center justify-center items-center text-neutral-900 bg-neutral-300 pointer-events-auto" }; +const _hoisted_2 = { class: "col-start-1 h-screen row-start-1 place-content-center mx-auto overflow-y-auto" }; +const _hoisted_3 = { class: "max-w-screen-sm flex flex-col gap-8 p-8 bg-[url('/assets/images/Git-Logo-White.svg')] bg-no-repeat bg-right-top bg-origin-padding" }; +const _hoisted_4 = { class: "mt-24 text-4xl font-bold text-red-500" }; +const _hoisted_5 = { class: "space-y-4" }; +const _hoisted_6 = { class: "text-xl" }; +const _hoisted_7 = { class: "text-xl" }; +const _hoisted_8 = { class: "text-m" }; +const _hoisted_9 = { class: "flex gap-4 flex-row-reverse" }; +======== +import { d as defineComponent, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, bW as useRouter } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js"; +const _hoisted_1 = { class: "max-w-screen-sm flex flex-col gap-8 p-8 bg-[url('/assets/images/Git-Logo-White.svg')] bg-no-repeat bg-right-top bg-origin-padding" }; +const _hoisted_2 = { class: "mt-24 text-4xl font-bold text-red-500" }; +const _hoisted_3 = { class: "space-y-4" }; +const _hoisted_4 = { class: "text-xl" }; +const _hoisted_5 = { class: "text-xl" }; +const _hoisted_6 = { class: "text-m" }; +const _hoisted_7 = { class: "flex gap-4 flex-row-reverse" }; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/DownloadGitView-DeC7MBzG.js +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "DownloadGitView", + setup(__props) { + const openGitDownloads = /* @__PURE__ */ __name(() => { + window.open("https://git-scm.com/downloads/", "_blank"); + }, "openGitDownloads"); + const skipGit = /* @__PURE__ */ __name(() => { + console.warn("pushing"); + const router = useRouter(); + router.push("install"); + }, "skipGit"); + return (_ctx, _cache) => { + return openBlock(), createBlock(_sfc_main$1, null, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_1, [ + createBaseVNode("h1", _hoisted_2, toDisplayString(_ctx.$t("downloadGit.title")), 1), + createBaseVNode("div", _hoisted_3, [ + createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("downloadGit.message")), 1), + createBaseVNode("p", _hoisted_5, toDisplayString(_ctx.$t("downloadGit.instructions")), 1), + createBaseVNode("p", _hoisted_6, toDisplayString(_ctx.$t("downloadGit.warning")), 1) + ]), + createBaseVNode("div", _hoisted_7, [ + createVNode(unref(script), { + label: _ctx.$t("downloadGit.gitWebsite"), + icon: "pi pi-external-link", + "icon-pos": "right", + onClick: openGitDownloads, + severity: "primary" + }, null, 8, ["label"]), + createVNode(unref(script), { + label: _ctx.$t("downloadGit.skip"), + icon: "pi pi-exclamation-triangle", + onClick: skipGit, + severity: "secondary" + }, null, 8, ["label"]) + ]) + ]) + ]), + _: 1 + }); + }; + } +}); +export { + _sfc_main as default +}; +<<<<<<<< HEAD:comfy/web/assets/DownloadGitView-UPm4J-4m.js +//# sourceMappingURL=DownloadGitView-UPm4J-4m.js.map +======== +//# sourceMappingURL=DownloadGitView-DeC7MBzG.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/DownloadGitView-DeC7MBzG.js diff --git a/comfy/web/assets/DownloadGitView-UPm4J-4m.js b/comfy/web/assets/DownloadGitView-UPm4J-4m.js index 689ae4e4a..b1c237fa4 100644 --- a/comfy/web/assets/DownloadGitView-UPm4J-4m.js +++ b/comfy/web/assets/DownloadGitView-UPm4J-4m.js @@ -1,5 +1,6 @@ var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/DownloadGitView-UPm4J-4m.js import { a as defineComponent, o as openBlock, f as createElementBlock, z as createBaseVNode, a5 as toDisplayString, g as createVNode, y as unref, C as script, bS as useRouter } from "./index-BK27PIiK.js"; const _hoisted_1 = { class: "font-sans w-screen h-screen mx-0 grid place-items-center justify-center items-center text-neutral-900 bg-neutral-300 pointer-events-auto" }; const _hoisted_2 = { class: "col-start-1 h-screen row-start-1 place-content-center mx-auto overflow-y-auto" }; @@ -10,6 +11,17 @@ const _hoisted_6 = { class: "text-xl" }; const _hoisted_7 = { class: "text-xl" }; const _hoisted_8 = { class: "text-m" }; const _hoisted_9 = { class: "flex gap-4 flex-row-reverse" }; +======== +import { d as defineComponent, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, bW as useRouter } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js"; +const _hoisted_1 = { class: "max-w-screen-sm flex flex-col gap-8 p-8 bg-[url('/assets/images/Git-Logo-White.svg')] bg-no-repeat bg-right-top bg-origin-padding" }; +const _hoisted_2 = { class: "mt-24 text-4xl font-bold text-red-500" }; +const _hoisted_3 = { class: "space-y-4" }; +const _hoisted_4 = { class: "text-xl" }; +const _hoisted_5 = { class: "text-xl" }; +const _hoisted_6 = { class: "text-m" }; +const _hoisted_7 = { class: "flex gap-4 flex-row-reverse" }; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/DownloadGitView-DeC7MBzG.js const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "DownloadGitView", setup(__props) { @@ -22,16 +34,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ router.push("install"); }, "skipGit"); return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1, [ - createBaseVNode("div", _hoisted_2, [ - createBaseVNode("div", _hoisted_3, [ - createBaseVNode("h1", _hoisted_4, toDisplayString(_ctx.$t("downloadGit.title")), 1), - createBaseVNode("div", _hoisted_5, [ - createBaseVNode("p", _hoisted_6, toDisplayString(_ctx.$t("downloadGit.message")), 1), - createBaseVNode("p", _hoisted_7, toDisplayString(_ctx.$t("downloadGit.instructions")), 1), - createBaseVNode("p", _hoisted_8, toDisplayString(_ctx.$t("downloadGit.warning")), 1) + return openBlock(), createBlock(_sfc_main$1, null, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_1, [ + createBaseVNode("h1", _hoisted_2, toDisplayString(_ctx.$t("downloadGit.title")), 1), + createBaseVNode("div", _hoisted_3, [ + createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("downloadGit.message")), 1), + createBaseVNode("p", _hoisted_5, toDisplayString(_ctx.$t("downloadGit.instructions")), 1), + createBaseVNode("p", _hoisted_6, toDisplayString(_ctx.$t("downloadGit.warning")), 1) ]), - createBaseVNode("div", _hoisted_9, [ + createBaseVNode("div", _hoisted_7, [ createVNode(unref(script), { label: _ctx.$t("downloadGit.gitWebsite"), icon: "pi pi-external-link", @@ -47,12 +59,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ }, null, 8, ["label"]) ]) ]) - ]) - ]); + ]), + _: 1 + }); }; } }); export { _sfc_main as default }; +<<<<<<<< HEAD:comfy/web/assets/DownloadGitView-UPm4J-4m.js //# sourceMappingURL=DownloadGitView-UPm4J-4m.js.map +======== +//# sourceMappingURL=DownloadGitView-DeC7MBzG.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/DownloadGitView-DeC7MBzG.js diff --git a/comfy/web/assets/ExtensionPanel-B4Se9sV5.js b/comfy/web/assets/ExtensionPanel-B4Se9sV5.js index 1bff35f22..ce9975837 100644 --- a/comfy/web/assets/ExtensionPanel-B4Se9sV5.js +++ b/comfy/web/assets/ExtensionPanel-B4Se9sV5.js @@ -1,8 +1,15 @@ var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/ExtensionPanel-B4Se9sV5.js import { a as defineComponent, r as ref, cj as FilterMatchMode, cn as useExtensionStore, u as useSettingStore, aE as onMounted, p as computed, o as openBlock, v as createBlock, x as withCtx, g as createVNode, ck as SearchBox, y as unref, bV as script, z as createBaseVNode, f as createElementBlock, P as renderList, a5 as toDisplayString, aw as createTextVNode, O as Fragment, C as script$1, h as createCommentVNode, aA as script$3, br as script$4, c4 as script$5, cl as _sfc_main$1 } from "./index-BK27PIiK.js"; import { s as script$2, a as script$6 } from "./index-BwNYbo7J.js"; import "./index-4Y1pXkN0.js"; +======== +import { d as defineComponent, ab as ref, cn as FilterMatchMode, cs as useExtensionStore, a as useSettingStore, m as onMounted, c as computed, o as openBlock, k as createBlock, M as withCtx, N as createVNode, co as SearchBox, j as unref, bZ as script, H as createBaseVNode, f as createElementBlock, E as renderList, X as toDisplayString, aE as createTextVNode, F as Fragment, l as script$1, I as createCommentVNode, aI as script$3, bO as script$4, c4 as script$5, cp as _sfc_main$1 } from "./index-DjNHn37O.js"; +import { s as script$2, a as script$6 } from "./index-B5F0uxTQ.js"; +import "./index-B-aVupP5.js"; +import "./index-5HFeZax4.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ExtensionPanel-D4Phn0Zr.js const _hoisted_1 = { class: "flex justify-end" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "ExtensionPanel", @@ -179,4 +186,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ export { _sfc_main as default }; +<<<<<<<< HEAD:comfy/web/assets/ExtensionPanel-B4Se9sV5.js //# sourceMappingURL=ExtensionPanel-B4Se9sV5.js.map +======== +//# sourceMappingURL=ExtensionPanel-D4Phn0Zr.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ExtensionPanel-D4Phn0Zr.js diff --git a/comfy/web/assets/ExtensionPanel-D4Phn0Zr.js b/comfy/web/assets/ExtensionPanel-D4Phn0Zr.js new file mode 100644 index 000000000..ce9975837 --- /dev/null +++ b/comfy/web/assets/ExtensionPanel-D4Phn0Zr.js @@ -0,0 +1,193 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/ExtensionPanel-B4Se9sV5.js +import { a as defineComponent, r as ref, cj as FilterMatchMode, cn as useExtensionStore, u as useSettingStore, aE as onMounted, p as computed, o as openBlock, v as createBlock, x as withCtx, g as createVNode, ck as SearchBox, y as unref, bV as script, z as createBaseVNode, f as createElementBlock, P as renderList, a5 as toDisplayString, aw as createTextVNode, O as Fragment, C as script$1, h as createCommentVNode, aA as script$3, br as script$4, c4 as script$5, cl as _sfc_main$1 } from "./index-BK27PIiK.js"; +import { s as script$2, a as script$6 } from "./index-BwNYbo7J.js"; +import "./index-4Y1pXkN0.js"; +======== +import { d as defineComponent, ab as ref, cn as FilterMatchMode, cs as useExtensionStore, a as useSettingStore, m as onMounted, c as computed, o as openBlock, k as createBlock, M as withCtx, N as createVNode, co as SearchBox, j as unref, bZ as script, H as createBaseVNode, f as createElementBlock, E as renderList, X as toDisplayString, aE as createTextVNode, F as Fragment, l as script$1, I as createCommentVNode, aI as script$3, bO as script$4, c4 as script$5, cp as _sfc_main$1 } from "./index-DjNHn37O.js"; +import { s as script$2, a as script$6 } from "./index-B5F0uxTQ.js"; +import "./index-B-aVupP5.js"; +import "./index-5HFeZax4.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ExtensionPanel-D4Phn0Zr.js +const _hoisted_1 = { class: "flex justify-end" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "ExtensionPanel", + setup(__props) { + const filters = ref({ + global: { value: "", matchMode: FilterMatchMode.CONTAINS } + }); + const extensionStore = useExtensionStore(); + const settingStore = useSettingStore(); + const editingEnabledExtensions = ref({}); + onMounted(() => { + extensionStore.extensions.forEach((ext) => { + editingEnabledExtensions.value[ext.name] = extensionStore.isExtensionEnabled(ext.name); + }); + }); + const changedExtensions = computed(() => { + return extensionStore.extensions.filter( + (ext) => editingEnabledExtensions.value[ext.name] !== extensionStore.isExtensionEnabled(ext.name) + ); + }); + const hasChanges = computed(() => { + return changedExtensions.value.length > 0; + }); + const updateExtensionStatus = /* @__PURE__ */ __name(() => { + const editingDisabledExtensionNames = Object.entries( + editingEnabledExtensions.value + ).filter(([_, enabled]) => !enabled).map(([name]) => name); + settingStore.set("Comfy.Extension.Disabled", [ + ...extensionStore.inactiveDisabledExtensionNames, + ...editingDisabledExtensionNames + ]); + }, "updateExtensionStatus"); + const enableAllExtensions = /* @__PURE__ */ __name(() => { + extensionStore.extensions.forEach((ext) => { + if (extensionStore.isExtensionReadOnly(ext.name)) return; + editingEnabledExtensions.value[ext.name] = true; + }); + updateExtensionStatus(); + }, "enableAllExtensions"); + const disableAllExtensions = /* @__PURE__ */ __name(() => { + extensionStore.extensions.forEach((ext) => { + if (extensionStore.isExtensionReadOnly(ext.name)) return; + editingEnabledExtensions.value[ext.name] = false; + }); + updateExtensionStatus(); + }, "disableAllExtensions"); + const disableThirdPartyExtensions = /* @__PURE__ */ __name(() => { + extensionStore.extensions.forEach((ext) => { + if (extensionStore.isCoreExtension(ext.name)) return; + editingEnabledExtensions.value[ext.name] = false; + }); + updateExtensionStatus(); + }, "disableThirdPartyExtensions"); + const applyChanges = /* @__PURE__ */ __name(() => { + window.location.reload(); + }, "applyChanges"); + const menu = ref(); + const contextMenuItems = [ + { + label: "Enable All", + icon: "pi pi-check", + command: enableAllExtensions + }, + { + label: "Disable All", + icon: "pi pi-times", + command: disableAllExtensions + }, + { + label: "Disable 3rd Party", + icon: "pi pi-times", + command: disableThirdPartyExtensions, + disabled: !extensionStore.hasThirdPartyExtensions + } + ]; + return (_ctx, _cache) => { + return openBlock(), createBlock(_sfc_main$1, { + value: "Extension", + class: "extension-panel" + }, { + header: withCtx(() => [ + createVNode(SearchBox, { + modelValue: filters.value["global"].value, + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filters.value["global"].value = $event), + placeholder: _ctx.$t("g.searchExtensions") + "..." + }, null, 8, ["modelValue", "placeholder"]), + hasChanges.value ? (openBlock(), createBlock(unref(script), { + key: 0, + severity: "info", + "pt:text": "w-full", + class: "max-h-96 overflow-y-auto" + }, { + default: withCtx(() => [ + createBaseVNode("ul", null, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(changedExtensions.value, (ext) => { + return openBlock(), createElementBlock("li", { + key: ext.name + }, [ + createBaseVNode("span", null, toDisplayString(unref(extensionStore).isExtensionEnabled(ext.name) ? "[-]" : "[+]"), 1), + createTextVNode(" " + toDisplayString(ext.name), 1) + ]); + }), 128)) + ]), + createBaseVNode("div", _hoisted_1, [ + createVNode(unref(script$1), { + label: _ctx.$t("g.reloadToApplyChanges"), + onClick: applyChanges, + outlined: "", + severity: "danger" + }, null, 8, ["label"]) + ]) + ]), + _: 1 + })) : createCommentVNode("", true) + ]), + default: withCtx(() => [ + createVNode(unref(script$6), { + value: unref(extensionStore).extensions, + stripedRows: "", + size: "small", + filters: filters.value + }, { + default: withCtx(() => [ + createVNode(unref(script$2), { + header: _ctx.$t("g.extensionName"), + sortable: "", + field: "name" + }, { + body: withCtx((slotProps) => [ + createTextVNode(toDisplayString(slotProps.data.name) + " ", 1), + unref(extensionStore).isCoreExtension(slotProps.data.name) ? (openBlock(), createBlock(unref(script$3), { + key: 0, + value: "Core" + })) : createCommentVNode("", true) + ]), + _: 1 + }, 8, ["header"]), + createVNode(unref(script$2), { pt: { + headerCell: "flex items-center justify-end", + bodyCell: "flex items-center justify-end" + } }, { + header: withCtx(() => [ + createVNode(unref(script$1), { + icon: "pi pi-ellipsis-h", + text: "", + severity: "secondary", + onClick: _cache[1] || (_cache[1] = ($event) => menu.value.show($event)) + }), + createVNode(unref(script$4), { + ref_key: "menu", + ref: menu, + model: contextMenuItems + }, null, 512) + ]), + body: withCtx((slotProps) => [ + createVNode(unref(script$5), { + disabled: unref(extensionStore).isExtensionReadOnly(slotProps.data.name), + modelValue: editingEnabledExtensions.value[slotProps.data.name], + "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => editingEnabledExtensions.value[slotProps.data.name] = $event, "onUpdate:modelValue"), + onChange: updateExtensionStatus + }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["value", "filters"]) + ]), + _: 1 + }); + }; + } +}); +export { + _sfc_main as default +}; +<<<<<<<< HEAD:comfy/web/assets/ExtensionPanel-B4Se9sV5.js +//# sourceMappingURL=ExtensionPanel-B4Se9sV5.js.map +======== +//# sourceMappingURL=ExtensionPanel-D4Phn0Zr.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ExtensionPanel-D4Phn0Zr.js diff --git a/comfy/web/assets/GraphView-CIRWBKTm.css b/comfy/web/assets/GraphView-CIRWBKTm.css new file mode 100644 index 000000000..f0fc54fe0 --- /dev/null +++ b/comfy/web/assets/GraphView-CIRWBKTm.css @@ -0,0 +1,440 @@ + +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css +.group-title-editor.node-title-editor[data-v-fe2de13a] { + z-index: 9999; + padding: 0.25rem; +} +[data-v-fe2de13a] .editable-text { + width: 100%; + height: 100%; +} +[data-v-fe2de13a] .editable-text input { + width: 100%; + height: 100%; + /* Override the default font size */ + font-size: inherit; +} + +.side-bar-button-icon { + font-size: var(--sidebar-icon-size) !important; +} +.side-bar-button-selected .side-bar-button-icon { + font-size: var(--sidebar-icon-size) !important; + font-weight: bold; +} + +.side-bar-button[data-v-caa3ee9c] { + width: var(--sidebar-width); + height: var(--sidebar-width); + border-radius: 0; +} +.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-caa3ee9c], +.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-caa3ee9c]:hover { + border-left: 4px solid var(--p-button-text-primary-color); +} +.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-caa3ee9c], +.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-caa3ee9c]:hover { + border-right: 4px solid var(--p-button-text-primary-color); +} + +:root { + --sidebar-width: 64px; + --sidebar-icon-size: 1.5rem; +} +:root .small-sidebar { + --sidebar-width: 40px; + --sidebar-icon-size: 1rem; +} + +.side-tool-bar-container[data-v-7851c166] { + display: flex; + flex-direction: column; + align-items: center; + + pointer-events: auto; + + width: var(--sidebar-width); + height: 100%; + + background-color: var(--comfy-menu-secondary-bg); + color: var(--fg-color); + box-shadow: var(--bar-shadow); +} +.side-tool-bar-end[data-v-7851c166] { + align-self: flex-end; + margin-top: auto; +} + +[data-v-95268c0b] .p-splitter-gutter { + pointer-events: auto; +} +[data-v-95268c0b] .p-splitter-gutter:hover,[data-v-95268c0b] .p-splitter-gutter[data-p-gutter-resizing='true'] { + transition: background-color 0.2s ease 300ms; + background-color: var(--p-primary-color); +} +.side-bar-panel[data-v-95268c0b] { + background-color: var(--bg-color); + pointer-events: auto; +} +.bottom-panel[data-v-95268c0b] { + background-color: var(--bg-color); + pointer-events: auto; +} +.splitter-overlay[data-v-95268c0b] { +======== +.comfy-menu-hamburger[data-v-5661bed0] { + pointer-events: auto; + position: fixed; + z-index: 9999; +} + +[data-v-e50caa15] .p-splitter-gutter { + pointer-events: auto; +} +[data-v-e50caa15] .p-splitter-gutter:hover,[data-v-e50caa15] .p-splitter-gutter[data-p-gutter-resizing='true'] { + transition: background-color 0.2s ease 300ms; + background-color: var(--p-primary-color); +} +.side-bar-panel[data-v-e50caa15] { + background-color: var(--bg-color); + pointer-events: auto; +} +.bottom-panel[data-v-e50caa15] { + background-color: var(--bg-color); + pointer-events: auto; +} +.splitter-overlay[data-v-e50caa15] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css + pointer-events: none; + border-style: none; + background-color: transparent; +} +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css +.splitter-overlay-root[data-v-95268c0b] { +======== +.splitter-overlay-root[data-v-e50caa15] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css + position: absolute; + top: 0px; + left: 0px; + height: 100%; + width: 100%; + + /* Set it the same as the ComfyUI menu */ + /* Note: Lite-graph DOM widgets have the same z-index as the node id, so + 999 should be sufficient to make sure splitter overlays on node's DOM + widgets */ + z-index: 999; +} + +.p-buttongroup-vertical[data-v-cf40dd39] { + display: flex; + flex-direction: column; + border-radius: var(--p-button-border-radius); + overflow: hidden; + border: 1px solid var(--p-panel-border-color); +} +.p-buttongroup-vertical .p-button[data-v-cf40dd39] { + margin: 0; + border-radius: 0; +} + +.node-tooltip[data-v-46859edf] { + background: var(--comfy-input-bg); + border-radius: 5px; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); + color: var(--input-text); + font-family: sans-serif; + left: 0; + max-width: 30vw; + padding: 4px 8px; + position: absolute; + top: 0; + transform: translate(5px, calc(-100% - 5px)); + white-space: pre-wrap; + z-index: 99999; +} + +.group-title-editor.node-title-editor[data-v-12d3fd12] { + z-index: 9999; + padding: 0.25rem; +} +[data-v-12d3fd12] .editable-text { + width: 100%; + height: 100%; +} +[data-v-12d3fd12] .editable-text input { + width: 100%; + height: 100%; + /* Override the default font size */ + font-size: inherit; +} + +[data-v-5741c9ae] .highlight { + background-color: var(--p-primary-color); + color: var(--p-primary-contrast-color); + font-weight: bold; + border-radius: 0.25rem; + padding: 0rem 0.125rem; + margin: -0.125rem 0.125rem; +} + +.invisible-dialog-root { + width: 60%; + min-width: 24rem; + max-width: 48rem; + border: 0 !important; + background-color: transparent !important; + margin-top: 25vh; + margin-left: 400px; +} +@media all and (max-width: 768px) { +.invisible-dialog-root { + margin-left: 0px; +} +} +.node-search-box-dialog-mask { + align-items: flex-start !important; +} + +.side-bar-button-icon { + font-size: var(--sidebar-icon-size) !important; +} +.side-bar-button-selected .side-bar-button-icon { + font-size: var(--sidebar-icon-size) !important; + font-weight: bold; +} + +.side-bar-button[data-v-6ab4daa6] { + width: var(--sidebar-width); + height: var(--sidebar-width); + border-radius: 0; +} +.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6], +.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover { + border-left: 4px solid var(--p-button-text-primary-color); +} +.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6], +.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover { + border-right: 4px solid var(--p-button-text-primary-color); +} + +:root { + --sidebar-width: 64px; + --sidebar-icon-size: 1.5rem; +} +:root .small-sidebar { + --sidebar-width: 40px; + --sidebar-icon-size: 1rem; +} + +.side-tool-bar-container[data-v-37d8d7b4] { + display: flex; + flex-direction: column; + align-items: center; + + pointer-events: auto; + + width: var(--sidebar-width); + height: 100%; + + background-color: var(--comfy-menu-secondary-bg); + color: var(--fg-color); + box-shadow: var(--bar-shadow); +} +.side-tool-bar-end[data-v-37d8d7b4] { + align-self: flex-end; + margin-top: auto; +} + +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css +.status-indicator[data-v-7381014c] { +======== +[data-v-b9328350] .p-inputtext { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.comfyui-queue-button[data-v-7f4f551b] .p-splitbutton-dropdown { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.actionbar[data-v-915e5456] { + pointer-events: all; + position: fixed; + z-index: 1000; +} +.actionbar.is-docked[data-v-915e5456] { + position: static; + border-style: none; + background-color: transparent; + padding: 0px; +} +.actionbar.is-dragging[data-v-915e5456] { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +[data-v-915e5456] .p-panel-content { + padding: 0.25rem; +} +.is-docked[data-v-915e5456] .p-panel-content { + padding: 0px; +} +[data-v-915e5456] .p-panel-header { + display: none; +} + +.top-menubar[data-v-6fecd137] .p-menubar-item-link svg { + display: none; +} +[data-v-6fecd137] .p-menubar-submenu.dropdown-direction-up { + top: auto; + bottom: 100%; + flex-direction: column-reverse; +} +.keybinding-tag[data-v-6fecd137] { + background: var(--p-content-hover-background); + border-color: var(--p-content-border-color); + border-style: solid; +} + +.status-indicator[data-v-8d011a31] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css + position: absolute; + font-weight: 700; + font-size: 1.5rem; + top: 50%; + left: 50%; + transform: translate(-50%, -50%) +} + +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css +[data-v-b447982f] .p-togglebutton::before { + display: none +} +[data-v-b447982f] .p-togglebutton { +======== +[data-v-d485c044] .p-togglebutton::before { + display: none +} +[data-v-d485c044] .p-togglebutton { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css + position: relative; + flex-shrink: 0; + border-radius: 0px; + background-color: transparent; + padding: 0px +} +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css +[data-v-b447982f] .p-togglebutton.p-togglebutton-checked { + border-bottom-width: 2px; + border-bottom-color: var(--p-button-text-primary-color) +} +[data-v-b447982f] .p-togglebutton-checked .close-button,[data-v-b447982f] .p-togglebutton:hover .close-button { + visibility: visible +} +[data-v-b447982f] .p-togglebutton:hover .status-indicator { + display: none +} +[data-v-b447982f] .p-togglebutton .close-button { + visibility: hidden +} + +.top-menubar[data-v-a2b12676] .p-menubar-item-link svg { + display: none; +} +[data-v-a2b12676] .p-menubar-submenu.dropdown-direction-up { + top: auto; + bottom: 100%; + flex-direction: column-reverse; +} +.keybinding-tag[data-v-a2b12676] { + background: var(--p-content-hover-background); + border-color: var(--p-content-border-color); + border-style: solid; +} + +[data-v-1163a5d2] .p-inputtext { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.comfyui-queue-button[data-v-d3897845] .p-splitbutton-dropdown { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.actionbar[data-v-6a1bcb8c] { + pointer-events: all; + position: fixed; + z-index: 1000; +} +.actionbar.is-docked[data-v-6a1bcb8c] { + position: static; + border-style: none; + background-color: transparent; + padding: 0px; +} +.actionbar.is-dragging[data-v-6a1bcb8c] { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +[data-v-6a1bcb8c] .p-panel-content { + padding: 0.25rem; +} +.is-docked[data-v-6a1bcb8c] .p-panel-content { + padding: 0px; +} +[data-v-6a1bcb8c] .p-panel-header { + display: none; +} + +.comfyui-menu[data-v-d792da31] { +======== +[data-v-d485c044] .p-togglebutton.p-togglebutton-checked { + border-bottom-width: 2px; + border-bottom-color: var(--p-button-text-primary-color) +} +[data-v-d485c044] .p-togglebutton-checked .close-button,[data-v-d485c044] .p-togglebutton:hover .close-button { + visibility: visible +} +[data-v-d485c044] .p-togglebutton:hover .status-indicator { + display: none +} +[data-v-d485c044] .p-togglebutton .close-button { + visibility: hidden +} + +.comfyui-menu[data-v-878b63b8] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css + width: 100vw; + background: var(--comfy-menu-bg); + color: var(--fg-color); + box-shadow: var(--bar-shadow); + font-family: Arial, Helvetica, sans-serif; + font-size: 0.8em; + box-sizing: border-box; + z-index: 1000; + order: 0; + grid-column: 1/-1; + max-height: 90vh; +} +.comfyui-menu.dropzone[data-v-878b63b8] { + background: var(--p-highlight-background); +} +.comfyui-menu.dropzone-active[data-v-878b63b8] { + background: var(--p-highlight-background-focus); +} +[data-v-878b63b8] .p-menubar-item-label { + line-height: revert; +} +.comfyui-logo[data-v-878b63b8] { + font-size: 1.2em; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: default; +} diff --git a/comfy/web/assets/GraphView-CtNN12CD.js b/comfy/web/assets/GraphView-CtNN12CD.js index 31e674fb5..7da27b8eb 100644 --- a/comfy/web/assets/GraphView-CtNN12CD.js +++ b/comfy/web/assets/GraphView-CtNN12CD.js @@ -1,5 +1,6 @@ var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js import { d as defineStore, s as shallowRef, a as defineComponent, u as useSettingStore, r as ref, w as watch, L as LGraphGroup, b as app, c as LGraphNode, e as useEventListener, o as openBlock, f as createElementBlock, g as createVNode, E as EditableText, n as normalizeStyle, h as createCommentVNode, i as LiteGraph, _ as _export_sfc, B as BaseStyle, j as script$g, k as resolveComponent, m as mergeProps, l as renderSlot, p as computed, q as resolveDirective, t as withDirectives, v as createBlock, x as withCtx, y as unref, z as createBaseVNode, A as normalizeClass, C as script$h, D as useCommandStore, F as useDialogStore, S as SettingDialogHeader, G as SettingDialogContent, H as useI18n, I as useUserStore, J as onBeforeUnmount, K as resolveDynamicComponent, M as useWorkspaceStore, N as useKeybindingStore, O as Fragment, P as renderList, T as Teleport, Q as script$i, R as getWidth, U as findSingle, V as getOuterHeight, W as getOffset, X as getOuterWidth, Y as getHeight, Z as script$j, $ as script$k, a0 as Ripple, a1 as getAttribute, a2 as focus, a3 as equals, a4 as useBottomPanelStore, a5 as toDisplayString, a6 as script$l, a7 as getVNodeProp, a8 as isArray, a9 as useSidebarTabStore, aa as vShow, ab as isNotEmpty, ac as script$m, ad as UniqueComponentId, ae as ZIndex, af as resolveFieldData, ag as OverlayEventBus, ah as isEmpty, ai as addStyle, aj as relativePosition, ak as absolutePosition, al as ConnectedOverlayScrollHandler, am as isTouchDevice, an as findLastIndex, ao as script$n, ap as script$o, aq as script$p, ar as script$q, as as script$r, at as script$s, au as Transition, av as createSlots, aw as createTextVNode, ax as useNodeFrequencyStore, ay as useNodeBookmarkStore, az as highlightQuery, aA as script$t, aB as formatNumberWithSuffix, aC as NodeSourceType, aD as useNodeDefStore, aE as onMounted, aF as NodePreview, aG as NodeSearchFilter, aH as script$u, aI as SearchFilterChip, aJ as nextTick, aK as storeToRefs, aL as watchEffect, aM as isRef, aN as toRaw, aO as LinkReleaseTriggerAction, aP as st, aQ as normalizeI18nKey, aR as getColorPalette, aS as BadgePosition, aT as LGraphBadge, aU as _, aV as defaultColorPalette, aW as NodeBadgeMode, aX as markRaw, aY as useModelToNodeStore, aZ as CanvasPointer, a_ as useWorkflowStore, a$ as setStorageValue, b0 as api, b1 as usePragmaticDroppable, b2 as ComfyNodeDefImpl, b3 as ComfyModelDef, b4 as LGraph, b5 as LLink, b6 as DragAndScale, b7 as LGraphCanvas, b8 as ContextMenu, b9 as ChangeTracker, ba as workflowService, bb as showNativeMenu, bc as script$v, bd as script$w, be as script$x, bf as script$y, bg as normalizeProps, bh as ToastEventBus, bi as setAttribute, bj as TransitionGroup, bk as useToast, bl as useToastStore, bm as useExecutionStore, bn as useTitle, bo as usePragmaticDraggable, bp as withModifiers, bq as script$z, br as script$A, bs as resolve, bt as script$B, bu as script$C, bv as isPrintableCharacter, bw as guardReactiveProps, bx as useMenuItemStore, by as script$F, bz as nestedPosition, bA as useQueueSettingsStore, bB as script$G, bC as useQueuePendingTaskCountStore, bD as useLocalStorage, bE as useDraggable, bF as watchDebounced, bG as inject, bH as useElementBounding, bI as lodashExports, bJ as useEventBus, bK as provide, bL as script$H, bM as LGraphEventMode, bN as useQueueStore, bO as showTemplateWorkflowsDialog, bP as showSettingsDialog, bQ as i18n, bR as useModelStore } from "./index-BK27PIiK.js"; import { s as script$D, a as script$E } from "./index-4Y1pXkN0.js"; import { u as useServerConfigStore } from "./serverConfigStore-7qHooIp9.js"; @@ -17,8 +18,54 @@ const useCanvasStore = defineStore("canvas", () => { }); const _sfc_main$t = /* @__PURE__ */ defineComponent({ __name: "TitleEditor", +======== +import { d as defineComponent, u as useExecutionStore, c as computed, a as useSettingStore, b as useWorkflowStore, e as useTitle, o as openBlock, f as createElementBlock, g as useWorkspaceStore, w as watchEffect, h as app, r as resolveDirective, i as withDirectives, v as vShow, j as unref, k as createBlock, n as normalizeStyle, s as showNativeMenu, l as script$d, _ as _export_sfc, m as onMounted, p as onBeforeUnmount, B as BaseStyle, q as script$e, t as getWidth, x as getHeight, y as getOuterWidth, z as getOuterHeight, A as getVNodeProp, C as isArray, D as mergeProps, F as Fragment, E as renderList, G as resolveDynamicComponent, H as createBaseVNode, I as createCommentVNode, J as renderSlot, K as useSidebarTabStore, L as useBottomPanelStore, M as withCtx, N as createVNode, O as getAttribute, P as findSingle, Q as focus, R as equals, S as Ripple, T as normalizeClass, U as getOffset, V as script$f, W as script$g, X as toDisplayString, Y as script$h, Z as markRaw, $ as defineStore, a0 as shallowRef, a1 as useI18n, a2 as useCommandStore, a3 as LiteGraph, a4 as useColorPaletteStore, a5 as watch, a6 as useNodeDefStore, a7 as BadgePosition, a8 as LGraphBadge, a9 as _, aa as NodeBadgeMode, ab as ref, ac as useEventListener, ad as nextTick, ae as st, af as normalizeI18nKey, ag as LGraphGroup, ah as LGraphNode, ai as EditableText, aj as isNotEmpty, ak as UniqueComponentId, al as ZIndex, am as resolveFieldData, an as OverlayEventBus, ao as isEmpty, ap as addStyle, aq as relativePosition, ar as absolutePosition, as as ConnectedOverlayScrollHandler, at as isTouchDevice, au as findLastIndex, av as script$i, aw as script$j, ax as script$k, ay as script$l, az as script$m, aA as script$n, aB as resolveComponent, aC as Transition, aD as createSlots, aE as createTextVNode, aF as useNodeFrequencyStore, aG as useNodeBookmarkStore, aH as highlightQuery, aI as script$o, aJ as formatNumberWithSuffix, aK as NodeSourceType, aL as pushScopeId, aM as popScopeId, aN as NodePreview, aO as NodeSearchFilter, aP as script$p, aQ as SearchFilterChip, aR as useLitegraphService, aS as storeToRefs, aT as isRef, aU as toRaw, aV as LinkReleaseTriggerAction, aW as script$q, aX as useUserStore, aY as useDialogStore, aZ as SettingDialogHeader, a_ as SettingDialogContent, a$ as useKeybindingStore, b0 as Teleport, b1 as LinkMarkerShape, b2 as useModelToNodeStore, b3 as CanvasPointer, b4 as IS_CONTROL_WIDGET, b5 as updateControlWidgetLabel, b6 as useColorPaletteService, b7 as setStorageValue, b8 as api, b9 as usePragmaticDroppable, ba as LGraph, bb as LLink, bc as DragAndScale, bd as LGraphCanvas, be as ContextMenu, bf as ChangeTracker, bg as useWorkflowService, bh as ComfyNodeDefImpl, bi as ComfyModelDef, bj as script$r, bk as script$s, bl as script$t, bm as script$u, bn as script$v, bo as normalizeProps, bp as ToastEventBus, bq as setAttribute, br as TransitionGroup, bs as useToast, bt as useToastStore, bu as resolve, bv as nestedPosition, bw as script$w, bx as isPrintableCharacter, by as useQueueSettingsStore, bz as script$x, bA as useQueuePendingTaskCountStore, bB as useLocalStorage, bC as useDraggable, bD as watchDebounced, bE as inject, bF as useElementBounding, bG as lodashExports, bH as useEventBus, bI as script$z, bJ as guardReactiveProps, bK as useMenuItemStore, bL as usePragmaticDraggable, bM as withModifiers, bN as script$B, bO as script$C, bP as provide, bQ as script$D, bR as useDialogService, bS as LGraphEventMode, bT as useQueueStore, bU as i18n, bV as useModelStore } from "./index-DjNHn37O.js"; +import { s as script$y } from "./index-jXPKy3pP.js"; +import { s as script$A } from "./index-B-aVupP5.js"; +import { u as useKeybindingService } from "./keybindingService-Bx7YdkXn.js"; +import { u as useServerConfigStore } from "./serverConfigStore-CvyKFVuP.js"; +import "./index-5HFeZax4.js"; +const DEFAULT_TITLE = "ComfyUI"; +const TITLE_SUFFIX = " - ComfyUI"; +const _sfc_main$t = /* @__PURE__ */ defineComponent({ + __name: "BrowserTabTitle", setup(__props) { + const executionStore = useExecutionStore(); + const executionText = computed( + () => executionStore.isIdle ? "" : `[${executionStore.executionProgress}%]` + ); const settingStore = useSettingStore(); + const betaMenuEnabled = computed( + () => settingStore.get("Comfy.UseNewMenu") !== "Disabled" + ); + const workflowStore = useWorkflowStore(); + const isUnsavedText = computed( + () => workflowStore.activeWorkflow?.isModified || !workflowStore.activeWorkflow?.isPersisted ? " *" : "" + ); + const workflowNameText = computed(() => { + const workflowName = workflowStore.activeWorkflow?.filename; + return workflowName ? isUnsavedText.value + workflowName + TITLE_SUFFIX : DEFAULT_TITLE; + }); + const nodeExecutionTitle = computed( + () => executionStore.executingNode && executionStore.executingNodeProgress ? `${executionText.value}[${executionStore.executingNodeProgress}%] ${executionStore.executingNode.type}` : "" + ); + const workflowTitle = computed( + () => executionText.value + (betaMenuEnabled.value ? workflowNameText.value : DEFAULT_TITLE) + ); + const title = computed(() => nodeExecutionTitle.value || workflowTitle.value); + useTitle(title); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +const _sfc_main$s = /* @__PURE__ */ defineComponent({ + __name: "MenuHamburger", +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + setup(__props) { + const workspaceState = useWorkspaceStore(); + const settingStore = useSettingStore(); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const showInput = ref(false); const editedTitle = ref(""); const inputStyle = ref({ @@ -188,10 +235,32 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({ const emit = __emit; const overlayValue = computed( () => typeof props.iconBadge === "function" ? props.iconBadge() || "" : props.iconBadge +======== + const exitFocusMode = /* @__PURE__ */ __name(() => { + workspaceState.focusMode = false; + }, "exitFocusMode"); + watchEffect(() => { + if (settingStore.get("Comfy.UseNewMenu") !== "Disabled") { + return; + } + if (workspaceState.focusMode) { + app.ui.menuContainer.style.display = "none"; + } else { + app.ui.menuContainer.style.display = "block"; + } + }); + const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu")); + const positionCSS = computed( + () => ( + // 'Bottom' menuSetting shows the hamburger button in the bottom right corner + // 'Disabled', 'Top' menuSetting shows the hamburger button in the top right corner + menuSetting.value === "Bottom" ? { bottom: "0px", right: "0px" } : { top: "0px", right: "0px" } + ) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js ); - const shouldShowBadge = computed(() => !!overlayValue.value); return (_ctx, _cache) => { const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js return withDirectives((openBlock(), createBlock(unref(script$h), { class: normalizeClass(props.class), text: "", @@ -222,10 +291,25 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({ _: 1 }, 8, ["class", "pt"])), [ [_directive_tooltip, { value: props.tooltip, showDelay: 300, hideDelay: 300 }] +======== + return withDirectives((openBlock(), createBlock(unref(script$d), { + class: "comfy-menu-hamburger", + style: normalizeStyle(positionCSS.value), + icon: "pi pi-bars", + severity: "secondary", + text: "", + size: "large", + onClick: exitFocusMode, + onContextmenu: unref(showNativeMenu) + }, null, 8, ["style", "onContextmenu"])), [ + [vShow, unref(workspaceState).focusMode], + [_directive_tooltip, { value: _ctx.$t("menu.showMenu"), showDelay: 300 }] +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js ]); }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-caa3ee9c"]]); const _sfc_main$r = /* @__PURE__ */ defineComponent({ __name: "SidebarThemeToggleIcon", @@ -301,25 +385,32 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({ const mountCustomExtension = /* @__PURE__ */ __name((extension, el) => { extension.render(el); }, "mountCustomExtension"); - onBeforeUnmount(() => { - if (props.extension.type === "custom" && props.extension.destroy) { - props.extension.destroy(); +======== +const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5661bed0"]]); +const _sfc_main$r = /* @__PURE__ */ defineComponent({ + __name: "UnloadWindowConfirmDialog", + setup(__props) { + const settingStore = useSettingStore(); + const handleBeforeUnload = /* @__PURE__ */ __name((event) => { + if (settingStore.get("Comfy.Window.UnloadConfirmation")) { + event.preventDefault(); + return true; } + return void 0; + }, "handleBeforeUnload"); + onMounted(() => { + window.addEventListener("beforeunload", handleBeforeUnload); + }); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + onBeforeUnmount(() => { + window.removeEventListener("beforeunload", handleBeforeUnload); }); return (_ctx, _cache) => { - return _ctx.extension.type === "vue" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.extension.component), { key: 0 })) : (openBlock(), createElementBlock("div", { - key: 1, - ref: /* @__PURE__ */ __name((el) => { - if (el) - mountCustomExtension( - props.extension, - el - ); - }, "ref") - }, null, 512)); + return openBlock(), createElementBlock("div"); }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const _hoisted_1$n = { class: "side-tool-bar-end" }; const _hoisted_2$b = { key: 0, @@ -892,11 +983,14 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({ } }); var theme$7 = /* @__PURE__ */ __name(function theme2(_ref) { +======== +var theme$7 = /* @__PURE__ */ __name(function theme(_ref) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var dt = _ref.dt; return "\n.p-splitter {\n display: flex;\n flex-wrap: nowrap;\n border: 1px solid ".concat(dt("splitter.border.color"), ";\n background: ").concat(dt("splitter.background"), ";\n border-radius: ").concat(dt("border.radius.md"), ";\n color: ").concat(dt("splitter.color"), ";\n}\n\n.p-splitter-vertical {\n flex-direction: column;\n}\n\n.p-splitter-gutter {\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1;\n background: ").concat(dt("splitter.gutter.background"), ";\n}\n\n.p-splitter-gutter-handle {\n border-radius: ").concat(dt("splitter.handle.border.radius"), ";\n background: ").concat(dt("splitter.handle.background"), ";\n transition: outline-color ").concat(dt("splitter.transition.duration"), ", box-shadow ").concat(dt("splitter.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-splitter-gutter-handle:focus-visible {\n box-shadow: ").concat(dt("splitter.handle.focus.ring.shadow"), ";\n outline: ").concat(dt("splitter.handle.focus.ring.width"), " ").concat(dt("splitter.handle.focus.ring.style"), " ").concat(dt("splitter.handle.focus.ring.color"), ";\n outline-offset: ").concat(dt("splitter.handle.focus.ring.offset"), ";\n}\n\n.p-splitter-horizontal.p-splitter-resizing {\n cursor: col-resize;\n user-select: none;\n}\n\n.p-splitter-vertical.p-splitter-resizing {\n cursor: row-resize;\n user-select: none;\n}\n\n.p-splitter-horizontal > .p-splitter-gutter > .p-splitter-gutter-handle {\n height: ").concat(dt("splitter.handle.size"), ";\n width: 100%;\n}\n\n.p-splitter-vertical > .p-splitter-gutter > .p-splitter-gutter-handle {\n width: ").concat(dt("splitter.handle.size"), ";\n height: 100%;\n}\n\n.p-splitter-horizontal > .p-splitter-gutter {\n cursor: col-resize;\n}\n\n.p-splitter-vertical > .p-splitter-gutter {\n cursor: row-resize;\n}\n\n.p-splitterpanel {\n flex-grow: 1;\n overflow: hidden;\n}\n\n.p-splitterpanel-nested {\n display: flex;\n}\n\n.p-splitterpanel .p-splitter {\n flex-grow: 1;\n border: 0 none;\n}\n"); }, "theme"); -var classes$8 = { - root: /* @__PURE__ */ __name(function root2(_ref2) { +var classes$a = { + root: /* @__PURE__ */ __name(function root(_ref2) { var props = _ref2.props; return ["p-splitter p-component", "p-splitter-" + props.layout]; }, "root"), @@ -904,7 +998,7 @@ var classes$8 = { gutterHandle: "p-splitter-gutter-handle" }; var inlineStyles$4 = { - root: /* @__PURE__ */ __name(function root3(_ref3) { + root: /* @__PURE__ */ __name(function root2(_ref3) { var props = _ref3.props; return [{ display: "flex", @@ -917,12 +1011,16 @@ var inlineStyles$4 = { var SplitterStyle = BaseStyle.extend({ name: "splitter", theme: theme$7, - classes: classes$8, + classes: classes$a, inlineStyles: inlineStyles$4 }); -var script$1$8 = { +var script$1$a = { name: "BaseSplitter", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js props: { layout: { type: String, @@ -946,7 +1044,7 @@ var script$1$8 = { } }, style: SplitterStyle, - provide: /* @__PURE__ */ __name(function provide5() { + provide: /* @__PURE__ */ __name(function provide2() { return { $pcSplitter: this, $parentInstance: this @@ -985,7 +1083,7 @@ function _arrayLikeToArray$2(r, a) { __name(_arrayLikeToArray$2, "_arrayLikeToArray$2"); var script$c = { name: "Splitter", - "extends": script$1$8, + "extends": script$1$a, inheritAttrs: false, emits: ["resizestart", "resizeend", "resize"], dragging: false, @@ -1003,19 +1101,48 @@ var script$c = { panelSizes: null, prevPanelIndex: null, timer: null, +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js mutationObserver: null, data: /* @__PURE__ */ __name(function data2() { +======== + data: /* @__PURE__ */ __name(function data() { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js return { prevSize: null, isRTL: false }; }, "data"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js mounted: /* @__PURE__ */ __name(function mounted2() { this.initializePanels(); this.updateDirection(); this.observeDirectionChanges(); +======== + mounted: /* @__PURE__ */ __name(function mounted() { + var _this = this; + if (this.panels && this.panels.length) { + var initialized = false; + if (this.isStateful()) { + initialized = this.restoreState(); + } + if (!initialized) { + var children = _toConsumableArray$2(this.$el.children).filter(function(child) { + return child.getAttribute("data-pc-name") === "splitterpanel"; + }); + var _panelSizes = []; + this.panels.map(function(panel, i) { + var panelInitialSize = panel.props && panel.props.size ? panel.props.size : null; + var panelSize = panelInitialSize || 100 / _this.panels.length; + _panelSizes[i] = panelSize; + children[i].style.flexBasis = "calc(" + panelSize + "% - " + (_this.panels.length - 1) * _this.gutterSize + "px)"; + }); + this.panelSizes = _panelSizes; + this.prevSize = parseFloat(_panelSizes[0]).toFixed(4); + } + } +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }, "mounted"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() { + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() { this.clear(); this.unbindMouseListeners(); if (this.mutationObserver) { @@ -1361,9 +1488,15 @@ var script$c = { }, "getPTOptions") } }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js var _hoisted_1$k = ["onMousedown", "onTouchstart", "onTouchmove", "onTouchend"]; var _hoisted_2$8 = ["aria-orientation", "aria-valuenow", "onKeydown"]; function render$i(_ctx, _cache, $props, $setup, $data, $options) { +======== +var _hoisted_1$m = ["onMousedown", "onTouchstart", "onTouchmove", "onTouchend"]; +var _hoisted_2$j = ["aria-orientation", "aria-valuenow", "onKeydown"]; +function render$j(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js return openBlock(), createElementBlock("div", mergeProps({ "class": _ctx.cx("root"), style: _ctx.sx("root"), @@ -1406,6 +1539,7 @@ function render$i(_ctx, _cache, $props, $setup, $data, $options) { return $options.onGutterKeyDown($event, i); }, "onKeydown"), ref_for: true +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js }, _ctx.ptm("gutterHandle")), null, 16, _hoisted_2$8)], 16, _hoisted_1$k)) : createCommentVNode("", true)], 64); }), 128))], 16); } @@ -1413,6 +1547,15 @@ __name(render$i, "render$i"); script$c.render = render$i; var classes$7 = { root: /* @__PURE__ */ __name(function root4(_ref) { +======== + }, _ctx.ptm("gutterHandle")), null, 16, _hoisted_2$j)], 16, _hoisted_1$m)) : createCommentVNode("", true)], 64); + }), 128))], 16); +} +__name(render$j, "render$j"); +script$c.render = render$j; +var classes$9 = { + root: /* @__PURE__ */ __name(function root3(_ref) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var instance = _ref.instance; return ["p-splitterpanel", { "p-splitterpanel-nested": instance.isNested @@ -1421,11 +1564,15 @@ var classes$7 = { }; var SplitterPanelStyle = BaseStyle.extend({ name: "splitterpanel", - classes: classes$7 + classes: classes$9 }); -var script$1$7 = { +var script$1$9 = { name: "BaseSplitterPanel", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js props: { size: { type: Number, @@ -1437,7 +1584,7 @@ var script$1$7 = { } }, style: SplitterPanelStyle, - provide: /* @__PURE__ */ __name(function provide6() { + provide: /* @__PURE__ */ __name(function provide3() { return { $pcSplitterPanel: this, $parentInstance: this @@ -1446,9 +1593,9 @@ var script$1$7 = { }; var script$b = { name: "SplitterPanel", - "extends": script$1$7, + "extends": script$1$9, inheritAttrs: false, - data: /* @__PURE__ */ __name(function data3() { + data: /* @__PURE__ */ __name(function data2() { return { nestedState: null }; @@ -1470,15 +1617,25 @@ var script$b = { }, "getPTOptions") } }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js function render$h(_ctx, _cache, $props, $setup, $data, $options) { +======== +function render$i(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js return openBlock(), createElementBlock("div", mergeProps({ ref: "container", "class": _ctx.cx("root") }, _ctx.ptmi("root", $options.getPTOptions)), [renderSlot(_ctx.$slots, "default")], 16); } +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js __name(render$h, "render$h"); script$b.render = render$h; const _sfc_main$l = /* @__PURE__ */ defineComponent({ +======== +__name(render$i, "render$i"); +script$b.render = render$i; +const _sfc_main$q = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js __name: "LiteGraphCanvasSplitterOverlay", setup(__props) { const settingStore = useSettingStore(); @@ -1565,8 +1722,1020 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-95268c0b"]]); var theme$6 = /* @__PURE__ */ __name(function theme3(_ref) { +======== +const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-e50caa15"]]); +var classes$8 = { + root: /* @__PURE__ */ __name(function root4(_ref) { + var instance = _ref.instance, props = _ref.props; + return ["p-tab", { + "p-tab-active": instance.active, + "p-disabled": props.disabled + }]; + }, "root") +}; +var TabStyle = BaseStyle.extend({ + name: "tab", + classes: classes$8 +}); +var script$1$8 = { + name: "BaseTab", + "extends": script$e, + props: { + value: { + type: [String, Number], + "default": void 0 + }, + disabled: { + type: Boolean, + "default": false + }, + as: { + type: [String, Object], + "default": "BUTTON" + }, + asChild: { + type: Boolean, + "default": false + } + }, + style: TabStyle, + provide: /* @__PURE__ */ __name(function provide4() { + return { + $pcTab: this, + $parentInstance: this + }; + }, "provide") +}; +var script$a = { + name: "Tab", + "extends": script$1$8, + inheritAttrs: false, + inject: ["$pcTabs", "$pcTabList"], + methods: { + onFocus: /* @__PURE__ */ __name(function onFocus() { + this.$pcTabs.selectOnFocus && this.changeActiveValue(); + }, "onFocus"), + onClick: /* @__PURE__ */ __name(function onClick() { + this.changeActiveValue(); + }, "onClick"), + onKeydown: /* @__PURE__ */ __name(function onKeydown(event) { + switch (event.code) { + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "PageDown": + this.onPageDownKey(event); + break; + case "PageUp": + this.onPageUpKey(event); + break; + case "Enter": + case "NumpadEnter": + case "Space": + this.onEnterKey(event); + break; + } + }, "onKeydown"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey(event) { + var nextTab = this.findNextTab(event.currentTarget); + nextTab ? this.changeFocusedTab(event, nextTab) : this.onHomeKey(event); + event.preventDefault(); + }, "onArrowRightKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey(event) { + var prevTab = this.findPrevTab(event.currentTarget); + prevTab ? this.changeFocusedTab(event, prevTab) : this.onEndKey(event); + event.preventDefault(); + }, "onArrowLeftKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey(event) { + var firstTab = this.findFirstTab(); + this.changeFocusedTab(event, firstTab); + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey(event) { + var lastTab = this.findLastTab(); + this.changeFocusedTab(event, lastTab); + event.preventDefault(); + }, "onEndKey"), + onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey(event) { + this.scrollInView(this.findLastTab()); + event.preventDefault(); + }, "onPageDownKey"), + onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey(event) { + this.scrollInView(this.findFirstTab()); + event.preventDefault(); + }, "onPageUpKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey(event) { + this.changeActiveValue(); + event.preventDefault(); + }, "onEnterKey"), + findNextTab: /* @__PURE__ */ __name(function findNextTab(tabElement) { + var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var element = selfCheck ? tabElement : tabElement.nextElementSibling; + return element ? getAttribute(element, "data-p-disabled") || getAttribute(element, "data-pc-section") === "inkbar" ? this.findNextTab(element) : findSingle(element, '[data-pc-name="tab"]') : null; + }, "findNextTab"), + findPrevTab: /* @__PURE__ */ __name(function findPrevTab(tabElement) { + var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var element = selfCheck ? tabElement : tabElement.previousElementSibling; + return element ? getAttribute(element, "data-p-disabled") || getAttribute(element, "data-pc-section") === "inkbar" ? this.findPrevTab(element) : findSingle(element, '[data-pc-name="tab"]') : null; + }, "findPrevTab"), + findFirstTab: /* @__PURE__ */ __name(function findFirstTab() { + return this.findNextTab(this.$pcTabList.$refs.content.firstElementChild, true); + }, "findFirstTab"), + findLastTab: /* @__PURE__ */ __name(function findLastTab() { + return this.findPrevTab(this.$pcTabList.$refs.content.lastElementChild, true); + }, "findLastTab"), + changeActiveValue: /* @__PURE__ */ __name(function changeActiveValue() { + this.$pcTabs.updateValue(this.value); + }, "changeActiveValue"), + changeFocusedTab: /* @__PURE__ */ __name(function changeFocusedTab(event, element) { + focus(element); + this.scrollInView(element); + }, "changeFocusedTab"), + scrollInView: /* @__PURE__ */ __name(function scrollInView(element) { + var _element$scrollIntoVi; + element === null || element === void 0 || (_element$scrollIntoVi = element.scrollIntoView) === null || _element$scrollIntoVi === void 0 || _element$scrollIntoVi.call(element, { + block: "nearest" + }); + }, "scrollInView") + }, + computed: { + active: /* @__PURE__ */ __name(function active() { + var _this$$pcTabs; + return equals((_this$$pcTabs = this.$pcTabs) === null || _this$$pcTabs === void 0 ? void 0 : _this$$pcTabs.d_value, this.value); + }, "active"), + id: /* @__PURE__ */ __name(function id() { + var _this$$pcTabs2; + return "".concat((_this$$pcTabs2 = this.$pcTabs) === null || _this$$pcTabs2 === void 0 ? void 0 : _this$$pcTabs2.id, "_tab_").concat(this.value); + }, "id"), + ariaControls: /* @__PURE__ */ __name(function ariaControls() { + var _this$$pcTabs3; + return "".concat((_this$$pcTabs3 = this.$pcTabs) === null || _this$$pcTabs3 === void 0 ? void 0 : _this$$pcTabs3.id, "_tabpanel_").concat(this.value); + }, "ariaControls"), + attrs: /* @__PURE__ */ __name(function attrs() { + return mergeProps(this.asAttrs, this.a11yAttrs, this.ptmi("root", this.ptParams)); + }, "attrs"), + asAttrs: /* @__PURE__ */ __name(function asAttrs() { + return this.as === "BUTTON" ? { + type: "button", + disabled: this.disabled + } : void 0; + }, "asAttrs"), + a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs() { + return { + id: this.id, + tabindex: this.active ? this.$pcTabs.tabindex : -1, + role: "tab", + "aria-selected": this.active, + "aria-controls": this.ariaControls, + "data-pc-name": "tab", + "data-p-disabled": this.disabled, + "data-p-active": this.active, + onFocus: this.onFocus, + onKeydown: this.onKeydown + }; + }, "a11yAttrs"), + ptParams: /* @__PURE__ */ __name(function ptParams() { + return { + context: { + active: this.active + } + }; + }, "ptParams") + }, + directives: { + ripple: Ripple + } +}; +function render$h(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return !_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ + key: 0, + "class": _ctx.cx("root"), + onClick: $options.onClick + }, $options.attrs), { + "default": withCtx(function() { + return [renderSlot(_ctx.$slots, "default")]; + }), + _: 3 + }, 16, ["class", "onClick"])), [[_directive_ripple]]) : renderSlot(_ctx.$slots, "default", { + key: 1, + "class": normalizeClass(_ctx.cx("root")), + active: $options.active, + a11yAttrs: $options.a11yAttrs, + onClick: $options.onClick + }); +} +__name(render$h, "render$h"); +script$a.render = render$h; +var classes$7 = { + root: "p-tablist", + content: /* @__PURE__ */ __name(function content(_ref) { + var instance = _ref.instance; + return ["p-tablist-content", { + "p-tablist-viewport": instance.$pcTabs.scrollable + }]; + }, "content"), + tabList: "p-tablist-tab-list", + activeBar: "p-tablist-active-bar", + prevButton: "p-tablist-prev-button p-tablist-nav-button", + nextButton: "p-tablist-next-button p-tablist-nav-button" +}; +var TabListStyle = BaseStyle.extend({ + name: "tablist", + classes: classes$7 +}); +var script$1$7 = { + name: "BaseTabList", + "extends": script$e, + props: {}, + style: TabListStyle, + provide: /* @__PURE__ */ __name(function provide5() { + return { + $pcTabList: this, + $parentInstance: this + }; + }, "provide") +}; +var script$9 = { + name: "TabList", + "extends": script$1$7, + inheritAttrs: false, + inject: ["$pcTabs"], + data: /* @__PURE__ */ __name(function data3() { + return { + isPrevButtonEnabled: false, + isNextButtonEnabled: true + }; + }, "data"), + resizeObserver: void 0, + watch: { + showNavigators: /* @__PURE__ */ __name(function showNavigators(newValue) { + newValue ? this.bindResizeObserver() : this.unbindResizeObserver(); + }, "showNavigators"), + activeValue: { + flush: "post", + handler: /* @__PURE__ */ __name(function handler() { + this.updateInkBar(); + }, "handler") + } + }, + mounted: /* @__PURE__ */ __name(function mounted2() { + var _this = this; + this.$nextTick(function() { + _this.updateInkBar(); + }); + if (this.showNavigators) { + this.updateButtonState(); + this.bindResizeObserver(); + } + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated() { + this.showNavigators && this.updateButtonState(); + }, "updated"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() { + this.unbindResizeObserver(); + }, "beforeUnmount"), + methods: { + onScroll: /* @__PURE__ */ __name(function onScroll(event) { + this.showNavigators && this.updateButtonState(); + event.preventDefault(); + }, "onScroll"), + onPrevButtonClick: /* @__PURE__ */ __name(function onPrevButtonClick() { + var content2 = this.$refs.content; + var width = getWidth(content2); + var pos = content2.scrollLeft - width; + content2.scrollLeft = pos <= 0 ? 0 : pos; + }, "onPrevButtonClick"), + onNextButtonClick: /* @__PURE__ */ __name(function onNextButtonClick() { + var content2 = this.$refs.content; + var width = getWidth(content2) - this.getVisibleButtonWidths(); + var pos = content2.scrollLeft + width; + var lastPos = content2.scrollWidth - width; + content2.scrollLeft = pos >= lastPos ? lastPos : pos; + }, "onNextButtonClick"), + bindResizeObserver: /* @__PURE__ */ __name(function bindResizeObserver() { + var _this2 = this; + this.resizeObserver = new ResizeObserver(function() { + return _this2.updateButtonState(); + }); + this.resizeObserver.observe(this.$refs.list); + }, "bindResizeObserver"), + unbindResizeObserver: /* @__PURE__ */ __name(function unbindResizeObserver() { + var _this$resizeObserver; + (_this$resizeObserver = this.resizeObserver) === null || _this$resizeObserver === void 0 || _this$resizeObserver.unobserve(this.$refs.list); + this.resizeObserver = void 0; + }, "unbindResizeObserver"), + updateInkBar: /* @__PURE__ */ __name(function updateInkBar() { + var _this$$refs = this.$refs, content2 = _this$$refs.content, inkbar = _this$$refs.inkbar, tabs = _this$$refs.tabs; + var activeTab = findSingle(content2, '[data-pc-name="tab"][data-p-active="true"]'); + if (this.$pcTabs.isVertical()) { + inkbar.style.height = getOuterHeight(activeTab) + "px"; + inkbar.style.top = getOffset(activeTab).top - getOffset(tabs).top + "px"; + } else { + inkbar.style.width = getOuterWidth(activeTab) + "px"; + inkbar.style.left = getOffset(activeTab).left - getOffset(tabs).left + "px"; + } + }, "updateInkBar"), + updateButtonState: /* @__PURE__ */ __name(function updateButtonState() { + var _this$$refs2 = this.$refs, list = _this$$refs2.list, content2 = _this$$refs2.content; + var scrollLeft = content2.scrollLeft, scrollTop = content2.scrollTop, scrollWidth = content2.scrollWidth, scrollHeight = content2.scrollHeight, offsetWidth = content2.offsetWidth, offsetHeight = content2.offsetHeight; + var _ref = [getWidth(content2), getHeight(content2)], width = _ref[0], height = _ref[1]; + if (this.$pcTabs.isVertical()) { + this.isPrevButtonEnabled = scrollTop !== 0; + this.isNextButtonEnabled = list.offsetHeight >= offsetHeight && parseInt(scrollTop) !== scrollHeight - height; + } else { + this.isPrevButtonEnabled = scrollLeft !== 0; + this.isNextButtonEnabled = list.offsetWidth >= offsetWidth && parseInt(scrollLeft) !== scrollWidth - width; + } + }, "updateButtonState"), + getVisibleButtonWidths: /* @__PURE__ */ __name(function getVisibleButtonWidths() { + var _this$$refs3 = this.$refs, prevBtn = _this$$refs3.prevBtn, nextBtn = _this$$refs3.nextBtn; + return [prevBtn, nextBtn].reduce(function(acc, el) { + return el ? acc + getWidth(el) : acc; + }, 0); + }, "getVisibleButtonWidths") + }, + computed: { + templates: /* @__PURE__ */ __name(function templates() { + return this.$pcTabs.$slots; + }, "templates"), + activeValue: /* @__PURE__ */ __name(function activeValue() { + return this.$pcTabs.d_value; + }, "activeValue"), + showNavigators: /* @__PURE__ */ __name(function showNavigators2() { + return this.$pcTabs.scrollable && this.$pcTabs.showNavigators; + }, "showNavigators"), + prevButtonAriaLabel: /* @__PURE__ */ __name(function prevButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.previous : void 0; + }, "prevButtonAriaLabel"), + nextButtonAriaLabel: /* @__PURE__ */ __name(function nextButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.next : void 0; + }, "nextButtonAriaLabel") + }, + components: { + ChevronLeftIcon: script$f, + ChevronRightIcon: script$g + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$l = ["aria-label", "tabindex"]; +var _hoisted_2$i = ["aria-orientation"]; +var _hoisted_3$g = ["aria-label", "tabindex"]; +function render$g(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("div", mergeProps({ + ref: "list", + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [$options.showNavigators && $data.isPrevButtonEnabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: 0, + ref: "prevButton", + "class": _ctx.cx("prevButton"), + "aria-label": $options.prevButtonAriaLabel, + tabindex: $options.$pcTabs.tabindex, + onClick: _cache[0] || (_cache[0] = function() { + return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments); + }) + }, _ctx.ptm("prevButton"), { + "data-pc-group-section": "navigator" + }), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.previcon || "ChevronLeftIcon"), mergeProps({ + "aria-hidden": "true" + }, _ctx.ptm("prevIcon")), null, 16))], 16, _hoisted_1$l)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + ref: "content", + "class": _ctx.cx("content"), + onScroll: _cache[1] || (_cache[1] = function() { + return $options.onScroll && $options.onScroll.apply($options, arguments); + }) + }, _ctx.ptm("content")), [createBaseVNode("div", mergeProps({ + ref: "tabs", + "class": _ctx.cx("tabList"), + role: "tablist", + "aria-orientation": $options.$pcTabs.orientation || "horizontal" + }, _ctx.ptm("tabList")), [renderSlot(_ctx.$slots, "default"), createBaseVNode("span", mergeProps({ + ref: "inkbar", + "class": _ctx.cx("activeBar"), + role: "presentation", + "aria-hidden": "true" + }, _ctx.ptm("activeBar")), null, 16)], 16, _hoisted_2$i)], 16), $options.showNavigators && $data.isNextButtonEnabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: 1, + ref: "nextButton", + "class": _ctx.cx("nextButton"), + "aria-label": $options.nextButtonAriaLabel, + tabindex: $options.$pcTabs.tabindex, + onClick: _cache[2] || (_cache[2] = function() { + return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments); + }) + }, _ctx.ptm("nextButton"), { + "data-pc-group-section": "navigator" + }), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.nexticon || "ChevronRightIcon"), mergeProps({ + "aria-hidden": "true" + }, _ctx.ptm("nextIcon")), null, 16))], 16, _hoisted_3$g)), [[_directive_ripple]]) : createCommentVNode("", true)], 16); +} +__name(render$g, "render$g"); +script$9.render = render$g; +const _sfc_main$p = /* @__PURE__ */ defineComponent({ + __name: "ExtensionSlot", + props: { + extension: {} + }, + setup(__props) { + const props = __props; + const mountCustomExtension = /* @__PURE__ */ __name((extension, el) => { + extension.render(el); + }, "mountCustomExtension"); + onBeforeUnmount(() => { + if (props.extension.type === "custom" && props.extension.destroy) { + props.extension.destroy(); + } + }); + return (_ctx, _cache) => { + return _ctx.extension.type === "vue" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.extension.component), { key: 0 })) : (openBlock(), createElementBlock("div", { + key: 1, + ref: /* @__PURE__ */ __name((el) => { + if (el) + mountCustomExtension( + props.extension, + el + ); + }, "ref") + }, null, 512)); + }; + } +}); +const _hoisted_1$k = { class: "flex flex-col h-full" }; +const _hoisted_2$h = { class: "w-full flex justify-between" }; +const _hoisted_3$f = { class: "tabs-container" }; +const _hoisted_4$5 = { class: "font-bold" }; +const _hoisted_5$4 = { class: "flex-grow h-0" }; +const _sfc_main$o = /* @__PURE__ */ defineComponent({ + __name: "BottomPanel", + setup(__props) { + const bottomPanelStore = useBottomPanelStore(); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$k, [ + createVNode(unref(script$h), { + value: unref(bottomPanelStore).activeBottomPanelTabId, + "onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(bottomPanelStore).activeBottomPanelTabId = $event) + }, { + default: withCtx(() => [ + createVNode(unref(script$9), { "pt:tabList": "border-none" }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_2$h, [ + createBaseVNode("div", _hoisted_3$f, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(unref(bottomPanelStore).bottomPanelTabs, (tab) => { + return openBlock(), createBlock(unref(script$a), { + key: tab.id, + value: tab.id, + class: "p-3 border-none" + }, { + default: withCtx(() => [ + createBaseVNode("span", _hoisted_4$5, toDisplayString(tab.title.toUpperCase()), 1) + ]), + _: 2 + }, 1032, ["value"]); + }), 128)) + ]), + createVNode(unref(script$d), { + class: "justify-self-end", + icon: "pi pi-times", + severity: "secondary", + size: "small", + text: "", + onClick: _cache[0] || (_cache[0] = ($event) => unref(bottomPanelStore).bottomPanelVisible = false) + }) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["value"]), + createBaseVNode("div", _hoisted_5$4, [ + unref(bottomPanelStore).bottomPanelVisible && unref(bottomPanelStore).activeBottomPanelTab ? (openBlock(), createBlock(_sfc_main$p, { + key: 0, + extension: unref(bottomPanelStore).activeBottomPanelTab + }, null, 8, ["extension"])) : createCommentVNode("", true) + ]) + ]); + }; + } +}); +const _hoisted_1$j = { + viewBox: "0 0 1024 1024", + width: "1.2em", + height: "1.2em" +}; +const _hoisted_2$g = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M921.088 103.232L584.832 889.024L465.52 544.512L121.328 440.48zM1004.46.769c-6.096 0-13.52 1.728-22.096 5.36L27.708 411.2c-34.383 14.592-36.56 42.704-4.847 62.464l395.296 123.584l129.36 403.264c9.28 15.184 20.496 22.72 31.263 22.72c11.936 0 23.296-9.152 31.04-27.248l408.272-953.728C1029.148 16.368 1022.86.769 1004.46.769" +}, null, -1); +const _hoisted_3$e = [ + _hoisted_2$g +]; +function render$f(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$j, [..._hoisted_3$e]); +} +__name(render$f, "render$f"); +const __unplugin_components_1$2 = markRaw({ name: "simple-line-icons-cursor", render: render$f }); +const _hoisted_1$i = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +const _hoisted_2$f = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M10.05 23q-.75 0-1.4-.337T7.575 21.7L1.2 12.375l.6-.575q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v13.425l-3.7-2.6l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zM11 12V2q0-.425.288-.712T12 1t.713.288T13 2v10zm4 0V3q0-.425.288-.712T16 2t.713.288T17 3v9zm-2.85 4.5" +}, null, -1); +const _hoisted_3$d = [ + _hoisted_2$f +]; +function render$e(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$i, [..._hoisted_3$d]); +} +__name(render$e, "render$e"); +const __unplugin_components_0$2 = markRaw({ name: "material-symbols-pan-tool-outline", render: render$e }); +var theme$6 = /* @__PURE__ */ __name(function theme2(_ref) { + _ref.dt; + return "\n.p-buttongroup .p-button {\n margin: 0;\n}\n\n.p-buttongroup .p-button:not(:last-child),\n.p-buttongroup .p-button:not(:last-child):hover {\n border-right: 0 none;\n}\n\n.p-buttongroup .p-button:not(:first-of-type):not(:last-of-type) {\n border-radius: 0;\n}\n\n.p-buttongroup .p-button:first-of-type:not(:only-of-type) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.p-buttongroup .p-button:last-of-type:not(:only-of-type) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-buttongroup .p-button:focus {\n position: relative;\n z-index: 1;\n}\n"; +}, "theme"); +var classes$6 = { + root: "p-buttongroup p-component" +}; +var ButtonGroupStyle = BaseStyle.extend({ + name: "buttongroup", + theme: theme$6, + classes: classes$6 +}); +var script$1$6 = { + name: "BaseButtonGroup", + "extends": script$e, + style: ButtonGroupStyle, + provide: /* @__PURE__ */ __name(function provide6() { + return { + $pcButtonGroup: this, + $parentInstance: this + }; + }, "provide") +}; +var script$8 = { + name: "ButtonGroup", + "extends": script$1$6, + inheritAttrs: false +}; +function render$d(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("span", mergeProps({ + "class": _ctx.cx("root"), + role: "group" + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); +} +__name(render$d, "render$d"); +script$8.render = render$d; +const useTitleEditorStore = defineStore("titleEditor", () => { + const titleEditorTarget = shallowRef(null); + return { + titleEditorTarget + }; +}); +const useCanvasStore = defineStore("canvas", () => { + const canvas = shallowRef(null); + return { + canvas + }; +}); +const _sfc_main$n = /* @__PURE__ */ defineComponent({ + __name: "GraphCanvasMenu", + setup(__props) { + const { t } = useI18n(); + const commandStore = useCommandStore(); + const canvasStore = useCanvasStore(); + const settingStore = useSettingStore(); + const linkHidden = computed( + () => settingStore.get("Comfy.LinkRenderMode") === LiteGraph.HIDDEN_LINK + ); + let interval = null; + const repeat2 = /* @__PURE__ */ __name((command) => { + if (interval) return; + const cmd = /* @__PURE__ */ __name(() => commandStore.execute(command), "cmd"); + cmd(); + interval = window.setInterval(cmd, 100); + }, "repeat"); + const stopRepeat = /* @__PURE__ */ __name(() => { + if (interval) { + clearInterval(interval); + interval = null; + } + }, "stopRepeat"); + return (_ctx, _cache) => { + const _component_i_material_symbols58pan_tool_outline = __unplugin_components_0$2; + const _component_i_simple_line_icons58cursor = __unplugin_components_1$2; + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createBlock(unref(script$8), { class: "p-buttongroup-vertical absolute bottom-[10px] right-[10px] z-[1000] pointer-events-auto" }, { + default: withCtx(() => [ + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: "pi pi-plus", + onMousedown: _cache[0] || (_cache[0] = ($event) => repeat2("Comfy.Canvas.ZoomIn")), + onMouseup: stopRepeat + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.zoomIn"), + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: "pi pi-minus", + onMousedown: _cache[1] || (_cache[1] = ($event) => repeat2("Comfy.Canvas.ZoomOut")), + onMouseup: stopRepeat + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.zoomOut"), + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: "pi pi-expand", + onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.Canvas.FitView")) + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.fitView"), + void 0, + { left: true } + ] + ]), + withDirectives((openBlock(), createBlock(unref(script$d), { + severity: "secondary", + onClick: _cache[3] || (_cache[3] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLock")) + }, { + icon: withCtx(() => [ + unref(canvasStore).canvas?.read_only ? (openBlock(), createBlock(_component_i_material_symbols58pan_tool_outline, { key: 0 })) : (openBlock(), createBlock(_component_i_simple_line_icons58cursor, { key: 1 })) + ]), + _: 1 + })), [ + [ + _directive_tooltip, + unref(t)( + "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode") + ) + " (Space)", + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: linkHidden.value ? "pi pi-eye-slash" : "pi pi-eye", + onClick: _cache[4] || (_cache[4] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLinkVisibility")), + "data-testid": "toggle-link-visibility-button" + }, null, 8, ["icon"]), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.toggleLinkVisibility"), + void 0, + { left: true } + ] + ]) + ]), + _: 1 + }); + }; + } +}); +const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-cf40dd39"]]); +const _sfc_main$m = /* @__PURE__ */ defineComponent({ + __name: "NodeBadge", + setup(__props) { + const settingStore = useSettingStore(); + const colorPaletteStore = useColorPaletteStore(); + const nodeSourceBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeSourceBadgeMode") + ); + const nodeIdBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeIdBadgeMode") + ); + const nodeLifeCycleBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeLifeCycleBadgeMode") + ); + watch([nodeSourceBadgeMode, nodeIdBadgeMode, nodeLifeCycleBadgeMode], () => { + app.graph?.setDirtyCanvas(true, true); + }); + const nodeDefStore = useNodeDefStore(); + function badgeTextVisible(nodeDef, badgeMode) { + return !(badgeMode === NodeBadgeMode.None || nodeDef?.isCoreNode && badgeMode === NodeBadgeMode.HideBuiltIn); + } + __name(badgeTextVisible, "badgeTextVisible"); + onMounted(() => { + app.registerExtension({ + name: "Comfy.NodeBadge", + nodeCreated(node) { + node.badgePosition = BadgePosition.TopRight; + const badge = computed(() => { + const nodeDef = nodeDefStore.fromLGraphNode(node); + return new LGraphBadge({ + text: _.truncate( + [ + badgeTextVisible(nodeDef, nodeIdBadgeMode.value) ? `#${node.id}` : "", + badgeTextVisible(nodeDef, nodeLifeCycleBadgeMode.value) ? nodeDef?.nodeLifeCycleBadgeText ?? "" : "", + badgeTextVisible(nodeDef, nodeSourceBadgeMode.value) ? nodeDef?.nodeSource?.badgeText ?? "" : "" + ].filter((s) => s.length > 0).join(" "), + { + length: 31 + } + ), + fgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_FG_COLOR, + bgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_BG_COLOR + }); + }); + node.badges.push(() => badge.value); + } + }); + }); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +const _sfc_main$l = /* @__PURE__ */ defineComponent({ + __name: "NodeTooltip", + setup(__props) { + let idleTimeout; + const nodeDefStore = useNodeDefStore(); + const tooltipRef = ref(); + const tooltipText = ref(""); + const left = ref(); + const top = ref(); + const hideTooltip = /* @__PURE__ */ __name(() => tooltipText.value = null, "hideTooltip"); + const showTooltip = /* @__PURE__ */ __name(async (tooltip) => { + if (!tooltip) return; + left.value = app.canvas.mouse[0] + "px"; + top.value = app.canvas.mouse[1] + "px"; + tooltipText.value = tooltip; + await nextTick(); + const rect = tooltipRef.value.getBoundingClientRect(); + if (rect.right > window.innerWidth) { + left.value = app.canvas.mouse[0] - rect.width + "px"; + } + if (rect.top < 0) { + top.value = app.canvas.mouse[1] + rect.height + "px"; + } + }, "showTooltip"); + const onIdle = /* @__PURE__ */ __name(() => { + const { canvas } = app; + const node = canvas.node_over; + if (!node) return; + const ctor = node.constructor; + const nodeDef = nodeDefStore.nodeDefsByName[node.type]; + if (ctor.title_mode !== LiteGraph.NO_TITLE && canvas.graph_mouse[1] < node.pos[1]) { + return showTooltip(nodeDef.description); + } + if (node.flags?.collapsed) return; + const inputSlot = canvas.isOverNodeInput( + node, + canvas.graph_mouse[0], + canvas.graph_mouse[1], + [0, 0] + ); + if (inputSlot !== -1) { + const inputName = node.inputs[inputSlot].name; + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(inputName)}.tooltip`, + nodeDef.inputs.getInput(inputName)?.tooltip + ); + return showTooltip(translatedTooltip); + } + const outputSlot = canvas.isOverNodeOutput( + node, + canvas.graph_mouse[0], + canvas.graph_mouse[1], + [0, 0] + ); + if (outputSlot !== -1) { + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.outputs.${outputSlot}.tooltip`, + nodeDef.outputs.all?.[outputSlot]?.tooltip + ); + return showTooltip(translatedTooltip); + } + const widget = app.canvas.getWidgetAtCursor(); + if (widget && !widget.element) { + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(widget.name)}.tooltip`, + nodeDef.inputs.getInput(widget.name)?.tooltip + ); + return showTooltip(widget.tooltip ?? translatedTooltip); + } + }, "onIdle"); + const onMouseMove = /* @__PURE__ */ __name((e) => { + hideTooltip(); + clearTimeout(idleTimeout); + if (e.target.nodeName !== "CANVAS") return; + idleTimeout = window.setTimeout(onIdle, 500); + }, "onMouseMove"); + useEventListener(window, "mousemove", onMouseMove); + useEventListener(window, "click", hideTooltip); + return (_ctx, _cache) => { + return tooltipText.value ? (openBlock(), createElementBlock("div", { + key: 0, + ref_key: "tooltipRef", + ref: tooltipRef, + class: "node-tooltip", + style: normalizeStyle({ left: left.value, top: top.value }) + }, toDisplayString(tooltipText.value), 5)) : createCommentVNode("", true); + }; + } +}); +const NodeTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-46859edf"]]); +const _sfc_main$k = /* @__PURE__ */ defineComponent({ + __name: "TitleEditor", + setup(__props) { + const settingStore = useSettingStore(); + const showInput = ref(false); + const editedTitle = ref(""); + const inputStyle = ref({ + position: "fixed", + left: "0px", + top: "0px", + width: "200px", + height: "20px", + fontSize: "12px" + }); + const titleEditorStore = useTitleEditorStore(); + const canvasStore = useCanvasStore(); + const previousCanvasDraggable = ref(true); + const onEdit = /* @__PURE__ */ __name((newValue) => { + if (titleEditorStore.titleEditorTarget && newValue.trim() !== "") { + titleEditorStore.titleEditorTarget.title = newValue.trim(); + app.graph.setDirtyCanvas(true, true); + } + showInput.value = false; + titleEditorStore.titleEditorTarget = null; + canvasStore.canvas.allow_dragcanvas = previousCanvasDraggable.value; + }, "onEdit"); + watch( + () => titleEditorStore.titleEditorTarget, + (target) => { + if (target === null) { + return; + } + editedTitle.value = target.title; + showInput.value = true; + previousCanvasDraggable.value = canvasStore.canvas.allow_dragcanvas; + canvasStore.canvas.allow_dragcanvas = false; + if (target instanceof LGraphGroup) { + const group = target; + const [x, y] = group.pos; + const [w, h] = group.size; + const [left, top] = app.canvasPosToClientPos([x, y]); + inputStyle.value.left = `${left}px`; + inputStyle.value.top = `${top}px`; + const width = w * app.canvas.ds.scale; + const height = group.titleHeight * app.canvas.ds.scale; + inputStyle.value.width = `${width}px`; + inputStyle.value.height = `${height}px`; + const fontSize = group.font_size * app.canvas.ds.scale; + inputStyle.value.fontSize = `${fontSize}px`; + } else if (target instanceof LGraphNode) { + const node = target; + const [x, y] = node.getBounding(); + const canvasWidth = node.width; + const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT; + const [left, top] = app.canvasPosToClientPos([x, y]); + inputStyle.value.left = `${left}px`; + inputStyle.value.top = `${top}px`; + const width = canvasWidth * app.canvas.ds.scale; + const height = canvasHeight * app.canvas.ds.scale; + inputStyle.value.width = `${width}px`; + inputStyle.value.height = `${height}px`; + const fontSize = 12 * app.canvas.ds.scale; + inputStyle.value.fontSize = `${fontSize}px`; + } + } + ); + const canvasEventHandler = /* @__PURE__ */ __name((event) => { + if (event.detail.subType === "group-double-click") { + if (!settingStore.get("Comfy.Group.DoubleClickTitleToEdit")) { + return; + } + const group = event.detail.group; + const [x, y] = group.pos; + const e = event.detail.originalEvent; + const relativeY = e.canvasY - y; + if (relativeY <= group.titleHeight) { + titleEditorStore.titleEditorTarget = group; + } + } else if (event.detail.subType === "node-double-click") { + if (!settingStore.get("Comfy.Node.DoubleClickTitleToEdit")) { + return; + } + const node = event.detail.node; + const [x, y] = node.pos; + const e = event.detail.originalEvent; + const relativeY = e.canvasY - y; + if (relativeY <= 0) { + titleEditorStore.titleEditorTarget = node; + } + } + }, "canvasEventHandler"); + useEventListener(document, "litegraph:canvas", canvasEventHandler); + return (_ctx, _cache) => { + return showInput.value ? (openBlock(), createElementBlock("div", { + key: 0, + class: "group-title-editor node-title-editor", + style: normalizeStyle(inputStyle.value) + }, [ + createVNode(EditableText, { + isEditing: showInput.value, + modelValue: editedTitle.value, + onEdit + }, null, 8, ["isEditing", "modelValue"]) + ], 4)) : createCommentVNode("", true); + }; + } +}); +const TitleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-12d3fd12"]]); +const useSearchBoxStore = defineStore("searchBox", () => { + const visible = ref(false); + function toggleVisible() { + visible.value = !visible.value; + } + __name(toggleVisible, "toggleVisible"); + return { + visible, + toggleVisible + }; +}); +class ConnectingLinkImpl { + static { + __name(this, "ConnectingLinkImpl"); + } + constructor(node, slot, input, output, pos, afterRerouteId) { + this.node = node; + this.slot = slot; + this.input = input; + this.output = output; + this.pos = pos; + this.afterRerouteId = afterRerouteId; + } + static createFromPlainObject(obj) { + return new ConnectingLinkImpl( + obj.node, + obj.slot, + obj.input, + obj.output, + obj.pos, + obj.afterRerouteId + ); + } + get type() { + const result = this.input ? this.input.type : this.output?.type ?? null; + return result === -1 ? null : result; + } + /** + * Which slot type is release and need to be reconnected. + * - 'output' means we need a new node's outputs slot to connect with this link + */ + get releaseSlotType() { + return this.output ? "input" : "output"; + } + connectTo(newNode) { + const newNodeSlots = this.releaseSlotType === "output" ? newNode.outputs : newNode.inputs; + if (!newNodeSlots) return; + const newNodeSlot = newNodeSlots.findIndex( + (slot) => LiteGraph.isValidConnection(slot.type, this.type) + ); + if (newNodeSlot === -1) { + console.warn( + `Could not find slot with type ${this.type} on node ${newNode.title}. This should never happen` + ); + return; + } + if (this.releaseSlotType === "input") { + this.node.connect(this.slot, newNode, newNodeSlot, this.afterRerouteId); + } else { + newNode.connect(newNodeSlot, this.node, this.slot, this.afterRerouteId); + } + } +} +var theme$5 = /* @__PURE__ */ __name(function theme3(_ref) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var dt = _ref.dt; return "\n.p-autocomplete {\n display: inline-flex;\n}\n\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n inset-inline-end: ".concat(dt("autocomplete.padding.x"), ";\n}\n\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-loader {\n inset-inline-end: calc(").concat(dt("autocomplete.dropdown.width"), " + ").concat(dt("autocomplete.padding.x"), ");\n}\n\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input {\n flex: 1 1 auto;\n width: 1%;\n}\n\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input,\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input-multiple {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n}\n\n.p-autocomplete-dropdown {\n cursor: pointer;\n display: inline-flex;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n width: ").concat(dt("autocomplete.dropdown.width"), ";\n border-start-end-radius: ").concat(dt("autocomplete.dropdown.border.radius"), ";\n border-end-end-radius: ").concat(dt("autocomplete.dropdown.border.radius"), ";\n background: ").concat(dt("autocomplete.dropdown.background"), ";\n border: 1px solid ").concat(dt("autocomplete.dropdown.border.color"), ";\n border-inline-start: 0 none;\n color: ").concat(dt("autocomplete.dropdown.color"), ";\n transition: background ").concat(dt("autocomplete.transition.duration"), ", color ").concat(dt("autocomplete.transition.duration"), ", border-color ").concat(dt("autocomplete.transition.duration"), ", outline-color ").concat(dt("autocomplete.transition.duration"), ", box-shadow ").concat(dt("autocomplete.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-autocomplete-dropdown:not(:disabled):hover {\n background: ").concat(dt("autocomplete.dropdown.hover.background"), ";\n border-color: ").concat(dt("autocomplete.dropdown.hover.border.color"), ";\n color: ").concat(dt("autocomplete.dropdown.hover.color"), ";\n}\n\n.p-autocomplete-dropdown:not(:disabled):active {\n background: ").concat(dt("autocomplete.dropdown.active.background"), ";\n border-color: ").concat(dt("autocomplete.dropdown.active.border.color"), ";\n color: ").concat(dt("autocomplete.dropdown.active.color"), ";\n}\n\n.p-autocomplete-dropdown:focus-visible {\n box-shadow: ").concat(dt("autocomplete.dropdown.focus.ring.shadow"), ";\n outline: ").concat(dt("autocomplete.dropdown.focus.ring.width"), " ").concat(dt("autocomplete.dropdown.focus.ring.style"), " ").concat(dt("autocomplete.dropdown.focus.ring.color"), ";\n outline-offset: ").concat(dt("autocomplete.dropdown.focus.ring.offset"), ";\n}\n\n.p-autocomplete .p-autocomplete-overlay {\n min-width: 100%;\n}\n\n.p-autocomplete-overlay {\n position: absolute;\n top: 0;\n left: 0;\n background: ").concat(dt("autocomplete.overlay.background"), ";\n color: ").concat(dt("autocomplete.overlay.color"), ";\n border: 1px solid ").concat(dt("autocomplete.overlay.border.color"), ";\n border-radius: ").concat(dt("autocomplete.overlay.border.radius"), ";\n box-shadow: ").concat(dt("autocomplete.overlay.shadow"), ";\n}\n\n.p-autocomplete-list-container {\n overflow: auto;\n}\n\n.p-autocomplete-list {\n margin: 0;\n list-style-type: none;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("autocomplete.list.gap"), ";\n padding: ").concat(dt("autocomplete.list.padding"), ";\n}\n\n.p-autocomplete-option {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n display: flex;\n align-items: center;\n padding: ").concat(dt("autocomplete.option.padding"), ";\n border: 0 none;\n color: ").concat(dt("autocomplete.option.color"), ";\n background: transparent;\n transition: background ").concat(dt("autocomplete.transition.duration"), ", color ").concat(dt("autocomplete.transition.duration"), ", border-color ").concat(dt("autocomplete.transition.duration"), ";\n border-radius: ").concat(dt("autocomplete.option.border.radius"), ";\n}\n\n.p-autocomplete-option:not(.p-autocomplete-option-selected):not(.p-disabled).p-focus {\n background: ").concat(dt("autocomplete.option.focus.background"), ";\n color: ").concat(dt("autocomplete.option.focus.color"), ";\n}\n\n.p-autocomplete-option-selected {\n background: ").concat(dt("autocomplete.option.selected.background"), ";\n color: ").concat(dt("autocomplete.option.selected.color"), ";\n}\n\n.p-autocomplete-option-selected.p-focus {\n background: ").concat(dt("autocomplete.option.selected.focus.background"), ";\n color: ").concat(dt("autocomplete.option.selected.focus.color"), ";\n}\n\n.p-autocomplete-option-group {\n margin: 0;\n padding: ").concat(dt("autocomplete.option.group.padding"), ";\n color: ").concat(dt("autocomplete.option.group.color"), ";\n background: ").concat(dt("autocomplete.option.group.background"), ";\n font-weight: ").concat(dt("autocomplete.option.group.font.weight"), ";\n}\n\n.p-autocomplete-input-multiple {\n margin: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n padding: calc(").concat(dt("autocomplete.padding.y"), " / 2) ").concat(dt("autocomplete.padding.x"), ";\n gap: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n color: ").concat(dt("autocomplete.color"), ";\n background: ").concat(dt("autocomplete.background"), ";\n border: 1px solid ").concat(dt("autocomplete.border.color"), ";\n border-radius: ").concat(dt("autocomplete.border.radius"), ";\n width: 100%;\n transition: background ").concat(dt("autocomplete.transition.duration"), ", color ").concat(dt("autocomplete.transition.duration"), ", border-color ").concat(dt("autocomplete.transition.duration"), ", outline-color ").concat(dt("autocomplete.transition.duration"), ", box-shadow ").concat(dt("autocomplete.transition.duration"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("autocomplete.shadow"), ";\n}\n\n.p-autocomplete:not(.p-disabled):hover .p-autocomplete-input-multiple {\n border-color: ").concat(dt("autocomplete.hover.border.color"), ";\n}\n\n.p-autocomplete:not(.p-disabled).p-focus .p-autocomplete-input-multiple {\n border-color: ").concat(dt("autocomplete.focus.border.color"), ";\n box-shadow: ").concat(dt("autocomplete.focus.ring.shadow"), ";\n outline: ").concat(dt("autocomplete.focus.ring.width"), " ").concat(dt("autocomplete.focus.ring.style"), " ").concat(dt("autocomplete.focus.ring.color"), ";\n outline-offset: ").concat(dt("autocomplete.focus.ring.offset"), ";\n}\n\n.p-autocomplete.p-invalid .p-autocomplete-input-multiple {\n border-color: ").concat(dt("autocomplete.invalid.border.color"), ";\n}\n\n.p-variant-filled.p-autocomplete-input-multiple {\n background: ").concat(dt("autocomplete.filled.background"), ";\n}\n\n.p-autocomplete:not(.p-disabled):hover .p-variant-filled.p-autocomplete-input-multiple {\n background: ").concat(dt("autocomplete.filled.hover.background"), ";\n}\n\n.p-autocomplete:not(.p-disabled).p-focus .p-variant-filled.p-autocomplete-input-multiple {\n background: ").concat(dt("autocomplete.filled.focus.background"), ";\n}\n\n.p-autocomplete.p-disabled .p-autocomplete-input-multiple {\n opacity: 1;\n background: ").concat(dt("autocomplete.disabled.background"), ";\n color: ").concat(dt("autocomplete.disabled.color"), ";\n}\n\n.p-autocomplete-chip.p-chip {\n padding-block-start: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n padding-block-end: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n border-radius: ").concat(dt("autocomplete.chip.border.radius"), ";\n}\n\n.p-autocomplete-input-multiple:has(.p-autocomplete-chip) {\n padding-inline-start: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n padding-inline-end: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n}\n\n.p-autocomplete-chip-item.p-focus .p-autocomplete-chip {\n background: ").concat(dt("autocomplete.chip.focus.background"), ";\n color: ").concat(dt("autocomplete.chip.focus.color"), ";\n}\n\n.p-autocomplete-input-chip {\n flex: 1 1 auto;\n display: inline-flex;\n padding-block-start: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n padding-block-end: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n}\n\n.p-autocomplete-input-chip input {\n border: 0 none;\n outline: 0 none;\n background: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: inherit;\n}\n\n.p-autocomplete-input-chip input::placeholder {\n color: ").concat(dt("autocomplete.placeholder.color"), ";\n}\n\n.p-autocomplete.p-invalid .p-autocomplete-input-chip input::placeholder {\n color: ").concat(dt("autocomplete.invalid.placeholder.color"), ";\n}\n\n.p-autocomplete-empty-message {\n padding: ").concat(dt("autocomplete.empty.message.padding"), ";\n}\n\n.p-autocomplete-fluid {\n display: flex;\n}\n\n.p-autocomplete-fluid:has(.p-autocomplete-dropdown) .p-autocomplete-input {\n width: 1%;\n}\n\n.p-autocomplete:has(.p-inputtext-sm) .p-autocomplete-dropdown {\n width: ").concat(dt("autocomplete.dropdown.sm.width"), ";\n}\n\n.p-autocomplete:has(.p-inputtext-sm) .p-autocomplete-dropdown .p-icon {\n font-size: ").concat(dt("form.field.sm.font.size"), ";\n width: ").concat(dt("form.field.sm.font.size"), ";\n height: ").concat(dt("form.field.sm.font.size"), ";\n}\n\n.p-autocomplete:has(.p-inputtext-lg) .p-autocomplete-dropdown {\n width: ").concat(dt("autocomplete.dropdown.lg.width"), ";\n}\n\n.p-autocomplete:has(.p-inputtext-lg) .p-autocomplete-dropdown .p-icon {\n font-size: ").concat(dt("form.field.lg.font.size"), ";\n width: ").concat(dt("form.field.lg.font.size"), ";\n height: ").concat(dt("form.field.lg.font.size"), ";\n}\n"); }, "theme"); @@ -1575,7 +2744,7 @@ var inlineStyles$3 = { position: "relative" } }; -var classes$6 = { +var classes$5 = { root: /* @__PURE__ */ __name(function root5(_ref2) { var instance = _ref2.instance, props = _ref2.props; return ["p-autocomplete p-component p-inputwrapper", { @@ -1623,13 +2792,17 @@ var classes$6 = { }; var AutoCompleteStyle = BaseStyle.extend({ name: "autocomplete", - theme: theme$6, - classes: classes$6, + theme: theme$5, + classes: classes$5, inlineStyles: inlineStyles$3 }); -var script$1$6 = { +var script$1$5 = { name: "BaseAutoComplete", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$m, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js props: { suggestions: { type: Array, @@ -1843,9 +3016,13 @@ function _arrayLikeToArray$1(r, a) { return n; } __name(_arrayLikeToArray$1, "_arrayLikeToArray$1"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js var script$a = { +======== +var script$7 = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js name: "AutoComplete", - "extends": script$1$6, + "extends": script$1$5, inheritAttrs: false, emits: ["change", "focus", "blur", "item-select", "item-unselect", "option-select", "option-unselect", "dropdown-click", "clear", "complete", "before-show", "before-hide", "show", "hide"], inject: { @@ -2613,12 +3790,21 @@ var script$a = { }, "panelId") }, components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js InputText: script$n, VirtualScroller: script$o, Portal: script$p, ChevronDownIcon: script$q, SpinnerIcon: script$r, Chip: script$s +======== + InputText: script$i, + VirtualScroller: script$j, + Portal: script$k, + ChevronDownIcon: script$l, + SpinnerIcon: script$m, + Chip: script$n +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }, directives: { ripple: Ripple @@ -2676,6 +3862,7 @@ function _toPrimitive$4(t, r) { return ("string" === r ? String : Number)(t); } __name(_toPrimitive$4, "_toPrimitive$4"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js var _hoisted_1$j = ["aria-activedescendant"]; var _hoisted_2$7 = ["id", "aria-label", "aria-setsize", "aria-posinset"]; var _hoisted_3$6 = ["id", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"]; @@ -2685,6 +3872,17 @@ var _hoisted_6$2 = ["id", "aria-label"]; var _hoisted_7$1 = ["id"]; var _hoisted_8 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove", "data-p-selected", "data-p-focus", "data-p-disabled"]; function render$g(_ctx, _cache, $props, $setup, $data, $options) { +======== +var _hoisted_1$h = ["aria-activedescendant"]; +var _hoisted_2$e = ["id", "aria-label", "aria-setsize", "aria-posinset"]; +var _hoisted_3$c = ["id", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"]; +var _hoisted_4$4 = ["disabled", "aria-expanded", "aria-controls"]; +var _hoisted_5$3 = ["id"]; +var _hoisted_6$2 = ["id", "aria-label"]; +var _hoisted_7$1 = ["id"]; +var _hoisted_8$1 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove", "data-p-selected", "data-p-focus", "data-p-disabled"]; +function render$c(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var _component_InputText = resolveComponent("InputText"); var _component_Chip = resolveComponent("Chip"); var _component_SpinnerIcon = resolveComponent("SpinnerIcon"); @@ -2791,7 +3989,11 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) { }), _: 2 }, 1032, ["class", "label", "removeIcon", "unstyled", "onRemove", "pt"])]; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js })], 16, _hoisted_2$7); +======== + })], 16, _hoisted_2$e); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }), 128)), createBaseVNode("li", mergeProps({ "class": _ctx.cx("inputChip"), role: "option" @@ -2829,7 +4031,11 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) { onChange: _cache[4] || (_cache[4] = function() { return $options.onChange && $options.onChange.apply($options, arguments); }) +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js }, _ctx.ptm("input")), null, 16, _hoisted_3$6)], 16)], 16, _hoisted_1$j)) : createCommentVNode("", true), $data.searching || _ctx.loading ? renderSlot(_ctx.$slots, _ctx.$slots.loader ? "loader" : "loadingicon", { +======== + }, _ctx.ptm("input")), null, 16, _hoisted_3$c)], 16)], 16, _hoisted_1$h)) : createCommentVNode("", true), $data.searching || _ctx.loading ? renderSlot(_ctx.$slots, _ctx.$slots.loader ? "loader" : "loadingicon", { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 2, "class": normalizeClass(_ctx.cx("loader")) }, function() { @@ -2866,7 +4072,11 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) { return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? "span" : "ChevronDownIcon"), mergeProps({ "class": _ctx.dropdownIcon }, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))]; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js })], 16, _hoisted_4$3)) : createCommentVNode("", true)]; +======== + })], 16, _hoisted_4$4)) : createCommentVNode("", true)]; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }), createBaseVNode("span", mergeProps({ role: "status", "aria-live": "polite", @@ -3012,6 +4222,7 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) { _: 3 }, 8, ["appendTo"])], 16); } +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js __name(render$g, "render$g"); script$a.render = render$g; const _sfc_main$k = { @@ -3021,6 +4232,17 @@ const _sfc_main$k = { mounted() { if (typeof script$a.mounted === "function") { script$a.mounted.call(this); +======== +__name(render$c, "render$c"); +script$7.render = render$c; +const _sfc_main$j = { + name: "AutoCompletePlus", + extends: script$7, + emits: ["focused-option-changed"], + mounted() { + if (typeof script$7.mounted === "function") { + script$7.mounted.call(this); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } this.$watch( () => this.focusedOptionIndex, @@ -3030,12 +4252,27 @@ const _sfc_main$k = { ); } }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const _hoisted_1$i = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" }; const _hoisted_2$6 = { class: "option-display-name font-semibold flex flex-col" }; const _hoisted_3$5 = { key: 0 }; const _hoisted_4$2 = ["innerHTML"]; const _hoisted_5$2 = ["innerHTML"]; const _hoisted_6$1 = { +======== +const _withScopeId$5 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-5741c9ae"), n = n(), popScopeId(), n), "_withScopeId$5"); +const _hoisted_1$g = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" }; +const _hoisted_2$d = { class: "option-display-name font-semibold flex flex-col" }; +const _hoisted_3$b = { key: 0 }; +const _hoisted_4$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-bookmark-fill text-sm mr-1" }, null, -1)); +const _hoisted_5$2 = [ + _hoisted_4$3 +]; +const _hoisted_6$1 = ["innerHTML"]; +const _hoisted_7 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ createBaseVNode("span", null, " ", -1)); +const _hoisted_8 = ["innerHTML"]; +const _hoisted_9 = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 0, class: "option-category font-light text-sm text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap" }; @@ -3067,6 +4304,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({ ); const props = __props; return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js return openBlock(), createElementBlock("div", _hoisted_1$i, [ createBaseVNode("div", _hoisted_2$6, [ createBaseVNode("div", null, [ @@ -3078,6 +4316,17 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({ }, null, 8, _hoisted_4$2), _cache[1] || (_cache[1] = createBaseVNode("span", null, " ", -1)), showIdName.value ? (openBlock(), createBlock(unref(script$t), { +======== + return openBlock(), createElementBlock("div", _hoisted_1$g, [ + createBaseVNode("div", _hoisted_2$d, [ + createBaseVNode("div", null, [ + isBookmarked.value ? (openBlock(), createElementBlock("span", _hoisted_3$b, _hoisted_5$2)) : createCommentVNode("", true), + createBaseVNode("span", { + innerHTML: unref(highlightQuery)(_ctx.nodeDef.display_name, _ctx.currentQuery) + }, null, 8, _hoisted_6$1), + _hoisted_7, + showIdName.value ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 1, severity: "secondary" }, { @@ -3091,23 +4340,40 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({ ]), showCategory.value ? (openBlock(), createElementBlock("div", _hoisted_6$1, toDisplayString(_ctx.nodeDef.category.replaceAll("/", " > ")), 1)) : createCommentVNode("", true) ]), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createBaseVNode("div", _hoisted_7, [ _ctx.nodeDef.experimental ? (openBlock(), createBlock(unref(script$t), { +======== + createBaseVNode("div", _hoisted_10, [ + _ctx.nodeDef.experimental ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 0, value: _ctx.$t("g.experimental"), severity: "primary" }, null, 8, ["value"])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js _ctx.nodeDef.deprecated ? (openBlock(), createBlock(unref(script$t), { +======== + _ctx.nodeDef.deprecated ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 1, value: _ctx.$t("g.deprecated"), severity: "danger" }, null, 8, ["value"])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js showNodeFrequency.value && nodeFrequency.value > 0 ? (openBlock(), createBlock(unref(script$t), { +======== + showNodeFrequency.value && nodeFrequency.value > 0 ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 2, value: unref(formatNumberWithSuffix)(nodeFrequency.value, { roundToInt: true }), severity: "secondary" }, null, 8, ["value"])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js _ctx.nodeDef.nodeSource.type !== unref(NodeSourceType).Unknown ? (openBlock(), createBlock(unref(script$s), { +======== + _ctx.nodeDef.nodeSource.type !== unref(NodeSourceType).Unknown ? (openBlock(), createBlock(unref(script$n), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 3, class: "text-sm font-light" }, { @@ -3121,6 +4387,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-d7cc0bce"]]); const _hoisted_1$h = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96 pointer-events-auto" }; const _hoisted_2$5 = { @@ -3129,6 +4396,17 @@ const _hoisted_2$5 = { }; const _hoisted_3$4 = { class: "_dialog-body" }; const _sfc_main$i = /* @__PURE__ */ defineComponent({ +======== +const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-5741c9ae"]]); +const _hoisted_1$f = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96 pointer-events-auto" }; +const _hoisted_2$c = { + key: 0, + class: "comfy-vue-node-preview-container absolute left-[-350px] top-[50px]" +}; +const _hoisted_3$a = /* @__PURE__ */ createBaseVNode("h3", null, "Add node filter condition", -1); +const _hoisted_4$2 = { class: "_dialog-body" }; +const _sfc_main$h = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js __name: "NodeSearchBox", props: { filters: {}, @@ -3191,29 +4469,50 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({ hoveredSuggestion.value = value; }, "setHoverSuggestion"); return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js return openBlock(), createElementBlock("div", _hoisted_1$h, [ enableNodePreview.value ? (openBlock(), createElementBlock("div", _hoisted_2$5, [ +======== + return openBlock(), createElementBlock("div", _hoisted_1$f, [ + enableNodePreview.value ? (openBlock(), createElementBlock("div", _hoisted_2$c, [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js hoveredSuggestion.value ? (openBlock(), createBlock(NodePreview, { nodeDef: hoveredSuggestion.value, key: hoveredSuggestion.value?.name || "" }, null, 8, ["nodeDef"])) : createCommentVNode("", true) ])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(unref(script$h), { +======== + createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js icon: "pi pi-filter", severity: "secondary", class: "filter-button z-10", onClick: _cache[0] || (_cache[0] = ($event) => nodeSearchFilterVisible.value = true) }), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(unref(script$u), { +======== + createVNode(unref(script$p), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js visible: nodeSearchFilterVisible.value, "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => nodeSearchFilterVisible.value = $event), class: "min-w-96" }, { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js header: withCtx(() => _cache[5] || (_cache[5] = [ createBaseVNode("h3", null, "Add node filter condition", -1) ])), default: withCtx(() => [ createBaseVNode("div", _hoisted_3$4, [ +======== + header: withCtx(() => [ + _hoisted_3$a + ]), + default: withCtx(() => [ + createBaseVNode("div", _hoisted_4$2, [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js createVNode(NodeSearchFilter, { onAddFilter }) ]) ]), @@ -3260,6 +4559,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js class ConnectingLinkImpl { static { __name(this, "ConnectingLinkImpl"); @@ -3324,15 +4624,19 @@ const useSearchBoxStore = defineStore("searchBox", () => { }; }); const _sfc_main$h = /* @__PURE__ */ defineComponent({ +======== +const _sfc_main$g = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js __name: "NodeSearchBoxPopover", setup(__props) { const settingStore = useSettingStore(); + const litegraphService = useLitegraphService(); const { visible } = storeToRefs(useSearchBoxStore()); const dismissable = ref(true); const triggerEvent = ref(null); const getNewNodeLocation = /* @__PURE__ */ __name(() => { if (!triggerEvent.value) { - return app.getCanvasCenter(); + return litegraphService.getCanvasCenter(); } const originalEvent = triggerEvent.value.detail.originalEvent; return [originalEvent.canvasX, originalEvent.canvasY]; @@ -3353,7 +4657,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({ visible.value = false; }, "closeDialog"); const addNode = /* @__PURE__ */ __name((nodeDef) => { - const node = app.addNodeOnGraph(nodeDef, { pos: getNewNodeLocation() }); + const node = litegraphService.addNodeOnGraph(nodeDef, { + pos: getNewNodeLocation() + }); const eventDetail = triggerEvent.value?.detail; if (eventDetail && eventDetail.subType === "empty-release") { eventDetail.linkReleaseContext.links.forEach((link) => { @@ -3479,7 +4785,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({ useEventListener(document, "litegraph:canvas", canvasEventHandler); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", null, [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(unref(script$u), { +======== + createVNode(unref(script$p), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js visible: unref(visible), "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => isRef(visible) ? visible.value = $event : null), modal: "", @@ -3514,6 +4824,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const _sfc_main$g = /* @__PURE__ */ defineComponent({ __name: "NodeTooltip", setup(__props) { @@ -3692,26 +5003,39 @@ const __unplugin_components_0$2 = markRaw({ name: "material-symbols-pan-tool-out var theme$5 = /* @__PURE__ */ __name(function theme4(_ref) { _ref.dt; return "\n.p-buttongroup {\n display: inline-flex;\n}\n\n.p-buttongroup .p-button {\n margin: 0;\n}\n\n.p-buttongroup .p-button:not(:last-child),\n.p-buttongroup .p-button:not(:last-child):hover {\n border-inline-end: 0 none;\n}\n\n.p-buttongroup .p-button:not(:first-of-type):not(:last-of-type) {\n border-radius: 0;\n}\n\n.p-buttongroup .p-button:first-of-type:not(:only-of-type) {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n}\n\n.p-buttongroup .p-button:last-of-type:not(:only-of-type) {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.p-buttongroup .p-button:focus {\n position: relative;\n z-index: 1;\n}\n"; +======== +var theme$4 = /* @__PURE__ */ __name(function theme4(_ref) { + var dt = _ref.dt; + return "\n.p-overlaybadge {\n position: relative;\n}\n\n.p-overlaybadge .p-badge {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n transform-origin: 100% 0;\n margin: 0;\n outline-width: ".concat(dt("overlaybadge.outline.width"), ";\n outline-style: solid;\n outline-color: ").concat(dt("overlaybadge.outline.color"), ";\n}\n"); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }, "theme"); -var classes$5 = { - root: "p-buttongroup p-component" +var classes$4 = { + root: "p-overlaybadge" }; -var ButtonGroupStyle = BaseStyle.extend({ - name: "buttongroup", - theme: theme$5, - classes: classes$5 +var OverlayBadgeStyle = BaseStyle.extend({ + name: "overlaybadge", + theme: theme$4, + classes: classes$4 }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js var script$1$5 = { name: "BaseButtonGroup", "extends": script$i, style: ButtonGroupStyle, +======== +var script$1$4 = { + name: "OverlayBadge", + "extends": script$q, + style: OverlayBadgeStyle, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js provide: /* @__PURE__ */ __name(function provide8() { return { - $pcButtonGroup: this, + $pcOverlayBadge: this, $parentInstance: this }; }, "provide") }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js var script$9 = { name: "ButtonGroup", "extends": script$1$5, @@ -3734,24 +5058,55 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({ const settingStore = useSettingStore(); const linkHidden = computed( () => settingStore.get("Comfy.LinkRenderMode") === LiteGraph.HIDDEN_LINK +======== +var script$6 = { + name: "OverlayBadge", + "extends": script$1$4, + inheritAttrs: false, + components: { + Badge: script$q + } +}; +function render$b(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Badge = resolveComponent("Badge"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default"), createVNode(_component_Badge, mergeProps(_ctx.$props, { + pt: _ctx.ptm("pcBadge") + }), null, 16, ["pt"])], 16); +} +__name(render$b, "render$b"); +script$6.render = render$b; +const _sfc_main$f = /* @__PURE__ */ defineComponent({ + __name: "SidebarIcon", + props: { + icon: String, + selected: Boolean, + tooltip: { + type: String, + default: "" + }, + class: { + type: String, + default: "" + }, + iconBadge: { + type: [String, Function], + default: "" + } + }, + emits: ["click"], + setup(__props, { emit: __emit }) { + const props = __props; + const emit = __emit; + const overlayValue = computed( + () => typeof props.iconBadge === "function" ? props.iconBadge() || "" : props.iconBadge +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js ); - let interval = null; - const repeat2 = /* @__PURE__ */ __name((command) => { - if (interval) return; - const cmd = /* @__PURE__ */ __name(() => commandStore.execute(command), "cmd"); - cmd(); - interval = window.setInterval(cmd, 100); - }, "repeat"); - const stopRepeat = /* @__PURE__ */ __name(() => { - if (interval) { - clearInterval(interval); - interval = null; - } - }, "stopRepeat"); + const shouldShowBadge = computed(() => !!overlayValue.value); return (_ctx, _cache) => { - const _component_i_material_symbols58pan_tool_outline = __unplugin_components_0$2; - const _component_i_simple_line_icons58cursor = __unplugin_components_1$2; const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js return openBlock(), createBlock(unref(script$9), { class: "p-buttongroup-vertical absolute bottom-[10px] right-[10px] z-[1000] pointer-events-auto" }, { default: withCtx(() => [ withDirectives(createVNode(unref(script$h), { @@ -3795,11 +5150,31 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({ withDirectives((openBlock(), createBlock(unref(script$h), { severity: "secondary", onClick: _cache[3] || (_cache[3] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLock")) +======== + return withDirectives((openBlock(), createBlock(unref(script$d), { + class: normalizeClass(props.class), + text: "", + pt: { + root: { + class: `side-bar-button ${props.selected ? "p-button-primary side-bar-button-selected" : "p-button-secondary"}`, + "aria-label": props.tooltip + } + }, + onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event)) + }, { + icon: withCtx(() => [ + shouldShowBadge.value ? (openBlock(), createBlock(unref(script$6), { + key: 0, + value: overlayValue.value +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }, { - icon: withCtx(() => [ - unref(canvasStore).canvas?.read_only ? (openBlock(), createBlock(_component_i_material_symbols58pan_tool_outline, { key: 0 })) : (openBlock(), createBlock(_component_i_simple_line_icons58cursor, { key: 1 })) + default: withCtx(() => [ + createBaseVNode("i", { + class: normalizeClass(props.icon + " side-bar-button-icon") + }, null, 2) ]), _: 1 +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js })), [ [ _directive_tooltip, @@ -3823,19 +5198,828 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({ { left: true } ] ]) +======== + }, 8, ["value"])) : (openBlock(), createElementBlock("i", { + key: 1, + class: normalizeClass(props.icon + " side-bar-button-icon") + }, null, 2)) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js ]), _: 1 - }); + }, 8, ["class", "pt"])), [ + [_directive_tooltip, { value: props.tooltip, showDelay: 300, hideDelay: 300 }] + ]); }; } }); +const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-6ab4daa6"]]); +const _sfc_main$e = /* @__PURE__ */ defineComponent({ + __name: "SidebarLogoutIcon", + setup(__props) { + const { t } = useI18n(); + const userStore = useUserStore(); + const tooltip = computed( + () => `${t("sideToolbar.logout")} (${userStore.currentUser?.username})` + ); + const logout = /* @__PURE__ */ __name(() => { + userStore.logout(); + window.location.reload(); + }, "logout"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: "pi pi-sign-out", + tooltip: tooltip.value, + onClick: logout + }, null, 8, ["tooltip"]); + }; + } +}); +const _sfc_main$d = /* @__PURE__ */ defineComponent({ + __name: "SidebarSettingsToggleIcon", + setup(__props) { + const dialogStore = useDialogStore(); + const showSetting = /* @__PURE__ */ __name(() => { + dialogStore.showDialog({ + key: "global-settings", + headerComponent: SettingDialogHeader, + component: SettingDialogContent + }); + }, "showSetting"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: "pi pi-cog", + class: "comfy-settings-btn", + onClick: showSetting, + tooltip: _ctx.$t("g.settings") + }, null, 8, ["tooltip"]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-94481f39"]]); const _sfc_main$d = /* @__PURE__ */ defineComponent({ +======== +const _sfc_main$c = /* @__PURE__ */ defineComponent({ + __name: "SidebarThemeToggleIcon", + setup(__props) { + const settingStore = useSettingStore(); + const currentTheme = computed(() => settingStore.get("Comfy.ColorPalette")); + const icon = computed( + () => currentTheme.value !== "light" ? "pi pi-moon" : "pi pi-sun" + ); + const commandStore = useCommandStore(); + const toggleTheme = /* @__PURE__ */ __name(() => { + commandStore.execute("Comfy.ToggleTheme"); + }, "toggleTheme"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: icon.value, + onClick: toggleTheme, + tooltip: _ctx.$t("sideToolbar.themeToggle"), + class: "comfy-vue-theme-toggle" + }, null, 8, ["icon", "tooltip"]); + }; + } +}); +const _withScopeId$4 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-37d8d7b4"), n = n(), popScopeId(), n), "_withScopeId$4"); +const _hoisted_1$e = { class: "side-tool-bar-end" }; +const _hoisted_2$b = { + key: 0, + class: "sidebar-content-container h-full overflow-y-auto overflow-x-hidden" +}; +const _sfc_main$b = /* @__PURE__ */ defineComponent({ + __name: "SideToolbar", + setup(__props) { + const workspaceStore = useWorkspaceStore(); + const settingStore = useSettingStore(); + const userStore = useUserStore(); + const teleportTarget = computed( + () => settingStore.get("Comfy.Sidebar.Location") === "left" ? ".comfyui-body-left" : ".comfyui-body-right" + ); + const isSmall = computed( + () => settingStore.get("Comfy.Sidebar.Size") === "small" + ); + const tabs = computed(() => workspaceStore.getSidebarTabs()); + const selectedTab = computed(() => workspaceStore.sidebarTab.activeSidebarTab); + const onTabClick = /* @__PURE__ */ __name((item3) => { + workspaceStore.sidebarTab.toggleSidebarTab(item3.id); + }, "onTabClick"); + const keybindingStore = useKeybindingStore(); + const getTabTooltipSuffix = /* @__PURE__ */ __name((tab) => { + const keybinding = keybindingStore.getKeybindingByCommandId( + `Workspace.ToggleSidebarTab.${tab.id}` + ); + return keybinding ? ` (${keybinding.combo.toString()})` : ""; + }, "getTabTooltipSuffix"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + (openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [ + createBaseVNode("nav", { + class: normalizeClass("side-tool-bar-container" + (isSmall.value ? " small-sidebar" : "")) + }, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(tabs.value, (tab) => { + return openBlock(), createBlock(SidebarIcon, { + key: tab.id, + icon: tab.icon, + iconBadge: tab.iconBadge, + tooltip: tab.tooltip + getTabTooltipSuffix(tab), + selected: tab.id === selectedTab.value?.id, + class: normalizeClass(tab.id + "-tab-button"), + onClick: /* @__PURE__ */ __name(($event) => onTabClick(tab), "onClick") + }, null, 8, ["icon", "iconBadge", "tooltip", "selected", "class", "onClick"]); + }), 128)), + createBaseVNode("div", _hoisted_1$e, [ + unref(userStore).isMultiUserServer ? (openBlock(), createBlock(_sfc_main$e, { key: 0 })) : createCommentVNode("", true), + createVNode(_sfc_main$c), + createVNode(_sfc_main$d) + ]) + ], 2) + ], 8, ["to"])), + selectedTab.value ? (openBlock(), createElementBlock("div", _hoisted_2$b, [ + createVNode(_sfc_main$p, { extension: selectedTab.value }, null, 8, ["extension"]) + ])) : createCommentVNode("", true) + ], 64); + }; + } +}); +const SideToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-37d8d7b4"]]); +const CORE_SETTINGS = [ + { + id: "Comfy.Validation.Workflows", + name: "Validate workflows", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.NodeSearchBoxImpl", + category: ["Comfy", "Node Search Box", "Implementation"], + experimental: true, + name: "Node search box implementation", + type: "combo", + options: ["default", "litegraph (legacy)"], + defaultValue: "default" + }, + { + id: "Comfy.LinkRelease.Action", + category: ["LiteGraph", "LinkRelease", "Action"], + name: "Action on link release (No modifier)", + type: "combo", + options: Object.values(LinkReleaseTriggerAction), + defaultValue: LinkReleaseTriggerAction.CONTEXT_MENU + }, + { + id: "Comfy.LinkRelease.ActionShift", + category: ["LiteGraph", "LinkRelease", "ActionShift"], + name: "Action on link release (Shift)", + type: "combo", + options: Object.values(LinkReleaseTriggerAction), + defaultValue: LinkReleaseTriggerAction.SEARCH_BOX + }, + { + id: "Comfy.NodeSearchBoxImpl.NodePreview", + category: ["Comfy", "Node Search Box", "NodePreview"], + name: "Node preview", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.NodeSearchBoxImpl.ShowCategory", + category: ["Comfy", "Node Search Box", "ShowCategory"], + name: "Show node category in search results", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.NodeSearchBoxImpl.ShowIdName", + category: ["Comfy", "Node Search Box", "ShowIdName"], + name: "Show node id name in search results", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.NodeSearchBoxImpl.ShowNodeFrequency", + category: ["Comfy", "Node Search Box", "ShowNodeFrequency"], + name: "Show node frequency in search results", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Sidebar.Location", + category: ["Appearance", "Sidebar", "Location"], + name: "Sidebar location", + type: "combo", + options: ["left", "right"], + defaultValue: "left" + }, + { + id: "Comfy.Sidebar.Size", + category: ["Appearance", "Sidebar", "Size"], + name: "Sidebar size", + type: "combo", + options: ["normal", "small"], + defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1600 ? "small" : "normal", "defaultValue") + }, + { + id: "Comfy.TextareaWidget.FontSize", + category: ["Appearance", "Node Widget", "TextareaWidget", "FontSize"], + name: "Textarea widget font size", + type: "slider", + defaultValue: 10, + attrs: { + min: 8, + max: 24 + } + }, + { + id: "Comfy.TextareaWidget.Spellcheck", + category: ["Comfy", "Node Widget", "TextareaWidget", "Spellcheck"], + name: "Textarea widget spellcheck", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Workflow.SortNodeIdOnSave", + name: "Sort node IDs when saving workflow", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Graph.CanvasInfo", + category: ["LiteGraph", "Canvas", "CanvasInfo"], + name: "Show canvas info on bottom left corner (fps, etc.)", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Node.ShowDeprecated", + name: "Show deprecated nodes in search", + tooltip: "Deprecated nodes are hidden by default in the UI, but remain functional in existing workflows that use them.", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Node.ShowExperimental", + name: "Show experimental nodes in search", + tooltip: "Experimental nodes are marked as such in the UI and may be subject to significant changes or removal in future versions. Use with caution in production workflows", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Node.Opacity", + category: ["Appearance", "Node", "Opacity"], + name: "Node opacity", + type: "slider", + defaultValue: 1, + attrs: { + min: 0.01, + max: 1, + step: 0.01 + } + }, + { + id: "Comfy.Workflow.ShowMissingNodesWarning", + name: "Show missing nodes warning", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Workflow.ShowMissingModelsWarning", + name: "Show missing models warning", + type: "boolean", + defaultValue: false, + experimental: true + }, + { + id: "Comfy.Graph.ZoomSpeed", + category: ["LiteGraph", "Canvas", "ZoomSpeed"], + name: "Canvas zoom speed", + type: "slider", + defaultValue: 1.1, + attrs: { + min: 1.01, + max: 2.5, + step: 0.01 + } + }, + // Bookmarks are stored in the settings store. + // Bookmarks are in format of category/display_name. e.g. "conditioning/CLIPTextEncode" + { + id: "Comfy.NodeLibrary.Bookmarks", + name: "Node library bookmarks with display name (deprecated)", + type: "hidden", + defaultValue: [], + deprecated: true + }, + { + id: "Comfy.NodeLibrary.Bookmarks.V2", + name: "Node library bookmarks v2 with unique name", + type: "hidden", + defaultValue: [] + }, + // Stores mapping from bookmark folder name to its customization. + { + id: "Comfy.NodeLibrary.BookmarksCustomization", + name: "Node library bookmarks customization", + type: "hidden", + defaultValue: {} + }, + // Hidden setting used by the queue for how to fit images + { + id: "Comfy.Queue.ImageFit", + name: "Queue image fit", + type: "hidden", + defaultValue: "cover" + }, + { + id: "Comfy.GroupSelectedNodes.Padding", + category: ["LiteGraph", "Group", "Padding"], + name: "Group selected nodes padding", + type: "slider", + defaultValue: 10, + attrs: { + min: 0, + max: 100 + } + }, + { + id: "Comfy.Node.DoubleClickTitleToEdit", + category: ["LiteGraph", "Node", "DoubleClickTitleToEdit"], + name: "Double click node title to edit", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Group.DoubleClickTitleToEdit", + category: ["LiteGraph", "Group", "DoubleClickTitleToEdit"], + name: "Double click group title to edit", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Window.UnloadConfirmation", + name: "Show confirmation when closing window", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.TreeExplorer.ItemPadding", + category: ["Appearance", "Tree Explorer", "ItemPadding"], + name: "Tree explorer item padding", + type: "slider", + defaultValue: 2, + attrs: { + min: 0, + max: 8, + step: 1 + } + }, + { + id: "Comfy.ModelLibrary.AutoLoadAll", + name: "Automatically load all model folders", + tooltip: "If true, all folders will load as soon as you open the model library (this may cause delays while it loads). If false, root level model folders will only load once you click on them.", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.ModelLibrary.NameFormat", + name: "What name to display in the model library tree view", + tooltip: 'Select "filename" to render a simplified view of the raw filename (without directory or ".safetensors" extension) in the model list. Select "title" to display the configurable model metadata title.', + type: "combo", + options: ["filename", "title"], + defaultValue: "title" + }, + { + id: "Comfy.Locale", + name: "Language", + type: "combo", + options: [ + { value: "en", text: "English" }, + { value: "zh", text: "中文" }, + { value: "ru", text: "Русский" }, + { value: "ja", text: "日本語" }, + { value: "ko", text: "한국어" }, + { value: "fr", text: "Français" } + ], + defaultValue: /* @__PURE__ */ __name(() => navigator.language.split("-")[0] || "en", "defaultValue") + }, + { + id: "Comfy.NodeBadge.NodeSourceBadgeMode", + category: ["LiteGraph", "Node", "NodeSourceBadgeMode"], + name: "Node source badge mode", + type: "combo", + options: Object.values(NodeBadgeMode), + defaultValue: NodeBadgeMode.HideBuiltIn + }, + { + id: "Comfy.NodeBadge.NodeIdBadgeMode", + category: ["LiteGraph", "Node", "NodeIdBadgeMode"], + name: "Node ID badge mode", + type: "combo", + options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll], + defaultValue: NodeBadgeMode.ShowAll + }, + { + id: "Comfy.NodeBadge.NodeLifeCycleBadgeMode", + category: ["LiteGraph", "Node", "NodeLifeCycleBadgeMode"], + name: "Node life cycle badge mode", + type: "combo", + options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll], + defaultValue: NodeBadgeMode.ShowAll + }, + { + id: "Comfy.ConfirmClear", + category: ["Comfy", "Workflow", "ConfirmClear"], + name: "Require confirmation when clearing workflow", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.PromptFilename", + category: ["Comfy", "Workflow", "PromptFilename"], + name: "Prompt for filename when saving workflow", + type: "boolean", + defaultValue: true + }, + /** + * file format for preview + * + * format;quality + * + * ex) + * webp;50 -> webp, quality 50 + * jpeg;80 -> rgb, jpeg, quality 80 + * + * @type {string} + */ + { + id: "Comfy.PreviewFormat", + category: ["LiteGraph", "Node Widget", "PreviewFormat"], + name: "Preview image format", + tooltip: "When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc.", + type: "text", + defaultValue: "" + }, + { + id: "Comfy.DisableSliders", + category: ["LiteGraph", "Node Widget", "DisableSliders"], + name: "Disable node widget sliders", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.DisableFloatRounding", + category: ["LiteGraph", "Node Widget", "DisableFloatRounding"], + name: "Disable default float widget rounding.", + tooltip: "(requires page reload) Cannot disable round when round is set by the node in the backend.", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.FloatRoundingPrecision", + category: ["LiteGraph", "Node Widget", "FloatRoundingPrecision"], + name: "Float widget rounding decimal places [0 = auto].", + tooltip: "(requires page reload)", + type: "slider", + attrs: { + min: 0, + max: 6, + step: 1 + }, + defaultValue: 0 + }, + { + id: "Comfy.EnableTooltips", + category: ["LiteGraph", "Node", "EnableTooltips"], + name: "Enable Tooltips", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.DevMode", + name: "Enable dev mode options (API save, etc.)", + type: "boolean", + defaultValue: false, + onChange: /* @__PURE__ */ __name((value) => { + const element = document.getElementById("comfy-dev-save-api-button"); + if (element) { + element.style.display = value ? "flex" : "none"; + } + }, "onChange") + }, + { + id: "Comfy.UseNewMenu", + category: ["Comfy", "Menu", "UseNewMenu"], + defaultValue: "Top", + name: "Use new menu", + type: "combo", + options: ["Disabled", "Top", "Bottom"], + migrateDeprecatedValue: /* @__PURE__ */ __name((value) => { + if (value === "Floating") { + return "Top"; + } + return value; + }, "migrateDeprecatedValue") + }, + { + id: "Comfy.Workflow.WorkflowTabsPosition", + name: "Opened workflows position", + type: "combo", + options: ["Sidebar", "Topbar"], + defaultValue: "Topbar" + }, + { + id: "Comfy.Graph.CanvasMenu", + category: ["LiteGraph", "Canvas", "CanvasMenu"], + name: "Show graph canvas menu", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.QueueButton.BatchCountLimit", + name: "Batch count limit", + tooltip: "The maximum number of tasks added to the queue at one button click", + type: "number", + defaultValue: 100, + versionAdded: "1.3.5" + }, + { + id: "Comfy.Keybinding.UnsetBindings", + name: "Keybindings unset by the user", + type: "hidden", + defaultValue: [], + versionAdded: "1.3.7" + }, + { + id: "Comfy.Keybinding.NewBindings", + name: "Keybindings set by the user", + type: "hidden", + defaultValue: [], + versionAdded: "1.3.7" + }, + { + id: "Comfy.Extension.Disabled", + name: "Disabled extension names", + type: "hidden", + defaultValue: [], + versionAdded: "1.3.11" + }, + { + id: "Comfy.Validation.NodeDefs", + name: "Validate node definitions (slow)", + type: "boolean", + tooltip: "Recommended for node developers. This will validate all node definitions on startup.", + defaultValue: false, + versionAdded: "1.3.14" + }, + { + id: "Comfy.LinkRenderMode", + category: ["LiteGraph", "Graph", "LinkRenderMode"], + name: "Link Render Mode", + defaultValue: 2, + type: "combo", + options: [ + { value: LiteGraph.STRAIGHT_LINK, text: "Straight" }, + { value: LiteGraph.LINEAR_LINK, text: "Linear" }, + { value: LiteGraph.SPLINE_LINK, text: "Spline" }, + { value: LiteGraph.HIDDEN_LINK, text: "Hidden" } + ] + }, + { + id: "Comfy.Node.AutoSnapLinkToSlot", + category: ["LiteGraph", "Node", "AutoSnapLinkToSlot"], + name: "Auto snap link to node slot", + tooltip: "When dragging a link over a node, the link automatically snap to a viable input slot on the node", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.29" + }, + { + id: "Comfy.Node.SnapHighlightsNode", + category: ["LiteGraph", "Node", "SnapHighlightsNode"], + name: "Snap highlights node", + tooltip: "When dragging a link over a node with viable input slot, highlight the node", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.29" + }, + { + id: "Comfy.Node.BypassAllLinksOnDelete", + category: ["LiteGraph", "Node", "BypassAllLinksOnDelete"], + name: "Keep all links when deleting nodes", + tooltip: "When deleting a node, attempt to reconnect all of its input and output links (bypassing the deleted node)", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.40" + }, + { + id: "Comfy.Node.MiddleClickRerouteNode", + category: ["LiteGraph", "Node", "MiddleClickRerouteNode"], + name: "Middle-click creates a new Reroute node", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.42" + }, + { + id: "Comfy.RerouteBeta", + category: ["LiteGraph", "RerouteBeta"], + name: "Opt-in to the reroute beta test", + tooltip: "Enables the new native reroutes.\n\nReroutes can be added by holding alt and dragging from a link line, or on the link menu.\n\nDisabling this option is non-destructive - reroutes are hidden.", + experimental: true, + type: "boolean", + defaultValue: false, + versionAdded: "1.3.42" + }, + { + id: "Comfy.Graph.LinkMarkers", + category: ["LiteGraph", "Link", "LinkMarkers"], + name: "Link midpoint markers", + defaultValue: LinkMarkerShape.Circle, + type: "combo", + options: [ + { value: LinkMarkerShape.None, text: "None" }, + { value: LinkMarkerShape.Circle, text: "Circle" }, + { value: LinkMarkerShape.Arrow, text: "Arrow" } + ], + versionAdded: "1.3.42" + }, + { + id: "Comfy.DOMClippingEnabled", + category: ["LiteGraph", "Node", "DOMClippingEnabled"], + name: "Enable DOM element clipping (enabling may reduce performance)", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Graph.CtrlShiftZoom", + category: ["LiteGraph", "Canvas", "CtrlShiftZoom"], + name: "Enable fast-zoom shortcut (Ctrl + Shift + Drag)", + type: "boolean", + defaultValue: true, + versionAdded: "1.4.0" + }, + { + id: "Comfy.Pointer.ClickDrift", + category: ["LiteGraph", "Pointer", "ClickDrift"], + name: "Pointer click drift (maximum distance)", + tooltip: "If the pointer moves more than this distance while holding a button down, it is considered dragging (rather than clicking).\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.", + experimental: true, + type: "slider", + attrs: { + min: 0, + max: 20, + step: 1 + }, + defaultValue: 6, + versionAdded: "1.4.3" + }, + { + id: "Comfy.Pointer.ClickBufferTime", + category: ["LiteGraph", "Pointer", "ClickBufferTime"], + name: "Pointer click drift delay", + tooltip: "After pressing a pointer button down, this is the maximum time (in milliseconds) that pointer movement can be ignored for.\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.", + experimental: true, + type: "slider", + attrs: { + min: 0, + max: 1e3, + step: 25 + }, + defaultValue: 150, + versionAdded: "1.4.3" + }, + { + id: "Comfy.Pointer.DoubleClickTime", + category: ["LiteGraph", "Pointer", "DoubleClickTime"], + name: "Double click interval (maximum)", + tooltip: "The maximum time in milliseconds between the two clicks of a double-click. Increasing this value may assist if double-clicks are sometimes not registered.", + type: "slider", + attrs: { + min: 100, + max: 1e3, + step: 50 + }, + defaultValue: 300, + versionAdded: "1.4.3" + }, + { + id: "Comfy.SnapToGrid.GridSize", + category: ["LiteGraph", "Canvas", "GridSize"], + name: "Snap to grid size", + type: "slider", + attrs: { + min: 1, + max: 500 + }, + tooltip: "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid.", + defaultValue: LiteGraph.CANVAS_GRID_SIZE + }, + // Keep the 'pysssss.SnapToGrid' setting id so we don't need to migrate setting values. + // Using a new setting id can cause existing users to lose their existing settings. + { + id: "pysssss.SnapToGrid", + category: ["LiteGraph", "Canvas", "AlwaysSnapToGrid"], + name: "Always snap to grid", + type: "boolean", + defaultValue: false, + versionAdded: "1.3.13" + }, + { + id: "Comfy.Server.ServerConfigValues", + name: "Server config values for frontend display", + tooltip: "Server config values used for frontend display only", + type: "hidden", + // Mapping from server config id to value. + defaultValue: {}, + versionAdded: "1.4.8" + }, + { + id: "Comfy.Server.LaunchArgs", + name: "Server launch arguments", + tooltip: "These are the actual arguments that are passed to the server when it is launched.", + type: "hidden", + defaultValue: {}, + versionAdded: "1.4.8" + }, + { + id: "Comfy.Queue.MaxHistoryItems", + name: "Queue history size", + tooltip: "The maximum number of tasks that show in the queue history.", + type: "slider", + attrs: { + min: 16, + max: 256, + step: 16 + }, + defaultValue: 64, + versionAdded: "1.4.12" + }, + { + id: "LiteGraph.Canvas.MaximumFps", + name: "Maxium FPS", + tooltip: "The maximum frames per second that the canvas is allowed to render. Caps GPU usage at the cost of smoothness. If 0, the screen refresh rate is used. Default: 0", + type: "slider", + attrs: { + min: 0, + max: 120 + }, + defaultValue: 0, + versionAdded: "1.5.1" + }, + { + id: "Comfy.EnableWorkflowViewRestore", + category: ["Comfy", "Workflow", "EnableWorkflowViewRestore"], + name: "Save and restore canvas position and zoom level in workflows", + type: "boolean", + defaultValue: true, + versionModified: "1.5.4" + }, + { + id: "Comfy.Workflow.ConfirmDelete", + name: "Show confirmation when deleting workflows", + type: "boolean", + defaultValue: true, + versionAdded: "1.5.6" + }, + { + id: "Comfy.ColorPalette", + name: "The active color palette id", + type: "hidden", + defaultValue: "dark", + versionModified: "1.6.7", + migrateDeprecatedValue(value) { + return value.startsWith("custom_") ? value.replace("custom_", "") : value; + } + }, + { + id: "Comfy.CustomColorPalettes", + name: "Custom color palettes", + type: "hidden", + defaultValue: {}, + versionModified: "1.6.7" + }, + { + id: "Comfy.WidgetControlMode", + category: ["Comfy", "Node Widget", "WidgetControlMode"], + name: "Widget control mode", + tooltip: "Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.", + type: "combo", + defaultValue: "after", + options: ["before", "after"], + versionModified: "1.6.10" + } +]; +const _sfc_main$a = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js __name: "GraphCanvas", emits: ["ready"], setup(__props, { emit: __emit }) { const emit = __emit; const canvasRef = ref(null); + const litegraphService = useLitegraphService(); const settingStore = useSettingStore(); const nodeDefStore = useNodeDefStore(); const workspaceStore = useWorkspaceStore(); @@ -3945,18 +6129,41 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({ watchEffect(() => { LiteGraph.alwaysSnapToGrid = settingStore.get("pysssss.SnapToGrid"); }); - watchEffect(() => { - if (!canvasStore.canvas) return; - if (canvasStore.canvas.state.draggingCanvas) { - canvasStore.canvas.canvas.style.cursor = "grabbing"; - return; + watch( + () => settingStore.get("Comfy.WidgetControlMode"), + () => { + if (!canvasStore.canvas) return; + for (const n of app.graph.nodes) { + if (!n.widgets) continue; + for (const w of n.widgets) { + if (w[IS_CONTROL_WIDGET]) { + updateControlWidgetLabel(w); + if (w.linkedWidgets) { + for (const l of w.linkedWidgets) { + updateControlWidgetLabel(l); + } + } + } + } + } + app.graph.setDirtyCanvas(true); } - if (canvasStore.canvas.state.readOnly) { - canvasStore.canvas.canvas.style.cursor = "grab"; - return; + ); + const colorPaletteService = useColorPaletteService(); + const colorPaletteStore = useColorPaletteStore(); + watch( + [() => canvasStore.canvas, () => settingStore.get("Comfy.ColorPalette")], + ([canvas, currentPaletteId]) => { + if (!canvas) return; + colorPaletteService.loadColorPalette(currentPaletteId); } - canvasStore.canvas.canvas.style.cursor = "default"; - }); + ); + watch( + () => colorPaletteStore.activePaletteId, + (newValue) => { + settingStore.set("Comfy.ColorPalette", newValue); + } + ); const workflowStore = useWorkflowStore(); const persistCurrentWorkflow = /* @__PURE__ */ __name(() => { const workflow = JSON.stringify(app.serializeGraph()); @@ -3985,7 +6192,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({ loc.clientX - 20, loc.clientY ]); - app.addNodeOnGraph(nodeDef, { pos }); + litegraphService.addNodeOnGraph(nodeDef, { pos }); } else if (node.data instanceof ComfyModelDef) { const model = node.data; const pos = app.clientPosToCanvasPos([loc.clientX, loc.clientY]); @@ -4006,9 +6213,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({ if (!targetGraphNode) { const provider = modelToNodeStore.getNodeProvider(model.directory); if (provider) { - targetGraphNode = app.addNodeOnGraph(provider.nodeDef, { - pos - }); + targetGraphNode = litegraphService.addNodeOnGraph( + provider.nodeDef, + { + pos + } + ); targetProvider = provider; } } @@ -4038,6 +6248,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({ app.vueAppReady = true; workspaceStore.spinner = true; ChangeTracker.init(app); + await settingStore.loadSettingValues(); + CORE_SETTINGS.forEach((setting) => { + settingStore.addSetting(setting); + }); await app.setup(canvasRef.value); canvasStore.canvas = app.canvas; canvasStore.canvas.render_canvas_border = false; @@ -4045,11 +6259,14 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({ window["app"] = app; window["graph"] = app.graph; comfyAppReady.value = true; + colorPaletteStore.customPalettes = settingStore.get( + "Comfy.CustomColorPalettes" + ); watch( () => settingStore.get("Comfy.Locale"), async () => { await useCommandStore().execute("Comfy.RefreshNodeDefinitions"); - workflowService.reloadCurrentWorkflow(); + useWorkflowService().reloadCurrentWorkflow(); } ); emit("ready"); @@ -4062,7 +6279,11 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({ createVNode(SideToolbar) ]), "bottom-panel": withCtx(() => [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(_sfc_main$m) +======== + createVNode(_sfc_main$o) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js ]), "graph-canvas-panel": withCtx(() => [ canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { key: 0 })) : createCommentVNode("", true) @@ -4080,11 +6301,16 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({ ])), createVNode(_sfc_main$h), tooltipEnabled.value ? (openBlock(), createBlock(NodeTooltip, { key: 0 })) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(_sfc_main$f) +======== + createVNode(_sfc_main$m) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js ], 64); }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const _sfc_main$c = /* @__PURE__ */ defineComponent({ __name: "MenuHamburger", setup(__props) { @@ -4130,6 +6356,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({ } }); const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-962c4073"]]); +======== +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js function _typeof$3(o) { "@babel/helpers - typeof"; return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { @@ -4159,7 +6387,7 @@ function _toPrimitive$3(t, r) { return ("string" === r ? String : Number)(t); } __name(_toPrimitive$3, "_toPrimitive$3"); -var theme$4 = /* @__PURE__ */ __name(function theme5(_ref) { +var theme$3 = /* @__PURE__ */ __name(function theme5(_ref) { var dt = _ref.dt; return "\n.p-toast {\n width: ".concat(dt("toast.width"), ";\n white-space: pre-line;\n word-break: break-word;\n}\n\n.p-toast-message {\n margin: 0 0 1rem 0;\n}\n\n.p-toast-message-icon {\n flex-shrink: 0;\n font-size: ").concat(dt("toast.icon.size"), ";\n width: ").concat(dt("toast.icon.size"), ";\n height: ").concat(dt("toast.icon.size"), ";\n}\n\n.p-toast-message-content {\n display: flex;\n align-items: flex-start;\n padding: ").concat(dt("toast.content.padding"), ";\n gap: ").concat(dt("toast.content.gap"), ";\n}\n\n.p-toast-message-text {\n flex: 1 1 auto;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("toast.text.gap"), ";\n}\n\n.p-toast-summary {\n font-weight: ").concat(dt("toast.summary.font.weight"), ";\n font-size: ").concat(dt("toast.summary.font.size"), ";\n}\n\n.p-toast-detail {\n font-weight: ").concat(dt("toast.detail.font.weight"), ";\n font-size: ").concat(dt("toast.detail.font.size"), ";\n}\n\n.p-toast-close-button {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n background: transparent;\n transition: background ").concat(dt("toast.transition.duration"), ", color ").concat(dt("toast.transition.duration"), ", outline-color ").concat(dt("toast.transition.duration"), ", box-shadow ").concat(dt("toast.transition.duration"), ";\n outline-color: transparent;\n color: inherit;\n width: ").concat(dt("toast.close.button.width"), ";\n height: ").concat(dt("toast.close.button.height"), ";\n border-radius: ").concat(dt("toast.close.button.border.radius"), ";\n margin: -25% 0 0 0;\n right: -25%;\n padding: 0;\n border: none;\n user-select: none;\n}\n\n.p-toast-close-button:dir(rtl) {\n margin: -25% 0 0 auto;\n left: -25%;\n right: auto;\n}\n\n.p-toast-message-info,\n.p-toast-message-success,\n.p-toast-message-warn,\n.p-toast-message-error,\n.p-toast-message-secondary,\n.p-toast-message-contrast {\n border-width: ").concat(dt("toast.border.width"), ";\n border-style: solid;\n backdrop-filter: blur(").concat(dt("toast.blur"), ");\n border-radius: ").concat(dt("toast.border.radius"), ";\n}\n\n.p-toast-close-icon {\n font-size: ").concat(dt("toast.close.icon.size"), ";\n width: ").concat(dt("toast.close.icon.size"), ";\n height: ").concat(dt("toast.close.icon.size"), ";\n}\n\n.p-toast-close-button:focus-visible {\n outline-width: ").concat(dt("focus.ring.width"), ";\n outline-style: ").concat(dt("focus.ring.style"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-toast-message-info {\n background: ").concat(dt("toast.info.background"), ";\n border-color: ").concat(dt("toast.info.border.color"), ";\n color: ").concat(dt("toast.info.color"), ";\n box-shadow: ").concat(dt("toast.info.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-detail {\n color: ").concat(dt("toast.info.detail.color"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.info.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.info.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:hover {\n background: ").concat(dt("toast.info.close.button.hover.background"), ";\n}\n\n.p-toast-message-success {\n background: ").concat(dt("toast.success.background"), ";\n border-color: ").concat(dt("toast.success.border.color"), ";\n color: ").concat(dt("toast.success.color"), ";\n box-shadow: ").concat(dt("toast.success.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-detail {\n color: ").concat(dt("toast.success.detail.color"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.success.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.success.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:hover {\n background: ").concat(dt("toast.success.close.button.hover.background"), ";\n}\n\n.p-toast-message-warn {\n background: ").concat(dt("toast.warn.background"), ";\n border-color: ").concat(dt("toast.warn.border.color"), ";\n color: ").concat(dt("toast.warn.color"), ";\n box-shadow: ").concat(dt("toast.warn.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-detail {\n color: ").concat(dt("toast.warn.detail.color"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.warn.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.warn.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:hover {\n background: ").concat(dt("toast.warn.close.button.hover.background"), ";\n}\n\n.p-toast-message-error {\n background: ").concat(dt("toast.error.background"), ";\n border-color: ").concat(dt("toast.error.border.color"), ";\n color: ").concat(dt("toast.error.color"), ";\n box-shadow: ").concat(dt("toast.error.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-detail {\n color: ").concat(dt("toast.error.detail.color"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.error.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.error.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:hover {\n background: ").concat(dt("toast.error.close.button.hover.background"), ";\n}\n\n.p-toast-message-secondary {\n background: ").concat(dt("toast.secondary.background"), ";\n border-color: ").concat(dt("toast.secondary.border.color"), ";\n color: ").concat(dt("toast.secondary.color"), ";\n box-shadow: ").concat(dt("toast.secondary.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-detail {\n color: ").concat(dt("toast.secondary.detail.color"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.secondary.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.secondary.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:hover {\n background: ").concat(dt("toast.secondary.close.button.hover.background"), ";\n}\n\n.p-toast-message-contrast {\n background: ").concat(dt("toast.contrast.background"), ";\n border-color: ").concat(dt("toast.contrast.border.color"), ";\n color: ").concat(dt("toast.contrast.color"), ";\n box-shadow: ").concat(dt("toast.contrast.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-detail {\n color: ").concat(dt("toast.contrast.detail.color"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.contrast.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.contrast.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:hover {\n background: ").concat(dt("toast.contrast.close.button.hover.background"), ";\n}\n\n.p-toast-top-center {\n transform: translateX(-50%);\n}\n\n.p-toast-bottom-center {\n transform: translateX(-50%);\n}\n\n.p-toast-center {\n min-width: 20vw;\n transform: translate(-50%, -50%);\n}\n\n.p-toast-message-enter-from {\n opacity: 0;\n transform: translateY(50%);\n}\n\n.p-toast-message-leave-from {\n max-height: 1000px;\n}\n\n.p-toast .p-toast-message.p-toast-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin-bottom: 0;\n overflow: hidden;\n}\n\n.p-toast-message-enter-active {\n transition: transform 0.3s, opacity 0.3s;\n}\n\n.p-toast-message-leave-active {\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;\n}\n"); }, "theme"); @@ -4175,7 +6403,7 @@ var inlineStyles$2 = { }; }, "root") }; -var classes$4 = { +var classes$3 = { root: /* @__PURE__ */ __name(function root7(_ref3) { var props = _ref3.props; return ["p-toast p-component p-toast-" + props.position]; @@ -4204,8 +6432,8 @@ var classes$4 = { }; var ToastStyle = BaseStyle.extend({ name: "toast", - theme: theme$4, - classes: classes$4, + theme: theme$3, + classes: classes$3, inlineStyles: inlineStyles$2 }); var script$8 = { @@ -4254,7 +6482,11 @@ __name(render$b, "render$b"); script$7.render = render$b; var script$2$2 = { name: "BaseToast", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js props: { group: { type: String, @@ -4309,10 +6541,14 @@ var script$2$2 = { }; }, "provide") }; -var script$1$4 = { +var script$1$3 = { name: "ToastMessage", hostName: "Toast", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js emits: ["close"], closeTimeout: null, props: { @@ -4384,10 +6620,17 @@ var script$1$4 = { computed: { iconComponent: /* @__PURE__ */ __name(function iconComponent() { return { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js info: !this.infoIcon && script$7, success: !this.successIcon && script$w, warn: !this.warnIcon && script$8, error: !this.errorIcon && script$x +======== + info: !this.infoIcon && script$r, + success: !this.successIcon && script$s, + warn: !this.warnIcon && script$t, + error: !this.errorIcon && script$u +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }[this.message.severity]; }, "iconComponent"), closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() { @@ -4395,11 +6638,19 @@ var script$1$4 = { }, "closeAriaLabel") }, components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js TimesIcon: script$y, InfoCircleIcon: script$7, CheckIcon: script$w, ExclamationTriangleIcon: script$8, TimesCircleIcon: script$x +======== + TimesIcon: script$v, + InfoCircleIcon: script$r, + CheckIcon: script$s, + ExclamationTriangleIcon: script$t, + TimesCircleIcon: script$u +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }, directives: { ripple: Ripple @@ -4457,8 +6708,8 @@ function _toPrimitive$1(t, r) { return ("string" === r ? String : Number)(t); } __name(_toPrimitive$1, "_toPrimitive$1"); -var _hoisted_1$e = ["aria-label"]; -function render$1$3(_ctx, _cache, $props, $setup, $data, $options) { +var _hoisted_1$d = ["aria-label"]; +function render$1$2(_ctx, _cache, $props, $setup, $data, $options) { var _directive_ripple = resolveDirective("ripple"); return openBlock(), createElementBlock("div", mergeProps({ "class": [_ctx.cx("message"), $props.message.styleClass], @@ -4497,10 +6748,10 @@ function render$1$3(_ctx, _cache, $props, $setup, $data, $options) { autofocus: "" }, _objectSpread$1(_objectSpread$1({}, $props.closeButtonProps), _ctx.ptm("closeButton"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.closeicon || "TimesIcon"), mergeProps({ "class": [_ctx.cx("closeIcon"), $props.closeIcon] - }, _ctx.ptm("closeIcon")), null, 16, ["class"]))], 16, _hoisted_1$e)), [[_directive_ripple]])], 16)) : createCommentVNode("", true)], 16))], 16); + }, _ctx.ptm("closeIcon")), null, 16, ["class"]))], 16, _hoisted_1$d)), [[_directive_ripple]])], 16)) : createCommentVNode("", true)], 16))], 16); } -__name(render$1$3, "render$1$3"); -script$1$4.render = render$1$3; +__name(render$1$2, "render$1$2"); +script$1$3.render = render$1$2; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } @@ -4532,7 +6783,7 @@ function _arrayLikeToArray(r, a) { } __name(_arrayLikeToArray, "_arrayLikeToArray"); var messageIdx = 0; -var script$6 = { +var script$5 = { name: "Toast", "extends": script$2$2, inheritAttrs: false, @@ -4638,8 +6889,13 @@ var script$6 = { }, "destroyStyle") }, components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js ToastMessage: script$1$4, Portal: script$p +======== + ToastMessage: script$1$3, + Portal: script$k +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } }; function _typeof$2(o) { @@ -4738,8 +6994,13 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) { }); } __name(render$a, "render$a"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js script$6.render = render$a; const _sfc_main$b = /* @__PURE__ */ defineComponent({ +======== +script$5.render = render$a; +const _sfc_main$9 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js __name: "GlobalToast", setup(__props) { const toast = useToast(); @@ -4809,10 +7070,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({ { immediate: true } ); return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$6)); + return openBlock(), createBlock(unref(script$5)); }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const _sfc_main$a = /* @__PURE__ */ defineComponent({ __name: "UnloadWindowConfirmDialog", setup(__props) { @@ -6386,10 +8648,14 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) { __name(render$8, "render$8"); script$4.render = render$8; const _hoisted_1$9 = { +======== +const _hoisted_1$c = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js viewBox: "0 0 24 24", width: "1.2em", height: "1.2em" }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js function render$7(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$9, _cache[0] || (_cache[0] = [ createBaseVNode("path", { @@ -6401,14 +8667,30 @@ function render$7(_ctx, _cache) { d: "M6 4v16m4-16l10 8l-10 8z" }, null, -1) ])); +======== +const _hoisted_2$a = /* @__PURE__ */ createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "M6 4v16m4-16l10 8l-10 8z" +}, null, -1); +const _hoisted_3$9 = [ + _hoisted_2$a +]; +function render$9(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$c, [..._hoisted_3$9]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } -__name(render$7, "render$7"); -const __unplugin_components_3 = markRaw({ name: "lucide-step-forward", render: render$7 }); -const _hoisted_1$8 = { +__name(render$9, "render$9"); +const __unplugin_components_3 = markRaw({ name: "lucide-step-forward", render: render$9 }); +const _hoisted_1$b = { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em" }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js function render$6(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$8, _cache[0] || (_cache[0] = [ createBaseVNode("path", { @@ -6420,14 +8702,30 @@ function render$6(_ctx, _cache) { d: "m13 19l9-7l-9-7zM2 19l9-7l-9-7z" }, null, -1) ])); +======== +const _hoisted_2$9 = /* @__PURE__ */ createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m13 19l9-7l-9-7zM2 19l9-7l-9-7z" +}, null, -1); +const _hoisted_3$8 = [ + _hoisted_2$9 +]; +function render$8(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$b, [..._hoisted_3$8]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } -__name(render$6, "render$6"); -const __unplugin_components_2 = markRaw({ name: "lucide-fast-forward", render: render$6 }); -const _hoisted_1$7 = { +__name(render$8, "render$8"); +const __unplugin_components_2 = markRaw({ name: "lucide-fast-forward", render: render$8 }); +const _hoisted_1$a = { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em" }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js function render$5(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$7, _cache[0] || (_cache[0] = [ createBaseVNode("path", { @@ -6439,14 +8737,30 @@ function render$5(_ctx, _cache) { d: "m6 3l14 9l-14 9z" }, null, -1) ])); +======== +const _hoisted_2$8 = /* @__PURE__ */ createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m6 3l14 9l-14 9z" +}, null, -1); +const _hoisted_3$7 = [ + _hoisted_2$8 +]; +function render$7(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$a, [..._hoisted_3$7]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } -__name(render$5, "render$5"); -const __unplugin_components_1$1 = markRaw({ name: "lucide-play", render: render$5 }); -const _hoisted_1$6 = { +__name(render$7, "render$7"); +const __unplugin_components_1$1 = markRaw({ name: "lucide-play", render: render$7 }); +const _hoisted_1$9 = { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em" }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js function render$4(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [ createBaseVNode("g", { @@ -6460,24 +8774,48 @@ function render$4(_ctx, _cache) { createBaseVNode("path", { d: "m16 8l-2-2l2-2" }) ], -1) ])); +======== +const _hoisted_2$7 = /* @__PURE__ */ createBaseVNode("g", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2" +}, [ + /* @__PURE__ */ createBaseVNode("path", { d: "M16 12H3m13 6H3m7-12H3m18 12V8a2 2 0 0 0-2-2h-5" }), + /* @__PURE__ */ createBaseVNode("path", { d: "m16 8l-2-2l2-2" }) +], -1); +const _hoisted_3$6 = [ + _hoisted_2$7 +]; +function render$6(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._hoisted_3$6]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } -__name(render$4, "render$4"); -const __unplugin_components_0$1 = markRaw({ name: "lucide-list-start", render: render$4 }); -var theme$1 = /* @__PURE__ */ __name(function theme8(_ref) { +__name(render$6, "render$6"); +const __unplugin_components_0$1 = markRaw({ name: "lucide-list-start", render: render$6 }); +var theme$2 = /* @__PURE__ */ __name(function theme6(_ref) { var dt = _ref.dt; return "\n.p-tieredmenu {\n background: ".concat(dt("tieredmenu.background"), ";\n color: ").concat(dt("tieredmenu.color"), ";\n border: 1px solid ").concat(dt("tieredmenu.border.color"), ";\n border-radius: ").concat(dt("tieredmenu.border.radius"), ";\n min-width: 12.5rem;\n}\n\n.p-tieredmenu-root-list,\n.p-tieredmenu-submenu {\n margin: 0;\n padding: ").concat(dt("tieredmenu.list.padding"), ";\n list-style: none;\n outline: 0 none;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("tieredmenu.list.gap"), ";\n}\n\n.p-tieredmenu-submenu {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n background: ").concat(dt("tieredmenu.background"), ";\n color: ").concat(dt("tieredmenu.color"), ";\n border: 1px solid ").concat(dt("tieredmenu.border.color"), ";\n border-radius: ").concat(dt("tieredmenu.border.radius"), ";\n box-shadow: ").concat(dt("tieredmenu.shadow"), ";\n}\n\n.p-tieredmenu-item {\n position: relative;\n}\n\n.p-tieredmenu-item-content {\n transition: background ").concat(dt("tieredmenu.transition.duration"), ", color ").concat(dt("tieredmenu.transition.duration"), ";\n border-radius: ").concat(dt("tieredmenu.item.border.radius"), ";\n color: ").concat(dt("tieredmenu.item.color"), ";\n}\n\n.p-tieredmenu-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ").concat(dt("tieredmenu.item.padding"), ";\n gap: ").concat(dt("tieredmenu.item.gap"), ";\n user-select: none;\n outline: 0 none;\n}\n\n.p-tieredmenu-item-label {\n line-height: 1;\n}\n\n.p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.color"), ";\n}\n\n.p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.color"), ";\n margin-left: auto;\n font-size: ").concat(dt("tieredmenu.submenu.icon.size"), ";\n width: ").concat(dt("tieredmenu.submenu.icon.size"), ";\n height: ").concat(dt("tieredmenu.submenu.icon.size"), ";\n}\n\n.p-tieredmenu-submenu-icon:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n}\n\n.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content {\n color: ").concat(dt("tieredmenu.item.focus.color"), ";\n background: ").concat(dt("tieredmenu.item.focus.background"), ";\n}\n\n.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover {\n color: ").concat(dt("tieredmenu.item.focus.color"), ";\n background: ").concat(dt("tieredmenu.item.focus.background"), ";\n}\n\n.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item-active > .p-tieredmenu-item-content {\n color: ").concat(dt("tieredmenu.item.active.color"), ";\n background: ").concat(dt("tieredmenu.item.active.background"), ";\n}\n\n.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.active.color"), ";\n}\n\n.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.active.color"), ";\n}\n\n.p-tieredmenu-separator {\n border-block-start: 1px solid ").concat(dt("tieredmenu.separator.border.color"), ";\n}\n\n.p-tieredmenu-overlay {\n box-shadow: ").concat(dt("tieredmenu.shadow"), ";\n}\n\n.p-tieredmenu-enter-from,\n.p-tieredmenu-leave-active {\n opacity: 0;\n}\n\n.p-tieredmenu-enter-active {\n transition: opacity 250ms;\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-submenu {\n position: static;\n box-shadow: none;\n border: 0 none;\n padding-inline-start: ").concat(dt("tieredmenu.submenu.mobile.indent"), ";\n padding-inline-end: 0;\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-submenu:dir(rtl) {\n padding-inline-start: 0;\n padding-inline-end: ").concat(dt("tieredmenu.submenu.mobile.indent"), ";\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-submenu-icon {\n transition: transform 0.2s;\n transform: rotate(90deg);\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {\n transform: rotate(-90deg);\n}\n"); }, "theme"); -var inlineStyles = { - submenu: /* @__PURE__ */ __name(function submenu2(_ref2) { +var inlineStyles$1 = { + submenu: /* @__PURE__ */ __name(function submenu(_ref2) { var instance = _ref2.instance, processedItem = _ref2.processedItem; return { display: instance.isItemActive(processedItem) ? "flex" : "none" }; }, "submenu") }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js var classes$1 = { root: /* @__PURE__ */ __name(function root10(_ref3) { var props = _ref3.props, instance = _ref3.instance; +======== +var classes$2 = { + root: /* @__PURE__ */ __name(function root8(_ref3) { + _ref3.instance; + var props = _ref3.props; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js return ["p-tieredmenu p-component", { "p-tieredmenu-overlay": props.popup, "p-tieredmenu-mobile": instance.queryMatches @@ -6485,7 +8823,7 @@ var classes$1 = { }, "root"), start: "p-tieredmenu-start", rootList: "p-tieredmenu-root-list", - item: /* @__PURE__ */ __name(function item2(_ref4) { + item: /* @__PURE__ */ __name(function item(_ref4) { var instance = _ref4.instance, processedItem = _ref4.processedItem; return ["p-tieredmenu-item", { "p-tieredmenu-item-active": instance.isItemActive(processedItem), @@ -6504,13 +8842,17 @@ var classes$1 = { }; var TieredMenuStyle = BaseStyle.extend({ name: "tieredmenu", - theme: theme$1, - classes: classes$1, - inlineStyles + theme: theme$2, + classes: classes$2, + inlineStyles: inlineStyles$1 }); -var script$2 = { +var script$2$1 = { name: "BaseTieredMenu", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js props: { popup: { type: Boolean, @@ -6554,17 +8896,21 @@ var script$2 = { } }, style: TieredMenuStyle, - provide: /* @__PURE__ */ __name(function provide12() { + provide: /* @__PURE__ */ __name(function provide10() { return { $pcTieredMenu: this, $parentInstance: this }; }, "provide") }; -var script$1$1 = { +var script$1$2 = { name: "TieredMenuSub", hostName: "TieredMenu", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js emits: ["item-click", "item-mouseenter", "item-mousemove"], container: null, props: { @@ -6602,22 +8948,22 @@ var script$1$1 = { } }, methods: { - getItemId: /* @__PURE__ */ __name(function getItemId2(processedItem) { + getItemId: /* @__PURE__ */ __name(function getItemId(processedItem) { return "".concat(this.menuId, "_").concat(processedItem.key); }, "getItemId"), - getItemKey: /* @__PURE__ */ __name(function getItemKey2(processedItem) { + getItemKey: /* @__PURE__ */ __name(function getItemKey(processedItem) { return this.getItemId(processedItem); }, "getItemKey"), - getItemProp: /* @__PURE__ */ __name(function getItemProp3(processedItem, name, params) { + getItemProp: /* @__PURE__ */ __name(function getItemProp(processedItem, name, params) { return processedItem && processedItem.item ? resolve(processedItem.item[name], params) : void 0; }, "getItemProp"), - getItemLabel: /* @__PURE__ */ __name(function getItemLabel3(processedItem) { + getItemLabel: /* @__PURE__ */ __name(function getItemLabel(processedItem) { return this.getItemProp(processedItem, "label"); }, "getItemLabel"), - getItemLabelId: /* @__PURE__ */ __name(function getItemLabelId2(processedItem) { + getItemLabelId: /* @__PURE__ */ __name(function getItemLabelId(processedItem) { return "".concat(this.menuId, "_").concat(processedItem.key, "_label"); }, "getItemLabelId"), - getPTOptions: /* @__PURE__ */ __name(function getPTOptions5(processedItem, index, key) { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions4(processedItem, index, key) { return this.ptm(key, { context: { item: processedItem.item, @@ -6628,27 +8974,27 @@ var script$1$1 = { } }); }, "getPTOptions"), - isItemActive: /* @__PURE__ */ __name(function isItemActive2(processedItem) { + isItemActive: /* @__PURE__ */ __name(function isItemActive(processedItem) { return this.activeItemPath.some(function(path) { return path.key === processedItem.key; }); }, "isItemActive"), - isItemVisible: /* @__PURE__ */ __name(function isItemVisible3(processedItem) { + isItemVisible: /* @__PURE__ */ __name(function isItemVisible(processedItem) { return this.getItemProp(processedItem, "visible") !== false; }, "isItemVisible"), - isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled3(processedItem) { + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled(processedItem) { return this.getItemProp(processedItem, "disabled"); }, "isItemDisabled"), - isItemFocused: /* @__PURE__ */ __name(function isItemFocused2(processedItem) { + isItemFocused: /* @__PURE__ */ __name(function isItemFocused(processedItem) { return this.focusedItemId === this.getItemId(processedItem); }, "isItemFocused"), - isItemGroup: /* @__PURE__ */ __name(function isItemGroup3(processedItem) { + isItemGroup: /* @__PURE__ */ __name(function isItemGroup(processedItem) { return isNotEmpty(processedItem.items); }, "isItemGroup"), onEnter: /* @__PURE__ */ __name(function onEnter2() { nestedPosition(this.container, this.level); }, "onEnter"), - onItemClick: /* @__PURE__ */ __name(function onItemClick3(event, processedItem) { + onItemClick: /* @__PURE__ */ __name(function onItemClick(event, processedItem) { this.getItemProp(processedItem, "command", { originalEvent: event, item: processedItem.item @@ -6659,31 +9005,31 @@ var script$1$1 = { isFocus: true }); }, "onItemClick"), - onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter3(event, processedItem) { + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter(event, processedItem) { this.$emit("item-mouseenter", { originalEvent: event, processedItem }); }, "onItemMouseEnter"), - onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove3(event, processedItem) { + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove(event, processedItem) { this.$emit("item-mousemove", { originalEvent: event, processedItem }); }, "onItemMouseMove"), - getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize2() { + getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize() { var _this = this; return this.items.filter(function(processedItem) { return _this.isItemVisible(processedItem) && !_this.getItemProp(processedItem, "separator"); }).length; }, "getAriaSetSize"), - getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset3(index) { + getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset2(index) { var _this2 = this; return index - this.items.slice(0, index).filter(function(processedItem) { return _this2.isItemVisible(processedItem) && _this2.getItemProp(processedItem, "separator"); }).length + 1; }, "getAriaPosInset"), - getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps2(processedItem, index) { + getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps(processedItem, index) { return { action: mergeProps({ "class": this.cx("itemLink"), @@ -6700,22 +9046,34 @@ var script$1$1 = { }, this.getPTOptions(processedItem, index, "submenuIcon")) }; }, "getMenuItemProps"), - containerRef: /* @__PURE__ */ __name(function containerRef2(el) { + containerRef: /* @__PURE__ */ __name(function containerRef(el) { this.container = el; }, "containerRef") }, components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js AngleRightIcon: script$B +======== + AngleRightIcon: script$w +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }, directives: { ripple: Ripple } }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js var _hoisted_1$1$1 = ["tabindex"]; var _hoisted_2 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"]; var _hoisted_3 = ["onClick", "onMouseenter", "onMousemove"]; var _hoisted_4 = ["href", "target"]; var _hoisted_5 = ["id"]; +======== +var _hoisted_1$1$2 = ["tabindex"]; +var _hoisted_2$6 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"]; +var _hoisted_3$5 = ["onClick", "onMouseenter", "onMousemove"]; +var _hoisted_4$1 = ["href", "target"]; +var _hoisted_5$1 = ["id"]; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var _hoisted_6 = ["id"]; function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { var _component_AngleRightIcon = resolveComponent("AngleRightIcon"); @@ -6784,7 +9142,7 @@ function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { id: $options.getItemLabelId(processedItem), "class": _ctx.cx("itemLabel"), ref_for: true - }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_5), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, { + }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_5$1), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), mergeProps({ key: 0, @@ -6795,13 +9153,17 @@ function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { key: 1, "class": _ctx.cx("submenuIcon"), ref_for: true - }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_4)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), { + }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_4$1)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), { key: 1, item: processedItem.item, hasSubmenu: $options.getItemProp(processedItem, "items"), label: $options.getItemLabel(processedItem), props: $options.getMenuItemProps(processedItem, index) +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js }, null, 8, ["item", "hasSubmenu", "label", "props"]))], 16, _hoisted_3), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_TieredMenuSub, mergeProps({ +======== + }, null, 8, ["item", "hasSubmenu", "label", "props"]))], 16, _hoisted_3$5), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_TieredMenuSub, { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 0, id: $options.getItemId(processedItem) + "_list", "class": _ctx.cx("submenu"), @@ -6827,9 +9189,14 @@ function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { }), onItemMousemove: _cache[2] || (_cache[2] = function($event) { return _ctx.$emit("item-mousemove", $event); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js }), ref_for: true }, _ctx.ptm("submenu")), null, 16, ["id", "class", "style", "aria-labelledby", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "level", "visible", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_2)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ +======== + }) + }, null, 8, ["id", "style", "aria-labelledby", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "level", "visible", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_2$6)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js key: 1, id: $options.getItemId(processedItem), style: $options.getItemProp(processedItem, "style"), @@ -6837,16 +9204,20 @@ function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { role: "separator", ref_for: true }, _ctx.ptm("separator")), null, 16, _hoisted_6)) : createCommentVNode("", true)], 64); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js }), 128))], 8, _hoisted_1$1$1)) : createCommentVNode("", true)]; +======== + }), 128))], 16, _hoisted_1$1$2)) : createCommentVNode("", true)]; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }), _: 1 }, 16, ["onEnter"]); } __name(render$1$1, "render$1$1"); -script$1$1.render = render$1$1; -var script$3 = { +script$1$2.render = render$1$1; +var script$4 = { name: "TieredMenu", - "extends": script$2, + "extends": script$2$1, inheritAttrs: false, emits: ["focus", "blur", "before-show", "before-hide", "hide", "show"], outsideClickListener: null, @@ -6858,7 +9229,7 @@ var script$3 = { menubar: null, searchTimeout: null, searchValue: null, - data: /* @__PURE__ */ __name(function data8() { + data: /* @__PURE__ */ __name(function data6() { return { id: this.$attrs.id, focused: false, @@ -6876,10 +9247,10 @@ var script$3 = { }; }, "data"), watch: { - "$attrs.id": /* @__PURE__ */ __name(function $attrsId4(newValue) { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId2(newValue) { this.id = newValue || UniqueComponentId(); }, "$attrsId"), - activeItemPath: /* @__PURE__ */ __name(function activeItemPath2(newPath) { + activeItemPath: /* @__PURE__ */ __name(function activeItemPath(newPath) { if (!this.popup) { if (isNotEmpty(newPath)) { this.bindOutsideClickListener(); @@ -6891,11 +9262,11 @@ var script$3 = { } }, "activeItemPath") }, - mounted: /* @__PURE__ */ __name(function mounted8() { + mounted: /* @__PURE__ */ __name(function mounted6() { this.id = this.id || UniqueComponentId(); this.bindMatchMediaListener(); }, "mounted"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount7() { + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount6() { this.unbindOutsideClickListener(); this.unbindResizeListener(); this.unbindMatchMediaListener(); @@ -6910,34 +9281,34 @@ var script$3 = { this.container = null; }, "beforeUnmount"), methods: { - getItemProp: /* @__PURE__ */ __name(function getItemProp4(item3, name) { + getItemProp: /* @__PURE__ */ __name(function getItemProp2(item3, name) { return item3 ? resolve(item3[name]) : void 0; }, "getItemProp"), - getItemLabel: /* @__PURE__ */ __name(function getItemLabel4(item3) { + getItemLabel: /* @__PURE__ */ __name(function getItemLabel2(item3) { return this.getItemProp(item3, "label"); }, "getItemLabel"), - isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled4(item3) { + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled2(item3) { return this.getItemProp(item3, "disabled"); }, "isItemDisabled"), - isItemVisible: /* @__PURE__ */ __name(function isItemVisible4(item3) { + isItemVisible: /* @__PURE__ */ __name(function isItemVisible2(item3) { return this.getItemProp(item3, "visible") !== false; }, "isItemVisible"), - isItemGroup: /* @__PURE__ */ __name(function isItemGroup4(item3) { + isItemGroup: /* @__PURE__ */ __name(function isItemGroup2(item3) { return isNotEmpty(this.getItemProp(item3, "items")); }, "isItemGroup"), - isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator2(item3) { + isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator(item3) { return this.getItemProp(item3, "separator"); }, "isItemSeparator"), - getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel2(processedItem) { + getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel(processedItem) { return processedItem ? this.getItemLabel(processedItem.item) : void 0; }, "getProccessedItemLabel"), - isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup2(processedItem) { + isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup(processedItem) { return processedItem && isNotEmpty(processedItem.items); }, "isProccessedItemGroup"), - toggle: /* @__PURE__ */ __name(function toggle3(event) { + toggle: /* @__PURE__ */ __name(function toggle(event) { this.visible ? this.hide(event, true) : this.show(event); }, "toggle"), - show: /* @__PURE__ */ __name(function show3(event, isFocus) { + show: /* @__PURE__ */ __name(function show2(event, isFocus) { if (this.popup) { this.$emit("before-show"); this.visible = true; @@ -6946,7 +9317,7 @@ var script$3 = { } isFocus && focus(this.menubar); }, "show"), - hide: /* @__PURE__ */ __name(function hide3(event, isFocus) { + hide: /* @__PURE__ */ __name(function hide2(event, isFocus) { if (this.popup) { this.$emit("before-hide"); this.visible = false; @@ -6960,7 +9331,7 @@ var script$3 = { isFocus && focus(this.relatedTarget || this.target || this.menubar); this.dirty = false; }, "hide"), - onFocus: /* @__PURE__ */ __name(function onFocus4(event) { + onFocus: /* @__PURE__ */ __name(function onFocus3(event) { this.focused = true; if (!this.popup) { this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { @@ -6971,7 +9342,7 @@ var script$3 = { } this.$emit("focus", event); }, "onFocus"), - onBlur: /* @__PURE__ */ __name(function onBlur3(event) { + onBlur: /* @__PURE__ */ __name(function onBlur2(event) { this.focused = false; this.focusedItemInfo = { index: -1, @@ -6982,7 +9353,7 @@ var script$3 = { this.dirty = false; this.$emit("blur", event); }, "onBlur"), - onKeyDown: /* @__PURE__ */ __name(function onKeyDown4(event) { + onKeyDown: /* @__PURE__ */ __name(function onKeyDown2(event) { if (this.disabled) { event.preventDefault(); return; @@ -7033,7 +9404,11 @@ var script$3 = { break; } }, "onKeyDown"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js onItemChange: /* @__PURE__ */ __name(function onItemChange2(event, type) { +======== + onItemChange: /* @__PURE__ */ __name(function onItemChange(event) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var processedItem = event.processedItem, isFocus = event.isFocus; if (isEmpty(processedItem)) return; var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey, items = processedItem.items; @@ -7063,10 +9438,10 @@ var script$3 = { target: this.target }); }, "onOverlayClick"), - onItemClick: /* @__PURE__ */ __name(function onItemClick4(event) { + onItemClick: /* @__PURE__ */ __name(function onItemClick2(event) { var originalEvent = event.originalEvent, processedItem = event.processedItem; var grouped = this.isProccessedItemGroup(processedItem); - var root12 = isEmpty(processedItem.parent); + var root11 = isEmpty(processedItem.parent); var selected = this.isSelected(processedItem); if (selected) { var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey; @@ -7078,13 +9453,13 @@ var script$3 = { level, parentKey }; - this.dirty = !root12; + this.dirty = !root11; focus(this.menubar); } else { if (grouped) { this.onItemChange(event); } else { - var rootProcessedItem = root12 ? processedItem : this.activeItemPath.find(function(p) { + var rootProcessedItem = root11 ? processedItem : this.activeItemPath.find(function(p) { return p.parentKey === ""; }); this.hide(originalEvent); @@ -7093,22 +9468,22 @@ var script$3 = { } } }, "onItemClick"), - onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter4(event) { + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter2(event) { if (this.dirty) { this.onItemChange(event, "hover"); } }, "onItemMouseEnter"), - onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove4(event) { + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove2(event) { if (this.focused) { this.changeFocusedItemIndex(event, event.processedItem.index); } }, "onItemMouseMove"), - onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey3(event) { + onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey2(event) { var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); this.changeFocusedItemIndex(event, itemIndex); event.preventDefault(); }, "onArrowDownKey"), - onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey3(event) { + onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey2(event) { if (event.altKey) { if (this.focusedItemInfo.index !== -1) { var processedItem = this.visibleItems[this.focusedItemInfo.index]; @@ -7126,14 +9501,14 @@ var script$3 = { event.preventDefault(); } }, "onArrowUpKey"), - onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey4(event) { + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey3(event) { var _this = this; var processedItem = this.visibleItems[this.focusedItemInfo.index]; var parentItem = this.activeItemPath.find(function(p) { return p.key === processedItem.parentKey; }); - var root12 = isEmpty(processedItem.parent); - if (!root12) { + var root11 = isEmpty(processedItem.parent); + if (!root11) { this.focusedItemInfo = { index: -1, parentKey: parentItem ? parentItem.parentKey : "" @@ -7146,7 +9521,7 @@ var script$3 = { }); event.preventDefault(); }, "onArrowLeftKey"), - onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey4(event) { + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey3(event) { var processedItem = this.visibleItems[this.focusedItemInfo.index]; var grouped = this.isProccessedItemGroup(processedItem); if (grouped) { @@ -7163,15 +9538,15 @@ var script$3 = { } event.preventDefault(); }, "onArrowRightKey"), - onHomeKey: /* @__PURE__ */ __name(function onHomeKey4(event) { + onHomeKey: /* @__PURE__ */ __name(function onHomeKey3(event) { this.changeFocusedItemIndex(event, this.findFirstItemIndex()); event.preventDefault(); }, "onHomeKey"), - onEndKey: /* @__PURE__ */ __name(function onEndKey4(event) { + onEndKey: /* @__PURE__ */ __name(function onEndKey3(event) { this.changeFocusedItemIndex(event, this.findLastItemIndex()); event.preventDefault(); }, "onEndKey"), - onEnterKey: /* @__PURE__ */ __name(function onEnterKey4(event) { + onEnterKey: /* @__PURE__ */ __name(function onEnterKey3(event) { if (this.focusedItemInfo.index !== -1) { var element = findSingle(this.menubar, 'li[id="'.concat("".concat(this.focusedItemId), '"]')); var anchorElement = element && findSingle(element, '[data-pc-section="itemlink"]'); @@ -7184,10 +9559,10 @@ var script$3 = { } event.preventDefault(); }, "onEnterKey"), - onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey2(event) { + onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey(event) { this.onEnterKey(event); }, "onSpaceKey"), - onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey3(event) { + onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey2(event) { if (this.popup || this.focusedItemInfo.level !== 0) { var _focusedItemInfo = this.focusedItemInfo; this.hide(event, false); @@ -7200,7 +9575,7 @@ var script$3 = { } event.preventDefault(); }, "onEscapeKey"), - onTabKey: /* @__PURE__ */ __name(function onTabKey3(event) { + onTabKey: /* @__PURE__ */ __name(function onTabKey2(event) { if (this.focusedItemInfo.index !== -1) { var processedItem = this.visibleItems[this.focusedItemInfo.index]; var grouped = this.isProccessedItemGroup(processedItem); @@ -7250,7 +9625,7 @@ var script$3 = { this.container.style.minWidth = getOuterWidth(this.target) + "px"; } }, "alignOverlay"), - bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener3() { + bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener2() { var _this2 = this; if (!this.outsideClickListener) { this.outsideClickListener = function(event) { @@ -7263,7 +9638,7 @@ var script$3 = { document.addEventListener("click", this.outsideClickListener); } }, "bindOutsideClickListener"), - unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener3() { + unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener2() { if (this.outsideClickListener) { document.removeEventListener("click", this.outsideClickListener); this.outsideClickListener = null; @@ -7283,7 +9658,7 @@ var script$3 = { this.scrollHandler.unbindScrollListener(); } }, "unbindScrollListener"), - bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener3() { + bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener2() { var _this4 = this; if (!this.resizeListener) { this.resizeListener = function(event) { @@ -7294,12 +9669,13 @@ var script$3 = { window.addEventListener("resize", this.resizeListener); } }, "bindResizeListener"), - unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener3() { + unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener2() { if (this.resizeListener) { window.removeEventListener("resize", this.resizeListener); this.resizeListener = null; } }, "unbindResizeListener"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener2() { var _this5 = this; if (!this.matchMediaListener) { @@ -7319,62 +9695,95 @@ var script$3 = { } }, "unbindMatchMediaListener"), isItemMatched: /* @__PURE__ */ __name(function isItemMatched2(processedItem) { +======== + isItemMatched: /* @__PURE__ */ __name(function isItemMatched(processedItem) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var _this$getProccessedIt; return this.isValidItem(processedItem) && ((_this$getProccessedIt = this.getProccessedItemLabel(processedItem)) === null || _this$getProccessedIt === void 0 ? void 0 : _this$getProccessedIt.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())); }, "isItemMatched"), - isValidItem: /* @__PURE__ */ __name(function isValidItem2(processedItem) { + isValidItem: /* @__PURE__ */ __name(function isValidItem(processedItem) { return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item); }, "isValidItem"), - isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem2(processedItem) { + isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem(processedItem) { return this.isValidItem(processedItem) && this.isSelected(processedItem); }, "isValidSelectedItem"), - isSelected: /* @__PURE__ */ __name(function isSelected3(processedItem) { + isSelected: /* @__PURE__ */ __name(function isSelected2(processedItem) { return this.activeItemPath.some(function(p) { return p.key === processedItem.key; }); }, "isSelected"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex2() { var _this6 = this; +======== + findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex() { + var _this5 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js return this.visibleItems.findIndex(function(processedItem) { return _this6.isValidItem(processedItem); }); }, "findFirstItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex2() { var _this7 = this; +======== + findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex() { + var _this6 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js return findLastIndex(this.visibleItems, function(processedItem) { return _this7.isValidItem(processedItem); }); }, "findLastItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex2(index) { var _this8 = this; +======== + findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex(index) { + var _this7 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex(function(processedItem) { return _this8.isValidItem(processedItem); }) : -1; return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index; }, "findNextItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex2(index) { var _this9 = this; +======== + findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex(index) { + var _this8 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems.slice(0, index), function(processedItem) { return _this9.isValidItem(processedItem); }) : -1; return matchedItemIndex > -1 ? matchedItemIndex : index; }, "findPrevItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex2() { var _this10 = this; +======== + findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex() { + var _this9 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js return this.visibleItems.findIndex(function(processedItem) { return _this10.isValidSelectedItem(processedItem); }); }, "findSelectedItemIndex"), - findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex2() { + findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex() { var selectedIndex = this.findSelectedItemIndex(); return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex; }, "findFirstFocusedItemIndex"), - findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex2() { + findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex() { var selectedIndex = this.findSelectedItemIndex(); return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex; }, "findLastFocusedItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js searchItems: /* @__PURE__ */ __name(function searchItems2(event, _char) { var _this11 = this; +======== + searchItems: /* @__PURE__ */ __name(function searchItems(event, _char) { + var _this10 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js this.searchValue = (this.searchValue || "") + _char; var itemIndex = -1; var matched = false; @@ -7408,13 +9817,13 @@ var script$3 = { }, 500); return matched; }, "searchItems"), - changeFocusedItemIndex: /* @__PURE__ */ __name(function changeFocusedItemIndex2(event, index) { + changeFocusedItemIndex: /* @__PURE__ */ __name(function changeFocusedItemIndex(event, index) { if (this.focusedItemInfo.index !== index) { this.focusedItemInfo.index = index; this.scrollInView(); } }, "changeFocusedItemIndex"), - scrollInView: /* @__PURE__ */ __name(function scrollInView4() { + scrollInView: /* @__PURE__ */ __name(function scrollInView3() { var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1; var id2 = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedItemId; var element = findSingle(this.menubar, 'li[id="'.concat(id2, '"]')); @@ -7425,8 +9834,13 @@ var script$3 = { }); } }, "scrollInView"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems2(items) { var _this12 = this; +======== + createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems(items) { + var _this11 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ""; @@ -7446,35 +9860,45 @@ var script$3 = { }); return processedItems3; }, "createProcessedItems"), - containerRef: /* @__PURE__ */ __name(function containerRef3(el) { + containerRef: /* @__PURE__ */ __name(function containerRef2(el) { this.container = el; }, "containerRef"), - menubarRef: /* @__PURE__ */ __name(function menubarRef2(el) { + menubarRef: /* @__PURE__ */ __name(function menubarRef(el) { this.menubar = el ? el.$el : void 0; }, "menubarRef") }, computed: { - processedItems: /* @__PURE__ */ __name(function processedItems2() { + processedItems: /* @__PURE__ */ __name(function processedItems() { return this.createProcessedItems(this.model || []); }, "processedItems"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js visibleItems: /* @__PURE__ */ __name(function visibleItems2() { var _this13 = this; +======== + visibleItems: /* @__PURE__ */ __name(function visibleItems() { + var _this12 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js var processedItem = this.activeItemPath.find(function(p) { return p.key === _this13.focusedItemInfo.parentKey; }); return processedItem ? processedItem.items : this.processedItems; }, "visibleItems"), - focusedItemId: /* @__PURE__ */ __name(function focusedItemId2() { + focusedItemId: /* @__PURE__ */ __name(function focusedItemId() { return this.focusedItemInfo.index !== -1 ? "".concat(this.id).concat(isNotEmpty(this.focusedItemInfo.parentKey) ? "_" + this.focusedItemInfo.parentKey : "", "_").concat(this.focusedItemInfo.index) : null; }, "focusedItemId") }, components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js TieredMenuSub: script$1$1, Portal: script$p +======== + TieredMenuSub: script$1$2, + Portal: script$k +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } }; -var _hoisted_1$5 = ["id"]; -function render$3(_ctx, _cache, $props, $setup, $data, $options) { +var _hoisted_1$8 = ["id"]; +function render$5(_ctx, _cache, $props, $setup, $data, $options) { var _component_TieredMenuSub = resolveComponent("TieredMenuSub"); var _component_Portal = resolveComponent("Portal"); return openBlock(), createBlock(_component_Portal, { @@ -7530,7 +9954,7 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) { }, _ctx.ptm("rootList")), null, 16, ["id", "class", "tabindex", "aria-label", "aria-labelledby", "aria-disabled", "aria-activedescendant", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "visible", "pt", "unstyled", "onFocus", "onBlur", "onKeydown", "onItemClick", "onItemMouseenter", "onItemMousemove"]), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({ key: 1, "class": _ctx.cx("end") - }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16, _hoisted_1$5)) : createCommentVNode("", true)]; + }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16, _hoisted_1$8)) : createCommentVNode("", true)]; }), _: 3 }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])]; @@ -7538,14 +9962,14 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) { _: 3 }, 8, ["appendTo", "disabled"]); } -__name(render$3, "render$3"); -script$3.render = render$3; -var theme9 = /* @__PURE__ */ __name(function theme10(_ref) { +__name(render$5, "render$5"); +script$4.render = render$5; +var theme$1 = /* @__PURE__ */ __name(function theme7(_ref) { var dt = _ref.dt; return "\n.p-splitbutton {\n display: inline-flex;\n position: relative;\n border-radius: ".concat(dt("splitbutton.border.radius"), ";\n}\n\n.p-splitbutton-button {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n border-inline-end: 0 none;\n}\n\n.p-splitbutton-button:focus-visible,\n.p-splitbutton-dropdown:focus-visible {\n z-index: 1;\n}\n\n.p-splitbutton-button:not(:disabled):hover,\n.p-splitbutton-button:not(:disabled):active {\n border-inline-end: 0 none;\n}\n\n.p-splitbutton-dropdown {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.p-splitbutton .p-menu {\n min-width: 100%;\n}\n\n.p-splitbutton-fluid {\n display: flex;\n}\n\n.p-splitbutton-rounded .p-splitbutton-dropdown {\n border-start-end-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n border-end-end-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n}\n\n.p-splitbutton-rounded .p-splitbutton-button {\n border-start-start-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n border-end-start-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n}\n\n.p-splitbutton-raised {\n box-shadow: ").concat(dt("splitbutton.raised.shadow"), ";\n}\n"); }, "theme"); -var classes = { - root: /* @__PURE__ */ __name(function root11(_ref2) { +var classes$1 = { + root: /* @__PURE__ */ __name(function root9(_ref2) { var instance = _ref2.instance, props = _ref2.props; return ["p-splitbutton p-component", { "p-splitbutton-raised": props.raised, @@ -7558,12 +9982,16 @@ var classes = { }; var SplitButtonStyle = BaseStyle.extend({ name: "splitbutton", - theme: theme9, - classes + theme: theme$1, + classes: classes$1 }); -var script$1 = { +var script$1$1 = { name: "BaseSplitButton", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js props: { label: { type: String, @@ -7651,16 +10079,16 @@ var script$1 = { } }, style: SplitButtonStyle, - provide: /* @__PURE__ */ __name(function provide13() { + provide: /* @__PURE__ */ __name(function provide11() { return { $pcSplitButton: this, $parentInstance: this }; }, "provide") }; -var script = { +var script$3 = { name: "SplitButton", - "extends": script$1, + "extends": script$1$1, inheritAttrs: false, emits: ["click"], inject: { @@ -7668,18 +10096,18 @@ var script = { "default": null } }, - data: /* @__PURE__ */ __name(function data9() { + data: /* @__PURE__ */ __name(function data7() { return { id: this.$attrs.id, isExpanded: false }; }, "data"), watch: { - "$attrs.id": /* @__PURE__ */ __name(function $attrsId5(newValue) { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId3(newValue) { this.id = newValue || UniqueComponentId(); }, "$attrsId") }, - mounted: /* @__PURE__ */ __name(function mounted9() { + mounted: /* @__PURE__ */ __name(function mounted7() { var _this = this; this.id = this.id || UniqueComponentId(); this.$watch("$refs.menu.visible", function(newValue) { @@ -7719,13 +10147,19 @@ var script = { }, "hasFluid") }, components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js PVSButton: script$h, PVSMenu: script$3, ChevronDownIcon: script$q +======== + PVSButton: script$d, + PVSMenu: script$4, + ChevronDownIcon: script$l +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } }; -var _hoisted_1$4 = ["data-p-severity"]; -function render$2(_ctx, _cache, $props, $setup, $data, $options) { +var _hoisted_1$7 = ["data-p-severity"]; +function render$4(_ctx, _cache, $props, $setup, $data, $options) { var _component_PVSButton = resolveComponent("PVSButton"); var _component_PVSMenu = resolveComponent("PVSMenu"); return openBlock(), createElementBlock("div", mergeProps({ @@ -7830,12 +10264,12 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) { })]; }), key: "1" - } : void 0]), 1032, ["id", "model", "autoZIndex", "baseZIndex", "appendTo", "unstyled", "pt"])], 16, _hoisted_1$4); + } : void 0]), 1032, ["id", "model", "autoZIndex", "baseZIndex", "appendTo", "unstyled", "pt"])], 16, _hoisted_1$7); } -__name(render$2, "render$2"); -script.render = render$2; +__name(render$4, "render$4"); +script$3.render = render$4; const minQueueCount = 1; -const _sfc_main$5 = /* @__PURE__ */ defineComponent({ +const _sfc_main$8 = /* @__PURE__ */ defineComponent({ __name: "BatchCountEdit", props: { class: { default: "" } @@ -7864,7 +10298,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({ return withDirectives((openBlock(), createElementBlock("div", { class: normalizeClass(["batch-count", props.class]) }, [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(unref(script$G), { +======== + createVNode(unref(script$x), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js class: "w-14", modelValue: unref(batchCount), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(batchCount) ? batchCount.value = $event : null), @@ -7898,9 +10336,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-1163a5d2"]]); const _hoisted_1$3 = { class: "queue-button-group flex" }; const _sfc_main$4 = /* @__PURE__ */ defineComponent({ +======== +const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-b9328350"]]); +const _withScopeId$3 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-7f4f551b"), n = n(), popScopeId(), n), "_withScopeId$3"); +const _hoisted_1$6 = { class: "queue-button-group flex" }; +const _sfc_main$7 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js __name: "ComfyQueueButton", setup(__props) { const workspaceStore = useWorkspaceStore(); @@ -7952,8 +10397,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ const _component_i_lucide58fast_forward = __unplugin_components_2; const _component_i_lucide58step_forward = __unplugin_components_3; const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createElementBlock("div", _hoisted_1$3, [ - withDirectives((openBlock(), createBlock(unref(script), { + return openBlock(), createElementBlock("div", _hoisted_1$6, [ + withDirectives((openBlock(), createBlock(unref(script$3), { class: "comfyui-queue-button", label: activeQueueModeMenuItem.value.label, severity: "primary", @@ -7966,7 +10411,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ unref(workspaceStore).shiftDown ? (openBlock(), createBlock(_component_i_lucide58list_start, { key: 0 })) : unref(queueMode) === "disabled" ? (openBlock(), createBlock(_component_i_lucide58play, { key: 1 })) : unref(queueMode) === "instant" ? (openBlock(), createBlock(_component_i_lucide58fast_forward, { key: 2 })) : unref(queueMode) === "change" ? (openBlock(), createBlock(_component_i_lucide58step_forward, { key: 3 })) : createCommentVNode("", true) ]), item: withCtx(({ item: item3 }) => [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js withDirectives(createVNode(unref(script$h), { +======== + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js label: item3.label, icon: item3.icon, severity: item3.key === unref(queueMode) ? "primary" : "secondary", @@ -7986,9 +10435,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ ] ]), createVNode(BatchCountEdit), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(unref(script$9), { class: "execution-actions flex flex-nowrap" }, { default: withCtx(() => [ withDirectives(createVNode(unref(script$h), { +======== + createVNode(unref(script$8), { class: "execution-actions flex flex-nowrap" }, { + default: withCtx(() => [ + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js icon: "pi pi-times", severity: executingPrompt.value ? "danger" : "secondary", disabled: !executingPrompt.value, @@ -8002,7 +10457,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ { bottom: true } ] ]), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js withDirectives(createVNode(unref(script$h), { +======== + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js icon: "pi pi-stop", severity: hasPendingTasks.value ? "danger" : "secondary", disabled: !hasPendingTasks.value, @@ -8023,9 +10482,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ }; } }); -const ComfyQueueButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d3897845"]]); +const ComfyQueueButton = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-7f4f551b"]]); const overlapThreshold = 20; -const _sfc_main$3 = /* @__PURE__ */ defineComponent({ +const _sfc_main$6 = /* @__PURE__ */ defineComponent({ __name: "ComfyActionbar", setup(__props) { const settingsStore = useSettingStore(); @@ -8174,7 +10633,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({ }); }); return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$4), { + return openBlock(), createBlock(unref(script$y), { class: normalizeClass(["actionbar w-fit", { "is-dragging": unref(isDragging), "is-docked": unref(isDocked) }]), style: normalizeStyle(unref(style)) }, { @@ -8197,12 +10656,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-6a1bcb8c"]]); const _hoisted_1$2 = { +======== +const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-915e5456"]]); +const _hoisted_1$5 = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js viewBox: "0 0 24 24", width: "1.2em", height: "1.2em" }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js function render$1(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [ createBaseVNode("path", { @@ -8210,14 +10675,26 @@ function render$1(_ctx, _cache) { d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-5v3h14v-3zm0-2h14V5H5zm0 2v3z" }, null, -1) ])); +======== +const _hoisted_2$5 = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-5v3h14v-3zm0-2h14V5H5zm0 2v3z" +}, null, -1); +const _hoisted_3$4 = [ + _hoisted_2$5 +]; +function render$3(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$5, [..._hoisted_3$4]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } -__name(render$1, "render$1"); -const __unplugin_components_1 = markRaw({ name: "material-symbols-dock-to-bottom-outline", render: render$1 }); -const _hoisted_1$1 = { +__name(render$3, "render$3"); +const __unplugin_components_1 = markRaw({ name: "material-symbols-dock-to-bottom-outline", render: render$3 }); +const _hoisted_1$4 = { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em" }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js function render(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [ createBaseVNode("path", { @@ -8225,10 +10702,21 @@ function render(_ctx, _cache) { d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-7h14V5H5z" }, null, -1) ])); +======== +const _hoisted_2$4 = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-7h14V5H5z" +}, null, -1); +const _hoisted_3$3 = [ + _hoisted_2$4 +]; +function render$2(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._hoisted_3$3]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js } -__name(render, "render"); -const __unplugin_components_0 = markRaw({ name: "material-symbols-dock-to-bottom", render }); -const _sfc_main$2 = /* @__PURE__ */ defineComponent({ +__name(render$2, "render$2"); +const __unplugin_components_0 = markRaw({ name: "material-symbols-dock-to-bottom", render: render$2 }); +const _sfc_main$5 = /* @__PURE__ */ defineComponent({ __name: "BottomPanelToggleButton", setup(__props) { const bottomPanelStore = useBottomPanelStore(); @@ -8236,7 +10724,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({ const _component_i_material_symbols58dock_to_bottom = __unplugin_components_0; const _component_i_material_symbols58dock_to_bottom_outline = __unplugin_components_1; const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js return withDirectives((openBlock(), createBlock(unref(script$h), { +======== + return withDirectives((openBlock(), createBlock(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js severity: "secondary", text: "", onClick: unref(bottomPanelStore).toggleBottomPanel @@ -8252,7 +10744,1365 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js const _hoisted_1 = { class: "flex-grow" }; +======== +var theme8 = /* @__PURE__ */ __name(function theme9(_ref) { + var dt = _ref.dt; + return "\n.p-menubar {\n display: flex;\n align-items: center;\n background: ".concat(dt("menubar.background"), ";\n border: 1px solid ").concat(dt("menubar.border.color"), ";\n border-radius: ").concat(dt("menubar.border.radius"), ";\n color: ").concat(dt("menubar.color"), ";\n padding: ").concat(dt("menubar.padding"), ";\n gap: ").concat(dt("menubar.gap"), ";\n}\n\n.p-menubar-start,\n.p-megamenu-end {\n display: flex;\n align-items: center;\n}\n\n.p-menubar-root-list,\n.p-menubar-submenu {\n display: flex;\n margin: 0;\n padding: 0;\n list-style: none;\n outline: 0 none;\n}\n\n.p-menubar-root-list {\n align-items: center;\n flex-wrap: wrap;\n gap: ").concat(dt("menubar.gap"), ";\n}\n\n.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content {\n border-radius: ").concat(dt("menubar.base.item.border.radius"), ";\n}\n\n.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {\n padding: ").concat(dt("menubar.base.item.padding"), ";\n}\n\n.p-menubar-item-content {\n transition: background ").concat(dt("menubar.transition.duration"), ", color ").concat(dt("menubar.transition.duration"), ";\n border-radius: ").concat(dt("menubar.item.border.radius"), ";\n color: ").concat(dt("menubar.item.color"), ";\n}\n\n.p-menubar-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ").concat(dt("menubar.item.padding"), ";\n gap: ").concat(dt("menubar.item.gap"), ";\n user-select: none;\n outline: 0 none;\n}\n\n.p-menubar-item-label {\n line-height: 1;\n}\n\n.p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.color"), ";\n}\n\n.p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.color"), ";\n margin-left: auto;\n font-size: ").concat(dt("menubar.submenu.icon.size"), ";\n width: ").concat(dt("menubar.submenu.icon.size"), ";\n height: ").concat(dt("menubar.submenu.icon.size"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content {\n color: ").concat(dt("menubar.item.focus.color"), ";\n background: ").concat(dt("menubar.item.focus.background"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.focus.color"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.focus.color"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover {\n color: ").concat(dt("menubar.item.focus.color"), ";\n background: ").concat(dt("menubar.item.focus.background"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.focus.color"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.focus.color"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content {\n color: ").concat(dt("menubar.item.active.color"), ";\n background: ").concat(dt("menubar.item.active.background"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.active.color"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.active.color"), ";\n}\n\n.p-menubar-submenu {\n display: none;\n position: absolute;\n min-width: 12.5rem;\n z-index: 1;\n background: ").concat(dt("menubar.submenu.background"), ";\n border: 1px solid ").concat(dt("menubar.submenu.border.color"), ";\n border-radius: ").concat(dt("menubar.border.radius"), ";\n box-shadow: ").concat(dt("menubar.submenu.shadow"), ";\n color: ").concat(dt("menubar.submenu.color"), ";\n flex-direction: column;\n padding: ").concat(dt("menubar.submenu.padding"), ";\n gap: ").concat(dt("menubar.submenu.gap"), ";\n}\n\n.p-menubar-submenu .p-menubar-separator {\n border-top: 1px solid ").concat(dt("menubar.separator.border.color"), ";\n}\n\n.p-menubar-submenu .p-menubar-item {\n position: relative;\n}\n\n .p-menubar-submenu > .p-menubar-item-active > .p-menubar-submenu {\n display: block;\n left: 100%;\n top: 0;\n}\n\n.p-menubar-end {\n margin-left: auto;\n align-self: center;\n}\n\n.p-menubar-button {\n display: none;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n width: ").concat(dt("menubar.mobile.button.size"), ";\n height: ").concat(dt("menubar.mobile.button.size"), ";\n position: relative;\n color: ").concat(dt("menubar.mobile.button.color"), ";\n border: 0 none;\n background: transparent;\n border-radius: ").concat(dt("menubar.mobile.button.border.radius"), ";\n transition: background ").concat(dt("menubar.transition.duration"), ", color ").concat(dt("menubar.transition.duration"), ", outline-color ").concat(dt("menubar.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-menubar-button:hover {\n color: ").concat(dt("menubar.mobile.button.hover.color"), ";\n background: ").concat(dt("menubar.mobile.button.hover.background"), ";\n}\n\n.p-menubar-button:focus-visible {\n box-shadow: ").concat(dt("menubar.mobile.button.focus.ring.shadow"), ";\n outline: ").concat(dt("menubar.mobile.button.focus.ring.width"), " ").concat(dt("menubar.mobile.button.focus.ring.style"), " ").concat(dt("menubar.mobile.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("menubar.mobile.button.focus.ring.offset"), ";\n}\n\n.p-menubar-mobile {\n position: relative;\n}\n\n.p-menubar-mobile .p-menubar-button {\n display: flex;\n}\n\n.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n padding: ").concat(dt("menubar.submenu.padding"), ";\n background: ").concat(dt("menubar.submenu.background"), ";\n border: 1px solid ").concat(dt("menubar.submenu.border.color"), ";\n box-shadow: ").concat(dt("menubar.submenu.shadow"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content {\n border-radius: ").concat(dt("menubar.item.border.radius"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {\n padding: ").concat(dt("menubar.item.padding"), ";\n}\n\n.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n}\n\n.p-menubar-mobile .p-menubar-root-list .p-menubar-item {\n width: 100%;\n position: static;\n}\n\n.p-menubar-mobile .p-menubar-root-list .p-menubar-separator {\n border-top: 1px solid ").concat(dt("menubar.separator.border.color"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content .p-menubar-submenu-icon {\n margin-left: auto;\n transition: transform 0.2s;\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n transform: rotate(-180deg);\n}\n\n.p-menubar-mobile .p-menubar-submenu .p-menubar-submenu-icon {\n transition: transform 0.2s;\n transform: rotate(90deg);\n}\n\n.p-menubar-mobile .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n transform: rotate(-90deg);\n}\n\n.p-menubar-mobile .p-menubar-submenu {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n padding-left: ").concat(dt("menubar.submenu.mobile.indent"), ";\n}\n"); +}, "theme"); +var inlineStyles = { + submenu: /* @__PURE__ */ __name(function submenu2(_ref2) { + var instance = _ref2.instance, processedItem = _ref2.processedItem; + return { + display: instance.isItemActive(processedItem) ? "flex" : "none" + }; + }, "submenu") +}; +var classes = { + root: /* @__PURE__ */ __name(function root10(_ref3) { + var instance = _ref3.instance; + return ["p-menubar p-component", { + "p-menubar-mobile": instance.queryMatches, + "p-menubar-mobile-active": instance.mobileActive + }]; + }, "root"), + start: "p-menubar-start", + button: "p-menubar-button", + rootList: "p-menubar-root-list", + item: /* @__PURE__ */ __name(function item2(_ref4) { + var instance = _ref4.instance, processedItem = _ref4.processedItem; + return ["p-menubar-item", { + "p-menubar-item-active": instance.isItemActive(processedItem), + "p-focus": instance.isItemFocused(processedItem), + "p-disabled": instance.isItemDisabled(processedItem) + }]; + }, "item"), + itemContent: "p-menubar-item-content", + itemLink: "p-menubar-item-link", + itemIcon: "p-menubar-item-icon", + itemLabel: "p-menubar-item-label", + submenuIcon: "p-menubar-submenu-icon", + submenu: "p-menubar-submenu", + separator: "p-menubar-separator", + end: "p-menubar-end" +}; +var MenubarStyle = BaseStyle.extend({ + name: "menubar", + theme: theme8, + classes, + inlineStyles +}); +var script$2 = { + name: "BaseMenubar", + "extends": script$e, + props: { + model: { + type: Array, + "default": null + }, + buttonProps: { + type: null, + "default": null + }, + breakpoint: { + type: String, + "default": "960px" + }, + ariaLabelledby: { + type: String, + "default": null + }, + ariaLabel: { + type: String, + "default": null + } + }, + style: MenubarStyle, + provide: /* @__PURE__ */ __name(function provide12() { + return { + $pcMenubar: this, + $parentInstance: this + }; + }, "provide") +}; +var script$1 = { + name: "MenubarSub", + hostName: "Menubar", + "extends": script$e, + emits: ["item-mouseenter", "item-click", "item-mousemove"], + props: { + items: { + type: Array, + "default": null + }, + root: { + type: Boolean, + "default": false + }, + popup: { + type: Boolean, + "default": false + }, + mobileActive: { + type: Boolean, + "default": false + }, + templates: { + type: Object, + "default": null + }, + level: { + type: Number, + "default": 0 + }, + menuId: { + type: String, + "default": null + }, + focusedItemId: { + type: String, + "default": null + }, + activeItemPath: { + type: Object, + "default": null + } + }, + list: null, + methods: { + getItemId: /* @__PURE__ */ __name(function getItemId2(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key); + }, "getItemId"), + getItemKey: /* @__PURE__ */ __name(function getItemKey2(processedItem) { + return this.getItemId(processedItem); + }, "getItemKey"), + getItemProp: /* @__PURE__ */ __name(function getItemProp3(processedItem, name, params) { + return processedItem && processedItem.item ? resolve(processedItem.item[name], params) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel3(processedItem) { + return this.getItemProp(processedItem, "label"); + }, "getItemLabel"), + getItemLabelId: /* @__PURE__ */ __name(function getItemLabelId2(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key, "_label"); + }, "getItemLabelId"), + getPTOptions: /* @__PURE__ */ __name(function getPTOptions5(processedItem, index, key) { + return this.ptm(key, { + context: { + item: processedItem.item, + index, + active: this.isItemActive(processedItem), + focused: this.isItemFocused(processedItem), + disabled: this.isItemDisabled(processedItem), + level: this.level + } + }); + }, "getPTOptions"), + isItemActive: /* @__PURE__ */ __name(function isItemActive2(processedItem) { + return this.activeItemPath.some(function(path) { + return path.key === processedItem.key; + }); + }, "isItemActive"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible3(processedItem) { + return this.getItemProp(processedItem, "visible") !== false; + }, "isItemVisible"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled3(processedItem) { + return this.getItemProp(processedItem, "disabled"); + }, "isItemDisabled"), + isItemFocused: /* @__PURE__ */ __name(function isItemFocused2(processedItem) { + return this.focusedItemId === this.getItemId(processedItem); + }, "isItemFocused"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup3(processedItem) { + return isNotEmpty(processedItem.items); + }, "isItemGroup"), + onItemClick: /* @__PURE__ */ __name(function onItemClick3(event, processedItem) { + this.getItemProp(processedItem, "command", { + originalEvent: event, + item: processedItem.item + }); + this.$emit("item-click", { + originalEvent: event, + processedItem, + isFocus: true + }); + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter3(event, processedItem) { + this.$emit("item-mouseenter", { + originalEvent: event, + processedItem + }); + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove3(event, processedItem) { + this.$emit("item-mousemove", { + originalEvent: event, + processedItem + }); + }, "onItemMouseMove"), + getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset3(index) { + return index - this.calculateAriaSetSize.slice(0, index).length + 1; + }, "getAriaPosInset"), + getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps2(processedItem, index) { + return { + action: mergeProps({ + "class": this.cx("itemLink"), + tabindex: -1, + "aria-hidden": true + }, this.getPTOptions(processedItem, index, "itemLink")), + icon: mergeProps({ + "class": [this.cx("itemIcon"), this.getItemProp(processedItem, "icon")] + }, this.getPTOptions(processedItem, index, "itemIcon")), + label: mergeProps({ + "class": this.cx("itemLabel") + }, this.getPTOptions(processedItem, index, "itemLabel")), + submenuicon: mergeProps({ + "class": this.cx("submenuIcon") + }, this.getPTOptions(processedItem, index, "submenuIcon")) + }; + }, "getMenuItemProps") + }, + computed: { + calculateAriaSetSize: /* @__PURE__ */ __name(function calculateAriaSetSize() { + var _this = this; + return this.items.filter(function(processedItem) { + return _this.isItemVisible(processedItem) && _this.getItemProp(processedItem, "separator"); + }); + }, "calculateAriaSetSize"), + getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize2() { + var _this2 = this; + return this.items.filter(function(processedItem) { + return _this2.isItemVisible(processedItem) && !_this2.getItemProp(processedItem, "separator"); + }).length; + }, "getAriaSetSize") + }, + components: { + AngleRightIcon: script$w, + AngleDownIcon: script$z + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$1$1 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"]; +var _hoisted_2$3 = ["onClick", "onMouseenter", "onMousemove"]; +var _hoisted_3$2 = ["href", "target"]; +var _hoisted_4 = ["id"]; +var _hoisted_5 = ["id"]; +function render$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_MenubarSub = resolveComponent("MenubarSub", true); + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("ul", mergeProps({ + "class": $props.level === 0 ? _ctx.cx("rootList") : _ctx.cx("submenu") + }, $props.level === 0 ? _ctx.ptm("rootList") : _ctx.ptm("submenu")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.items, function(processedItem, index) { + return openBlock(), createElementBlock(Fragment, { + key: $options.getItemKey(processedItem) + }, [$options.isItemVisible(processedItem) && !$options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ + key: 0, + id: $options.getItemId(processedItem), + style: $options.getItemProp(processedItem, "style"), + "class": [_ctx.cx("item", { + processedItem + }), $options.getItemProp(processedItem, "class")], + role: "menuitem", + "aria-label": $options.getItemLabel(processedItem), + "aria-disabled": $options.isItemDisabled(processedItem) || void 0, + "aria-expanded": $options.isItemGroup(processedItem) ? $options.isItemActive(processedItem) : void 0, + "aria-haspopup": $options.isItemGroup(processedItem) && !$options.getItemProp(processedItem, "to") ? "menu" : void 0, + "aria-level": $props.level + 1, + "aria-setsize": $options.getAriaSetSize, + "aria-posinset": $options.getAriaPosInset(index), + ref_for: true + }, $options.getPTOptions(processedItem, index, "item"), { + "data-p-active": $options.isItemActive(processedItem), + "data-p-focused": $options.isItemFocused(processedItem), + "data-p-disabled": $options.isItemDisabled(processedItem) + }), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("itemContent"), + onClick: /* @__PURE__ */ __name(function onClick2($event) { + return $options.onItemClick($event, processedItem); + }, "onClick"), + onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) { + return $options.onItemMouseEnter($event, processedItem); + }, "onMouseenter"), + onMousemove: /* @__PURE__ */ __name(function onMousemove($event) { + return $options.onItemMouseMove($event, processedItem); + }, "onMousemove"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemContent")), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({ + key: 0, + href: $options.getItemProp(processedItem, "url"), + "class": _ctx.cx("itemLink"), + target: $options.getItemProp(processedItem, "target"), + tabindex: "-1", + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLink")), [$props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), { + key: 0, + item: processedItem.item, + "class": normalizeClass(_ctx.cx("itemIcon")) + }, null, 8, ["item", "class"])) : $options.getItemProp(processedItem, "icon") ? (openBlock(), createElementBlock("span", mergeProps({ + key: 1, + "class": [_ctx.cx("itemIcon"), $options.getItemProp(processedItem, "icon")], + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemIcon")), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({ + id: $options.getItemLabelId(processedItem), + "class": _ctx.cx("itemLabel"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_4), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, { + key: 2 + }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), { + key: 0, + root: $props.root, + active: $options.isItemActive(processedItem), + "class": normalizeClass(_ctx.cx("submenuIcon")) + }, null, 8, ["root", "active", "class"])) : (openBlock(), createBlock(resolveDynamicComponent($props.root ? "AngleDownIcon" : "AngleRightIcon"), mergeProps({ + key: 1, + "class": _ctx.cx("submenuIcon"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_3$2)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), { + key: 1, + item: processedItem.item, + root: $props.root, + hasSubmenu: $options.getItemProp(processedItem, "items"), + label: $options.getItemLabel(processedItem), + props: $options.getMenuItemProps(processedItem, index) + }, null, 8, ["item", "root", "hasSubmenu", "label", "props"]))], 16, _hoisted_2$3), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_MenubarSub, { + key: 0, + id: $options.getItemId(processedItem) + "_list", + menuId: $props.menuId, + role: "menu", + style: normalizeStyle(_ctx.sx("submenu", true, { + processedItem + })), + focusedItemId: $props.focusedItemId, + items: processedItem.items, + mobileActive: $props.mobileActive, + activeItemPath: $props.activeItemPath, + templates: $props.templates, + level: $props.level + 1, + "aria-labelledby": $options.getItemLabelId(processedItem), + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onItemClick: _cache[0] || (_cache[0] = function($event) { + return _ctx.$emit("item-click", $event); + }), + onItemMouseenter: _cache[1] || (_cache[1] = function($event) { + return _ctx.$emit("item-mouseenter", $event); + }), + onItemMousemove: _cache[2] || (_cache[2] = function($event) { + return _ctx.$emit("item-mousemove", $event); + }) + }, null, 8, ["id", "menuId", "style", "focusedItemId", "items", "mobileActive", "activeItemPath", "templates", "level", "aria-labelledby", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_1$1$1)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ + key: 1, + id: $options.getItemId(processedItem), + "class": [_ctx.cx("separator"), $options.getItemProp(processedItem, "class")], + style: $options.getItemProp(processedItem, "style"), + role: "separator", + ref_for: true + }, _ctx.ptm("separator")), null, 16, _hoisted_5)) : createCommentVNode("", true)], 64); + }), 128))], 16); +} +__name(render$1, "render$1"); +script$1.render = render$1; +var script = { + name: "Menubar", + "extends": script$2, + inheritAttrs: false, + emits: ["focus", "blur"], + matchMediaListener: null, + data: /* @__PURE__ */ __name(function data8() { + return { + id: this.$attrs.id, + mobileActive: false, + focused: false, + focusedItemInfo: { + index: -1, + level: 0, + parentKey: "" + }, + activeItemPath: [], + dirty: false, + query: null, + queryMatches: false + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId4(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + activeItemPath: /* @__PURE__ */ __name(function activeItemPath2(newPath) { + if (isNotEmpty(newPath)) { + this.bindOutsideClickListener(); + this.bindResizeListener(); + } else { + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + } + }, "activeItemPath") + }, + outsideClickListener: null, + container: null, + menubar: null, + mounted: /* @__PURE__ */ __name(function mounted8() { + this.id = this.id || UniqueComponentId(); + this.bindMatchMediaListener(); + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount7() { + this.mobileActive = false; + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + this.unbindMatchMediaListener(); + if (this.container) { + ZIndex.clear(this.container); + } + this.container = null; + }, "beforeUnmount"), + methods: { + getItemProp: /* @__PURE__ */ __name(function getItemProp4(item3, name) { + return item3 ? resolve(item3[name]) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel4(item3) { + return this.getItemProp(item3, "label"); + }, "getItemLabel"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled4(item3) { + return this.getItemProp(item3, "disabled"); + }, "isItemDisabled"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible4(item3) { + return this.getItemProp(item3, "visible") !== false; + }, "isItemVisible"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup4(item3) { + return isNotEmpty(this.getItemProp(item3, "items")); + }, "isItemGroup"), + isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator2(item3) { + return this.getItemProp(item3, "separator"); + }, "isItemSeparator"), + getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel2(processedItem) { + return processedItem ? this.getItemLabel(processedItem.item) : void 0; + }, "getProccessedItemLabel"), + isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup2(processedItem) { + return processedItem && isNotEmpty(processedItem.items); + }, "isProccessedItemGroup"), + toggle: /* @__PURE__ */ __name(function toggle2(event) { + var _this = this; + if (this.mobileActive) { + this.mobileActive = false; + ZIndex.clear(this.menubar); + this.hide(); + } else { + this.mobileActive = true; + ZIndex.set("menu", this.menubar, this.$primevue.config.zIndex.menu); + setTimeout(function() { + _this.show(); + }, 1); + } + this.bindOutsideClickListener(); + event.preventDefault(); + }, "toggle"), + show: /* @__PURE__ */ __name(function show3() { + focus(this.menubar); + }, "show"), + hide: /* @__PURE__ */ __name(function hide3(event, isFocus) { + var _this2 = this; + if (this.mobileActive) { + this.mobileActive = false; + setTimeout(function() { + focus(_this2.$refs.menubutton); + }, 0); + } + this.activeItemPath = []; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + isFocus && focus(this.menubar); + this.dirty = false; + }, "hide"), + onFocus: /* @__PURE__ */ __name(function onFocus4(event) { + this.focused = true; + this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { + index: this.findFirstFocusedItemIndex(), + level: 0, + parentKey: "" + }; + this.$emit("focus", event); + }, "onFocus"), + onBlur: /* @__PURE__ */ __name(function onBlur3(event) { + this.focused = false; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + this.searchValue = ""; + this.dirty = false; + this.$emit("blur", event); + }, "onBlur"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown3(event) { + var metaKey = event.metaKey || event.ctrlKey; + switch (event.code) { + case "ArrowDown": + this.onArrowDownKey(event); + break; + case "ArrowUp": + this.onArrowUpKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "Space": + this.onSpaceKey(event); + break; + case "Enter": + case "NumpadEnter": + this.onEnterKey(event); + break; + case "Escape": + this.onEscapeKey(event); + break; + case "Tab": + this.onTabKey(event); + break; + case "PageDown": + case "PageUp": + case "Backspace": + case "ShiftLeft": + case "ShiftRight": + break; + default: + if (!metaKey && isPrintableCharacter(event.key)) { + this.searchItems(event, event.key); + } + break; + } + }, "onKeyDown"), + onItemChange: /* @__PURE__ */ __name(function onItemChange2(event) { + var processedItem = event.processedItem, isFocus = event.isFocus; + if (isEmpty(processedItem)) return; + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey, items = processedItem.items; + var grouped = isNotEmpty(items); + var activeItemPath3 = this.activeItemPath.filter(function(p) { + return p.parentKey !== parentKey && p.parentKey !== key; + }); + grouped && activeItemPath3.push(processedItem); + this.focusedItemInfo = { + index, + level, + parentKey + }; + this.activeItemPath = activeItemPath3; + grouped && (this.dirty = true); + isFocus && focus(this.menubar); + }, "onItemChange"), + onItemClick: /* @__PURE__ */ __name(function onItemClick4(event) { + var originalEvent = event.originalEvent, processedItem = event.processedItem; + var grouped = this.isProccessedItemGroup(processedItem); + var root11 = isEmpty(processedItem.parent); + var selected = this.isSelected(processedItem); + if (selected) { + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey; + this.activeItemPath = this.activeItemPath.filter(function(p) { + return key !== p.key && key.startsWith(p.key); + }); + this.focusedItemInfo = { + index, + level, + parentKey + }; + this.dirty = !root11; + focus(this.menubar); + } else { + if (grouped) { + this.onItemChange(event); + } else { + var rootProcessedItem = root11 ? processedItem : this.activeItemPath.find(function(p) { + return p.parentKey === ""; + }); + this.hide(originalEvent); + this.changeFocusedItemIndex(originalEvent, rootProcessedItem ? rootProcessedItem.index : -1); + this.mobileActive = false; + focus(this.menubar); + } + } + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter4(event) { + if (this.dirty) { + this.onItemChange(event); + } + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove4(event) { + if (this.focused) { + this.changeFocusedItemIndex(event, event.processedItem.index); + } + }, "onItemMouseMove"), + menuButtonClick: /* @__PURE__ */ __name(function menuButtonClick(event) { + this.toggle(event); + }, "menuButtonClick"), + menuButtonKeydown: /* @__PURE__ */ __name(function menuButtonKeydown(event) { + (event.code === "Enter" || event.code === "NumpadEnter" || event.code === "Space") && this.menuButtonClick(event); + }, "menuButtonKeydown"), + onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey3(event) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var root11 = processedItem ? isEmpty(processedItem.parent) : null; + if (root11) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + this.onArrowRightKey(event); + } + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + } + event.preventDefault(); + }, "onArrowDownKey"), + onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey3(event) { + var _this3 = this; + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var root11 = isEmpty(processedItem.parent); + if (root11) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + var itemIndex = this.findLastItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + } + } else { + var parentItem = this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }); + if (this.focusedItemInfo.index === 0) { + this.focusedItemInfo = { + index: -1, + parentKey: parentItem ? parentItem.parentKey : "" + }; + this.searchValue = ""; + this.onArrowLeftKey(event); + this.activeItemPath = this.activeItemPath.filter(function(p) { + return p.parentKey !== _this3.focusedItemInfo.parentKey; + }); + } else { + var _itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex(); + this.changeFocusedItemIndex(event, _itemIndex); + } + } + event.preventDefault(); + }, "onArrowUpKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey4(event) { + var _this4 = this; + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var parentItem = processedItem ? this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }) : null; + if (parentItem) { + this.onItemChange({ + originalEvent: event, + processedItem: parentItem + }); + this.activeItemPath = this.activeItemPath.filter(function(p) { + return p.parentKey !== _this4.focusedItemInfo.parentKey; + }); + event.preventDefault(); + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + } + }, "onArrowLeftKey"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey4(event) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var parentItem = processedItem ? this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }) : null; + if (parentItem) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + this.onArrowDownKey(event); + } + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + } + }, "onArrowRightKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey4(event) { + this.changeFocusedItemIndex(event, this.findFirstItemIndex()); + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey4(event) { + this.changeFocusedItemIndex(event, this.findLastItemIndex()); + event.preventDefault(); + }, "onEndKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey4(event) { + if (this.focusedItemInfo.index !== -1) { + var element = findSingle(this.menubar, 'li[id="'.concat("".concat(this.focusedItemId), '"]')); + var anchorElement = element && findSingle(element, 'a[data-pc-section="itemlink"]'); + anchorElement ? anchorElement.click() : element && element.click(); + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex()); + } + event.preventDefault(); + }, "onEnterKey"), + onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey2(event) { + this.onEnterKey(event); + }, "onSpaceKey"), + onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey3(event) { + if (this.focusedItemInfo.level !== 0) { + var _focusedItemInfo = this.focusedItemInfo; + this.hide(event, false); + this.focusedItemInfo = { + index: Number(_focusedItemInfo.parentKey.split("_")[0]), + level: 0, + parentKey: "" + }; + } + event.preventDefault(); + }, "onEscapeKey"), + onTabKey: /* @__PURE__ */ __name(function onTabKey3(event) { + if (this.focusedItemInfo.index !== -1) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && this.onItemChange({ + originalEvent: event, + processedItem + }); + } + this.hide(); + }, "onTabKey"), + bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener3() { + var _this5 = this; + if (!this.outsideClickListener) { + this.outsideClickListener = function(event) { + var isOutsideContainer = _this5.container && !_this5.container.contains(event.target); + var isOutsideTarget = !(_this5.target && (_this5.target === event.target || _this5.target.contains(event.target))); + if (isOutsideContainer && isOutsideTarget) { + _this5.hide(); + } + }; + document.addEventListener("click", this.outsideClickListener); + } + }, "bindOutsideClickListener"), + unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener3() { + if (this.outsideClickListener) { + document.removeEventListener("click", this.outsideClickListener); + this.outsideClickListener = null; + } + }, "unbindOutsideClickListener"), + bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener3() { + var _this6 = this; + if (!this.resizeListener) { + this.resizeListener = function(event) { + if (!isTouchDevice()) { + _this6.hide(event, true); + } + _this6.mobileActive = false; + }; + window.addEventListener("resize", this.resizeListener); + } + }, "bindResizeListener"), + unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener3() { + if (this.resizeListener) { + window.removeEventListener("resize", this.resizeListener); + this.resizeListener = null; + } + }, "unbindResizeListener"), + bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener() { + var _this7 = this; + if (!this.matchMediaListener) { + var query = matchMedia("(max-width: ".concat(this.breakpoint, ")")); + this.query = query; + this.queryMatches = query.matches; + this.matchMediaListener = function() { + _this7.queryMatches = query.matches; + _this7.mobileActive = false; + }; + this.query.addEventListener("change", this.matchMediaListener); + } + }, "bindMatchMediaListener"), + unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener() { + if (this.matchMediaListener) { + this.query.removeEventListener("change", this.matchMediaListener); + this.matchMediaListener = null; + } + }, "unbindMatchMediaListener"), + isItemMatched: /* @__PURE__ */ __name(function isItemMatched2(processedItem) { + var _this$getProccessedIt; + return this.isValidItem(processedItem) && ((_this$getProccessedIt = this.getProccessedItemLabel(processedItem)) === null || _this$getProccessedIt === void 0 ? void 0 : _this$getProccessedIt.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())); + }, "isItemMatched"), + isValidItem: /* @__PURE__ */ __name(function isValidItem2(processedItem) { + return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item); + }, "isValidItem"), + isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem2(processedItem) { + return this.isValidItem(processedItem) && this.isSelected(processedItem); + }, "isValidSelectedItem"), + isSelected: /* @__PURE__ */ __name(function isSelected3(processedItem) { + return this.activeItemPath.some(function(p) { + return p.key === processedItem.key; + }); + }, "isSelected"), + findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex2() { + var _this8 = this; + return this.visibleItems.findIndex(function(processedItem) { + return _this8.isValidItem(processedItem); + }); + }, "findFirstItemIndex"), + findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex2() { + var _this9 = this; + return findLastIndex(this.visibleItems, function(processedItem) { + return _this9.isValidItem(processedItem); + }); + }, "findLastItemIndex"), + findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex2(index) { + var _this10 = this; + var matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex(function(processedItem) { + return _this10.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index; + }, "findNextItemIndex"), + findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex2(index) { + var _this11 = this; + var matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems.slice(0, index), function(processedItem) { + return _this11.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex : index; + }, "findPrevItemIndex"), + findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex2() { + var _this12 = this; + return this.visibleItems.findIndex(function(processedItem) { + return _this12.isValidSelectedItem(processedItem); + }); + }, "findSelectedItemIndex"), + findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex2() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex; + }, "findFirstFocusedItemIndex"), + findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex2() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex; + }, "findLastFocusedItemIndex"), + searchItems: /* @__PURE__ */ __name(function searchItems2(event, _char) { + var _this13 = this; + this.searchValue = (this.searchValue || "") + _char; + var itemIndex = -1; + var matched = false; + if (this.focusedItemInfo.index !== -1) { + itemIndex = this.visibleItems.slice(this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }); + itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }) : itemIndex + this.focusedItemInfo.index; + } else { + itemIndex = this.visibleItems.findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }); + } + if (itemIndex !== -1) { + matched = true; + } + if (itemIndex === -1 && this.focusedItemInfo.index === -1) { + itemIndex = this.findFirstFocusedItemIndex(); + } + if (itemIndex !== -1) { + this.changeFocusedItemIndex(event, itemIndex); + } + if (this.searchTimeout) { + clearTimeout(this.searchTimeout); + } + this.searchTimeout = setTimeout(function() { + _this13.searchValue = ""; + _this13.searchTimeout = null; + }, 500); + return matched; + }, "searchItems"), + changeFocusedItemIndex: /* @__PURE__ */ __name(function changeFocusedItemIndex2(event, index) { + if (this.focusedItemInfo.index !== index) { + this.focusedItemInfo.index = index; + this.scrollInView(); + } + }, "changeFocusedItemIndex"), + scrollInView: /* @__PURE__ */ __name(function scrollInView4() { + var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1; + var id2 = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedItemId; + var element = findSingle(this.menubar, 'li[id="'.concat(id2, '"]')); + if (element) { + element.scrollIntoView && element.scrollIntoView({ + block: "nearest", + inline: "start" + }); + } + }, "scrollInView"), + createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems2(items) { + var _this14 = this; + var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ""; + var processedItems3 = []; + items && items.forEach(function(item3, index) { + var key = (parentKey !== "" ? parentKey + "_" : "") + index; + var newItem = { + item: item3, + index, + level, + key, + parent, + parentKey + }; + newItem["items"] = _this14.createProcessedItems(item3.items, level + 1, newItem, key); + processedItems3.push(newItem); + }); + return processedItems3; + }, "createProcessedItems"), + containerRef: /* @__PURE__ */ __name(function containerRef3(el) { + this.container = el; + }, "containerRef"), + menubarRef: /* @__PURE__ */ __name(function menubarRef2(el) { + this.menubar = el ? el.$el : void 0; + }, "menubarRef") + }, + computed: { + processedItems: /* @__PURE__ */ __name(function processedItems2() { + return this.createProcessedItems(this.model || []); + }, "processedItems"), + visibleItems: /* @__PURE__ */ __name(function visibleItems2() { + var _this15 = this; + var processedItem = this.activeItemPath.find(function(p) { + return p.key === _this15.focusedItemInfo.parentKey; + }); + return processedItem ? processedItem.items : this.processedItems; + }, "visibleItems"), + focusedItemId: /* @__PURE__ */ __name(function focusedItemId2() { + return this.focusedItemInfo.index !== -1 ? "".concat(this.id).concat(isNotEmpty(this.focusedItemInfo.parentKey) ? "_" + this.focusedItemInfo.parentKey : "", "_").concat(this.focusedItemInfo.index) : null; + }, "focusedItemId") + }, + components: { + MenubarSub: script$1, + BarsIcon: script$A + } +}; +function _typeof(o) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof(o); +} +__name(_typeof, "_typeof"); +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys, "ownKeys"); +function _objectSpread(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread, "_objectSpread"); +function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty, "_defineProperty"); +function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : i + ""; +} +__name(_toPropertyKey, "_toPropertyKey"); +function _toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive, "_toPrimitive"); +var _hoisted_1$3 = ["aria-haspopup", "aria-expanded", "aria-controls", "aria-label"]; +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_BarsIcon = resolveComponent("BarsIcon"); + var _component_MenubarSub = resolveComponent("MenubarSub"); + return openBlock(), createElementBlock("div", mergeProps({ + ref: $options.containerRef, + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("start") + }, _ctx.ptm("start")), [renderSlot(_ctx.$slots, "start")], 16)) : createCommentVNode("", true), renderSlot(_ctx.$slots, _ctx.$slots.button ? "button" : "menubutton", { + id: $data.id, + "class": normalizeClass(_ctx.cx("button")), + toggleCallback: /* @__PURE__ */ __name(function toggleCallback(event) { + return $options.menuButtonClick(event); + }, "toggleCallback") + }, function() { + var _ctx$$primevue$config; + return [_ctx.model && _ctx.model.length > 0 ? (openBlock(), createElementBlock("a", mergeProps({ + key: 0, + ref: "menubutton", + role: "button", + tabindex: "0", + "class": _ctx.cx("button"), + "aria-haspopup": _ctx.model.length && _ctx.model.length > 0 ? true : false, + "aria-expanded": $data.mobileActive, + "aria-controls": $data.id, + "aria-label": (_ctx$$primevue$config = _ctx.$primevue.config.locale.aria) === null || _ctx$$primevue$config === void 0 ? void 0 : _ctx$$primevue$config.navigation, + onClick: _cache[0] || (_cache[0] = function($event) { + return $options.menuButtonClick($event); + }), + onKeydown: _cache[1] || (_cache[1] = function($event) { + return $options.menuButtonKeydown($event); + }) + }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.ptm("button"))), [renderSlot(_ctx.$slots, _ctx.$slots.buttonicon ? "buttonicon" : "menubuttonicon", {}, function() { + return [createVNode(_component_BarsIcon, normalizeProps(guardReactiveProps(_ctx.ptm("buttonicon"))), null, 16)]; + })], 16, _hoisted_1$3)) : createCommentVNode("", true)]; + }), createVNode(_component_MenubarSub, { + ref: $options.menubarRef, + id: $data.id + "_list", + role: "menubar", + items: $options.processedItems, + templates: _ctx.$slots, + root: true, + mobileActive: $data.mobileActive, + tabindex: "0", + "aria-activedescendant": $data.focused ? $options.focusedItemId : void 0, + menuId: $data.id, + focusedItemId: $data.focused ? $options.focusedItemId : void 0, + activeItemPath: $data.activeItemPath, + level: 0, + "aria-labelledby": _ctx.ariaLabelledby, + "aria-label": _ctx.ariaLabel, + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onFocus: $options.onFocus, + onBlur: $options.onBlur, + onKeydown: $options.onKeyDown, + onItemClick: $options.onItemClick, + onItemMouseenter: $options.onItemMouseEnter, + onItemMousemove: $options.onItemMouseMove + }, null, 8, ["id", "items", "templates", "mobileActive", "aria-activedescendant", "menuId", "focusedItemId", "activeItemPath", "aria-labelledby", "aria-label", "pt", "unstyled", "onFocus", "onBlur", "onKeydown", "onItemClick", "onItemMouseenter", "onItemMousemove"]), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({ + key: 1, + "class": _ctx.cx("end") + }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16); +} +__name(render, "render"); +script.render = render; +const _withScopeId$2 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-6fecd137"), n = n(), popScopeId(), n), "_withScopeId$2"); +const _hoisted_1$2 = ["href"]; +const _hoisted_2$2 = { class: "p-menubar-item-label" }; +const _hoisted_3$1 = { + key: 1, + class: "ml-auto border border-surface rounded text-muted text-xs p-1 keybinding-tag" +}; +const _sfc_main$4 = /* @__PURE__ */ defineComponent({ + __name: "CommandMenubar", + setup(__props) { + const settingStore = useSettingStore(); + const dropdownDirection = computed( + () => settingStore.get("Comfy.UseNewMenu") === "Top" ? "down" : "up" + ); + const menuItemsStore = useMenuItemStore(); + const { t } = useI18n(); + const translateMenuItem = /* @__PURE__ */ __name((item3) => { + const label = typeof item3.label === "function" ? item3.label() : item3.label; + const translatedLabel = label ? t(`menuLabels.${normalizeI18nKey(label)}`, label) : void 0; + return { + ...item3, + label: translatedLabel, + items: item3.items?.map(translateMenuItem) + }; + }, "translateMenuItem"); + const translatedItems = computed( + () => menuItemsStore.menuItems.map(translateMenuItem) + ); + return (_ctx, _cache) => { + return openBlock(), createBlock(unref(script), { + model: translatedItems.value, + class: "top-menubar border-none p-0 bg-transparent", + pt: { + rootList: "gap-0 flex-nowrap w-auto", + submenu: `dropdown-direction-${dropdownDirection.value}`, + item: "relative" + } + }, { + item: withCtx(({ item: item3, props }) => [ + createBaseVNode("a", mergeProps({ class: "p-menubar-item-link" }, props.action, { + href: item3.url, + target: "_blank" + }), [ + item3.icon ? (openBlock(), createElementBlock("span", { + key: 0, + class: normalizeClass(["p-menubar-item-icon", item3.icon]) + }, null, 2)) : createCommentVNode("", true), + createBaseVNode("span", _hoisted_2$2, toDisplayString(item3.label), 1), + item3?.comfyCommand?.keybinding ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(item3.comfyCommand.keybinding.combo.toString()), 1)) : createCommentVNode("", true) + ], 16, _hoisted_1$2) + ]), + _: 1 + }, 8, ["model", "pt"]); + }; + } +}); +const CommandMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6fecd137"]]); +const _withScopeId$1 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-8d011a31"), n = n(), popScopeId(), n), "_withScopeId$1"); +const _hoisted_1$1 = { class: "workflow-label text-sm max-w-[150px] truncate inline-block" }; +const _hoisted_2$1 = { class: "relative" }; +const _hoisted_3 = { + key: 0, + class: "status-indicator" +}; +const _sfc_main$3 = /* @__PURE__ */ defineComponent({ + __name: "WorkflowTab", + props: { + class: {}, + workflowOption: {} + }, + setup(__props) { + const props = __props; + const workspaceStore = useWorkspaceStore(); + const workflowStore = useWorkflowStore(); + const workflowTabRef = ref(null); + const closeWorkflows = /* @__PURE__ */ __name(async (options) => { + for (const opt of options) { + if (!await useWorkflowService().closeWorkflow(opt.workflow, { + warnIfUnsaved: !workspaceStore.shiftDown + })) { + break; + } + } + }, "closeWorkflows"); + const onCloseWorkflow = /* @__PURE__ */ __name((option2) => { + closeWorkflows([option2]); + }, "onCloseWorkflow"); + const tabGetter = /* @__PURE__ */ __name(() => workflowTabRef.value, "tabGetter"); + usePragmaticDraggable(tabGetter, { + getInitialData: /* @__PURE__ */ __name(() => { + return { + workflowKey: props.workflowOption.workflow.key + }; + }, "getInitialData") + }); + usePragmaticDroppable(tabGetter, { + getData: /* @__PURE__ */ __name(() => { + return { + workflowKey: props.workflowOption.workflow.key + }; + }, "getData"), + onDrop: /* @__PURE__ */ __name((e) => { + const fromIndex = workflowStore.openWorkflows.findIndex( + (wf) => wf.key === e.source.data.workflowKey + ); + const toIndex = workflowStore.openWorkflows.findIndex( + (wf) => wf.key === e.location.current.dropTargets[0]?.data.workflowKey + ); + if (fromIndex !== toIndex) { + workflowStore.reorderWorkflows(fromIndex, toIndex); + } + }, "onDrop") + }); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createElementBlock("div", mergeProps({ + class: "flex p-2 gap-2 workflow-tab", + ref_key: "workflowTabRef", + ref: workflowTabRef + }, _ctx.$attrs), [ + withDirectives((openBlock(), createElementBlock("span", _hoisted_1$1, [ + createTextVNode(toDisplayString(_ctx.workflowOption.workflow.filename), 1) + ])), [ + [ + _directive_tooltip, + _ctx.workflowOption.workflow.key, + void 0, + { bottom: true } + ] + ]), + createBaseVNode("div", _hoisted_2$1, [ + !unref(workspaceStore).shiftDown && (_ctx.workflowOption.workflow.isModified || !_ctx.workflowOption.workflow.isPersisted) ? (openBlock(), createElementBlock("span", _hoisted_3, "•")) : createCommentVNode("", true), + createVNode(unref(script$d), { + class: "close-button p-0 w-auto", + icon: "pi pi-times", + text: "", + severity: "secondary", + size: "small", + onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onCloseWorkflow(_ctx.workflowOption), ["stop"])) + }) + ]) + ], 16); + }; + } +}); +const WorkflowTab = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-8d011a31"]]); +const _sfc_main$2 = /* @__PURE__ */ defineComponent({ + __name: "WorkflowTabs", + props: { + class: {} + }, + setup(__props) { + const props = __props; + const { t } = useI18n(); + const workspaceStore = useWorkspaceStore(); + const workflowStore = useWorkflowStore(); + const workflowService = useWorkflowService(); + const rightClickedTab = ref(null); + const menu = ref(); + const workflowToOption = /* @__PURE__ */ __name((workflow) => ({ + value: workflow.path, + workflow + }), "workflowToOption"); + const options = computed( + () => workflowStore.openWorkflows.map(workflowToOption) + ); + const selectedWorkflow = computed( + () => workflowStore.activeWorkflow ? workflowToOption(workflowStore.activeWorkflow) : null + ); + const onWorkflowChange = /* @__PURE__ */ __name((option2) => { + if (!option2) { + return; + } + if (selectedWorkflow.value?.value === option2.value) { + return; + } + workflowService.openWorkflow(option2.workflow); + }, "onWorkflowChange"); + const closeWorkflows = /* @__PURE__ */ __name(async (options2) => { + for (const opt of options2) { + if (!await workflowService.closeWorkflow(opt.workflow, { + warnIfUnsaved: !workspaceStore.shiftDown + })) { + break; + } + } + }, "closeWorkflows"); + const onCloseWorkflow = /* @__PURE__ */ __name((option2) => { + closeWorkflows([option2]); + }, "onCloseWorkflow"); + const showContextMenu = /* @__PURE__ */ __name((event, option2) => { + rightClickedTab.value = option2; + menu.value.show(event); + }, "showContextMenu"); + const contextMenuItems = computed(() => { + const tab = rightClickedTab.value; + if (!tab) return []; + const index = options.value.findIndex((v) => v.workflow === tab.workflow); + return [ + { + label: t("tabMenu.duplicateTab"), + command: /* @__PURE__ */ __name(() => { + workflowService.duplicateWorkflow(tab.workflow); + }, "command") + }, + { + separator: true + }, + { + label: t("tabMenu.closeTab"), + command: /* @__PURE__ */ __name(() => onCloseWorkflow(tab), "command") + }, + { + label: t("tabMenu.closeTabsToLeft"), + command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(0, index)), "command"), + disabled: index <= 0 + }, + { + label: t("tabMenu.closeTabsToRight"), + command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(index + 1)), "command"), + disabled: index === options.value.length - 1 + }, + { + label: t("tabMenu.closeOtherTabs"), + command: /* @__PURE__ */ __name(() => closeWorkflows([ + ...options.value.slice(index + 1), + ...options.value.slice(0, index) + ]), "command"), + disabled: options.value.length <= 1 + } + ]; + }); + const commandStore = useCommandStore(); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + createVNode(unref(script$B), { + class: normalizeClass(["workflow-tabs bg-transparent inline", props.class]), + modelValue: selectedWorkflow.value, + "onUpdate:modelValue": onWorkflowChange, + options: options.value, + optionLabel: "label", + dataKey: "value" + }, { + option: withCtx(({ option: option2 }) => [ + createVNode(WorkflowTab, { + onContextmenu: /* @__PURE__ */ __name(($event) => showContextMenu($event, option2), "onContextmenu"), + onMouseup: withModifiers(($event) => onCloseWorkflow(option2), ["middle"]), + "workflow-option": option2 + }, null, 8, ["onContextmenu", "onMouseup", "workflow-option"]) + ]), + _: 1 + }, 8, ["class", "modelValue", "options"]), + createVNode(unref(script$d), { + class: "new-blank-workflow-button", + icon: "pi pi-plus", + text: "", + severity: "secondary", + onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow")) + }), + createVNode(unref(script$C), { + ref_key: "menu", + ref: menu, + model: contextMenuItems.value + }, null, 8, ["model"]) + ], 64); + }; + } +}); +const WorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d485c044"]]); +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-878b63b8"), n = n(), popScopeId(), n), "_withScopeId"); +const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("h1", { class: "comfyui-logo mx-2" }, "ComfyUI", -1)); +const _hoisted_2 = { class: "flex-grow" }; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js const _sfc_main$1 = /* @__PURE__ */ defineComponent({ __name: "TopMenubar", setup(__props) { @@ -8294,7 +12144,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({ }, [ _cache[1] || (_cache[1] = createBaseVNode("h1", { class: "comfyui-logo mx-2" }, "ComfyUI", -1)), createVNode(CommandMenubar), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(unref(script$H), { +======== + createVNode(unref(script$D), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js layout: "vertical", class: "mx-2" }), @@ -8307,8 +12161,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({ ref: menuRight }, null, 512), createVNode(Actionbar), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(_sfc_main$2), withDirectives(createVNode(unref(script$h), { +======== + createVNode(_sfc_main$5), + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js icon: "pi pi-bars", severity: "secondary", text: "", @@ -8324,37 +12183,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({ }; } }); -const TopMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d792da31"]]); -function setupAutoQueueHandler() { - const queueCountStore = useQueuePendingTaskCountStore(); - const queueSettingsStore = useQueueSettingsStore(); - let graphHasChanged = false; - let internalCount = 0; - api.addEventListener("graphChanged", () => { - if (queueSettingsStore.mode === "change") { - if (internalCount) { - graphHasChanged = true; - } else { - graphHasChanged = false; - app.queuePrompt(0, queueSettingsStore.batchCount); - internalCount++; - } - } - }); - queueCountStore.$subscribe( - () => { - internalCount = queueCountStore.count; - if (!internalCount && !app.lastExecutionError) { - if (queueSettingsStore.mode === "instant" || queueSettingsStore.mode === "change" && graphHasChanged) { - graphHasChanged = false; - app.queuePrompt(0, queueSettingsStore.batchCount); - } - } - }, - { detached: true } - ); -} -__name(setupAutoQueueHandler, "setupAutoQueueHandler"); +const TopMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-878b63b8"]]); var LatentPreviewMethod = /* @__PURE__ */ ((LatentPreviewMethod2) => { LatentPreviewMethod2["NoPreviews"] = "none"; LatentPreviewMethod2["Auto"] = "auto"; @@ -8833,7 +12662,10 @@ const SERVER_CONFIG_ITEMS = [ } ]; function useCoreCommands() { - const getTracker = /* @__PURE__ */ __name(() => useWorkflowStore()?.activeWorkflow?.changeTracker, "getTracker"); + const workflowService = useWorkflowService(); + const workflowStore = useWorkflowStore(); + const dialogService = useDialogService(); + const getTracker = /* @__PURE__ */ __name(() => workflowStore.activeWorkflow?.changeTracker, "getTracker"); const getSelectedNodes = /* @__PURE__ */ __name(() => { const selectedNodes = app.canvas.selected_nodes; const result = []; @@ -9002,7 +12834,9 @@ function useCoreCommands() { id: "Comfy.BrowseTemplates", icon: "pi pi-folder-open", label: "Browse Templates", - function: showTemplateWorkflowsDialog + function: /* @__PURE__ */ __name(() => { + dialogService.showTemplateWorkflowsDialog(); + }, "function") }, { id: "Comfy.Canvas.ZoomIn", @@ -9099,7 +12933,7 @@ function useCoreCommands() { label: "Show Settings Dialog", versionAdded: "1.3.7", function: /* @__PURE__ */ __name(() => { - showSettingsDialog(); + dialogService.showSettingsDialog(); }, "function") }, { @@ -9303,12 +13137,55 @@ function useCoreCommands() { menubarLabel: "About ComfyUI", versionAdded: "1.6.4", function: /* @__PURE__ */ __name(() => { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js showSettingsDialog("about"); +======== + dialogService.showSettingsDialog("about"); + }, "function") + }, + { + id: "Comfy.DuplicateWorkflow", + icon: "pi pi-clone", + label: "Duplicate Current Workflow", + versionAdded: "1.6.15", + function: /* @__PURE__ */ __name(() => { + workflowService.duplicateWorkflow(workflowStore.activeWorkflow); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js }, "function") } ]; } __name(useCoreCommands, "useCoreCommands"); +function setupAutoQueueHandler() { + const queueCountStore = useQueuePendingTaskCountStore(); + const queueSettingsStore = useQueueSettingsStore(); + let graphHasChanged = false; + let internalCount = 0; + api.addEventListener("graphChanged", () => { + if (queueSettingsStore.mode === "change") { + if (internalCount) { + graphHasChanged = true; + } else { + graphHasChanged = false; + app.queuePrompt(0, queueSettingsStore.batchCount); + internalCount++; + } + } + }); + queueCountStore.$subscribe( + () => { + internalCount = queueCountStore.count; + if (!internalCount && !app.lastExecutionError) { + if (queueSettingsStore.mode === "instant" || queueSettingsStore.mode === "change" && graphHasChanged) { + graphHasChanged = false; + app.queuePrompt(0, queueSettingsStore.batchCount); + } + } + }, + { detached: true } + ); +} +__name(setupAutoQueueHandler, "setupAutoQueueHandler"); const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "GraphView", setup(__props) { @@ -9317,9 +13194,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ const toast = useToast(); const settingStore = useSettingStore(); const executionStore = useExecutionStore(); - const theme11 = computed(() => settingStore.get("Comfy.ColorPalette")); + const theme10 = computed(() => settingStore.get("Comfy.ColorPalette")); watch( - theme11, + theme10, (newTheme) => { const DARK_THEME_CLASS = "dark-theme"; const isDarkTheme = newTheme !== "light"; @@ -9354,7 +13231,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ watchEffect(() => { const useNewMenu = settingStore.get("Comfy.UseNewMenu"); if (useNewMenu === "Disabled") { - app.ui.menuContainer.style.removeProperty("display"); + app.ui.menuContainer.style.setProperty("display", "block"); app.ui.restoreMenuPosition(); } else { app.ui.menuContainer.style.setProperty("display", "none"); @@ -9366,11 +13243,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ ); }); const init = /* @__PURE__ */ __name(() => { - settingStore.addSettings(app.ui.settings); const coreCommands = useCoreCommands(); useCommandStore().registerCommands(coreCommands); useMenuItemStore().registerCoreMenuCommands(); - useKeybindingStore().loadCoreKeybindings(); + useKeybindingService().registerCoreKeybindings(); useSidebarTabStore().registerCoreSidebarTabs(); useBottomPanelStore().registerCoreBottomPanelTabs(); app.extensionManager = useWorkspaceStore(); @@ -9412,10 +13288,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ api.removeEventListener("reconnected", onReconnected); executionStore.unbindExecutionEvents(); }); + useEventListener(window, "keydown", useKeybindingService().keybindHandler); const onGraphReady = /* @__PURE__ */ __name(() => { requestIdleCallback( () => { - useKeybindingStore().loadUserKeybindings(); + useKeybindingService().registerUserKeybindings(); useServerConfigStore().loadServerConfig( SERVER_CONFIG_ITEMS, settingStore.get("Comfy.Server.ServerConfigValues") @@ -9430,10 +13307,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [ createVNode(TopMenubar), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js createVNode(_sfc_main$d, { onReady: onGraphReady }), createVNode(_sfc_main$b), createVNode(_sfc_main$a), createVNode(_sfc_main$9), +======== + createVNode(_sfc_main$a, { onReady: onGraphReady }), + createVNode(_sfc_main$9), + createVNode(_sfc_main$r), + createVNode(_sfc_main$t), +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js createVNode(MenuHamburger) ], 64); }; @@ -9442,4 +13326,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ export { _sfc_main as default }; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js //# sourceMappingURL=GraphView-CtNN12CD.js.map +======== +//# sourceMappingURL=GraphView-HVeNbkaW.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js diff --git a/comfy/web/assets/GraphView-D9bTLjwH.css b/comfy/web/assets/GraphView-D9bTLjwH.css index 18df9864a..f0fc54fe0 100644 --- a/comfy/web/assets/GraphView-D9bTLjwH.css +++ b/comfy/web/assets/GraphView-D9bTLjwH.css @@ -1,4 +1,5 @@ +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css .group-title-editor.node-title-editor[data-v-fe2de13a] { z-index: 9999; padding: 0.25rem; @@ -80,11 +81,39 @@ pointer-events: auto; } .splitter-overlay[data-v-95268c0b] { +======== +.comfy-menu-hamburger[data-v-5661bed0] { + pointer-events: auto; + position: fixed; + z-index: 9999; +} + +[data-v-e50caa15] .p-splitter-gutter { + pointer-events: auto; +} +[data-v-e50caa15] .p-splitter-gutter:hover,[data-v-e50caa15] .p-splitter-gutter[data-p-gutter-resizing='true'] { + transition: background-color 0.2s ease 300ms; + background-color: var(--p-primary-color); +} +.side-bar-panel[data-v-e50caa15] { + background-color: var(--bg-color); + pointer-events: auto; +} +.bottom-panel[data-v-e50caa15] { + background-color: var(--bg-color); + pointer-events: auto; +} +.splitter-overlay[data-v-e50caa15] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css pointer-events: none; border-style: none; background-color: transparent; } +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css .splitter-overlay-root[data-v-95268c0b] { +======== +.splitter-overlay-root[data-v-e50caa15] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css position: absolute; top: 0px; left: 0px; @@ -98,7 +127,50 @@ z-index: 999; } -[data-v-d7cc0bce] .highlight { +.p-buttongroup-vertical[data-v-cf40dd39] { + display: flex; + flex-direction: column; + border-radius: var(--p-button-border-radius); + overflow: hidden; + border: 1px solid var(--p-panel-border-color); +} +.p-buttongroup-vertical .p-button[data-v-cf40dd39] { + margin: 0; + border-radius: 0; +} + +.node-tooltip[data-v-46859edf] { + background: var(--comfy-input-bg); + border-radius: 5px; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); + color: var(--input-text); + font-family: sans-serif; + left: 0; + max-width: 30vw; + padding: 4px 8px; + position: absolute; + top: 0; + transform: translate(5px, calc(-100% - 5px)); + white-space: pre-wrap; + z-index: 99999; +} + +.group-title-editor.node-title-editor[data-v-12d3fd12] { + z-index: 9999; + padding: 0.25rem; +} +[data-v-12d3fd12] .editable-text { + width: 100%; + height: 100%; +} +[data-v-12d3fd12] .editable-text input { + width: 100%; + height: 100%; + /* Override the default font size */ + font-size: inherit; +} + +[data-v-5741c9ae] .highlight { background-color: var(--p-primary-color); color: var(--p-primary-contrast-color); font-weight: bold; @@ -125,41 +197,111 @@ align-items: flex-start !important; } -.node-tooltip[data-v-9ecc8adc] { - background: var(--comfy-input-bg); - border-radius: 5px; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); - color: var(--input-text); - font-family: sans-serif; - left: 0; - max-width: 30vw; - padding: 4px 8px; - position: absolute; - top: 0; - transform: translate(5px, calc(-100% - 5px)); - white-space: pre-wrap; - z-index: 99999; +.side-bar-button-icon { + font-size: var(--sidebar-icon-size) !important; +} +.side-bar-button-selected .side-bar-button-icon { + font-size: var(--sidebar-icon-size) !important; + font-weight: bold; } -.p-buttongroup-vertical[data-v-94481f39] { - display: flex; - flex-direction: column; - border-radius: var(--p-button-border-radius); - overflow: hidden; - border: 1px solid var(--p-panel-border-color); -} -.p-buttongroup-vertical .p-button[data-v-94481f39] { - margin: 0; +.side-bar-button[data-v-6ab4daa6] { + width: var(--sidebar-width); + height: var(--sidebar-width); border-radius: 0; } - -.comfy-menu-hamburger[data-v-962c4073] { - pointer-events: auto; - position: fixed; - z-index: 9999; +.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6], +.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover { + border-left: 4px solid var(--p-button-text-primary-color); +} +.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6], +.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover { + border-right: 4px solid var(--p-button-text-primary-color); } +:root { + --sidebar-width: 64px; + --sidebar-icon-size: 1.5rem; +} +:root .small-sidebar { + --sidebar-width: 40px; + --sidebar-icon-size: 1rem; +} + +.side-tool-bar-container[data-v-37d8d7b4] { + display: flex; + flex-direction: column; + align-items: center; + + pointer-events: auto; + + width: var(--sidebar-width); + height: 100%; + + background-color: var(--comfy-menu-secondary-bg); + color: var(--fg-color); + box-shadow: var(--bar-shadow); +} +.side-tool-bar-end[data-v-37d8d7b4] { + align-self: flex-end; + margin-top: auto; +} + +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css .status-indicator[data-v-7381014c] { +======== +[data-v-b9328350] .p-inputtext { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.comfyui-queue-button[data-v-7f4f551b] .p-splitbutton-dropdown { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.actionbar[data-v-915e5456] { + pointer-events: all; + position: fixed; + z-index: 1000; +} +.actionbar.is-docked[data-v-915e5456] { + position: static; + border-style: none; + background-color: transparent; + padding: 0px; +} +.actionbar.is-dragging[data-v-915e5456] { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +[data-v-915e5456] .p-panel-content { + padding: 0.25rem; +} +.is-docked[data-v-915e5456] .p-panel-content { + padding: 0px; +} +[data-v-915e5456] .p-panel-header { + display: none; +} + +.top-menubar[data-v-6fecd137] .p-menubar-item-link svg { + display: none; +} +[data-v-6fecd137] .p-menubar-submenu.dropdown-direction-up { + top: auto; + bottom: 100%; + flex-direction: column-reverse; +} +.keybinding-tag[data-v-6fecd137] { + background: var(--p-content-hover-background); + border-color: var(--p-content-border-color); + border-style: solid; +} + +.status-indicator[data-v-8d011a31] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css position: absolute; font-weight: 700; font-size: 1.5rem; @@ -168,16 +310,24 @@ transform: translate(-50%, -50%) } +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css [data-v-b447982f] .p-togglebutton::before { display: none } [data-v-b447982f] .p-togglebutton { +======== +[data-v-d485c044] .p-togglebutton::before { + display: none +} +[data-v-d485c044] .p-togglebutton { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css position: relative; flex-shrink: 0; border-radius: 0px; background-color: transparent; padding: 0px } +<<<<<<<< HEAD:comfy/web/assets/GraphView-D9bTLjwH.css [data-v-b447982f] .p-togglebutton.p-togglebutton-checked { border-bottom-width: 2px; border-bottom-color: var(--p-button-text-primary-color) @@ -243,6 +393,23 @@ } .comfyui-menu[data-v-d792da31] { +======== +[data-v-d485c044] .p-togglebutton.p-togglebutton-checked { + border-bottom-width: 2px; + border-bottom-color: var(--p-button-text-primary-color) +} +[data-v-d485c044] .p-togglebutton-checked .close-button,[data-v-d485c044] .p-togglebutton:hover .close-button { + visibility: visible +} +[data-v-d485c044] .p-togglebutton:hover .status-indicator { + display: none +} +[data-v-d485c044] .p-togglebutton .close-button { + visibility: hidden +} + +.comfyui-menu[data-v-878b63b8] { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-CIRWBKTm.css width: 100vw; background: var(--comfy-menu-bg); color: var(--fg-color); @@ -255,16 +422,16 @@ grid-column: 1/-1; max-height: 90vh; } -.comfyui-menu.dropzone[data-v-d792da31] { +.comfyui-menu.dropzone[data-v-878b63b8] { background: var(--p-highlight-background); } -.comfyui-menu.dropzone-active[data-v-d792da31] { +.comfyui-menu.dropzone-active[data-v-878b63b8] { background: var(--p-highlight-background-focus); } -[data-v-d792da31] .p-menubar-item-label { +[data-v-878b63b8] .p-menubar-item-label { line-height: revert; } -.comfyui-logo[data-v-d792da31] { +.comfyui-logo[data-v-878b63b8] { font-size: 1.2em; -webkit-user-select: none; -moz-user-select: none; diff --git a/comfy/web/assets/GraphView-HVeNbkaW.js b/comfy/web/assets/GraphView-HVeNbkaW.js new file mode 100644 index 000000000..7da27b8eb --- /dev/null +++ b/comfy/web/assets/GraphView-HVeNbkaW.js @@ -0,0 +1,13333 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +import { d as defineStore, s as shallowRef, a as defineComponent, u as useSettingStore, r as ref, w as watch, L as LGraphGroup, b as app, c as LGraphNode, e as useEventListener, o as openBlock, f as createElementBlock, g as createVNode, E as EditableText, n as normalizeStyle, h as createCommentVNode, i as LiteGraph, _ as _export_sfc, B as BaseStyle, j as script$g, k as resolveComponent, m as mergeProps, l as renderSlot, p as computed, q as resolveDirective, t as withDirectives, v as createBlock, x as withCtx, y as unref, z as createBaseVNode, A as normalizeClass, C as script$h, D as useCommandStore, F as useDialogStore, S as SettingDialogHeader, G as SettingDialogContent, H as useI18n, I as useUserStore, J as onBeforeUnmount, K as resolveDynamicComponent, M as useWorkspaceStore, N as useKeybindingStore, O as Fragment, P as renderList, T as Teleport, Q as script$i, R as getWidth, U as findSingle, V as getOuterHeight, W as getOffset, X as getOuterWidth, Y as getHeight, Z as script$j, $ as script$k, a0 as Ripple, a1 as getAttribute, a2 as focus, a3 as equals, a4 as useBottomPanelStore, a5 as toDisplayString, a6 as script$l, a7 as getVNodeProp, a8 as isArray, a9 as useSidebarTabStore, aa as vShow, ab as isNotEmpty, ac as script$m, ad as UniqueComponentId, ae as ZIndex, af as resolveFieldData, ag as OverlayEventBus, ah as isEmpty, ai as addStyle, aj as relativePosition, ak as absolutePosition, al as ConnectedOverlayScrollHandler, am as isTouchDevice, an as findLastIndex, ao as script$n, ap as script$o, aq as script$p, ar as script$q, as as script$r, at as script$s, au as Transition, av as createSlots, aw as createTextVNode, ax as useNodeFrequencyStore, ay as useNodeBookmarkStore, az as highlightQuery, aA as script$t, aB as formatNumberWithSuffix, aC as NodeSourceType, aD as useNodeDefStore, aE as onMounted, aF as NodePreview, aG as NodeSearchFilter, aH as script$u, aI as SearchFilterChip, aJ as nextTick, aK as storeToRefs, aL as watchEffect, aM as isRef, aN as toRaw, aO as LinkReleaseTriggerAction, aP as st, aQ as normalizeI18nKey, aR as getColorPalette, aS as BadgePosition, aT as LGraphBadge, aU as _, aV as defaultColorPalette, aW as NodeBadgeMode, aX as markRaw, aY as useModelToNodeStore, aZ as CanvasPointer, a_ as useWorkflowStore, a$ as setStorageValue, b0 as api, b1 as usePragmaticDroppable, b2 as ComfyNodeDefImpl, b3 as ComfyModelDef, b4 as LGraph, b5 as LLink, b6 as DragAndScale, b7 as LGraphCanvas, b8 as ContextMenu, b9 as ChangeTracker, ba as workflowService, bb as showNativeMenu, bc as script$v, bd as script$w, be as script$x, bf as script$y, bg as normalizeProps, bh as ToastEventBus, bi as setAttribute, bj as TransitionGroup, bk as useToast, bl as useToastStore, bm as useExecutionStore, bn as useTitle, bo as usePragmaticDraggable, bp as withModifiers, bq as script$z, br as script$A, bs as resolve, bt as script$B, bu as script$C, bv as isPrintableCharacter, bw as guardReactiveProps, bx as useMenuItemStore, by as script$F, bz as nestedPosition, bA as useQueueSettingsStore, bB as script$G, bC as useQueuePendingTaskCountStore, bD as useLocalStorage, bE as useDraggable, bF as watchDebounced, bG as inject, bH as useElementBounding, bI as lodashExports, bJ as useEventBus, bK as provide, bL as script$H, bM as LGraphEventMode, bN as useQueueStore, bO as showTemplateWorkflowsDialog, bP as showSettingsDialog, bQ as i18n, bR as useModelStore } from "./index-BK27PIiK.js"; +import { s as script$D, a as script$E } from "./index-4Y1pXkN0.js"; +import { u as useServerConfigStore } from "./serverConfigStore-7qHooIp9.js"; +const useTitleEditorStore = defineStore("titleEditor", () => { + const titleEditorTarget = shallowRef(null); + return { + titleEditorTarget + }; +}); +const useCanvasStore = defineStore("canvas", () => { + const canvas = shallowRef(null); + return { + canvas + }; +}); +const _sfc_main$t = /* @__PURE__ */ defineComponent({ + __name: "TitleEditor", +======== +import { d as defineComponent, u as useExecutionStore, c as computed, a as useSettingStore, b as useWorkflowStore, e as useTitle, o as openBlock, f as createElementBlock, g as useWorkspaceStore, w as watchEffect, h as app, r as resolveDirective, i as withDirectives, v as vShow, j as unref, k as createBlock, n as normalizeStyle, s as showNativeMenu, l as script$d, _ as _export_sfc, m as onMounted, p as onBeforeUnmount, B as BaseStyle, q as script$e, t as getWidth, x as getHeight, y as getOuterWidth, z as getOuterHeight, A as getVNodeProp, C as isArray, D as mergeProps, F as Fragment, E as renderList, G as resolveDynamicComponent, H as createBaseVNode, I as createCommentVNode, J as renderSlot, K as useSidebarTabStore, L as useBottomPanelStore, M as withCtx, N as createVNode, O as getAttribute, P as findSingle, Q as focus, R as equals, S as Ripple, T as normalizeClass, U as getOffset, V as script$f, W as script$g, X as toDisplayString, Y as script$h, Z as markRaw, $ as defineStore, a0 as shallowRef, a1 as useI18n, a2 as useCommandStore, a3 as LiteGraph, a4 as useColorPaletteStore, a5 as watch, a6 as useNodeDefStore, a7 as BadgePosition, a8 as LGraphBadge, a9 as _, aa as NodeBadgeMode, ab as ref, ac as useEventListener, ad as nextTick, ae as st, af as normalizeI18nKey, ag as LGraphGroup, ah as LGraphNode, ai as EditableText, aj as isNotEmpty, ak as UniqueComponentId, al as ZIndex, am as resolveFieldData, an as OverlayEventBus, ao as isEmpty, ap as addStyle, aq as relativePosition, ar as absolutePosition, as as ConnectedOverlayScrollHandler, at as isTouchDevice, au as findLastIndex, av as script$i, aw as script$j, ax as script$k, ay as script$l, az as script$m, aA as script$n, aB as resolveComponent, aC as Transition, aD as createSlots, aE as createTextVNode, aF as useNodeFrequencyStore, aG as useNodeBookmarkStore, aH as highlightQuery, aI as script$o, aJ as formatNumberWithSuffix, aK as NodeSourceType, aL as pushScopeId, aM as popScopeId, aN as NodePreview, aO as NodeSearchFilter, aP as script$p, aQ as SearchFilterChip, aR as useLitegraphService, aS as storeToRefs, aT as isRef, aU as toRaw, aV as LinkReleaseTriggerAction, aW as script$q, aX as useUserStore, aY as useDialogStore, aZ as SettingDialogHeader, a_ as SettingDialogContent, a$ as useKeybindingStore, b0 as Teleport, b1 as LinkMarkerShape, b2 as useModelToNodeStore, b3 as CanvasPointer, b4 as IS_CONTROL_WIDGET, b5 as updateControlWidgetLabel, b6 as useColorPaletteService, b7 as setStorageValue, b8 as api, b9 as usePragmaticDroppable, ba as LGraph, bb as LLink, bc as DragAndScale, bd as LGraphCanvas, be as ContextMenu, bf as ChangeTracker, bg as useWorkflowService, bh as ComfyNodeDefImpl, bi as ComfyModelDef, bj as script$r, bk as script$s, bl as script$t, bm as script$u, bn as script$v, bo as normalizeProps, bp as ToastEventBus, bq as setAttribute, br as TransitionGroup, bs as useToast, bt as useToastStore, bu as resolve, bv as nestedPosition, bw as script$w, bx as isPrintableCharacter, by as useQueueSettingsStore, bz as script$x, bA as useQueuePendingTaskCountStore, bB as useLocalStorage, bC as useDraggable, bD as watchDebounced, bE as inject, bF as useElementBounding, bG as lodashExports, bH as useEventBus, bI as script$z, bJ as guardReactiveProps, bK as useMenuItemStore, bL as usePragmaticDraggable, bM as withModifiers, bN as script$B, bO as script$C, bP as provide, bQ as script$D, bR as useDialogService, bS as LGraphEventMode, bT as useQueueStore, bU as i18n, bV as useModelStore } from "./index-DjNHn37O.js"; +import { s as script$y } from "./index-jXPKy3pP.js"; +import { s as script$A } from "./index-B-aVupP5.js"; +import { u as useKeybindingService } from "./keybindingService-Bx7YdkXn.js"; +import { u as useServerConfigStore } from "./serverConfigStore-CvyKFVuP.js"; +import "./index-5HFeZax4.js"; +const DEFAULT_TITLE = "ComfyUI"; +const TITLE_SUFFIX = " - ComfyUI"; +const _sfc_main$t = /* @__PURE__ */ defineComponent({ + __name: "BrowserTabTitle", + setup(__props) { + const executionStore = useExecutionStore(); + const executionText = computed( + () => executionStore.isIdle ? "" : `[${executionStore.executionProgress}%]` + ); + const settingStore = useSettingStore(); + const betaMenuEnabled = computed( + () => settingStore.get("Comfy.UseNewMenu") !== "Disabled" + ); + const workflowStore = useWorkflowStore(); + const isUnsavedText = computed( + () => workflowStore.activeWorkflow?.isModified || !workflowStore.activeWorkflow?.isPersisted ? " *" : "" + ); + const workflowNameText = computed(() => { + const workflowName = workflowStore.activeWorkflow?.filename; + return workflowName ? isUnsavedText.value + workflowName + TITLE_SUFFIX : DEFAULT_TITLE; + }); + const nodeExecutionTitle = computed( + () => executionStore.executingNode && executionStore.executingNodeProgress ? `${executionText.value}[${executionStore.executingNodeProgress}%] ${executionStore.executingNode.type}` : "" + ); + const workflowTitle = computed( + () => executionText.value + (betaMenuEnabled.value ? workflowNameText.value : DEFAULT_TITLE) + ); + const title = computed(() => nodeExecutionTitle.value || workflowTitle.value); + useTitle(title); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +const _sfc_main$s = /* @__PURE__ */ defineComponent({ + __name: "MenuHamburger", +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + setup(__props) { + const workspaceState = useWorkspaceStore(); + const settingStore = useSettingStore(); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + const showInput = ref(false); + const editedTitle = ref(""); + const inputStyle = ref({ + position: "fixed", + left: "0px", + top: "0px", + width: "200px", + height: "20px", + fontSize: "12px" + }); + const titleEditorStore = useTitleEditorStore(); + const canvasStore = useCanvasStore(); + const previousCanvasDraggable = ref(true); + const onEdit = /* @__PURE__ */ __name((newValue) => { + if (titleEditorStore.titleEditorTarget && newValue.trim() !== "") { + titleEditorStore.titleEditorTarget.title = newValue.trim(); + app.graph.setDirtyCanvas(true, true); + } + showInput.value = false; + titleEditorStore.titleEditorTarget = null; + canvasStore.canvas.allow_dragcanvas = previousCanvasDraggable.value; + }, "onEdit"); + watch( + () => titleEditorStore.titleEditorTarget, + (target) => { + if (target === null) { + return; + } + editedTitle.value = target.title; + showInput.value = true; + previousCanvasDraggable.value = canvasStore.canvas.allow_dragcanvas; + canvasStore.canvas.allow_dragcanvas = false; + if (target instanceof LGraphGroup) { + const group = target; + const [x, y] = group.pos; + const [w, h] = group.size; + const [left, top] = app.canvasPosToClientPos([x, y]); + inputStyle.value.left = `${left}px`; + inputStyle.value.top = `${top}px`; + const width = w * app.canvas.ds.scale; + const height = group.titleHeight * app.canvas.ds.scale; + inputStyle.value.width = `${width}px`; + inputStyle.value.height = `${height}px`; + const fontSize = group.font_size * app.canvas.ds.scale; + inputStyle.value.fontSize = `${fontSize}px`; + } else if (target instanceof LGraphNode) { + const node = target; + const [x, y] = node.getBounding(); + const canvasWidth = node.width; + const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT; + const [left, top] = app.canvasPosToClientPos([x, y]); + inputStyle.value.left = `${left}px`; + inputStyle.value.top = `${top}px`; + const width = canvasWidth * app.canvas.ds.scale; + const height = canvasHeight * app.canvas.ds.scale; + inputStyle.value.width = `${width}px`; + inputStyle.value.height = `${height}px`; + const fontSize = 12 * app.canvas.ds.scale; + inputStyle.value.fontSize = `${fontSize}px`; + } + } + ); + const canvasEventHandler = /* @__PURE__ */ __name((event) => { + if (event.detail.subType === "group-double-click") { + if (!settingStore.get("Comfy.Group.DoubleClickTitleToEdit")) { + return; + } + const group = event.detail.group; + const [x, y] = group.pos; + const e = event.detail.originalEvent; + const relativeY = e.canvasY - y; + if (relativeY <= group.titleHeight) { + titleEditorStore.titleEditorTarget = group; + } + } else if (event.detail.subType === "node-double-click") { + if (!settingStore.get("Comfy.Node.DoubleClickTitleToEdit")) { + return; + } + const node = event.detail.node; + const [x, y] = node.pos; + const e = event.detail.originalEvent; + const relativeY = e.canvasY - y; + if (relativeY <= 0) { + titleEditorStore.titleEditorTarget = node; + } + } + }, "canvasEventHandler"); + useEventListener(document, "litegraph:canvas", canvasEventHandler); + return (_ctx, _cache) => { + return showInput.value ? (openBlock(), createElementBlock("div", { + key: 0, + class: "group-title-editor node-title-editor", + style: normalizeStyle(inputStyle.value) + }, [ + createVNode(EditableText, { + isEditing: showInput.value, + modelValue: editedTitle.value, + onEdit + }, null, 8, ["isEditing", "modelValue"]) + ], 4)) : createCommentVNode("", true); + }; + } +}); +const TitleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-fe2de13a"]]); +var theme$8 = /* @__PURE__ */ __name(function theme(_ref) { + var dt = _ref.dt; + return "\n.p-overlaybadge {\n position: relative;\n}\n\n.p-overlaybadge .p-badge {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n transform-origin: 100% 0;\n margin: 0;\n outline-width: ".concat(dt("overlaybadge.outline.width"), ";\n outline-style: solid;\n outline-color: ").concat(dt("overlaybadge.outline.color"), ";\n}\n\n.p-overlaybadge .p-badge:dir(rtl) {\n transform: translate(-50%, -50%);\n}\n"); +}, "theme"); +var classes$b = { + root: "p-overlaybadge" +}; +var OverlayBadgeStyle = BaseStyle.extend({ + name: "overlaybadge", + theme: theme$8, + classes: classes$b +}); +var script$1$b = { + name: "OverlayBadge", + "extends": script$g, + style: OverlayBadgeStyle, + provide: /* @__PURE__ */ __name(function provide2() { + return { + $pcOverlayBadge: this, + $parentInstance: this + }; + }, "provide") +}; +var script$f = { + name: "OverlayBadge", + "extends": script$1$b, + inheritAttrs: false, + components: { + Badge: script$g + } +}; +function render$l(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Badge = resolveComponent("Badge"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default"), createVNode(_component_Badge, mergeProps(_ctx.$props, { + pt: _ctx.ptm("pcBadge") + }), null, 16, ["pt"])], 16); +} +__name(render$l, "render$l"); +script$f.render = render$l; +const _sfc_main$s = /* @__PURE__ */ defineComponent({ + __name: "SidebarIcon", + props: { + icon: String, + selected: Boolean, + tooltip: { + type: String, + default: "" + }, + class: { + type: String, + default: "" + }, + iconBadge: { + type: [String, Function], + default: "" + } + }, + emits: ["click"], + setup(__props, { emit: __emit }) { + const props = __props; + const emit = __emit; + const overlayValue = computed( + () => typeof props.iconBadge === "function" ? props.iconBadge() || "" : props.iconBadge +======== + const exitFocusMode = /* @__PURE__ */ __name(() => { + workspaceState.focusMode = false; + }, "exitFocusMode"); + watchEffect(() => { + if (settingStore.get("Comfy.UseNewMenu") !== "Disabled") { + return; + } + if (workspaceState.focusMode) { + app.ui.menuContainer.style.display = "none"; + } else { + app.ui.menuContainer.style.display = "block"; + } + }); + const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu")); + const positionCSS = computed( + () => ( + // 'Bottom' menuSetting shows the hamburger button in the bottom right corner + // 'Disabled', 'Top' menuSetting shows the hamburger button in the top right corner + menuSetting.value === "Bottom" ? { bottom: "0px", right: "0px" } : { top: "0px", right: "0px" } + ) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + ); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + return withDirectives((openBlock(), createBlock(unref(script$h), { + class: normalizeClass(props.class), + text: "", + pt: { + root: { + class: `side-bar-button ${props.selected ? "p-button-primary side-bar-button-selected" : "p-button-secondary"}`, + "aria-label": props.tooltip + } + }, + onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event)) + }, { + icon: withCtx(() => [ + shouldShowBadge.value ? (openBlock(), createBlock(unref(script$f), { + key: 0, + value: overlayValue.value + }, { + default: withCtx(() => [ + createBaseVNode("i", { + class: normalizeClass(props.icon + " side-bar-button-icon") + }, null, 2) + ]), + _: 1 + }, 8, ["value"])) : (openBlock(), createElementBlock("i", { + key: 1, + class: normalizeClass(props.icon + " side-bar-button-icon") + }, null, 2)) + ]), + _: 1 + }, 8, ["class", "pt"])), [ + [_directive_tooltip, { value: props.tooltip, showDelay: 300, hideDelay: 300 }] +======== + return withDirectives((openBlock(), createBlock(unref(script$d), { + class: "comfy-menu-hamburger", + style: normalizeStyle(positionCSS.value), + icon: "pi pi-bars", + severity: "secondary", + text: "", + size: "large", + onClick: exitFocusMode, + onContextmenu: unref(showNativeMenu) + }, null, 8, ["style", "onContextmenu"])), [ + [vShow, unref(workspaceState).focusMode], + [_directive_tooltip, { value: _ctx.$t("menu.showMenu"), showDelay: 300 }] +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-caa3ee9c"]]); +const _sfc_main$r = /* @__PURE__ */ defineComponent({ + __name: "SidebarThemeToggleIcon", + setup(__props) { + const settingStore = useSettingStore(); + const currentTheme = computed(() => settingStore.get("Comfy.ColorPalette")); + const icon = computed( + () => currentTheme.value !== "light" ? "pi pi-moon" : "pi pi-sun" + ); + const commandStore = useCommandStore(); + const toggleTheme = /* @__PURE__ */ __name(() => { + commandStore.execute("Comfy.ToggleTheme"); + }, "toggleTheme"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: icon.value, + onClick: toggleTheme, + tooltip: _ctx.$t("sideToolbar.themeToggle"), + class: "comfy-vue-theme-toggle" + }, null, 8, ["icon", "tooltip"]); + }; + } +}); +const _sfc_main$q = /* @__PURE__ */ defineComponent({ + __name: "SidebarSettingsToggleIcon", + setup(__props) { + const dialogStore = useDialogStore(); + const showSetting = /* @__PURE__ */ __name(() => { + dialogStore.showDialog({ + key: "global-settings", + headerComponent: SettingDialogHeader, + component: SettingDialogContent + }); + }, "showSetting"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: "pi pi-cog", + class: "comfy-settings-btn", + onClick: showSetting, + tooltip: _ctx.$t("g.settings") + }, null, 8, ["tooltip"]); + }; + } +}); +const _sfc_main$p = /* @__PURE__ */ defineComponent({ + __name: "SidebarLogoutIcon", + setup(__props) { + const { t } = useI18n(); + const userStore = useUserStore(); + const tooltip = computed( + () => `${t("sideToolbar.logout")} (${userStore.currentUser?.username})` + ); + const logout = /* @__PURE__ */ __name(() => { + userStore.logout(); + window.location.reload(); + }, "logout"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: "pi pi-sign-out", + tooltip: tooltip.value, + onClick: logout + }, null, 8, ["tooltip"]); + }; + } +}); +const _sfc_main$o = /* @__PURE__ */ defineComponent({ + __name: "ExtensionSlot", + props: { + extension: {} + }, + setup(__props) { + const props = __props; + const mountCustomExtension = /* @__PURE__ */ __name((extension, el) => { + extension.render(el); + }, "mountCustomExtension"); +======== +const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5661bed0"]]); +const _sfc_main$r = /* @__PURE__ */ defineComponent({ + __name: "UnloadWindowConfirmDialog", + setup(__props) { + const settingStore = useSettingStore(); + const handleBeforeUnload = /* @__PURE__ */ __name((event) => { + if (settingStore.get("Comfy.Window.UnloadConfirmation")) { + event.preventDefault(); + return true; + } + return void 0; + }, "handleBeforeUnload"); + onMounted(() => { + window.addEventListener("beforeunload", handleBeforeUnload); + }); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + onBeforeUnmount(() => { + window.removeEventListener("beforeunload", handleBeforeUnload); + }); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const _hoisted_1$n = { class: "side-tool-bar-end" }; +const _hoisted_2$b = { + key: 0, + class: "sidebar-content-container h-full overflow-y-auto overflow-x-hidden" +}; +const _sfc_main$n = /* @__PURE__ */ defineComponent({ + __name: "SideToolbar", + setup(__props) { + const workspaceStore = useWorkspaceStore(); + const settingStore = useSettingStore(); + const userStore = useUserStore(); + const teleportTarget = computed( + () => settingStore.get("Comfy.Sidebar.Location") === "left" ? ".comfyui-body-left" : ".comfyui-body-right" + ); + const isSmall = computed( + () => settingStore.get("Comfy.Sidebar.Size") === "small" + ); + const tabs = computed(() => workspaceStore.getSidebarTabs()); + const selectedTab = computed(() => workspaceStore.sidebarTab.activeSidebarTab); + const onTabClick = /* @__PURE__ */ __name((item3) => { + workspaceStore.sidebarTab.toggleSidebarTab(item3.id); + }, "onTabClick"); + const keybindingStore = useKeybindingStore(); + const getTabTooltipSuffix = /* @__PURE__ */ __name((tab) => { + const keybinding = keybindingStore.getKeybindingByCommandId( + `Workspace.ToggleSidebarTab.${tab.id}` + ); + return keybinding ? ` (${keybinding.combo.toString()})` : ""; + }, "getTabTooltipSuffix"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + (openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [ + createBaseVNode("nav", { + class: normalizeClass("side-tool-bar-container" + (isSmall.value ? " small-sidebar" : "")) + }, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(tabs.value, (tab) => { + return openBlock(), createBlock(SidebarIcon, { + key: tab.id, + icon: tab.icon, + iconBadge: tab.iconBadge, + tooltip: tab.tooltip + getTabTooltipSuffix(tab), + selected: tab.id === selectedTab.value?.id, + class: normalizeClass(tab.id + "-tab-button"), + onClick: /* @__PURE__ */ __name(($event) => onTabClick(tab), "onClick") + }, null, 8, ["icon", "iconBadge", "tooltip", "selected", "class", "onClick"]); + }), 128)), + createBaseVNode("div", _hoisted_1$n, [ + unref(userStore).isMultiUserServer ? (openBlock(), createBlock(_sfc_main$p, { key: 0 })) : createCommentVNode("", true), + createVNode(_sfc_main$r), + createVNode(_sfc_main$q) + ]) + ], 2) + ], 8, ["to"])), + selectedTab.value ? (openBlock(), createElementBlock("div", _hoisted_2$b, [ + createVNode(_sfc_main$o, { extension: selectedTab.value }, null, 8, ["extension"]) + ])) : createCommentVNode("", true) + ], 64); + }; + } +}); +const SideToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-7851c166"]]); +var classes$a = { + root: "p-tablist", + content: /* @__PURE__ */ __name(function content(_ref) { + var instance = _ref.instance; + return ["p-tablist-content", { + "p-tablist-viewport": instance.$pcTabs.scrollable + }]; + }, "content"), + tabList: "p-tablist-tab-list", + activeBar: "p-tablist-active-bar", + prevButton: "p-tablist-prev-button p-tablist-nav-button", + nextButton: "p-tablist-next-button p-tablist-nav-button" +}; +var TabListStyle = BaseStyle.extend({ + name: "tablist", + classes: classes$a +}); +var script$1$a = { + name: "BaseTabList", + "extends": script$i, + props: {}, + style: TabListStyle, + provide: /* @__PURE__ */ __name(function provide3() { + return { + $pcTabList: this, + $parentInstance: this + }; + }, "provide") +}; +var script$e = { + name: "TabList", + "extends": script$1$a, + inheritAttrs: false, + inject: ["$pcTabs"], + mutationObserver: null, + data: /* @__PURE__ */ __name(function data() { + return { + isPrevButtonEnabled: false, + isNextButtonEnabled: true, + isRTL: false + }; + }, "data"), + resizeObserver: void 0, + watch: { + showNavigators: /* @__PURE__ */ __name(function showNavigators(newValue) { + newValue ? this.bindResizeObserver() : this.unbindResizeObserver(); + }, "showNavigators"), + activeValue: { + flush: "post", + handler: /* @__PURE__ */ __name(function handler() { + this.updateInkBar(); + }, "handler") + } + }, + mounted: /* @__PURE__ */ __name(function mounted() { + var _this = this; + this.$nextTick(function() { + _this.updateInkBar(); + }); + if (this.showNavigators) { + this.updateButtonState(); + this.bindResizeObserver(); + } + this.updateDirection(); + this.observeDirectionChanges(); + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated() { + this.showNavigators && this.updateButtonState(); + }, "updated"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() { + this.unbindResizeObserver(); + if (this.mutationObserver) { + this.mutationObserver.disconnect(); + } + }, "beforeUnmount"), + methods: { + onScroll: /* @__PURE__ */ __name(function onScroll(event) { + this.showNavigators && this.updateButtonState(); + event.preventDefault(); + }, "onScroll"), + onPrevButtonClick: /* @__PURE__ */ __name(function onPrevButtonClick() { + var content2 = this.$refs.content; + var width = getWidth(content2); + var pos; + if (this.isRTL) { + pos = content2.scrollLeft + width; + } else { + pos = content2.scrollLeft - width; + } + content2.scrollLeft = pos <= 0 ? 0 : pos; + }, "onPrevButtonClick"), + onNextButtonClick: /* @__PURE__ */ __name(function onNextButtonClick() { + var content2 = this.$refs.content; + var width = getWidth(content2) - this.getVisibleButtonWidths(); + var pos, lastPos; + if (this.isRTL) { + pos = content2.scrollLeft - width; + lastPos = content2.scrollWidth + width; + } else { + pos = content2.scrollLeft + width; + lastPos = content2.scrollWidth - width; + } + content2.scrollLeft = pos >= lastPos ? lastPos : pos; + }, "onNextButtonClick"), + bindResizeObserver: /* @__PURE__ */ __name(function bindResizeObserver() { + var _this2 = this; + this.resizeObserver = new ResizeObserver(function() { + return _this2.updateButtonState(); + }); + this.resizeObserver.observe(this.$refs.list); + }, "bindResizeObserver"), + unbindResizeObserver: /* @__PURE__ */ __name(function unbindResizeObserver() { + var _this$resizeObserver; + (_this$resizeObserver = this.resizeObserver) === null || _this$resizeObserver === void 0 || _this$resizeObserver.unobserve(this.$refs.list); + this.resizeObserver = void 0; + }, "unbindResizeObserver"), + updateInkBar: /* @__PURE__ */ __name(function updateInkBar() { + var _this$$refs = this.$refs, content2 = _this$$refs.content, inkbar = _this$$refs.inkbar, tabs = _this$$refs.tabs; + var activeTab = findSingle(content2, '[data-pc-name="tab"][data-p-active="true"]'); + if (this.$pcTabs.isVertical()) { + inkbar.style.height = getOuterHeight(activeTab) + "px"; + inkbar.style.top = getOffset(activeTab).top - getOffset(tabs).top + "px"; + } else { + inkbar.style.width = getOuterWidth(activeTab) + "px"; + inkbar.style.left = getOffset(activeTab).left - getOffset(tabs).left + "px"; + } + }, "updateInkBar"), + updateButtonState: /* @__PURE__ */ __name(function updateButtonState() { + var _this$$refs2 = this.$refs, list = _this$$refs2.list, content2 = _this$$refs2.content; + var scrollLeft = content2.scrollLeft, scrollTop = content2.scrollTop, scrollWidth = content2.scrollWidth, scrollHeight = content2.scrollHeight, offsetWidth = content2.offsetWidth, offsetHeight = content2.offsetHeight; + var _ref = [getWidth(content2), getHeight(content2)], width = _ref[0], height = _ref[1]; + if (this.$pcTabs.isVertical()) { + this.isPrevButtonEnabled = scrollTop !== 0; + this.isNextButtonEnabled = list.offsetHeight >= offsetHeight && parseInt(scrollTop) !== scrollHeight - height; + } else { + this.isPrevButtonEnabled = scrollLeft !== 0; + this.isNextButtonEnabled = list.offsetWidth >= offsetWidth && parseInt(scrollLeft) !== scrollWidth - width; + } + }, "updateButtonState"), + getVisibleButtonWidths: /* @__PURE__ */ __name(function getVisibleButtonWidths() { + var _this$$refs3 = this.$refs, prevBtn = _this$$refs3.prevBtn, nextBtn = _this$$refs3.nextBtn; + return [prevBtn, nextBtn].reduce(function(acc, el) { + return el ? acc + getWidth(el) : acc; + }, 0); + }, "getVisibleButtonWidths"), + updateDirection: /* @__PURE__ */ __name(function updateDirection() { + this.isRTL = !!this.$el.closest('[dir="rtl"]'); + }, "updateDirection"), + observeDirectionChanges: /* @__PURE__ */ __name(function observeDirectionChanges() { + var _this3 = this; + var targetNode = document.documentElement; + var config = { + attributes: true, + attributeFilter: ["dir"] + }; + this.mutationObserver = new MutationObserver(function() { + _this3.updateDirection(); + }); + this.mutationObserver.observe(targetNode, config); + }, "observeDirectionChanges") + }, + computed: { + templates: /* @__PURE__ */ __name(function templates() { + return this.$pcTabs.$slots; + }, "templates"), + activeValue: /* @__PURE__ */ __name(function activeValue() { + return this.$pcTabs.d_value; + }, "activeValue"), + showNavigators: /* @__PURE__ */ __name(function showNavigators2() { + return this.$pcTabs.scrollable && this.$pcTabs.showNavigators; + }, "showNavigators"), + prevButtonAriaLabel: /* @__PURE__ */ __name(function prevButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.previous : void 0; + }, "prevButtonAriaLabel"), + nextButtonAriaLabel: /* @__PURE__ */ __name(function nextButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.next : void 0; + }, "nextButtonAriaLabel") + }, + components: { + ChevronLeftIcon: script$j, + ChevronRightIcon: script$k + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$m = ["aria-label", "tabindex"]; +var _hoisted_2$a = ["aria-orientation"]; +var _hoisted_3$8 = ["aria-label", "tabindex"]; +function render$k(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("div", mergeProps({ + ref: "list", + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [$options.showNavigators && $data.isPrevButtonEnabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: 0, + ref: "prevButton", + "class": _ctx.cx("prevButton"), + "aria-label": $options.prevButtonAriaLabel, + tabindex: $options.$pcTabs.tabindex, + onClick: _cache[0] || (_cache[0] = function() { + return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments); + }) + }, _ctx.ptm("prevButton"), { + "data-pc-group-section": "navigator" + }), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.previcon || "ChevronLeftIcon"), mergeProps({ + "aria-hidden": "true" + }, _ctx.ptm("prevIcon")), null, 16))], 16, _hoisted_1$m)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + ref: "content", + "class": _ctx.cx("content"), + onScroll: _cache[1] || (_cache[1] = function() { + return $options.onScroll && $options.onScroll.apply($options, arguments); + }) + }, _ctx.ptm("content")), [createBaseVNode("div", mergeProps({ + ref: "tabs", + "class": _ctx.cx("tabList"), + role: "tablist", + "aria-orientation": $options.$pcTabs.orientation || "horizontal" + }, _ctx.ptm("tabList")), [renderSlot(_ctx.$slots, "default"), createBaseVNode("span", mergeProps({ + ref: "inkbar", + "class": _ctx.cx("activeBar"), + role: "presentation", + "aria-hidden": "true" + }, _ctx.ptm("activeBar")), null, 16)], 16, _hoisted_2$a)], 16), $options.showNavigators && $data.isNextButtonEnabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: 1, + ref: "nextButton", + "class": _ctx.cx("nextButton"), + "aria-label": $options.nextButtonAriaLabel, + tabindex: $options.$pcTabs.tabindex, + onClick: _cache[2] || (_cache[2] = function() { + return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments); + }) + }, _ctx.ptm("nextButton"), { + "data-pc-group-section": "navigator" + }), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.nexticon || "ChevronRightIcon"), mergeProps({ + "aria-hidden": "true" + }, _ctx.ptm("nextIcon")), null, 16))], 16, _hoisted_3$8)), [[_directive_ripple]]) : createCommentVNode("", true)], 16); +} +__name(render$k, "render$k"); +script$e.render = render$k; +var classes$9 = { + root: /* @__PURE__ */ __name(function root(_ref) { + var instance = _ref.instance, props = _ref.props; + return ["p-tab", { + "p-tab-active": instance.active, + "p-disabled": props.disabled + }]; + }, "root") +}; +var TabStyle = BaseStyle.extend({ + name: "tab", + classes: classes$9 +}); +var script$1$9 = { + name: "BaseTab", + "extends": script$i, + props: { + value: { + type: [String, Number], + "default": void 0 + }, + disabled: { + type: Boolean, + "default": false + }, + as: { + type: [String, Object], + "default": "BUTTON" + }, + asChild: { + type: Boolean, + "default": false + } + }, + style: TabStyle, + provide: /* @__PURE__ */ __name(function provide4() { + return { + $pcTab: this, + $parentInstance: this + }; + }, "provide") +}; +var script$d = { + name: "Tab", + "extends": script$1$9, + inheritAttrs: false, + inject: ["$pcTabs", "$pcTabList"], + methods: { + onFocus: /* @__PURE__ */ __name(function onFocus() { + this.$pcTabs.selectOnFocus && this.changeActiveValue(); + }, "onFocus"), + onClick: /* @__PURE__ */ __name(function onClick() { + this.changeActiveValue(); + }, "onClick"), + onKeydown: /* @__PURE__ */ __name(function onKeydown(event) { + switch (event.code) { + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "PageDown": + this.onPageDownKey(event); + break; + case "PageUp": + this.onPageUpKey(event); + break; + case "Enter": + case "NumpadEnter": + case "Space": + this.onEnterKey(event); + break; + } + }, "onKeydown"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey(event) { + var nextTab = this.findNextTab(event.currentTarget); + nextTab ? this.changeFocusedTab(event, nextTab) : this.onHomeKey(event); + event.preventDefault(); + }, "onArrowRightKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey(event) { + var prevTab = this.findPrevTab(event.currentTarget); + prevTab ? this.changeFocusedTab(event, prevTab) : this.onEndKey(event); + event.preventDefault(); + }, "onArrowLeftKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey(event) { + var firstTab = this.findFirstTab(); + this.changeFocusedTab(event, firstTab); + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey(event) { + var lastTab = this.findLastTab(); + this.changeFocusedTab(event, lastTab); + event.preventDefault(); + }, "onEndKey"), + onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey(event) { + this.scrollInView(this.findLastTab()); + event.preventDefault(); + }, "onPageDownKey"), + onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey(event) { + this.scrollInView(this.findFirstTab()); + event.preventDefault(); + }, "onPageUpKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey(event) { + this.changeActiveValue(); + event.preventDefault(); + }, "onEnterKey"), + findNextTab: /* @__PURE__ */ __name(function findNextTab(tabElement) { + var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var element = selfCheck ? tabElement : tabElement.nextElementSibling; + return element ? getAttribute(element, "data-p-disabled") || getAttribute(element, "data-pc-section") === "inkbar" ? this.findNextTab(element) : findSingle(element, '[data-pc-name="tab"]') : null; + }, "findNextTab"), + findPrevTab: /* @__PURE__ */ __name(function findPrevTab(tabElement) { + var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var element = selfCheck ? tabElement : tabElement.previousElementSibling; + return element ? getAttribute(element, "data-p-disabled") || getAttribute(element, "data-pc-section") === "inkbar" ? this.findPrevTab(element) : findSingle(element, '[data-pc-name="tab"]') : null; + }, "findPrevTab"), + findFirstTab: /* @__PURE__ */ __name(function findFirstTab() { + return this.findNextTab(this.$pcTabList.$refs.content.firstElementChild, true); + }, "findFirstTab"), + findLastTab: /* @__PURE__ */ __name(function findLastTab() { + return this.findPrevTab(this.$pcTabList.$refs.content.lastElementChild, true); + }, "findLastTab"), + changeActiveValue: /* @__PURE__ */ __name(function changeActiveValue() { + this.$pcTabs.updateValue(this.value); + }, "changeActiveValue"), + changeFocusedTab: /* @__PURE__ */ __name(function changeFocusedTab(event, element) { + focus(element); + this.scrollInView(element); + }, "changeFocusedTab"), + scrollInView: /* @__PURE__ */ __name(function scrollInView(element) { + var _element$scrollIntoVi; + element === null || element === void 0 || (_element$scrollIntoVi = element.scrollIntoView) === null || _element$scrollIntoVi === void 0 || _element$scrollIntoVi.call(element, { + block: "nearest" + }); + }, "scrollInView") + }, + computed: { + active: /* @__PURE__ */ __name(function active() { + var _this$$pcTabs; + return equals((_this$$pcTabs = this.$pcTabs) === null || _this$$pcTabs === void 0 ? void 0 : _this$$pcTabs.d_value, this.value); + }, "active"), + id: /* @__PURE__ */ __name(function id() { + var _this$$pcTabs2; + return "".concat((_this$$pcTabs2 = this.$pcTabs) === null || _this$$pcTabs2 === void 0 ? void 0 : _this$$pcTabs2.id, "_tab_").concat(this.value); + }, "id"), + ariaControls: /* @__PURE__ */ __name(function ariaControls() { + var _this$$pcTabs3; + return "".concat((_this$$pcTabs3 = this.$pcTabs) === null || _this$$pcTabs3 === void 0 ? void 0 : _this$$pcTabs3.id, "_tabpanel_").concat(this.value); + }, "ariaControls"), + attrs: /* @__PURE__ */ __name(function attrs() { + return mergeProps(this.asAttrs, this.a11yAttrs, this.ptmi("root", this.ptParams)); + }, "attrs"), + asAttrs: /* @__PURE__ */ __name(function asAttrs() { + return this.as === "BUTTON" ? { + type: "button", + disabled: this.disabled + } : void 0; + }, "asAttrs"), + a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs() { + return { + id: this.id, + tabindex: this.active ? this.$pcTabs.tabindex : -1, + role: "tab", + "aria-selected": this.active, + "aria-controls": this.ariaControls, + "data-pc-name": "tab", + "data-p-disabled": this.disabled, + "data-p-active": this.active, + onFocus: this.onFocus, + onKeydown: this.onKeydown + }; + }, "a11yAttrs"), + ptParams: /* @__PURE__ */ __name(function ptParams() { + return { + context: { + active: this.active + } + }; + }, "ptParams") + }, + directives: { + ripple: Ripple + } +}; +function render$j(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return !_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ + key: 0, + "class": _ctx.cx("root"), + onClick: $options.onClick + }, $options.attrs), { + "default": withCtx(function() { + return [renderSlot(_ctx.$slots, "default")]; + }), + _: 3 + }, 16, ["class", "onClick"])), [[_directive_ripple]]) : renderSlot(_ctx.$slots, "default", { + key: 1, + "class": normalizeClass(_ctx.cx("root")), + active: $options.active, + a11yAttrs: $options.a11yAttrs, + onClick: $options.onClick + }); +} +__name(render$j, "render$j"); +script$d.render = render$j; +const _hoisted_1$l = { class: "flex flex-col h-full" }; +const _hoisted_2$9 = { class: "w-full flex justify-between" }; +const _hoisted_3$7 = { class: "tabs-container" }; +const _hoisted_4$4 = { class: "font-bold" }; +const _hoisted_5$4 = { class: "flex-grow h-0" }; +const _sfc_main$m = /* @__PURE__ */ defineComponent({ + __name: "BottomPanel", + setup(__props) { + const bottomPanelStore = useBottomPanelStore(); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$l, [ + createVNode(unref(script$l), { + value: unref(bottomPanelStore).activeBottomPanelTabId, + "onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(bottomPanelStore).activeBottomPanelTabId = $event) + }, { + default: withCtx(() => [ + createVNode(unref(script$e), { "pt:tabList": "border-none" }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_2$9, [ + createBaseVNode("div", _hoisted_3$7, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(unref(bottomPanelStore).bottomPanelTabs, (tab) => { + return openBlock(), createBlock(unref(script$d), { + key: tab.id, + value: tab.id, + class: "p-3 border-none" + }, { + default: withCtx(() => [ + createBaseVNode("span", _hoisted_4$4, toDisplayString(tab.title.toUpperCase()), 1) + ]), + _: 2 + }, 1032, ["value"]); + }), 128)) + ]), + createVNode(unref(script$h), { + class: "justify-self-end", + icon: "pi pi-times", + severity: "secondary", + size: "small", + text: "", + onClick: _cache[0] || (_cache[0] = ($event) => unref(bottomPanelStore).bottomPanelVisible = false) + }) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["value"]), + createBaseVNode("div", _hoisted_5$4, [ + unref(bottomPanelStore).bottomPanelVisible && unref(bottomPanelStore).activeBottomPanelTab ? (openBlock(), createBlock(_sfc_main$o, { + key: 0, + extension: unref(bottomPanelStore).activeBottomPanelTab + }, null, 8, ["extension"])) : createCommentVNode("", true) + ]) + ]); + }; + } +}); +var theme$7 = /* @__PURE__ */ __name(function theme2(_ref) { +======== +var theme$7 = /* @__PURE__ */ __name(function theme(_ref) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var dt = _ref.dt; + return "\n.p-splitter {\n display: flex;\n flex-wrap: nowrap;\n border: 1px solid ".concat(dt("splitter.border.color"), ";\n background: ").concat(dt("splitter.background"), ";\n border-radius: ").concat(dt("border.radius.md"), ";\n color: ").concat(dt("splitter.color"), ";\n}\n\n.p-splitter-vertical {\n flex-direction: column;\n}\n\n.p-splitter-gutter {\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1;\n background: ").concat(dt("splitter.gutter.background"), ";\n}\n\n.p-splitter-gutter-handle {\n border-radius: ").concat(dt("splitter.handle.border.radius"), ";\n background: ").concat(dt("splitter.handle.background"), ";\n transition: outline-color ").concat(dt("splitter.transition.duration"), ", box-shadow ").concat(dt("splitter.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-splitter-gutter-handle:focus-visible {\n box-shadow: ").concat(dt("splitter.handle.focus.ring.shadow"), ";\n outline: ").concat(dt("splitter.handle.focus.ring.width"), " ").concat(dt("splitter.handle.focus.ring.style"), " ").concat(dt("splitter.handle.focus.ring.color"), ";\n outline-offset: ").concat(dt("splitter.handle.focus.ring.offset"), ";\n}\n\n.p-splitter-horizontal.p-splitter-resizing {\n cursor: col-resize;\n user-select: none;\n}\n\n.p-splitter-vertical.p-splitter-resizing {\n cursor: row-resize;\n user-select: none;\n}\n\n.p-splitter-horizontal > .p-splitter-gutter > .p-splitter-gutter-handle {\n height: ").concat(dt("splitter.handle.size"), ";\n width: 100%;\n}\n\n.p-splitter-vertical > .p-splitter-gutter > .p-splitter-gutter-handle {\n width: ").concat(dt("splitter.handle.size"), ";\n height: 100%;\n}\n\n.p-splitter-horizontal > .p-splitter-gutter {\n cursor: col-resize;\n}\n\n.p-splitter-vertical > .p-splitter-gutter {\n cursor: row-resize;\n}\n\n.p-splitterpanel {\n flex-grow: 1;\n overflow: hidden;\n}\n\n.p-splitterpanel-nested {\n display: flex;\n}\n\n.p-splitterpanel .p-splitter {\n flex-grow: 1;\n border: 0 none;\n}\n"); +}, "theme"); +var classes$a = { + root: /* @__PURE__ */ __name(function root(_ref2) { + var props = _ref2.props; + return ["p-splitter p-component", "p-splitter-" + props.layout]; + }, "root"), + gutter: "p-splitter-gutter", + gutterHandle: "p-splitter-gutter-handle" +}; +var inlineStyles$4 = { + root: /* @__PURE__ */ __name(function root2(_ref3) { + var props = _ref3.props; + return [{ + display: "flex", + "flex-wrap": "nowrap" + }, props.layout === "vertical" ? { + "flex-direction": "column" + } : ""]; + }, "root") +}; +var SplitterStyle = BaseStyle.extend({ + name: "splitter", + theme: theme$7, + classes: classes$a, + inlineStyles: inlineStyles$4 +}); +var script$1$a = { + name: "BaseSplitter", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + props: { + layout: { + type: String, + "default": "horizontal" + }, + gutterSize: { + type: Number, + "default": 4 + }, + stateKey: { + type: String, + "default": null + }, + stateStorage: { + type: String, + "default": "session" + }, + step: { + type: Number, + "default": 5 + } + }, + style: SplitterStyle, + provide: /* @__PURE__ */ __name(function provide2() { + return { + $pcSplitter: this, + $parentInstance: this + }; + }, "provide") +}; +function _toConsumableArray$2(r) { + return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread$2(); +} +__name(_toConsumableArray$2, "_toConsumableArray$2"); +function _nonIterableSpread$2() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +__name(_nonIterableSpread$2, "_nonIterableSpread$2"); +function _unsupportedIterableToArray$2(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray$2(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; + } +} +__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray$2"); +function _iterableToArray$2(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +__name(_iterableToArray$2, "_iterableToArray$2"); +function _arrayWithoutHoles$2(r) { + if (Array.isArray(r)) return _arrayLikeToArray$2(r); +} +__name(_arrayWithoutHoles$2, "_arrayWithoutHoles$2"); +function _arrayLikeToArray$2(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +__name(_arrayLikeToArray$2, "_arrayLikeToArray$2"); +var script$c = { + name: "Splitter", + "extends": script$1$a, + inheritAttrs: false, + emits: ["resizestart", "resizeend", "resize"], + dragging: false, + mouseMoveListener: null, + mouseUpListener: null, + touchMoveListener: null, + touchEndListener: null, + size: null, + gutterElement: null, + startPos: null, + prevPanelElement: null, + nextPanelElement: null, + nextPanelSize: null, + prevPanelSize: null, + panelSizes: null, + prevPanelIndex: null, + timer: null, +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + mutationObserver: null, + data: /* @__PURE__ */ __name(function data2() { +======== + data: /* @__PURE__ */ __name(function data() { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + return { + prevSize: null, + isRTL: false + }; + }, "data"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + mounted: /* @__PURE__ */ __name(function mounted2() { + this.initializePanels(); + this.updateDirection(); + this.observeDirectionChanges(); +======== + mounted: /* @__PURE__ */ __name(function mounted() { + var _this = this; + if (this.panels && this.panels.length) { + var initialized = false; + if (this.isStateful()) { + initialized = this.restoreState(); + } + if (!initialized) { + var children = _toConsumableArray$2(this.$el.children).filter(function(child) { + return child.getAttribute("data-pc-name") === "splitterpanel"; + }); + var _panelSizes = []; + this.panels.map(function(panel, i) { + var panelInitialSize = panel.props && panel.props.size ? panel.props.size : null; + var panelSize = panelInitialSize || 100 / _this.panels.length; + _panelSizes[i] = panelSize; + children[i].style.flexBasis = "calc(" + panelSize + "% - " + (_this.panels.length - 1) * _this.gutterSize + "px)"; + }); + this.panelSizes = _panelSizes; + this.prevSize = parseFloat(_panelSizes[0]).toFixed(4); + } + } +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() { + this.clear(); + this.unbindMouseListeners(); + if (this.mutationObserver) { + this.mutationObserver.disconnect(); + } + }, "beforeUnmount"), + methods: { + updateDirection: /* @__PURE__ */ __name(function updateDirection2() { + this.isRTL = !!this.$el.closest('[dir="rtl"]'); + }, "updateDirection"), + observeDirectionChanges: /* @__PURE__ */ __name(function observeDirectionChanges2() { + var _this = this; + var targetNode = document.documentElement; + var config = { + attributes: true, + attributeFilter: ["dir"] + }; + this.mutationObserver = new MutationObserver(function() { + _this.updateDirection(); + }); + this.mutationObserver.observe(targetNode, config); + }, "observeDirectionChanges"), + isSplitterPanel: /* @__PURE__ */ __name(function isSplitterPanel(child) { + return child.type.name === "SplitterPanel"; + }, "isSplitterPanel"), + initializePanels: /* @__PURE__ */ __name(function initializePanels() { + var _this2 = this; + if (this.panels && this.panels.length) { + var initialized = false; + if (this.isStateful()) { + initialized = this.restoreState(); + } + if (!initialized) { + var children = _toConsumableArray$2(this.$el.children).filter(function(child) { + return child.getAttribute("data-pc-name") === "splitterpanel"; + }); + var _panelSizes = []; + this.panels.map(function(panel, i) { + var panelInitialSize = panel.props && panel.props.size ? panel.props.size : null; + var panelSize = panelInitialSize || 100 / _this2.panels.length; + _panelSizes[i] = panelSize; + children[i].style.flexBasis = "calc(" + panelSize + "% - " + (_this2.panels.length - 1) * _this2.gutterSize + "px)"; + }); + this.panelSizes = _panelSizes; + this.prevSize = parseFloat(_panelSizes[0]).toFixed(4); + } + } + }, "initializePanels"), + onResizeStart: /* @__PURE__ */ __name(function onResizeStart(event, index, isKeyDown) { + this.gutterElement = event.currentTarget || event.target.parentElement; + this.size = this.horizontal ? getWidth(this.$el) : getHeight(this.$el); + if (!isKeyDown) { + this.dragging = true; + this.startPos = this.layout === "horizontal" ? event.pageX || event.changedTouches[0].pageX : event.pageY || event.changedTouches[0].pageY; + } + this.prevPanelElement = this.gutterElement.previousElementSibling; + this.nextPanelElement = this.gutterElement.nextElementSibling; + if (isKeyDown) { + this.prevPanelSize = this.horizontal ? getOuterWidth(this.prevPanelElement, true) : getOuterHeight(this.prevPanelElement, true); + this.nextPanelSize = this.horizontal ? getOuterWidth(this.nextPanelElement, true) : getOuterHeight(this.nextPanelElement, true); + } else { + this.prevPanelSize = 100 * (this.horizontal ? getOuterWidth(this.prevPanelElement, true) : getOuterHeight(this.prevPanelElement, true)) / this.size; + this.nextPanelSize = 100 * (this.horizontal ? getOuterWidth(this.nextPanelElement, true) : getOuterHeight(this.nextPanelElement, true)) / this.size; + } + this.prevPanelIndex = index; + this.$emit("resizestart", { + originalEvent: event, + sizes: this.panelSizes + }); + this.$refs.gutter[index].setAttribute("data-p-gutter-resizing", true); + this.$el.setAttribute("data-p-resizing", true); + }, "onResizeStart"), + onResize: /* @__PURE__ */ __name(function onResize(event, step, isKeyDown) { + var newPos, newPrevPanelSize, newNextPanelSize; + if (isKeyDown) { + if (this.horizontal) { + newPrevPanelSize = 100 * (this.prevPanelSize + step) / this.size; + newNextPanelSize = 100 * (this.nextPanelSize - step) / this.size; + } else { + newPrevPanelSize = 100 * (this.prevPanelSize - step) / this.size; + newNextPanelSize = 100 * (this.nextPanelSize + step) / this.size; + } + } else { + if (this.horizontal) { + if (this.isRTL) { + newPos = (this.startPos - event.pageX) * 100 / this.size; + } else { + newPos = (event.pageX - this.startPos) * 100 / this.size; + } + } else { + newPos = (event.pageY - this.startPos) * 100 / this.size; + } + newPrevPanelSize = this.prevPanelSize + newPos; + newNextPanelSize = this.nextPanelSize - newPos; + } + if (this.validateResize(newPrevPanelSize, newNextPanelSize)) { + this.prevPanelElement.style.flexBasis = "calc(" + newPrevPanelSize + "% - " + (this.panels.length - 1) * this.gutterSize + "px)"; + this.nextPanelElement.style.flexBasis = "calc(" + newNextPanelSize + "% - " + (this.panels.length - 1) * this.gutterSize + "px)"; + this.panelSizes[this.prevPanelIndex] = newPrevPanelSize; + this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize; + this.prevSize = parseFloat(newPrevPanelSize).toFixed(4); + } + this.$emit("resize", { + originalEvent: event, + sizes: this.panelSizes + }); + }, "onResize"), + onResizeEnd: /* @__PURE__ */ __name(function onResizeEnd(event) { + if (this.isStateful()) { + this.saveState(); + } + this.$emit("resizeend", { + originalEvent: event, + sizes: this.panelSizes + }); + this.$refs.gutter.forEach(function(gutter) { + return gutter.setAttribute("data-p-gutter-resizing", false); + }); + this.$el.setAttribute("data-p-resizing", false); + this.clear(); + }, "onResizeEnd"), + repeat: /* @__PURE__ */ __name(function repeat(event, index, step) { + this.onResizeStart(event, index, true); + this.onResize(event, step, true); + }, "repeat"), + setTimer: /* @__PURE__ */ __name(function setTimer(event, index, step) { + var _this3 = this; + if (!this.timer) { + this.timer = setInterval(function() { + _this3.repeat(event, index, step); + }, 40); + } + }, "setTimer"), + clearTimer: /* @__PURE__ */ __name(function clearTimer() { + if (this.timer) { + clearInterval(this.timer); + this.timer = null; + } + }, "clearTimer"), + onGutterKeyUp: /* @__PURE__ */ __name(function onGutterKeyUp() { + this.clearTimer(); + this.onResizeEnd(); + }, "onGutterKeyUp"), + onGutterKeyDown: /* @__PURE__ */ __name(function onGutterKeyDown(event, index) { + switch (event.code) { + case "ArrowLeft": { + if (this.layout === "horizontal") { + this.setTimer(event, index, this.step * -1); + } + event.preventDefault(); + break; + } + case "ArrowRight": { + if (this.layout === "horizontal") { + this.setTimer(event, index, this.step); + } + event.preventDefault(); + break; + } + case "ArrowDown": { + if (this.layout === "vertical") { + this.setTimer(event, index, this.step * -1); + } + event.preventDefault(); + break; + } + case "ArrowUp": { + if (this.layout === "vertical") { + this.setTimer(event, index, this.step); + } + event.preventDefault(); + break; + } + } + }, "onGutterKeyDown"), + onGutterMouseDown: /* @__PURE__ */ __name(function onGutterMouseDown(event, index) { + this.onResizeStart(event, index); + this.bindMouseListeners(); + }, "onGutterMouseDown"), + onGutterTouchStart: /* @__PURE__ */ __name(function onGutterTouchStart(event, index) { + this.onResizeStart(event, index); + this.bindTouchListeners(); + event.preventDefault(); + }, "onGutterTouchStart"), + onGutterTouchMove: /* @__PURE__ */ __name(function onGutterTouchMove(event) { + this.onResize(event); + event.preventDefault(); + }, "onGutterTouchMove"), + onGutterTouchEnd: /* @__PURE__ */ __name(function onGutterTouchEnd(event) { + this.onResizeEnd(event); + this.unbindTouchListeners(); + event.preventDefault(); + }, "onGutterTouchEnd"), + bindMouseListeners: /* @__PURE__ */ __name(function bindMouseListeners() { + var _this4 = this; + if (!this.mouseMoveListener) { + this.mouseMoveListener = function(event) { + return _this4.onResize(event); + }; + document.addEventListener("mousemove", this.mouseMoveListener); + } + if (!this.mouseUpListener) { + this.mouseUpListener = function(event) { + _this4.onResizeEnd(event); + _this4.unbindMouseListeners(); + }; + document.addEventListener("mouseup", this.mouseUpListener); + } + }, "bindMouseListeners"), + bindTouchListeners: /* @__PURE__ */ __name(function bindTouchListeners() { + var _this5 = this; + if (!this.touchMoveListener) { + this.touchMoveListener = function(event) { + return _this5.onResize(event.changedTouches[0]); + }; + document.addEventListener("touchmove", this.touchMoveListener); + } + if (!this.touchEndListener) { + this.touchEndListener = function(event) { + _this5.resizeEnd(event); + _this5.unbindTouchListeners(); + }; + document.addEventListener("touchend", this.touchEndListener); + } + }, "bindTouchListeners"), + validateResize: /* @__PURE__ */ __name(function validateResize(newPrevPanelSize, newNextPanelSize) { + if (newPrevPanelSize > 100 || newPrevPanelSize < 0) return false; + if (newNextPanelSize > 100 || newNextPanelSize < 0) return false; + var prevPanelMinSize = getVNodeProp(this.panels[this.prevPanelIndex], "minSize"); + if (this.panels[this.prevPanelIndex].props && prevPanelMinSize && prevPanelMinSize > newPrevPanelSize) { + return false; + } + var newPanelMinSize = getVNodeProp(this.panels[this.prevPanelIndex + 1], "minSize"); + if (this.panels[this.prevPanelIndex + 1].props && newPanelMinSize && newPanelMinSize > newNextPanelSize) { + return false; + } + return true; + }, "validateResize"), + unbindMouseListeners: /* @__PURE__ */ __name(function unbindMouseListeners() { + if (this.mouseMoveListener) { + document.removeEventListener("mousemove", this.mouseMoveListener); + this.mouseMoveListener = null; + } + if (this.mouseUpListener) { + document.removeEventListener("mouseup", this.mouseUpListener); + this.mouseUpListener = null; + } + }, "unbindMouseListeners"), + unbindTouchListeners: /* @__PURE__ */ __name(function unbindTouchListeners() { + if (this.touchMoveListener) { + document.removeEventListener("touchmove", this.touchMoveListener); + this.touchMoveListener = null; + } + if (this.touchEndListener) { + document.removeEventListener("touchend", this.touchEndListener); + this.touchEndListener = null; + } + }, "unbindTouchListeners"), + clear: /* @__PURE__ */ __name(function clear() { + this.dragging = false; + this.size = null; + this.startPos = null; + this.prevPanelElement = null; + this.nextPanelElement = null; + this.prevPanelSize = null; + this.nextPanelSize = null; + this.gutterElement = null; + this.prevPanelIndex = null; + }, "clear"), + isStateful: /* @__PURE__ */ __name(function isStateful() { + return this.stateKey != null; + }, "isStateful"), + getStorage: /* @__PURE__ */ __name(function getStorage() { + switch (this.stateStorage) { + case "local": + return window.localStorage; + case "session": + return window.sessionStorage; + default: + throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are "local" and "session".'); + } + }, "getStorage"), + saveState: /* @__PURE__ */ __name(function saveState() { + if (isArray(this.panelSizes)) { + this.getStorage().setItem(this.stateKey, JSON.stringify(this.panelSizes)); + } + }, "saveState"), + restoreState: /* @__PURE__ */ __name(function restoreState() { + var _this6 = this; + var storage = this.getStorage(); + var stateString = storage.getItem(this.stateKey); + if (stateString) { + this.panelSizes = JSON.parse(stateString); + var children = _toConsumableArray$2(this.$el.children).filter(function(child) { + return child.getAttribute("data-pc-name") === "splitterpanel"; + }); + children.forEach(function(child, i) { + child.style.flexBasis = "calc(" + _this6.panelSizes[i] + "% - " + (_this6.panels.length - 1) * _this6.gutterSize + "px)"; + }); + return true; + } + return false; + }, "restoreState"), + resetState: /* @__PURE__ */ __name(function resetState() { + this.initializePanels(); + }, "resetState") + }, + computed: { + panels: /* @__PURE__ */ __name(function panels() { + var _this7 = this; + var panels2 = []; + this.$slots["default"]().forEach(function(child) { + if (_this7.isSplitterPanel(child)) { + panels2.push(child); + } else if (child.children instanceof Array) { + child.children.forEach(function(nestedChild) { + if (_this7.isSplitterPanel(nestedChild)) { + panels2.push(nestedChild); + } + }); + } + }); + return panels2; + }, "panels"), + gutterStyle: /* @__PURE__ */ __name(function gutterStyle() { + if (this.horizontal) return { + width: this.gutterSize + "px" + }; + else return { + height: this.gutterSize + "px" + }; + }, "gutterStyle"), + horizontal: /* @__PURE__ */ __name(function horizontal() { + return this.layout === "horizontal"; + }, "horizontal"), + getPTOptions: /* @__PURE__ */ __name(function getPTOptions() { + var _this$$parentInstance; + return { + context: { + nested: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.nestedState + } + }; + }, "getPTOptions") + } +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +var _hoisted_1$k = ["onMousedown", "onTouchstart", "onTouchmove", "onTouchend"]; +var _hoisted_2$8 = ["aria-orientation", "aria-valuenow", "onKeydown"]; +function render$i(_ctx, _cache, $props, $setup, $data, $options) { +======== +var _hoisted_1$m = ["onMousedown", "onTouchstart", "onTouchmove", "onTouchend"]; +var _hoisted_2$j = ["aria-orientation", "aria-valuenow", "onKeydown"]; +function render$j(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root"), + style: _ctx.sx("root"), + "data-p-resizing": false + }, _ctx.ptmi("root", $options.getPTOptions)), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.panels, function(panel, i) { + return openBlock(), createElementBlock(Fragment, { + key: i + }, [(openBlock(), createBlock(resolveDynamicComponent(panel), { + tabindex: "-1" + })), i !== $options.panels.length - 1 ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + ref_for: true, + ref: "gutter", + "class": _ctx.cx("gutter"), + role: "separator", + tabindex: "-1", + onMousedown: /* @__PURE__ */ __name(function onMousedown($event) { + return $options.onGutterMouseDown($event, i); + }, "onMousedown"), + onTouchstart: /* @__PURE__ */ __name(function onTouchstart($event) { + return $options.onGutterTouchStart($event, i); + }, "onTouchstart"), + onTouchmove: /* @__PURE__ */ __name(function onTouchmove($event) { + return $options.onGutterTouchMove($event, i); + }, "onTouchmove"), + onTouchend: /* @__PURE__ */ __name(function onTouchend($event) { + return $options.onGutterTouchEnd($event, i); + }, "onTouchend"), + "data-p-gutter-resizing": false + }, _ctx.ptm("gutter")), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("gutterHandle"), + tabindex: "0", + style: [$options.gutterStyle], + "aria-orientation": _ctx.layout, + "aria-valuenow": $data.prevSize, + onKeyup: _cache[0] || (_cache[0] = function() { + return $options.onGutterKeyUp && $options.onGutterKeyUp.apply($options, arguments); + }), + onKeydown: /* @__PURE__ */ __name(function onKeydown2($event) { + return $options.onGutterKeyDown($event, i); + }, "onKeydown"), + ref_for: true +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + }, _ctx.ptm("gutterHandle")), null, 16, _hoisted_2$8)], 16, _hoisted_1$k)) : createCommentVNode("", true)], 64); + }), 128))], 16); +} +__name(render$i, "render$i"); +script$c.render = render$i; +var classes$7 = { + root: /* @__PURE__ */ __name(function root4(_ref) { +======== + }, _ctx.ptm("gutterHandle")), null, 16, _hoisted_2$j)], 16, _hoisted_1$m)) : createCommentVNode("", true)], 64); + }), 128))], 16); +} +__name(render$j, "render$j"); +script$c.render = render$j; +var classes$9 = { + root: /* @__PURE__ */ __name(function root3(_ref) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var instance = _ref.instance; + return ["p-splitterpanel", { + "p-splitterpanel-nested": instance.isNested + }]; + }, "root") +}; +var SplitterPanelStyle = BaseStyle.extend({ + name: "splitterpanel", + classes: classes$9 +}); +var script$1$9 = { + name: "BaseSplitterPanel", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + props: { + size: { + type: Number, + "default": null + }, + minSize: { + type: Number, + "default": null + } + }, + style: SplitterPanelStyle, + provide: /* @__PURE__ */ __name(function provide3() { + return { + $pcSplitterPanel: this, + $parentInstance: this + }; + }, "provide") +}; +var script$b = { + name: "SplitterPanel", + "extends": script$1$9, + inheritAttrs: false, + data: /* @__PURE__ */ __name(function data2() { + return { + nestedState: null + }; + }, "data"), + computed: { + isNested: /* @__PURE__ */ __name(function isNested() { + var _this = this; + return this.$slots["default"]().some(function(child) { + _this.nestedState = child.type.name === "Splitter" ? true : null; + return _this.nestedState; + }); + }, "isNested"), + getPTOptions: /* @__PURE__ */ __name(function getPTOptions2() { + return { + context: { + nested: this.isNested + } + }; + }, "getPTOptions") + } +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +function render$h(_ctx, _cache, $props, $setup, $data, $options) { +======== +function render$i(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + return openBlock(), createElementBlock("div", mergeProps({ + ref: "container", + "class": _ctx.cx("root") + }, _ctx.ptmi("root", $options.getPTOptions)), [renderSlot(_ctx.$slots, "default")], 16); +} +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +__name(render$h, "render$h"); +script$b.render = render$h; +const _sfc_main$l = /* @__PURE__ */ defineComponent({ +======== +__name(render$i, "render$i"); +script$b.render = render$i; +const _sfc_main$q = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + __name: "LiteGraphCanvasSplitterOverlay", + setup(__props) { + const settingStore = useSettingStore(); + const sidebarLocation = computed( + () => settingStore.get("Comfy.Sidebar.Location") + ); + const sidebarPanelVisible = computed( + () => useSidebarTabStore().activeSidebarTab !== null + ); + const bottomPanelVisible = computed( + () => useBottomPanelStore().bottomPanelVisible + ); + const activeSidebarTabId = computed( + () => useSidebarTabStore().activeSidebarTabId + ); + return (_ctx, _cache) => { + return openBlock(), createBlock(unref(script$c), { + class: "splitter-overlay-root splitter-overlay", + "pt:gutter": sidebarPanelVisible.value ? "" : "hidden", + key: activeSidebarTabId.value, + stateKey: activeSidebarTabId.value, + stateStorage: "local" + }, { + default: withCtx(() => [ + sidebarLocation.value === "left" ? withDirectives((openBlock(), createBlock(unref(script$b), { + key: 0, + class: "side-bar-panel", + minSize: 10, + size: 20 + }, { + default: withCtx(() => [ + renderSlot(_ctx.$slots, "side-bar-panel", {}, void 0, true) + ]), + _: 3 + }, 512)), [ + [vShow, sidebarPanelVisible.value] + ]) : createCommentVNode("", true), + createVNode(unref(script$b), { size: 100 }, { + default: withCtx(() => [ + createVNode(unref(script$c), { + class: "splitter-overlay max-w-full", + layout: "vertical", + "pt:gutter": bottomPanelVisible.value ? "" : "hidden", + stateKey: "bottom-panel-splitter", + stateStorage: "local" + }, { + default: withCtx(() => [ + createVNode(unref(script$b), { class: "graph-canvas-panel relative" }, { + default: withCtx(() => [ + renderSlot(_ctx.$slots, "graph-canvas-panel", {}, void 0, true) + ]), + _: 3 + }), + withDirectives(createVNode(unref(script$b), { class: "bottom-panel" }, { + default: withCtx(() => [ + renderSlot(_ctx.$slots, "bottom-panel", {}, void 0, true) + ]), + _: 3 + }, 512), [ + [vShow, bottomPanelVisible.value] + ]) + ]), + _: 3 + }, 8, ["pt:gutter"]) + ]), + _: 3 + }), + sidebarLocation.value === "right" ? withDirectives((openBlock(), createBlock(unref(script$b), { + key: 1, + class: "side-bar-panel", + minSize: 10, + size: 20 + }, { + default: withCtx(() => [ + renderSlot(_ctx.$slots, "side-bar-panel", {}, void 0, true) + ]), + _: 3 + }, 512)), [ + [vShow, sidebarPanelVisible.value] + ]) : createCommentVNode("", true) + ]), + _: 3 + }, 8, ["pt:gutter", "stateKey"]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-95268c0b"]]); +var theme$6 = /* @__PURE__ */ __name(function theme3(_ref) { +======== +const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-e50caa15"]]); +var classes$8 = { + root: /* @__PURE__ */ __name(function root4(_ref) { + var instance = _ref.instance, props = _ref.props; + return ["p-tab", { + "p-tab-active": instance.active, + "p-disabled": props.disabled + }]; + }, "root") +}; +var TabStyle = BaseStyle.extend({ + name: "tab", + classes: classes$8 +}); +var script$1$8 = { + name: "BaseTab", + "extends": script$e, + props: { + value: { + type: [String, Number], + "default": void 0 + }, + disabled: { + type: Boolean, + "default": false + }, + as: { + type: [String, Object], + "default": "BUTTON" + }, + asChild: { + type: Boolean, + "default": false + } + }, + style: TabStyle, + provide: /* @__PURE__ */ __name(function provide4() { + return { + $pcTab: this, + $parentInstance: this + }; + }, "provide") +}; +var script$a = { + name: "Tab", + "extends": script$1$8, + inheritAttrs: false, + inject: ["$pcTabs", "$pcTabList"], + methods: { + onFocus: /* @__PURE__ */ __name(function onFocus() { + this.$pcTabs.selectOnFocus && this.changeActiveValue(); + }, "onFocus"), + onClick: /* @__PURE__ */ __name(function onClick() { + this.changeActiveValue(); + }, "onClick"), + onKeydown: /* @__PURE__ */ __name(function onKeydown(event) { + switch (event.code) { + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "PageDown": + this.onPageDownKey(event); + break; + case "PageUp": + this.onPageUpKey(event); + break; + case "Enter": + case "NumpadEnter": + case "Space": + this.onEnterKey(event); + break; + } + }, "onKeydown"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey(event) { + var nextTab = this.findNextTab(event.currentTarget); + nextTab ? this.changeFocusedTab(event, nextTab) : this.onHomeKey(event); + event.preventDefault(); + }, "onArrowRightKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey(event) { + var prevTab = this.findPrevTab(event.currentTarget); + prevTab ? this.changeFocusedTab(event, prevTab) : this.onEndKey(event); + event.preventDefault(); + }, "onArrowLeftKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey(event) { + var firstTab = this.findFirstTab(); + this.changeFocusedTab(event, firstTab); + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey(event) { + var lastTab = this.findLastTab(); + this.changeFocusedTab(event, lastTab); + event.preventDefault(); + }, "onEndKey"), + onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey(event) { + this.scrollInView(this.findLastTab()); + event.preventDefault(); + }, "onPageDownKey"), + onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey(event) { + this.scrollInView(this.findFirstTab()); + event.preventDefault(); + }, "onPageUpKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey(event) { + this.changeActiveValue(); + event.preventDefault(); + }, "onEnterKey"), + findNextTab: /* @__PURE__ */ __name(function findNextTab(tabElement) { + var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var element = selfCheck ? tabElement : tabElement.nextElementSibling; + return element ? getAttribute(element, "data-p-disabled") || getAttribute(element, "data-pc-section") === "inkbar" ? this.findNextTab(element) : findSingle(element, '[data-pc-name="tab"]') : null; + }, "findNextTab"), + findPrevTab: /* @__PURE__ */ __name(function findPrevTab(tabElement) { + var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var element = selfCheck ? tabElement : tabElement.previousElementSibling; + return element ? getAttribute(element, "data-p-disabled") || getAttribute(element, "data-pc-section") === "inkbar" ? this.findPrevTab(element) : findSingle(element, '[data-pc-name="tab"]') : null; + }, "findPrevTab"), + findFirstTab: /* @__PURE__ */ __name(function findFirstTab() { + return this.findNextTab(this.$pcTabList.$refs.content.firstElementChild, true); + }, "findFirstTab"), + findLastTab: /* @__PURE__ */ __name(function findLastTab() { + return this.findPrevTab(this.$pcTabList.$refs.content.lastElementChild, true); + }, "findLastTab"), + changeActiveValue: /* @__PURE__ */ __name(function changeActiveValue() { + this.$pcTabs.updateValue(this.value); + }, "changeActiveValue"), + changeFocusedTab: /* @__PURE__ */ __name(function changeFocusedTab(event, element) { + focus(element); + this.scrollInView(element); + }, "changeFocusedTab"), + scrollInView: /* @__PURE__ */ __name(function scrollInView(element) { + var _element$scrollIntoVi; + element === null || element === void 0 || (_element$scrollIntoVi = element.scrollIntoView) === null || _element$scrollIntoVi === void 0 || _element$scrollIntoVi.call(element, { + block: "nearest" + }); + }, "scrollInView") + }, + computed: { + active: /* @__PURE__ */ __name(function active() { + var _this$$pcTabs; + return equals((_this$$pcTabs = this.$pcTabs) === null || _this$$pcTabs === void 0 ? void 0 : _this$$pcTabs.d_value, this.value); + }, "active"), + id: /* @__PURE__ */ __name(function id() { + var _this$$pcTabs2; + return "".concat((_this$$pcTabs2 = this.$pcTabs) === null || _this$$pcTabs2 === void 0 ? void 0 : _this$$pcTabs2.id, "_tab_").concat(this.value); + }, "id"), + ariaControls: /* @__PURE__ */ __name(function ariaControls() { + var _this$$pcTabs3; + return "".concat((_this$$pcTabs3 = this.$pcTabs) === null || _this$$pcTabs3 === void 0 ? void 0 : _this$$pcTabs3.id, "_tabpanel_").concat(this.value); + }, "ariaControls"), + attrs: /* @__PURE__ */ __name(function attrs() { + return mergeProps(this.asAttrs, this.a11yAttrs, this.ptmi("root", this.ptParams)); + }, "attrs"), + asAttrs: /* @__PURE__ */ __name(function asAttrs() { + return this.as === "BUTTON" ? { + type: "button", + disabled: this.disabled + } : void 0; + }, "asAttrs"), + a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs() { + return { + id: this.id, + tabindex: this.active ? this.$pcTabs.tabindex : -1, + role: "tab", + "aria-selected": this.active, + "aria-controls": this.ariaControls, + "data-pc-name": "tab", + "data-p-disabled": this.disabled, + "data-p-active": this.active, + onFocus: this.onFocus, + onKeydown: this.onKeydown + }; + }, "a11yAttrs"), + ptParams: /* @__PURE__ */ __name(function ptParams() { + return { + context: { + active: this.active + } + }; + }, "ptParams") + }, + directives: { + ripple: Ripple + } +}; +function render$h(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return !_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ + key: 0, + "class": _ctx.cx("root"), + onClick: $options.onClick + }, $options.attrs), { + "default": withCtx(function() { + return [renderSlot(_ctx.$slots, "default")]; + }), + _: 3 + }, 16, ["class", "onClick"])), [[_directive_ripple]]) : renderSlot(_ctx.$slots, "default", { + key: 1, + "class": normalizeClass(_ctx.cx("root")), + active: $options.active, + a11yAttrs: $options.a11yAttrs, + onClick: $options.onClick + }); +} +__name(render$h, "render$h"); +script$a.render = render$h; +var classes$7 = { + root: "p-tablist", + content: /* @__PURE__ */ __name(function content(_ref) { + var instance = _ref.instance; + return ["p-tablist-content", { + "p-tablist-viewport": instance.$pcTabs.scrollable + }]; + }, "content"), + tabList: "p-tablist-tab-list", + activeBar: "p-tablist-active-bar", + prevButton: "p-tablist-prev-button p-tablist-nav-button", + nextButton: "p-tablist-next-button p-tablist-nav-button" +}; +var TabListStyle = BaseStyle.extend({ + name: "tablist", + classes: classes$7 +}); +var script$1$7 = { + name: "BaseTabList", + "extends": script$e, + props: {}, + style: TabListStyle, + provide: /* @__PURE__ */ __name(function provide5() { + return { + $pcTabList: this, + $parentInstance: this + }; + }, "provide") +}; +var script$9 = { + name: "TabList", + "extends": script$1$7, + inheritAttrs: false, + inject: ["$pcTabs"], + data: /* @__PURE__ */ __name(function data3() { + return { + isPrevButtonEnabled: false, + isNextButtonEnabled: true + }; + }, "data"), + resizeObserver: void 0, + watch: { + showNavigators: /* @__PURE__ */ __name(function showNavigators(newValue) { + newValue ? this.bindResizeObserver() : this.unbindResizeObserver(); + }, "showNavigators"), + activeValue: { + flush: "post", + handler: /* @__PURE__ */ __name(function handler() { + this.updateInkBar(); + }, "handler") + } + }, + mounted: /* @__PURE__ */ __name(function mounted2() { + var _this = this; + this.$nextTick(function() { + _this.updateInkBar(); + }); + if (this.showNavigators) { + this.updateButtonState(); + this.bindResizeObserver(); + } + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated() { + this.showNavigators && this.updateButtonState(); + }, "updated"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() { + this.unbindResizeObserver(); + }, "beforeUnmount"), + methods: { + onScroll: /* @__PURE__ */ __name(function onScroll(event) { + this.showNavigators && this.updateButtonState(); + event.preventDefault(); + }, "onScroll"), + onPrevButtonClick: /* @__PURE__ */ __name(function onPrevButtonClick() { + var content2 = this.$refs.content; + var width = getWidth(content2); + var pos = content2.scrollLeft - width; + content2.scrollLeft = pos <= 0 ? 0 : pos; + }, "onPrevButtonClick"), + onNextButtonClick: /* @__PURE__ */ __name(function onNextButtonClick() { + var content2 = this.$refs.content; + var width = getWidth(content2) - this.getVisibleButtonWidths(); + var pos = content2.scrollLeft + width; + var lastPos = content2.scrollWidth - width; + content2.scrollLeft = pos >= lastPos ? lastPos : pos; + }, "onNextButtonClick"), + bindResizeObserver: /* @__PURE__ */ __name(function bindResizeObserver() { + var _this2 = this; + this.resizeObserver = new ResizeObserver(function() { + return _this2.updateButtonState(); + }); + this.resizeObserver.observe(this.$refs.list); + }, "bindResizeObserver"), + unbindResizeObserver: /* @__PURE__ */ __name(function unbindResizeObserver() { + var _this$resizeObserver; + (_this$resizeObserver = this.resizeObserver) === null || _this$resizeObserver === void 0 || _this$resizeObserver.unobserve(this.$refs.list); + this.resizeObserver = void 0; + }, "unbindResizeObserver"), + updateInkBar: /* @__PURE__ */ __name(function updateInkBar() { + var _this$$refs = this.$refs, content2 = _this$$refs.content, inkbar = _this$$refs.inkbar, tabs = _this$$refs.tabs; + var activeTab = findSingle(content2, '[data-pc-name="tab"][data-p-active="true"]'); + if (this.$pcTabs.isVertical()) { + inkbar.style.height = getOuterHeight(activeTab) + "px"; + inkbar.style.top = getOffset(activeTab).top - getOffset(tabs).top + "px"; + } else { + inkbar.style.width = getOuterWidth(activeTab) + "px"; + inkbar.style.left = getOffset(activeTab).left - getOffset(tabs).left + "px"; + } + }, "updateInkBar"), + updateButtonState: /* @__PURE__ */ __name(function updateButtonState() { + var _this$$refs2 = this.$refs, list = _this$$refs2.list, content2 = _this$$refs2.content; + var scrollLeft = content2.scrollLeft, scrollTop = content2.scrollTop, scrollWidth = content2.scrollWidth, scrollHeight = content2.scrollHeight, offsetWidth = content2.offsetWidth, offsetHeight = content2.offsetHeight; + var _ref = [getWidth(content2), getHeight(content2)], width = _ref[0], height = _ref[1]; + if (this.$pcTabs.isVertical()) { + this.isPrevButtonEnabled = scrollTop !== 0; + this.isNextButtonEnabled = list.offsetHeight >= offsetHeight && parseInt(scrollTop) !== scrollHeight - height; + } else { + this.isPrevButtonEnabled = scrollLeft !== 0; + this.isNextButtonEnabled = list.offsetWidth >= offsetWidth && parseInt(scrollLeft) !== scrollWidth - width; + } + }, "updateButtonState"), + getVisibleButtonWidths: /* @__PURE__ */ __name(function getVisibleButtonWidths() { + var _this$$refs3 = this.$refs, prevBtn = _this$$refs3.prevBtn, nextBtn = _this$$refs3.nextBtn; + return [prevBtn, nextBtn].reduce(function(acc, el) { + return el ? acc + getWidth(el) : acc; + }, 0); + }, "getVisibleButtonWidths") + }, + computed: { + templates: /* @__PURE__ */ __name(function templates() { + return this.$pcTabs.$slots; + }, "templates"), + activeValue: /* @__PURE__ */ __name(function activeValue() { + return this.$pcTabs.d_value; + }, "activeValue"), + showNavigators: /* @__PURE__ */ __name(function showNavigators2() { + return this.$pcTabs.scrollable && this.$pcTabs.showNavigators; + }, "showNavigators"), + prevButtonAriaLabel: /* @__PURE__ */ __name(function prevButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.previous : void 0; + }, "prevButtonAriaLabel"), + nextButtonAriaLabel: /* @__PURE__ */ __name(function nextButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.next : void 0; + }, "nextButtonAriaLabel") + }, + components: { + ChevronLeftIcon: script$f, + ChevronRightIcon: script$g + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$l = ["aria-label", "tabindex"]; +var _hoisted_2$i = ["aria-orientation"]; +var _hoisted_3$g = ["aria-label", "tabindex"]; +function render$g(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("div", mergeProps({ + ref: "list", + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [$options.showNavigators && $data.isPrevButtonEnabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: 0, + ref: "prevButton", + "class": _ctx.cx("prevButton"), + "aria-label": $options.prevButtonAriaLabel, + tabindex: $options.$pcTabs.tabindex, + onClick: _cache[0] || (_cache[0] = function() { + return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments); + }) + }, _ctx.ptm("prevButton"), { + "data-pc-group-section": "navigator" + }), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.previcon || "ChevronLeftIcon"), mergeProps({ + "aria-hidden": "true" + }, _ctx.ptm("prevIcon")), null, 16))], 16, _hoisted_1$l)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + ref: "content", + "class": _ctx.cx("content"), + onScroll: _cache[1] || (_cache[1] = function() { + return $options.onScroll && $options.onScroll.apply($options, arguments); + }) + }, _ctx.ptm("content")), [createBaseVNode("div", mergeProps({ + ref: "tabs", + "class": _ctx.cx("tabList"), + role: "tablist", + "aria-orientation": $options.$pcTabs.orientation || "horizontal" + }, _ctx.ptm("tabList")), [renderSlot(_ctx.$slots, "default"), createBaseVNode("span", mergeProps({ + ref: "inkbar", + "class": _ctx.cx("activeBar"), + role: "presentation", + "aria-hidden": "true" + }, _ctx.ptm("activeBar")), null, 16)], 16, _hoisted_2$i)], 16), $options.showNavigators && $data.isNextButtonEnabled ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: 1, + ref: "nextButton", + "class": _ctx.cx("nextButton"), + "aria-label": $options.nextButtonAriaLabel, + tabindex: $options.$pcTabs.tabindex, + onClick: _cache[2] || (_cache[2] = function() { + return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments); + }) + }, _ctx.ptm("nextButton"), { + "data-pc-group-section": "navigator" + }), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.nexticon || "ChevronRightIcon"), mergeProps({ + "aria-hidden": "true" + }, _ctx.ptm("nextIcon")), null, 16))], 16, _hoisted_3$g)), [[_directive_ripple]]) : createCommentVNode("", true)], 16); +} +__name(render$g, "render$g"); +script$9.render = render$g; +const _sfc_main$p = /* @__PURE__ */ defineComponent({ + __name: "ExtensionSlot", + props: { + extension: {} + }, + setup(__props) { + const props = __props; + const mountCustomExtension = /* @__PURE__ */ __name((extension, el) => { + extension.render(el); + }, "mountCustomExtension"); + onBeforeUnmount(() => { + if (props.extension.type === "custom" && props.extension.destroy) { + props.extension.destroy(); + } + }); + return (_ctx, _cache) => { + return _ctx.extension.type === "vue" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.extension.component), { key: 0 })) : (openBlock(), createElementBlock("div", { + key: 1, + ref: /* @__PURE__ */ __name((el) => { + if (el) + mountCustomExtension( + props.extension, + el + ); + }, "ref") + }, null, 512)); + }; + } +}); +const _hoisted_1$k = { class: "flex flex-col h-full" }; +const _hoisted_2$h = { class: "w-full flex justify-between" }; +const _hoisted_3$f = { class: "tabs-container" }; +const _hoisted_4$5 = { class: "font-bold" }; +const _hoisted_5$4 = { class: "flex-grow h-0" }; +const _sfc_main$o = /* @__PURE__ */ defineComponent({ + __name: "BottomPanel", + setup(__props) { + const bottomPanelStore = useBottomPanelStore(); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$k, [ + createVNode(unref(script$h), { + value: unref(bottomPanelStore).activeBottomPanelTabId, + "onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(bottomPanelStore).activeBottomPanelTabId = $event) + }, { + default: withCtx(() => [ + createVNode(unref(script$9), { "pt:tabList": "border-none" }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_2$h, [ + createBaseVNode("div", _hoisted_3$f, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(unref(bottomPanelStore).bottomPanelTabs, (tab) => { + return openBlock(), createBlock(unref(script$a), { + key: tab.id, + value: tab.id, + class: "p-3 border-none" + }, { + default: withCtx(() => [ + createBaseVNode("span", _hoisted_4$5, toDisplayString(tab.title.toUpperCase()), 1) + ]), + _: 2 + }, 1032, ["value"]); + }), 128)) + ]), + createVNode(unref(script$d), { + class: "justify-self-end", + icon: "pi pi-times", + severity: "secondary", + size: "small", + text: "", + onClick: _cache[0] || (_cache[0] = ($event) => unref(bottomPanelStore).bottomPanelVisible = false) + }) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["value"]), + createBaseVNode("div", _hoisted_5$4, [ + unref(bottomPanelStore).bottomPanelVisible && unref(bottomPanelStore).activeBottomPanelTab ? (openBlock(), createBlock(_sfc_main$p, { + key: 0, + extension: unref(bottomPanelStore).activeBottomPanelTab + }, null, 8, ["extension"])) : createCommentVNode("", true) + ]) + ]); + }; + } +}); +const _hoisted_1$j = { + viewBox: "0 0 1024 1024", + width: "1.2em", + height: "1.2em" +}; +const _hoisted_2$g = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M921.088 103.232L584.832 889.024L465.52 544.512L121.328 440.48zM1004.46.769c-6.096 0-13.52 1.728-22.096 5.36L27.708 411.2c-34.383 14.592-36.56 42.704-4.847 62.464l395.296 123.584l129.36 403.264c9.28 15.184 20.496 22.72 31.263 22.72c11.936 0 23.296-9.152 31.04-27.248l408.272-953.728C1029.148 16.368 1022.86.769 1004.46.769" +}, null, -1); +const _hoisted_3$e = [ + _hoisted_2$g +]; +function render$f(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$j, [..._hoisted_3$e]); +} +__name(render$f, "render$f"); +const __unplugin_components_1$2 = markRaw({ name: "simple-line-icons-cursor", render: render$f }); +const _hoisted_1$i = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +const _hoisted_2$f = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M10.05 23q-.75 0-1.4-.337T7.575 21.7L1.2 12.375l.6-.575q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v13.425l-3.7-2.6l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zM11 12V2q0-.425.288-.712T12 1t.713.288T13 2v10zm4 0V3q0-.425.288-.712T16 2t.713.288T17 3v9zm-2.85 4.5" +}, null, -1); +const _hoisted_3$d = [ + _hoisted_2$f +]; +function render$e(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$i, [..._hoisted_3$d]); +} +__name(render$e, "render$e"); +const __unplugin_components_0$2 = markRaw({ name: "material-symbols-pan-tool-outline", render: render$e }); +var theme$6 = /* @__PURE__ */ __name(function theme2(_ref) { + _ref.dt; + return "\n.p-buttongroup .p-button {\n margin: 0;\n}\n\n.p-buttongroup .p-button:not(:last-child),\n.p-buttongroup .p-button:not(:last-child):hover {\n border-right: 0 none;\n}\n\n.p-buttongroup .p-button:not(:first-of-type):not(:last-of-type) {\n border-radius: 0;\n}\n\n.p-buttongroup .p-button:first-of-type:not(:only-of-type) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.p-buttongroup .p-button:last-of-type:not(:only-of-type) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-buttongroup .p-button:focus {\n position: relative;\n z-index: 1;\n}\n"; +}, "theme"); +var classes$6 = { + root: "p-buttongroup p-component" +}; +var ButtonGroupStyle = BaseStyle.extend({ + name: "buttongroup", + theme: theme$6, + classes: classes$6 +}); +var script$1$6 = { + name: "BaseButtonGroup", + "extends": script$e, + style: ButtonGroupStyle, + provide: /* @__PURE__ */ __name(function provide6() { + return { + $pcButtonGroup: this, + $parentInstance: this + }; + }, "provide") +}; +var script$8 = { + name: "ButtonGroup", + "extends": script$1$6, + inheritAttrs: false +}; +function render$d(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("span", mergeProps({ + "class": _ctx.cx("root"), + role: "group" + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); +} +__name(render$d, "render$d"); +script$8.render = render$d; +const useTitleEditorStore = defineStore("titleEditor", () => { + const titleEditorTarget = shallowRef(null); + return { + titleEditorTarget + }; +}); +const useCanvasStore = defineStore("canvas", () => { + const canvas = shallowRef(null); + return { + canvas + }; +}); +const _sfc_main$n = /* @__PURE__ */ defineComponent({ + __name: "GraphCanvasMenu", + setup(__props) { + const { t } = useI18n(); + const commandStore = useCommandStore(); + const canvasStore = useCanvasStore(); + const settingStore = useSettingStore(); + const linkHidden = computed( + () => settingStore.get("Comfy.LinkRenderMode") === LiteGraph.HIDDEN_LINK + ); + let interval = null; + const repeat2 = /* @__PURE__ */ __name((command) => { + if (interval) return; + const cmd = /* @__PURE__ */ __name(() => commandStore.execute(command), "cmd"); + cmd(); + interval = window.setInterval(cmd, 100); + }, "repeat"); + const stopRepeat = /* @__PURE__ */ __name(() => { + if (interval) { + clearInterval(interval); + interval = null; + } + }, "stopRepeat"); + return (_ctx, _cache) => { + const _component_i_material_symbols58pan_tool_outline = __unplugin_components_0$2; + const _component_i_simple_line_icons58cursor = __unplugin_components_1$2; + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createBlock(unref(script$8), { class: "p-buttongroup-vertical absolute bottom-[10px] right-[10px] z-[1000] pointer-events-auto" }, { + default: withCtx(() => [ + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: "pi pi-plus", + onMousedown: _cache[0] || (_cache[0] = ($event) => repeat2("Comfy.Canvas.ZoomIn")), + onMouseup: stopRepeat + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.zoomIn"), + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: "pi pi-minus", + onMousedown: _cache[1] || (_cache[1] = ($event) => repeat2("Comfy.Canvas.ZoomOut")), + onMouseup: stopRepeat + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.zoomOut"), + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: "pi pi-expand", + onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.Canvas.FitView")) + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.fitView"), + void 0, + { left: true } + ] + ]), + withDirectives((openBlock(), createBlock(unref(script$d), { + severity: "secondary", + onClick: _cache[3] || (_cache[3] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLock")) + }, { + icon: withCtx(() => [ + unref(canvasStore).canvas?.read_only ? (openBlock(), createBlock(_component_i_material_symbols58pan_tool_outline, { key: 0 })) : (openBlock(), createBlock(_component_i_simple_line_icons58cursor, { key: 1 })) + ]), + _: 1 + })), [ + [ + _directive_tooltip, + unref(t)( + "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode") + ) + " (Space)", + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$d), { + severity: "secondary", + icon: linkHidden.value ? "pi pi-eye-slash" : "pi pi-eye", + onClick: _cache[4] || (_cache[4] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLinkVisibility")), + "data-testid": "toggle-link-visibility-button" + }, null, 8, ["icon"]), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.toggleLinkVisibility"), + void 0, + { left: true } + ] + ]) + ]), + _: 1 + }); + }; + } +}); +const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-cf40dd39"]]); +const _sfc_main$m = /* @__PURE__ */ defineComponent({ + __name: "NodeBadge", + setup(__props) { + const settingStore = useSettingStore(); + const colorPaletteStore = useColorPaletteStore(); + const nodeSourceBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeSourceBadgeMode") + ); + const nodeIdBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeIdBadgeMode") + ); + const nodeLifeCycleBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeLifeCycleBadgeMode") + ); + watch([nodeSourceBadgeMode, nodeIdBadgeMode, nodeLifeCycleBadgeMode], () => { + app.graph?.setDirtyCanvas(true, true); + }); + const nodeDefStore = useNodeDefStore(); + function badgeTextVisible(nodeDef, badgeMode) { + return !(badgeMode === NodeBadgeMode.None || nodeDef?.isCoreNode && badgeMode === NodeBadgeMode.HideBuiltIn); + } + __name(badgeTextVisible, "badgeTextVisible"); + onMounted(() => { + app.registerExtension({ + name: "Comfy.NodeBadge", + nodeCreated(node) { + node.badgePosition = BadgePosition.TopRight; + const badge = computed(() => { + const nodeDef = nodeDefStore.fromLGraphNode(node); + return new LGraphBadge({ + text: _.truncate( + [ + badgeTextVisible(nodeDef, nodeIdBadgeMode.value) ? `#${node.id}` : "", + badgeTextVisible(nodeDef, nodeLifeCycleBadgeMode.value) ? nodeDef?.nodeLifeCycleBadgeText ?? "" : "", + badgeTextVisible(nodeDef, nodeSourceBadgeMode.value) ? nodeDef?.nodeSource?.badgeText ?? "" : "" + ].filter((s) => s.length > 0).join(" "), + { + length: 31 + } + ), + fgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_FG_COLOR, + bgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_BG_COLOR + }); + }); + node.badges.push(() => badge.value); + } + }); + }); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +const _sfc_main$l = /* @__PURE__ */ defineComponent({ + __name: "NodeTooltip", + setup(__props) { + let idleTimeout; + const nodeDefStore = useNodeDefStore(); + const tooltipRef = ref(); + const tooltipText = ref(""); + const left = ref(); + const top = ref(); + const hideTooltip = /* @__PURE__ */ __name(() => tooltipText.value = null, "hideTooltip"); + const showTooltip = /* @__PURE__ */ __name(async (tooltip) => { + if (!tooltip) return; + left.value = app.canvas.mouse[0] + "px"; + top.value = app.canvas.mouse[1] + "px"; + tooltipText.value = tooltip; + await nextTick(); + const rect = tooltipRef.value.getBoundingClientRect(); + if (rect.right > window.innerWidth) { + left.value = app.canvas.mouse[0] - rect.width + "px"; + } + if (rect.top < 0) { + top.value = app.canvas.mouse[1] + rect.height + "px"; + } + }, "showTooltip"); + const onIdle = /* @__PURE__ */ __name(() => { + const { canvas } = app; + const node = canvas.node_over; + if (!node) return; + const ctor = node.constructor; + const nodeDef = nodeDefStore.nodeDefsByName[node.type]; + if (ctor.title_mode !== LiteGraph.NO_TITLE && canvas.graph_mouse[1] < node.pos[1]) { + return showTooltip(nodeDef.description); + } + if (node.flags?.collapsed) return; + const inputSlot = canvas.isOverNodeInput( + node, + canvas.graph_mouse[0], + canvas.graph_mouse[1], + [0, 0] + ); + if (inputSlot !== -1) { + const inputName = node.inputs[inputSlot].name; + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(inputName)}.tooltip`, + nodeDef.inputs.getInput(inputName)?.tooltip + ); + return showTooltip(translatedTooltip); + } + const outputSlot = canvas.isOverNodeOutput( + node, + canvas.graph_mouse[0], + canvas.graph_mouse[1], + [0, 0] + ); + if (outputSlot !== -1) { + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.outputs.${outputSlot}.tooltip`, + nodeDef.outputs.all?.[outputSlot]?.tooltip + ); + return showTooltip(translatedTooltip); + } + const widget = app.canvas.getWidgetAtCursor(); + if (widget && !widget.element) { + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(widget.name)}.tooltip`, + nodeDef.inputs.getInput(widget.name)?.tooltip + ); + return showTooltip(widget.tooltip ?? translatedTooltip); + } + }, "onIdle"); + const onMouseMove = /* @__PURE__ */ __name((e) => { + hideTooltip(); + clearTimeout(idleTimeout); + if (e.target.nodeName !== "CANVAS") return; + idleTimeout = window.setTimeout(onIdle, 500); + }, "onMouseMove"); + useEventListener(window, "mousemove", onMouseMove); + useEventListener(window, "click", hideTooltip); + return (_ctx, _cache) => { + return tooltipText.value ? (openBlock(), createElementBlock("div", { + key: 0, + ref_key: "tooltipRef", + ref: tooltipRef, + class: "node-tooltip", + style: normalizeStyle({ left: left.value, top: top.value }) + }, toDisplayString(tooltipText.value), 5)) : createCommentVNode("", true); + }; + } +}); +const NodeTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-46859edf"]]); +const _sfc_main$k = /* @__PURE__ */ defineComponent({ + __name: "TitleEditor", + setup(__props) { + const settingStore = useSettingStore(); + const showInput = ref(false); + const editedTitle = ref(""); + const inputStyle = ref({ + position: "fixed", + left: "0px", + top: "0px", + width: "200px", + height: "20px", + fontSize: "12px" + }); + const titleEditorStore = useTitleEditorStore(); + const canvasStore = useCanvasStore(); + const previousCanvasDraggable = ref(true); + const onEdit = /* @__PURE__ */ __name((newValue) => { + if (titleEditorStore.titleEditorTarget && newValue.trim() !== "") { + titleEditorStore.titleEditorTarget.title = newValue.trim(); + app.graph.setDirtyCanvas(true, true); + } + showInput.value = false; + titleEditorStore.titleEditorTarget = null; + canvasStore.canvas.allow_dragcanvas = previousCanvasDraggable.value; + }, "onEdit"); + watch( + () => titleEditorStore.titleEditorTarget, + (target) => { + if (target === null) { + return; + } + editedTitle.value = target.title; + showInput.value = true; + previousCanvasDraggable.value = canvasStore.canvas.allow_dragcanvas; + canvasStore.canvas.allow_dragcanvas = false; + if (target instanceof LGraphGroup) { + const group = target; + const [x, y] = group.pos; + const [w, h] = group.size; + const [left, top] = app.canvasPosToClientPos([x, y]); + inputStyle.value.left = `${left}px`; + inputStyle.value.top = `${top}px`; + const width = w * app.canvas.ds.scale; + const height = group.titleHeight * app.canvas.ds.scale; + inputStyle.value.width = `${width}px`; + inputStyle.value.height = `${height}px`; + const fontSize = group.font_size * app.canvas.ds.scale; + inputStyle.value.fontSize = `${fontSize}px`; + } else if (target instanceof LGraphNode) { + const node = target; + const [x, y] = node.getBounding(); + const canvasWidth = node.width; + const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT; + const [left, top] = app.canvasPosToClientPos([x, y]); + inputStyle.value.left = `${left}px`; + inputStyle.value.top = `${top}px`; + const width = canvasWidth * app.canvas.ds.scale; + const height = canvasHeight * app.canvas.ds.scale; + inputStyle.value.width = `${width}px`; + inputStyle.value.height = `${height}px`; + const fontSize = 12 * app.canvas.ds.scale; + inputStyle.value.fontSize = `${fontSize}px`; + } + } + ); + const canvasEventHandler = /* @__PURE__ */ __name((event) => { + if (event.detail.subType === "group-double-click") { + if (!settingStore.get("Comfy.Group.DoubleClickTitleToEdit")) { + return; + } + const group = event.detail.group; + const [x, y] = group.pos; + const e = event.detail.originalEvent; + const relativeY = e.canvasY - y; + if (relativeY <= group.titleHeight) { + titleEditorStore.titleEditorTarget = group; + } + } else if (event.detail.subType === "node-double-click") { + if (!settingStore.get("Comfy.Node.DoubleClickTitleToEdit")) { + return; + } + const node = event.detail.node; + const [x, y] = node.pos; + const e = event.detail.originalEvent; + const relativeY = e.canvasY - y; + if (relativeY <= 0) { + titleEditorStore.titleEditorTarget = node; + } + } + }, "canvasEventHandler"); + useEventListener(document, "litegraph:canvas", canvasEventHandler); + return (_ctx, _cache) => { + return showInput.value ? (openBlock(), createElementBlock("div", { + key: 0, + class: "group-title-editor node-title-editor", + style: normalizeStyle(inputStyle.value) + }, [ + createVNode(EditableText, { + isEditing: showInput.value, + modelValue: editedTitle.value, + onEdit + }, null, 8, ["isEditing", "modelValue"]) + ], 4)) : createCommentVNode("", true); + }; + } +}); +const TitleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-12d3fd12"]]); +const useSearchBoxStore = defineStore("searchBox", () => { + const visible = ref(false); + function toggleVisible() { + visible.value = !visible.value; + } + __name(toggleVisible, "toggleVisible"); + return { + visible, + toggleVisible + }; +}); +class ConnectingLinkImpl { + static { + __name(this, "ConnectingLinkImpl"); + } + constructor(node, slot, input, output, pos, afterRerouteId) { + this.node = node; + this.slot = slot; + this.input = input; + this.output = output; + this.pos = pos; + this.afterRerouteId = afterRerouteId; + } + static createFromPlainObject(obj) { + return new ConnectingLinkImpl( + obj.node, + obj.slot, + obj.input, + obj.output, + obj.pos, + obj.afterRerouteId + ); + } + get type() { + const result = this.input ? this.input.type : this.output?.type ?? null; + return result === -1 ? null : result; + } + /** + * Which slot type is release and need to be reconnected. + * - 'output' means we need a new node's outputs slot to connect with this link + */ + get releaseSlotType() { + return this.output ? "input" : "output"; + } + connectTo(newNode) { + const newNodeSlots = this.releaseSlotType === "output" ? newNode.outputs : newNode.inputs; + if (!newNodeSlots) return; + const newNodeSlot = newNodeSlots.findIndex( + (slot) => LiteGraph.isValidConnection(slot.type, this.type) + ); + if (newNodeSlot === -1) { + console.warn( + `Could not find slot with type ${this.type} on node ${newNode.title}. This should never happen` + ); + return; + } + if (this.releaseSlotType === "input") { + this.node.connect(this.slot, newNode, newNodeSlot, this.afterRerouteId); + } else { + newNode.connect(newNodeSlot, this.node, this.slot, this.afterRerouteId); + } + } +} +var theme$5 = /* @__PURE__ */ __name(function theme3(_ref) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var dt = _ref.dt; + return "\n.p-autocomplete {\n display: inline-flex;\n}\n\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n inset-inline-end: ".concat(dt("autocomplete.padding.x"), ";\n}\n\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-loader {\n inset-inline-end: calc(").concat(dt("autocomplete.dropdown.width"), " + ").concat(dt("autocomplete.padding.x"), ");\n}\n\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input {\n flex: 1 1 auto;\n width: 1%;\n}\n\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input,\n.p-autocomplete:has(.p-autocomplete-dropdown) .p-autocomplete-input-multiple {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n}\n\n.p-autocomplete-dropdown {\n cursor: pointer;\n display: inline-flex;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n width: ").concat(dt("autocomplete.dropdown.width"), ";\n border-start-end-radius: ").concat(dt("autocomplete.dropdown.border.radius"), ";\n border-end-end-radius: ").concat(dt("autocomplete.dropdown.border.radius"), ";\n background: ").concat(dt("autocomplete.dropdown.background"), ";\n border: 1px solid ").concat(dt("autocomplete.dropdown.border.color"), ";\n border-inline-start: 0 none;\n color: ").concat(dt("autocomplete.dropdown.color"), ";\n transition: background ").concat(dt("autocomplete.transition.duration"), ", color ").concat(dt("autocomplete.transition.duration"), ", border-color ").concat(dt("autocomplete.transition.duration"), ", outline-color ").concat(dt("autocomplete.transition.duration"), ", box-shadow ").concat(dt("autocomplete.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-autocomplete-dropdown:not(:disabled):hover {\n background: ").concat(dt("autocomplete.dropdown.hover.background"), ";\n border-color: ").concat(dt("autocomplete.dropdown.hover.border.color"), ";\n color: ").concat(dt("autocomplete.dropdown.hover.color"), ";\n}\n\n.p-autocomplete-dropdown:not(:disabled):active {\n background: ").concat(dt("autocomplete.dropdown.active.background"), ";\n border-color: ").concat(dt("autocomplete.dropdown.active.border.color"), ";\n color: ").concat(dt("autocomplete.dropdown.active.color"), ";\n}\n\n.p-autocomplete-dropdown:focus-visible {\n box-shadow: ").concat(dt("autocomplete.dropdown.focus.ring.shadow"), ";\n outline: ").concat(dt("autocomplete.dropdown.focus.ring.width"), " ").concat(dt("autocomplete.dropdown.focus.ring.style"), " ").concat(dt("autocomplete.dropdown.focus.ring.color"), ";\n outline-offset: ").concat(dt("autocomplete.dropdown.focus.ring.offset"), ";\n}\n\n.p-autocomplete .p-autocomplete-overlay {\n min-width: 100%;\n}\n\n.p-autocomplete-overlay {\n position: absolute;\n top: 0;\n left: 0;\n background: ").concat(dt("autocomplete.overlay.background"), ";\n color: ").concat(dt("autocomplete.overlay.color"), ";\n border: 1px solid ").concat(dt("autocomplete.overlay.border.color"), ";\n border-radius: ").concat(dt("autocomplete.overlay.border.radius"), ";\n box-shadow: ").concat(dt("autocomplete.overlay.shadow"), ";\n}\n\n.p-autocomplete-list-container {\n overflow: auto;\n}\n\n.p-autocomplete-list {\n margin: 0;\n list-style-type: none;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("autocomplete.list.gap"), ";\n padding: ").concat(dt("autocomplete.list.padding"), ";\n}\n\n.p-autocomplete-option {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n display: flex;\n align-items: center;\n padding: ").concat(dt("autocomplete.option.padding"), ";\n border: 0 none;\n color: ").concat(dt("autocomplete.option.color"), ";\n background: transparent;\n transition: background ").concat(dt("autocomplete.transition.duration"), ", color ").concat(dt("autocomplete.transition.duration"), ", border-color ").concat(dt("autocomplete.transition.duration"), ";\n border-radius: ").concat(dt("autocomplete.option.border.radius"), ";\n}\n\n.p-autocomplete-option:not(.p-autocomplete-option-selected):not(.p-disabled).p-focus {\n background: ").concat(dt("autocomplete.option.focus.background"), ";\n color: ").concat(dt("autocomplete.option.focus.color"), ";\n}\n\n.p-autocomplete-option-selected {\n background: ").concat(dt("autocomplete.option.selected.background"), ";\n color: ").concat(dt("autocomplete.option.selected.color"), ";\n}\n\n.p-autocomplete-option-selected.p-focus {\n background: ").concat(dt("autocomplete.option.selected.focus.background"), ";\n color: ").concat(dt("autocomplete.option.selected.focus.color"), ";\n}\n\n.p-autocomplete-option-group {\n margin: 0;\n padding: ").concat(dt("autocomplete.option.group.padding"), ";\n color: ").concat(dt("autocomplete.option.group.color"), ";\n background: ").concat(dt("autocomplete.option.group.background"), ";\n font-weight: ").concat(dt("autocomplete.option.group.font.weight"), ";\n}\n\n.p-autocomplete-input-multiple {\n margin: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n padding: calc(").concat(dt("autocomplete.padding.y"), " / 2) ").concat(dt("autocomplete.padding.x"), ";\n gap: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n color: ").concat(dt("autocomplete.color"), ";\n background: ").concat(dt("autocomplete.background"), ";\n border: 1px solid ").concat(dt("autocomplete.border.color"), ";\n border-radius: ").concat(dt("autocomplete.border.radius"), ";\n width: 100%;\n transition: background ").concat(dt("autocomplete.transition.duration"), ", color ").concat(dt("autocomplete.transition.duration"), ", border-color ").concat(dt("autocomplete.transition.duration"), ", outline-color ").concat(dt("autocomplete.transition.duration"), ", box-shadow ").concat(dt("autocomplete.transition.duration"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("autocomplete.shadow"), ";\n}\n\n.p-autocomplete:not(.p-disabled):hover .p-autocomplete-input-multiple {\n border-color: ").concat(dt("autocomplete.hover.border.color"), ";\n}\n\n.p-autocomplete:not(.p-disabled).p-focus .p-autocomplete-input-multiple {\n border-color: ").concat(dt("autocomplete.focus.border.color"), ";\n box-shadow: ").concat(dt("autocomplete.focus.ring.shadow"), ";\n outline: ").concat(dt("autocomplete.focus.ring.width"), " ").concat(dt("autocomplete.focus.ring.style"), " ").concat(dt("autocomplete.focus.ring.color"), ";\n outline-offset: ").concat(dt("autocomplete.focus.ring.offset"), ";\n}\n\n.p-autocomplete.p-invalid .p-autocomplete-input-multiple {\n border-color: ").concat(dt("autocomplete.invalid.border.color"), ";\n}\n\n.p-variant-filled.p-autocomplete-input-multiple {\n background: ").concat(dt("autocomplete.filled.background"), ";\n}\n\n.p-autocomplete:not(.p-disabled):hover .p-variant-filled.p-autocomplete-input-multiple {\n background: ").concat(dt("autocomplete.filled.hover.background"), ";\n}\n\n.p-autocomplete:not(.p-disabled).p-focus .p-variant-filled.p-autocomplete-input-multiple {\n background: ").concat(dt("autocomplete.filled.focus.background"), ";\n}\n\n.p-autocomplete.p-disabled .p-autocomplete-input-multiple {\n opacity: 1;\n background: ").concat(dt("autocomplete.disabled.background"), ";\n color: ").concat(dt("autocomplete.disabled.color"), ";\n}\n\n.p-autocomplete-chip.p-chip {\n padding-block-start: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n padding-block-end: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n border-radius: ").concat(dt("autocomplete.chip.border.radius"), ";\n}\n\n.p-autocomplete-input-multiple:has(.p-autocomplete-chip) {\n padding-inline-start: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n padding-inline-end: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n}\n\n.p-autocomplete-chip-item.p-focus .p-autocomplete-chip {\n background: ").concat(dt("autocomplete.chip.focus.background"), ";\n color: ").concat(dt("autocomplete.chip.focus.color"), ";\n}\n\n.p-autocomplete-input-chip {\n flex: 1 1 auto;\n display: inline-flex;\n padding-block-start: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n padding-block-end: calc(").concat(dt("autocomplete.padding.y"), " / 2);\n}\n\n.p-autocomplete-input-chip input {\n border: 0 none;\n outline: 0 none;\n background: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: inherit;\n}\n\n.p-autocomplete-input-chip input::placeholder {\n color: ").concat(dt("autocomplete.placeholder.color"), ";\n}\n\n.p-autocomplete.p-invalid .p-autocomplete-input-chip input::placeholder {\n color: ").concat(dt("autocomplete.invalid.placeholder.color"), ";\n}\n\n.p-autocomplete-empty-message {\n padding: ").concat(dt("autocomplete.empty.message.padding"), ";\n}\n\n.p-autocomplete-fluid {\n display: flex;\n}\n\n.p-autocomplete-fluid:has(.p-autocomplete-dropdown) .p-autocomplete-input {\n width: 1%;\n}\n\n.p-autocomplete:has(.p-inputtext-sm) .p-autocomplete-dropdown {\n width: ").concat(dt("autocomplete.dropdown.sm.width"), ";\n}\n\n.p-autocomplete:has(.p-inputtext-sm) .p-autocomplete-dropdown .p-icon {\n font-size: ").concat(dt("form.field.sm.font.size"), ";\n width: ").concat(dt("form.field.sm.font.size"), ";\n height: ").concat(dt("form.field.sm.font.size"), ";\n}\n\n.p-autocomplete:has(.p-inputtext-lg) .p-autocomplete-dropdown {\n width: ").concat(dt("autocomplete.dropdown.lg.width"), ";\n}\n\n.p-autocomplete:has(.p-inputtext-lg) .p-autocomplete-dropdown .p-icon {\n font-size: ").concat(dt("form.field.lg.font.size"), ";\n width: ").concat(dt("form.field.lg.font.size"), ";\n height: ").concat(dt("form.field.lg.font.size"), ";\n}\n"); +}, "theme"); +var inlineStyles$3 = { + root: { + position: "relative" + } +}; +var classes$5 = { + root: /* @__PURE__ */ __name(function root5(_ref2) { + var instance = _ref2.instance, props = _ref2.props; + return ["p-autocomplete p-component p-inputwrapper", { + "p-disabled": props.disabled, + "p-invalid": instance.$invalid, + "p-focus": instance.focused, + "p-inputwrapper-filled": instance.$filled || isNotEmpty(instance.inputValue), + "p-inputwrapper-focus": instance.focused, + "p-autocomplete-open": instance.overlayVisible, + "p-autocomplete-fluid": instance.$fluid + }]; + }, "root"), + pcInputText: "p-autocomplete-input", + inputMultiple: /* @__PURE__ */ __name(function inputMultiple(_ref3) { + _ref3.props; + var instance = _ref3.instance; + return ["p-autocomplete-input-multiple", { + "p-variant-filled": instance.$variant === "filled" + }]; + }, "inputMultiple"), + chipItem: /* @__PURE__ */ __name(function chipItem(_ref4) { + var instance = _ref4.instance, i = _ref4.i; + return ["p-autocomplete-chip-item", { + "p-focus": instance.focusedMultipleOptionIndex === i + }]; + }, "chipItem"), + pcChip: "p-autocomplete-chip", + chipIcon: "p-autocomplete-chip-icon", + inputChip: "p-autocomplete-input-chip", + loader: "p-autocomplete-loader", + dropdown: "p-autocomplete-dropdown", + overlay: "p-autocomplete-overlay p-component", + listContainer: "p-autocomplete-list-container", + list: "p-autocomplete-list", + optionGroup: "p-autocomplete-option-group", + option: /* @__PURE__ */ __name(function option(_ref5) { + var instance = _ref5.instance, _option = _ref5.option, i = _ref5.i, getItemOptions = _ref5.getItemOptions; + return ["p-autocomplete-option", { + "p-autocomplete-option-selected": instance.isSelected(_option), + "p-focus": instance.focusedOptionIndex === instance.getOptionIndex(i, getItemOptions), + "p-disabled": instance.isOptionDisabled(_option) + }]; + }, "option"), + emptyMessage: "p-autocomplete-empty-message" +}; +var AutoCompleteStyle = BaseStyle.extend({ + name: "autocomplete", + theme: theme$5, + classes: classes$5, + inlineStyles: inlineStyles$3 +}); +var script$1$5 = { + name: "BaseAutoComplete", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$m, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + props: { + suggestions: { + type: Array, + "default": null + }, + optionLabel: null, + optionDisabled: null, + optionGroupLabel: null, + optionGroupChildren: null, + scrollHeight: { + type: String, + "default": "14rem" + }, + dropdown: { + type: Boolean, + "default": false + }, + dropdownMode: { + type: String, + "default": "blank" + }, + multiple: { + type: Boolean, + "default": false + }, + loading: { + type: Boolean, + "default": false + }, + placeholder: { + type: String, + "default": null + }, + dataKey: { + type: String, + "default": null + }, + minLength: { + type: Number, + "default": 1 + }, + delay: { + type: Number, + "default": 300 + }, + appendTo: { + type: [String, Object], + "default": "body" + }, + forceSelection: { + type: Boolean, + "default": false + }, + completeOnFocus: { + type: Boolean, + "default": false + }, + inputId: { + type: String, + "default": null + }, + inputStyle: { + type: Object, + "default": null + }, + inputClass: { + type: [String, Object], + "default": null + }, + panelStyle: { + type: Object, + "default": null + }, + panelClass: { + type: [String, Object], + "default": null + }, + overlayStyle: { + type: Object, + "default": null + }, + overlayClass: { + type: [String, Object], + "default": null + }, + dropdownIcon: { + type: String, + "default": null + }, + dropdownClass: { + type: [String, Object], + "default": null + }, + loader: { + type: String, + "default": null + }, + loadingIcon: { + type: String, + "default": null + }, + removeTokenIcon: { + type: String, + "default": null + }, + chipIcon: { + type: String, + "default": null + }, + virtualScrollerOptions: { + type: Object, + "default": null + }, + autoOptionFocus: { + type: Boolean, + "default": false + }, + selectOnFocus: { + type: Boolean, + "default": false + }, + focusOnHover: { + type: Boolean, + "default": true + }, + searchLocale: { + type: String, + "default": void 0 + }, + searchMessage: { + type: String, + "default": null + }, + selectionMessage: { + type: String, + "default": null + }, + emptySelectionMessage: { + type: String, + "default": null + }, + emptySearchMessage: { + type: String, + "default": null + }, + showEmptyMessage: { + type: Boolean, + "default": true + }, + tabindex: { + type: Number, + "default": 0 + }, + typeahead: { + type: Boolean, + "default": true + }, + ariaLabel: { + type: String, + "default": null + }, + ariaLabelledby: { + type: String, + "default": null + } + }, + style: AutoCompleteStyle, + provide: /* @__PURE__ */ __name(function provide7() { + return { + $pcAutoComplete: this, + $parentInstance: this + }; + }, "provide") +}; +function _typeof$1$1(o) { + "@babel/helpers - typeof"; + return _typeof$1$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$1$1(o); +} +__name(_typeof$1$1, "_typeof$1$1"); +function _toConsumableArray$1(r) { + return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$1(); +} +__name(_toConsumableArray$1, "_toConsumableArray$1"); +function _nonIterableSpread$1() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +__name(_nonIterableSpread$1, "_nonIterableSpread$1"); +function _unsupportedIterableToArray$1(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray$1(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; + } +} +__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1"); +function _iterableToArray$1(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +__name(_iterableToArray$1, "_iterableToArray$1"); +function _arrayWithoutHoles$1(r) { + if (Array.isArray(r)) return _arrayLikeToArray$1(r); +} +__name(_arrayWithoutHoles$1, "_arrayWithoutHoles$1"); +function _arrayLikeToArray$1(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +__name(_arrayLikeToArray$1, "_arrayLikeToArray$1"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +var script$a = { +======== +var script$7 = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + name: "AutoComplete", + "extends": script$1$5, + inheritAttrs: false, + emits: ["change", "focus", "blur", "item-select", "item-unselect", "option-select", "option-unselect", "dropdown-click", "clear", "complete", "before-show", "before-hide", "show", "hide"], + inject: { + $pcFluid: { + "default": null + } + }, + outsideClickListener: null, + resizeListener: null, + scrollHandler: null, + overlay: null, + virtualScroller: null, + searchTimeout: null, + dirty: false, + data: /* @__PURE__ */ __name(function data4() { + return { + id: this.$attrs.id, + clicked: false, + focused: false, + focusedOptionIndex: -1, + focusedMultipleOptionIndex: -1, + overlayVisible: false, + searching: false + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + suggestions: /* @__PURE__ */ __name(function suggestions() { + if (this.searching) { + this.show(); + this.focusedOptionIndex = this.overlayVisible && this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1; + this.searching = false; + !this.showEmptyMessage && this.visibleOptions.length === 0 && this.hide(); + } + this.autoUpdateModel(); + }, "suggestions") + }, + mounted: /* @__PURE__ */ __name(function mounted3() { + this.id = this.id || UniqueComponentId(); + this.autoUpdateModel(); + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated2() { + if (this.overlayVisible) { + this.alignOverlay(); + } + }, "updated"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount3() { + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + if (this.scrollHandler) { + this.scrollHandler.destroy(); + this.scrollHandler = null; + } + if (this.overlay) { + ZIndex.clear(this.overlay); + this.overlay = null; + } + }, "beforeUnmount"), + methods: { + getOptionIndex: /* @__PURE__ */ __name(function getOptionIndex(index, fn) { + return this.virtualScrollerDisabled ? index : fn && fn(index)["index"]; + }, "getOptionIndex"), + getOptionLabel: /* @__PURE__ */ __name(function getOptionLabel(option2) { + return this.optionLabel ? resolveFieldData(option2, this.optionLabel) : option2; + }, "getOptionLabel"), + getOptionValue: /* @__PURE__ */ __name(function getOptionValue(option2) { + return option2; + }, "getOptionValue"), + getOptionRenderKey: /* @__PURE__ */ __name(function getOptionRenderKey(option2, index) { + return (this.dataKey ? resolveFieldData(option2, this.dataKey) : this.getOptionLabel(option2)) + "_" + index; + }, "getOptionRenderKey"), + getPTOptions: /* @__PURE__ */ __name(function getPTOptions3(option2, itemOptions, index, key) { + return this.ptm(key, { + context: { + selected: this.isSelected(option2), + focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions), + disabled: this.isOptionDisabled(option2) + } + }); + }, "getPTOptions"), + isOptionDisabled: /* @__PURE__ */ __name(function isOptionDisabled(option2) { + return this.optionDisabled ? resolveFieldData(option2, this.optionDisabled) : false; + }, "isOptionDisabled"), + isOptionGroup: /* @__PURE__ */ __name(function isOptionGroup(option2) { + return this.optionGroupLabel && option2.optionGroup && option2.group; + }, "isOptionGroup"), + getOptionGroupLabel: /* @__PURE__ */ __name(function getOptionGroupLabel(optionGroup) { + return resolveFieldData(optionGroup, this.optionGroupLabel); + }, "getOptionGroupLabel"), + getOptionGroupChildren: /* @__PURE__ */ __name(function getOptionGroupChildren(optionGroup) { + return resolveFieldData(optionGroup, this.optionGroupChildren); + }, "getOptionGroupChildren"), + getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset(index) { + var _this = this; + return (this.optionGroupLabel ? index - this.visibleOptions.slice(0, index).filter(function(option2) { + return _this.isOptionGroup(option2); + }).length : index) + 1; + }, "getAriaPosInset"), + show: /* @__PURE__ */ __name(function show(isFocus) { + this.$emit("before-show"); + this.dirty = true; + this.overlayVisible = true; + this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1; + isFocus && focus(this.multiple ? this.$refs.focusInput : this.$refs.focusInput.$el); + }, "show"), + hide: /* @__PURE__ */ __name(function hide(isFocus) { + var _this2 = this; + var _hide = /* @__PURE__ */ __name(function _hide2() { + _this2.$emit("before-hide"); + _this2.dirty = isFocus; + _this2.overlayVisible = false; + _this2.clicked = false; + _this2.focusedOptionIndex = -1; + isFocus && focus(_this2.multiple ? _this2.$refs.focusInput : _this2.$refs.focusInput.$el); + }, "_hide"); + setTimeout(function() { + _hide(); + }, 0); + }, "hide"), + onFocus: /* @__PURE__ */ __name(function onFocus2(event) { + if (this.disabled) { + return; + } + if (!this.dirty && this.completeOnFocus) { + this.search(event, event.target.value, "focus"); + } + this.dirty = true; + this.focused = true; + if (this.overlayVisible) { + this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.overlayVisible && this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1; + this.scrollInView(this.focusedOptionIndex); + } + this.$emit("focus", event); + }, "onFocus"), + onBlur: /* @__PURE__ */ __name(function onBlur(event) { + var _this$formField$onBlu, _this$formField; + this.dirty = false; + this.focused = false; + this.focusedOptionIndex = -1; + this.$emit("blur", event); + (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField); + }, "onBlur"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown(event) { + if (this.disabled) { + event.preventDefault(); + return; + } + switch (event.code) { + case "ArrowDown": + this.onArrowDownKey(event); + break; + case "ArrowUp": + this.onArrowUpKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "PageDown": + this.onPageDownKey(event); + break; + case "PageUp": + this.onPageUpKey(event); + break; + case "Enter": + case "NumpadEnter": + this.onEnterKey(event); + break; + case "Escape": + this.onEscapeKey(event); + break; + case "Tab": + this.onTabKey(event); + break; + case "Backspace": + this.onBackspaceKey(event); + break; + } + this.clicked = false; + }, "onKeyDown"), + onInput: /* @__PURE__ */ __name(function onInput(event) { + var _this3 = this; + if (this.typeahead) { + if (this.searchTimeout) { + clearTimeout(this.searchTimeout); + } + var query = event.target.value; + if (!this.multiple) { + this.updateModel(event, query); + } + if (query.length === 0) { + this.hide(); + this.$emit("clear"); + } else { + if (query.length >= this.minLength) { + this.focusedOptionIndex = -1; + this.searchTimeout = setTimeout(function() { + _this3.search(event, query, "input"); + }, this.delay); + } else { + this.hide(); + } + } + } + }, "onInput"), + onChange: /* @__PURE__ */ __name(function onChange(event) { + var _this4 = this; + if (this.forceSelection) { + var valid = false; + if (this.visibleOptions && !this.multiple) { + var value = this.multiple ? this.$refs.focusInput.value : this.$refs.focusInput.$el.value; + var matchedValue = this.visibleOptions.find(function(option2) { + return _this4.isOptionMatched(option2, value || ""); + }); + if (matchedValue !== void 0) { + valid = true; + !this.isSelected(matchedValue) && this.onOptionSelect(event, matchedValue); + } + } + if (!valid) { + if (this.multiple) this.$refs.focusInput.value = ""; + else this.$refs.focusInput.$el.value = ""; + this.$emit("clear"); + !this.multiple && this.updateModel(event, null); + } + } + }, "onChange"), + onMultipleContainerFocus: /* @__PURE__ */ __name(function onMultipleContainerFocus() { + if (this.disabled) { + return; + } + this.focused = true; + }, "onMultipleContainerFocus"), + onMultipleContainerBlur: /* @__PURE__ */ __name(function onMultipleContainerBlur() { + this.focusedMultipleOptionIndex = -1; + this.focused = false; + }, "onMultipleContainerBlur"), + onMultipleContainerKeyDown: /* @__PURE__ */ __name(function onMultipleContainerKeyDown(event) { + if (this.disabled) { + event.preventDefault(); + return; + } + switch (event.code) { + case "ArrowLeft": + this.onArrowLeftKeyOnMultiple(event); + break; + case "ArrowRight": + this.onArrowRightKeyOnMultiple(event); + break; + case "Backspace": + this.onBackspaceKeyOnMultiple(event); + break; + } + }, "onMultipleContainerKeyDown"), + onContainerClick: /* @__PURE__ */ __name(function onContainerClick(event) { + this.clicked = true; + if (this.disabled || this.searching || this.loading || this.isDropdownClicked(event)) { + return; + } + if (!this.overlay || !this.overlay.contains(event.target)) { + focus(this.multiple ? this.$refs.focusInput : this.$refs.focusInput.$el); + } + }, "onContainerClick"), + onDropdownClick: /* @__PURE__ */ __name(function onDropdownClick(event) { + var query = void 0; + if (this.overlayVisible) { + this.hide(true); + } else { + var target = this.multiple ? this.$refs.focusInput : this.$refs.focusInput.$el; + focus(target); + query = target.value; + if (this.dropdownMode === "blank") this.search(event, "", "dropdown"); + else if (this.dropdownMode === "current") this.search(event, query, "dropdown"); + } + this.$emit("dropdown-click", { + originalEvent: event, + query + }); + }, "onDropdownClick"), + onOptionSelect: /* @__PURE__ */ __name(function onOptionSelect(event, option2) { + var isHide = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; + var value = this.getOptionValue(option2); + if (this.multiple) { + this.$refs.focusInput.value = ""; + if (!this.isSelected(option2)) { + this.updateModel(event, [].concat(_toConsumableArray$1(this.d_value || []), [value])); + } + } else { + this.updateModel(event, value); + } + this.$emit("item-select", { + originalEvent: event, + value: option2 + }); + this.$emit("option-select", { + originalEvent: event, + value: option2 + }); + isHide && this.hide(true); + }, "onOptionSelect"), + onOptionMouseMove: /* @__PURE__ */ __name(function onOptionMouseMove(event, index) { + if (this.focusOnHover) { + this.changeFocusedOptionIndex(event, index); + } + }, "onOptionMouseMove"), + onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick(event) { + OverlayEventBus.emit("overlay-click", { + originalEvent: event, + target: this.$el + }); + }, "onOverlayClick"), + onOverlayKeyDown: /* @__PURE__ */ __name(function onOverlayKeyDown(event) { + switch (event.code) { + case "Escape": + this.onEscapeKey(event); + break; + } + }, "onOverlayKeyDown"), + onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey(event) { + if (!this.overlayVisible) { + return; + } + var optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findFirstOptionIndex() : this.findFirstFocusedOptionIndex(); + this.changeFocusedOptionIndex(event, optionIndex); + event.preventDefault(); + }, "onArrowDownKey"), + onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey(event) { + if (!this.overlayVisible) { + return; + } + if (event.altKey) { + if (this.focusedOptionIndex !== -1) { + this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]); + } + this.overlayVisible && this.hide(); + event.preventDefault(); + } else { + var optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findLastOptionIndex() : this.findLastFocusedOptionIndex(); + this.changeFocusedOptionIndex(event, optionIndex); + event.preventDefault(); + } + }, "onArrowUpKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey2(event) { + var target = event.currentTarget; + this.focusedOptionIndex = -1; + if (this.multiple) { + if (isEmpty(target.value) && this.$filled) { + focus(this.$refs.multiContainer); + this.focusedMultipleOptionIndex = this.d_value.length; + } else { + event.stopPropagation(); + } + } + }, "onArrowLeftKey"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey2(event) { + this.focusedOptionIndex = -1; + this.multiple && event.stopPropagation(); + }, "onArrowRightKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey2(event) { + var currentTarget = event.currentTarget; + var len = currentTarget.value.length; + currentTarget.setSelectionRange(0, event.shiftKey ? len : 0); + this.focusedOptionIndex = -1; + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey2(event) { + var currentTarget = event.currentTarget; + var len = currentTarget.value.length; + currentTarget.setSelectionRange(event.shiftKey ? 0 : len, len); + this.focusedOptionIndex = -1; + event.preventDefault(); + }, "onEndKey"), + onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey2(event) { + this.scrollInView(0); + event.preventDefault(); + }, "onPageUpKey"), + onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey2(event) { + this.scrollInView(this.visibleOptions.length - 1); + event.preventDefault(); + }, "onPageDownKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey2(event) { + if (!this.typeahead) { + if (this.multiple) { + this.updateModel(event, [].concat(_toConsumableArray$1(this.d_value || []), [event.target.value])); + this.$refs.focusInput.value = ""; + } + } else { + if (!this.overlayVisible) { + this.focusedOptionIndex = -1; + this.onArrowDownKey(event); + } else { + if (this.focusedOptionIndex !== -1) { + this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]); + } + this.hide(); + } + } + event.preventDefault(); + }, "onEnterKey"), + onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey(event) { + this.overlayVisible && this.hide(true); + event.preventDefault(); + }, "onEscapeKey"), + onTabKey: /* @__PURE__ */ __name(function onTabKey(event) { + if (this.focusedOptionIndex !== -1) { + this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]); + } + this.overlayVisible && this.hide(); + }, "onTabKey"), + onBackspaceKey: /* @__PURE__ */ __name(function onBackspaceKey(event) { + if (this.multiple) { + if (isNotEmpty(this.d_value) && !this.$refs.focusInput.value) { + var removedValue = this.d_value[this.d_value.length - 1]; + var newValue = this.d_value.slice(0, -1); + this.writeValue(newValue, event); + this.$emit("item-unselect", { + originalEvent: event, + value: removedValue + }); + this.$emit("option-unselect", { + originalEvent: event, + value: removedValue + }); + } + event.stopPropagation(); + } + }, "onBackspaceKey"), + onArrowLeftKeyOnMultiple: /* @__PURE__ */ __name(function onArrowLeftKeyOnMultiple() { + this.focusedMultipleOptionIndex = this.focusedMultipleOptionIndex < 1 ? 0 : this.focusedMultipleOptionIndex - 1; + }, "onArrowLeftKeyOnMultiple"), + onArrowRightKeyOnMultiple: /* @__PURE__ */ __name(function onArrowRightKeyOnMultiple() { + this.focusedMultipleOptionIndex++; + if (this.focusedMultipleOptionIndex > this.d_value.length - 1) { + this.focusedMultipleOptionIndex = -1; + focus(this.$refs.focusInput); + } + }, "onArrowRightKeyOnMultiple"), + onBackspaceKeyOnMultiple: /* @__PURE__ */ __name(function onBackspaceKeyOnMultiple(event) { + if (this.focusedMultipleOptionIndex !== -1) { + this.removeOption(event, this.focusedMultipleOptionIndex); + } + }, "onBackspaceKeyOnMultiple"), + onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter(el) { + ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay); + addStyle(el, { + position: "absolute", + top: "0", + left: "0" + }); + this.alignOverlay(); + }, "onOverlayEnter"), + onOverlayAfterEnter: /* @__PURE__ */ __name(function onOverlayAfterEnter() { + this.bindOutsideClickListener(); + this.bindScrollListener(); + this.bindResizeListener(); + this.$emit("show"); + }, "onOverlayAfterEnter"), + onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave() { + this.unbindOutsideClickListener(); + this.unbindScrollListener(); + this.unbindResizeListener(); + this.$emit("hide"); + this.overlay = null; + }, "onOverlayLeave"), + onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave(el) { + ZIndex.clear(el); + }, "onOverlayAfterLeave"), + alignOverlay: /* @__PURE__ */ __name(function alignOverlay() { + var target = this.multiple ? this.$refs.multiContainer : this.$refs.focusInput.$el; + if (this.appendTo === "self") { + relativePosition(this.overlay, target); + } else { + this.overlay.style.minWidth = getOuterWidth(target) + "px"; + absolutePosition(this.overlay, target); + } + }, "alignOverlay"), + bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener() { + var _this5 = this; + if (!this.outsideClickListener) { + this.outsideClickListener = function(event) { + if (_this5.overlayVisible && _this5.overlay && _this5.isOutsideClicked(event)) { + _this5.hide(); + } + }; + document.addEventListener("click", this.outsideClickListener); + } + }, "bindOutsideClickListener"), + unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener() { + if (this.outsideClickListener) { + document.removeEventListener("click", this.outsideClickListener); + this.outsideClickListener = null; + } + }, "unbindOutsideClickListener"), + bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener() { + var _this6 = this; + if (!this.scrollHandler) { + this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function() { + if (_this6.overlayVisible) { + _this6.hide(); + } + }); + } + this.scrollHandler.bindScrollListener(); + }, "bindScrollListener"), + unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener() { + if (this.scrollHandler) { + this.scrollHandler.unbindScrollListener(); + } + }, "unbindScrollListener"), + bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener() { + var _this7 = this; + if (!this.resizeListener) { + this.resizeListener = function() { + if (_this7.overlayVisible && !isTouchDevice()) { + _this7.hide(); + } + }; + window.addEventListener("resize", this.resizeListener); + } + }, "bindResizeListener"), + unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener() { + if (this.resizeListener) { + window.removeEventListener("resize", this.resizeListener); + this.resizeListener = null; + } + }, "unbindResizeListener"), + isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked(event) { + return !this.overlay.contains(event.target) && !this.isInputClicked(event) && !this.isDropdownClicked(event); + }, "isOutsideClicked"), + isInputClicked: /* @__PURE__ */ __name(function isInputClicked(event) { + if (this.multiple) return event.target === this.$refs.multiContainer || this.$refs.multiContainer.contains(event.target); + else return event.target === this.$refs.focusInput.$el; + }, "isInputClicked"), + isDropdownClicked: /* @__PURE__ */ __name(function isDropdownClicked(event) { + return this.$refs.dropdownButton ? event.target === this.$refs.dropdownButton || this.$refs.dropdownButton.contains(event.target) : false; + }, "isDropdownClicked"), + isOptionMatched: /* @__PURE__ */ __name(function isOptionMatched(option2, value) { + var _this$getOptionLabel; + return this.isValidOption(option2) && ((_this$getOptionLabel = this.getOptionLabel(option2)) === null || _this$getOptionLabel === void 0 ? void 0 : _this$getOptionLabel.toLocaleLowerCase(this.searchLocale)) === value.toLocaleLowerCase(this.searchLocale); + }, "isOptionMatched"), + isValidOption: /* @__PURE__ */ __name(function isValidOption(option2) { + return isNotEmpty(option2) && !(this.isOptionDisabled(option2) || this.isOptionGroup(option2)); + }, "isValidOption"), + isValidSelectedOption: /* @__PURE__ */ __name(function isValidSelectedOption(option2) { + return this.isValidOption(option2) && this.isSelected(option2); + }, "isValidSelectedOption"), + isEquals: /* @__PURE__ */ __name(function isEquals(value1, value2) { + return equals(value1, value2, this.equalityKey); + }, "isEquals"), + isSelected: /* @__PURE__ */ __name(function isSelected(option2) { + var _this8 = this; + var optionValue = this.getOptionValue(option2); + return this.multiple ? (this.d_value || []).some(function(value) { + return _this8.isEquals(value, optionValue); + }) : this.isEquals(this.d_value, this.getOptionValue(option2)); + }, "isSelected"), + findFirstOptionIndex: /* @__PURE__ */ __name(function findFirstOptionIndex() { + var _this9 = this; + return this.visibleOptions.findIndex(function(option2) { + return _this9.isValidOption(option2); + }); + }, "findFirstOptionIndex"), + findLastOptionIndex: /* @__PURE__ */ __name(function findLastOptionIndex() { + var _this10 = this; + return findLastIndex(this.visibleOptions, function(option2) { + return _this10.isValidOption(option2); + }); + }, "findLastOptionIndex"), + findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex(index) { + var _this11 = this; + var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function(option2) { + return _this11.isValidOption(option2); + }) : -1; + return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index; + }, "findNextOptionIndex"), + findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex(index) { + var _this12 = this; + var matchedOptionIndex = index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function(option2) { + return _this12.isValidOption(option2); + }) : -1; + return matchedOptionIndex > -1 ? matchedOptionIndex : index; + }, "findPrevOptionIndex"), + findSelectedOptionIndex: /* @__PURE__ */ __name(function findSelectedOptionIndex() { + var _this13 = this; + return this.$filled ? this.visibleOptions.findIndex(function(option2) { + return _this13.isValidSelectedOption(option2); + }) : -1; + }, "findSelectedOptionIndex"), + findFirstFocusedOptionIndex: /* @__PURE__ */ __name(function findFirstFocusedOptionIndex() { + var selectedIndex = this.findSelectedOptionIndex(); + return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex; + }, "findFirstFocusedOptionIndex"), + findLastFocusedOptionIndex: /* @__PURE__ */ __name(function findLastFocusedOptionIndex() { + var selectedIndex = this.findSelectedOptionIndex(); + return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex; + }, "findLastFocusedOptionIndex"), + search: /* @__PURE__ */ __name(function search(event, query, source) { + if (query === void 0 || query === null) { + return; + } + if (source === "input" && query.trim().length === 0) { + return; + } + this.searching = true; + this.$emit("complete", { + originalEvent: event, + query + }); + }, "search"), + removeOption: /* @__PURE__ */ __name(function removeOption(event, index) { + var _this14 = this; + var removedOption = this.d_value[index]; + var value = this.d_value.filter(function(_2, i) { + return i !== index; + }).map(function(option2) { + return _this14.getOptionValue(option2); + }); + this.updateModel(event, value); + this.$emit("item-unselect", { + originalEvent: event, + value: removedOption + }); + this.$emit("option-unselect", { + originalEvent: event, + value: removedOption + }); + this.dirty = true; + focus(this.multiple ? this.$refs.focusInput : this.$refs.focusInput.$el); + }, "removeOption"), + changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex(event, index) { + if (this.focusedOptionIndex !== index) { + this.focusedOptionIndex = index; + this.scrollInView(); + if (this.selectOnFocus) { + this.onOptionSelect(event, this.visibleOptions[index], false); + } + } + }, "changeFocusedOptionIndex"), + scrollInView: /* @__PURE__ */ __name(function scrollInView2() { + var _this15 = this; + var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1; + this.$nextTick(function() { + var id2 = index !== -1 ? "".concat(_this15.id, "_").concat(index) : _this15.focusedOptionId; + var element = findSingle(_this15.list, 'li[id="'.concat(id2, '"]')); + if (element) { + element.scrollIntoView && element.scrollIntoView({ + block: "nearest", + inline: "start" + }); + } else if (!_this15.virtualScrollerDisabled) { + _this15.virtualScroller && _this15.virtualScroller.scrollToIndex(index !== -1 ? index : _this15.focusedOptionIndex); + } + }); + }, "scrollInView"), + autoUpdateModel: /* @__PURE__ */ __name(function autoUpdateModel() { + if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) { + this.focusedOptionIndex = this.findFirstFocusedOptionIndex(); + this.onOptionSelect(null, this.visibleOptions[this.focusedOptionIndex], false); + } + }, "autoUpdateModel"), + updateModel: /* @__PURE__ */ __name(function updateModel(event, value) { + this.writeValue(value, event); + this.$emit("change", { + originalEvent: event, + value + }); + }, "updateModel"), + flatOptions: /* @__PURE__ */ __name(function flatOptions(options) { + var _this16 = this; + return (options || []).reduce(function(result, option2, index) { + result.push({ + optionGroup: option2, + group: true, + index + }); + var optionGroupChildren = _this16.getOptionGroupChildren(option2); + optionGroupChildren && optionGroupChildren.forEach(function(o) { + return result.push(o); + }); + return result; + }, []); + }, "flatOptions"), + overlayRef: /* @__PURE__ */ __name(function overlayRef(el) { + this.overlay = el; + }, "overlayRef"), + listRef: /* @__PURE__ */ __name(function listRef(el, contentRef) { + this.list = el; + contentRef && contentRef(el); + }, "listRef"), + virtualScrollerRef: /* @__PURE__ */ __name(function virtualScrollerRef(el) { + this.virtualScroller = el; + }, "virtualScrollerRef") + }, + computed: { + visibleOptions: /* @__PURE__ */ __name(function visibleOptions() { + return this.optionGroupLabel ? this.flatOptions(this.suggestions) : this.suggestions || []; + }, "visibleOptions"), + inputValue: /* @__PURE__ */ __name(function inputValue() { + if (this.$filled) { + if (_typeof$1$1(this.d_value) === "object") { + var label = this.getOptionLabel(this.d_value); + return label != null ? label : this.d_value; + } else { + return this.d_value; + } + } else { + return ""; + } + }, "inputValue"), + // @deprecated use $filled instead. + hasSelectedOption: /* @__PURE__ */ __name(function hasSelectedOption() { + return this.$filled; + }, "hasSelectedOption"), + equalityKey: /* @__PURE__ */ __name(function equalityKey() { + return this.dataKey; + }, "equalityKey"), + searchResultMessageText: /* @__PURE__ */ __name(function searchResultMessageText() { + return isNotEmpty(this.visibleOptions) && this.overlayVisible ? this.searchMessageText.replaceAll("{0}", this.visibleOptions.length) : this.emptySearchMessageText; + }, "searchResultMessageText"), + searchMessageText: /* @__PURE__ */ __name(function searchMessageText() { + return this.searchMessage || this.$primevue.config.locale.searchMessage || ""; + }, "searchMessageText"), + emptySearchMessageText: /* @__PURE__ */ __name(function emptySearchMessageText() { + return this.emptySearchMessage || this.$primevue.config.locale.emptySearchMessage || ""; + }, "emptySearchMessageText"), + selectionMessageText: /* @__PURE__ */ __name(function selectionMessageText() { + return this.selectionMessage || this.$primevue.config.locale.selectionMessage || ""; + }, "selectionMessageText"), + emptySelectionMessageText: /* @__PURE__ */ __name(function emptySelectionMessageText() { + return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || ""; + }, "emptySelectionMessageText"), + selectedMessageText: /* @__PURE__ */ __name(function selectedMessageText() { + return this.$filled ? this.selectionMessageText.replaceAll("{0}", this.multiple ? this.d_value.length : "1") : this.emptySelectionMessageText; + }, "selectedMessageText"), + listAriaLabel: /* @__PURE__ */ __name(function listAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.listLabel : void 0; + }, "listAriaLabel"), + focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId() { + return this.focusedOptionIndex !== -1 ? "".concat(this.id, "_").concat(this.focusedOptionIndex) : null; + }, "focusedOptionId"), + focusedMultipleOptionId: /* @__PURE__ */ __name(function focusedMultipleOptionId() { + return this.focusedMultipleOptionIndex !== -1 ? "".concat(this.id, "_multiple_option_").concat(this.focusedMultipleOptionIndex) : null; + }, "focusedMultipleOptionId"), + ariaSetSize: /* @__PURE__ */ __name(function ariaSetSize() { + var _this17 = this; + return this.visibleOptions.filter(function(option2) { + return !_this17.isOptionGroup(option2); + }).length; + }, "ariaSetSize"), + virtualScrollerDisabled: /* @__PURE__ */ __name(function virtualScrollerDisabled() { + return !this.virtualScrollerOptions; + }, "virtualScrollerDisabled"), + panelId: /* @__PURE__ */ __name(function panelId() { + return this.id + "_panel"; + }, "panelId") + }, + components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + InputText: script$n, + VirtualScroller: script$o, + Portal: script$p, + ChevronDownIcon: script$q, + SpinnerIcon: script$r, + Chip: script$s +======== + InputText: script$i, + VirtualScroller: script$j, + Portal: script$k, + ChevronDownIcon: script$l, + SpinnerIcon: script$m, + Chip: script$n +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }, + directives: { + ripple: Ripple + } +}; +function _typeof$4(o) { + "@babel/helpers - typeof"; + return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$4(o); +} +__name(_typeof$4, "_typeof$4"); +function ownKeys$3(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$3, "ownKeys$3"); +function _objectSpread$3(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$3(Object(t), true).forEach(function(r2) { + _defineProperty$4(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$3, "_objectSpread$3"); +function _defineProperty$4(e, r, t) { + return (r = _toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$4, "_defineProperty$4"); +function _toPropertyKey$4(t) { + var i = _toPrimitive$4(t, "string"); + return "symbol" == _typeof$4(i) ? i : i + ""; +} +__name(_toPropertyKey$4, "_toPropertyKey$4"); +function _toPrimitive$4(t, r) { + if ("object" != _typeof$4(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$4(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$4, "_toPrimitive$4"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +var _hoisted_1$j = ["aria-activedescendant"]; +var _hoisted_2$7 = ["id", "aria-label", "aria-setsize", "aria-posinset"]; +var _hoisted_3$6 = ["id", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"]; +var _hoisted_4$3 = ["disabled", "aria-expanded", "aria-controls"]; +var _hoisted_5$3 = ["id"]; +var _hoisted_6$2 = ["id", "aria-label"]; +var _hoisted_7$1 = ["id"]; +var _hoisted_8 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove", "data-p-selected", "data-p-focus", "data-p-disabled"]; +function render$g(_ctx, _cache, $props, $setup, $data, $options) { +======== +var _hoisted_1$h = ["aria-activedescendant"]; +var _hoisted_2$e = ["id", "aria-label", "aria-setsize", "aria-posinset"]; +var _hoisted_3$c = ["id", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"]; +var _hoisted_4$4 = ["disabled", "aria-expanded", "aria-controls"]; +var _hoisted_5$3 = ["id"]; +var _hoisted_6$2 = ["id", "aria-label"]; +var _hoisted_7$1 = ["id"]; +var _hoisted_8$1 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove", "data-p-selected", "data-p-focus", "data-p-disabled"]; +function render$c(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var _component_InputText = resolveComponent("InputText"); + var _component_Chip = resolveComponent("Chip"); + var _component_SpinnerIcon = resolveComponent("SpinnerIcon"); + var _component_VirtualScroller = resolveComponent("VirtualScroller"); + var _component_Portal = resolveComponent("Portal"); + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("div", mergeProps({ + ref: "container", + "class": _ctx.cx("root"), + style: _ctx.sx("root"), + onClick: _cache[11] || (_cache[11] = function() { + return $options.onContainerClick && $options.onContainerClick.apply($options, arguments); + }) + }, _ctx.ptmi("root")), [!_ctx.multiple ? (openBlock(), createBlock(_component_InputText, { + key: 0, + ref: "focusInput", + id: _ctx.inputId, + type: "text", + name: _ctx.$formName, + "class": normalizeClass([_ctx.cx("pcInputText"), _ctx.inputClass]), + style: normalizeStyle(_ctx.inputStyle), + value: $options.inputValue, + placeholder: _ctx.placeholder, + tabindex: !_ctx.disabled ? _ctx.tabindex : -1, + fluid: _ctx.$fluid, + disabled: _ctx.disabled, + size: _ctx.size, + invalid: _ctx.invalid, + variant: _ctx.variant, + autocomplete: "off", + role: "combobox", + "aria-label": _ctx.ariaLabel, + "aria-labelledby": _ctx.ariaLabelledby, + "aria-haspopup": "listbox", + "aria-autocomplete": "list", + "aria-expanded": $data.overlayVisible, + "aria-controls": $options.panelId, + "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0, + onFocus: $options.onFocus, + onBlur: $options.onBlur, + onKeydown: $options.onKeyDown, + onInput: $options.onInput, + onChange: $options.onChange, + unstyled: _ctx.unstyled, + pt: _ctx.ptm("pcInputText") + }, null, 8, ["id", "name", "class", "style", "value", "placeholder", "tabindex", "fluid", "disabled", "size", "invalid", "variant", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "onFocus", "onBlur", "onKeydown", "onInput", "onChange", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.multiple ? (openBlock(), createElementBlock("ul", mergeProps({ + key: 1, + ref: "multiContainer", + "class": _ctx.cx("inputMultiple"), + tabindex: "-1", + role: "listbox", + "aria-orientation": "horizontal", + "aria-activedescendant": $data.focused ? $options.focusedMultipleOptionId : void 0, + onFocus: _cache[5] || (_cache[5] = function() { + return $options.onMultipleContainerFocus && $options.onMultipleContainerFocus.apply($options, arguments); + }), + onBlur: _cache[6] || (_cache[6] = function() { + return $options.onMultipleContainerBlur && $options.onMultipleContainerBlur.apply($options, arguments); + }), + onKeydown: _cache[7] || (_cache[7] = function() { + return $options.onMultipleContainerKeyDown && $options.onMultipleContainerKeyDown.apply($options, arguments); + }) + }, _ctx.ptm("inputMultiple")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.d_value, function(option2, i) { + return openBlock(), createElementBlock("li", mergeProps({ + key: "".concat(i, "_").concat($options.getOptionLabel(option2)), + id: $data.id + "_multiple_option_" + i, + "class": _ctx.cx("chipItem", { + i + }), + role: "option", + "aria-label": $options.getOptionLabel(option2), + "aria-selected": true, + "aria-setsize": _ctx.d_value.length, + "aria-posinset": i + 1, + ref_for: true + }, _ctx.ptm("chipItem")), [renderSlot(_ctx.$slots, "chip", mergeProps({ + "class": _ctx.cx("pcChip"), + value: option2, + index: i, + removeCallback: /* @__PURE__ */ __name(function removeCallback(event) { + return $options.removeOption(event, i); + }, "removeCallback"), + ref_for: true + }, _ctx.ptm("pcChip")), function() { + return [createVNode(_component_Chip, { + "class": normalizeClass(_ctx.cx("pcChip")), + label: $options.getOptionLabel(option2), + removeIcon: _ctx.chipIcon || _ctx.removeTokenIcon, + removable: "", + unstyled: _ctx.unstyled, + onRemove: /* @__PURE__ */ __name(function onRemove2($event) { + return $options.removeOption($event, i); + }, "onRemove"), + pt: _ctx.ptm("pcChip") + }, { + removeicon: withCtx(function() { + return [renderSlot(_ctx.$slots, _ctx.$slots.chipicon ? "chipicon" : "removetokenicon", { + "class": normalizeClass(_ctx.cx("chipIcon")), + index: i, + removeCallback: /* @__PURE__ */ __name(function removeCallback(event) { + return $options.removeOption(event, i); + }, "removeCallback") + })]; + }), + _: 2 + }, 1032, ["class", "label", "removeIcon", "unstyled", "onRemove", "pt"])]; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + })], 16, _hoisted_2$7); +======== + })], 16, _hoisted_2$e); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }), 128)), createBaseVNode("li", mergeProps({ + "class": _ctx.cx("inputChip"), + role: "option" + }, _ctx.ptm("inputChip")), [createBaseVNode("input", mergeProps({ + ref: "focusInput", + id: _ctx.inputId, + type: "text", + style: _ctx.inputStyle, + "class": _ctx.inputClass, + placeholder: _ctx.placeholder, + tabindex: !_ctx.disabled ? _ctx.tabindex : -1, + disabled: _ctx.disabled, + autocomplete: "off", + role: "combobox", + "aria-label": _ctx.ariaLabel, + "aria-labelledby": _ctx.ariaLabelledby, + "aria-haspopup": "listbox", + "aria-autocomplete": "list", + "aria-expanded": $data.overlayVisible, + "aria-controls": $data.id + "_list", + "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0, + "aria-invalid": _ctx.invalid || void 0, + onFocus: _cache[0] || (_cache[0] = function() { + return $options.onFocus && $options.onFocus.apply($options, arguments); + }), + onBlur: _cache[1] || (_cache[1] = function() { + return $options.onBlur && $options.onBlur.apply($options, arguments); + }), + onKeydown: _cache[2] || (_cache[2] = function() { + return $options.onKeyDown && $options.onKeyDown.apply($options, arguments); + }), + onInput: _cache[3] || (_cache[3] = function() { + return $options.onInput && $options.onInput.apply($options, arguments); + }), + onChange: _cache[4] || (_cache[4] = function() { + return $options.onChange && $options.onChange.apply($options, arguments); + }) +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + }, _ctx.ptm("input")), null, 16, _hoisted_3$6)], 16)], 16, _hoisted_1$j)) : createCommentVNode("", true), $data.searching || _ctx.loading ? renderSlot(_ctx.$slots, _ctx.$slots.loader ? "loader" : "loadingicon", { +======== + }, _ctx.ptm("input")), null, 16, _hoisted_3$c)], 16)], 16, _hoisted_1$h)) : createCommentVNode("", true), $data.searching || _ctx.loading ? renderSlot(_ctx.$slots, _ctx.$slots.loader ? "loader" : "loadingicon", { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 2, + "class": normalizeClass(_ctx.cx("loader")) + }, function() { + return [_ctx.loader || _ctx.loadingIcon ? (openBlock(), createElementBlock("i", mergeProps({ + key: 0, + "class": ["pi-spin", _ctx.cx("loader"), _ctx.loader, _ctx.loadingIcon], + "aria-hidden": "true" + }, _ctx.ptm("loader")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({ + key: 1, + "class": _ctx.cx("loader"), + spin: "", + "aria-hidden": "true" + }, _ctx.ptm("loader")), null, 16, ["class"]))]; + }) : createCommentVNode("", true), renderSlot(_ctx.$slots, _ctx.$slots.dropdown ? "dropdown" : "dropdownbutton", { + toggleCallback: /* @__PURE__ */ __name(function toggleCallback(event) { + return $options.onDropdownClick(event); + }, "toggleCallback") + }, function() { + return [_ctx.dropdown ? (openBlock(), createElementBlock("button", mergeProps({ + key: 0, + ref: "dropdownButton", + type: "button", + "class": [_ctx.cx("dropdown"), _ctx.dropdownClass], + disabled: _ctx.disabled, + "aria-haspopup": "listbox", + "aria-expanded": $data.overlayVisible, + "aria-controls": $options.panelId, + onClick: _cache[8] || (_cache[8] = function() { + return $options.onDropdownClick && $options.onDropdownClick.apply($options, arguments); + }) + }, _ctx.ptm("dropdown")), [renderSlot(_ctx.$slots, "dropdownicon", { + "class": normalizeClass(_ctx.dropdownIcon) + }, function() { + return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? "span" : "ChevronDownIcon"), mergeProps({ + "class": _ctx.dropdownIcon + }, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))]; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + })], 16, _hoisted_4$3)) : createCommentVNode("", true)]; +======== + })], 16, _hoisted_4$4)) : createCommentVNode("", true)]; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }), createBaseVNode("span", mergeProps({ + role: "status", + "aria-live": "polite", + "class": "p-hidden-accessible" + }, _ctx.ptm("hiddenSearchResult"), { + "data-p-hidden-accessible": true + }), toDisplayString($options.searchResultMessageText), 17), createVNode(_component_Portal, { + appendTo: _ctx.appendTo + }, { + "default": withCtx(function() { + return [createVNode(Transition, mergeProps({ + name: "p-connected-overlay", + onEnter: $options.onOverlayEnter, + onAfterEnter: $options.onOverlayAfterEnter, + onLeave: $options.onOverlayLeave, + onAfterLeave: $options.onOverlayAfterLeave + }, _ctx.ptm("transition")), { + "default": withCtx(function() { + return [$data.overlayVisible ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + ref: $options.overlayRef, + id: $options.panelId, + "class": [_ctx.cx("overlay"), _ctx.panelClass, _ctx.overlayClass], + style: _objectSpread$3(_objectSpread$3({}, _ctx.panelStyle), _ctx.overlayStyle), + onClick: _cache[9] || (_cache[9] = function() { + return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments); + }), + onKeydown: _cache[10] || (_cache[10] = function() { + return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments); + }) + }, _ctx.ptm("overlay")), [renderSlot(_ctx.$slots, "header", { + value: _ctx.d_value, + suggestions: $options.visibleOptions + }), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("listContainer"), + style: { + "max-height": $options.virtualScrollerDisabled ? _ctx.scrollHeight : "" + } + }, _ctx.ptm("listContainer")), [createVNode(_component_VirtualScroller, mergeProps({ + ref: $options.virtualScrollerRef + }, _ctx.virtualScrollerOptions, { + style: { + height: _ctx.scrollHeight + }, + items: $options.visibleOptions, + tabindex: -1, + disabled: $options.virtualScrollerDisabled, + pt: _ctx.ptm("virtualScroller") + }), createSlots({ + content: withCtx(function(_ref) { + var styleClass = _ref.styleClass, contentRef = _ref.contentRef, items = _ref.items, getItemOptions = _ref.getItemOptions, contentStyle = _ref.contentStyle, itemSize = _ref.itemSize; + return [createBaseVNode("ul", mergeProps({ + ref: /* @__PURE__ */ __name(function ref2(el) { + return $options.listRef(el, contentRef); + }, "ref"), + id: $data.id + "_list", + "class": [_ctx.cx("list"), styleClass], + style: contentStyle, + role: "listbox", + "aria-label": $options.listAriaLabel + }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment, null, renderList(items, function(option2, i) { + return openBlock(), createElementBlock(Fragment, { + key: $options.getOptionRenderKey(option2, $options.getOptionIndex(i, getItemOptions)) + }, [$options.isOptionGroup(option2) ? (openBlock(), createElementBlock("li", mergeProps({ + key: 0, + id: $data.id + "_" + $options.getOptionIndex(i, getItemOptions), + style: { + height: itemSize ? itemSize + "px" : void 0 + }, + "class": _ctx.cx("optionGroup"), + role: "option", + ref_for: true + }, _ctx.ptm("optionGroup")), [renderSlot(_ctx.$slots, "optiongroup", { + option: option2.optionGroup, + index: $options.getOptionIndex(i, getItemOptions) + }, function() { + return [createTextVNode(toDisplayString($options.getOptionGroupLabel(option2.optionGroup)), 1)]; + })], 16, _hoisted_7$1)) : withDirectives((openBlock(), createElementBlock("li", mergeProps({ + key: 1, + id: $data.id + "_" + $options.getOptionIndex(i, getItemOptions), + style: { + height: itemSize ? itemSize + "px" : void 0 + }, + "class": _ctx.cx("option", { + option: option2, + i, + getItemOptions + }), + role: "option", + "aria-label": $options.getOptionLabel(option2), + "aria-selected": $options.isSelected(option2), + "aria-disabled": $options.isOptionDisabled(option2), + "aria-setsize": $options.ariaSetSize, + "aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)), + onClick: /* @__PURE__ */ __name(function onClick2($event) { + return $options.onOptionSelect($event, option2); + }, "onClick"), + onMousemove: /* @__PURE__ */ __name(function onMousemove($event) { + return $options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions)); + }, "onMousemove"), + "data-p-selected": $options.isSelected(option2), + "data-p-focus": $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), + "data-p-disabled": $options.isOptionDisabled(option2), + ref_for: true + }, $options.getPTOptions(option2, getItemOptions, i, "option")), [renderSlot(_ctx.$slots, "option", { + option: option2, + index: $options.getOptionIndex(i, getItemOptions) + }, function() { + return [createTextVNode(toDisplayString($options.getOptionLabel(option2)), 1)]; + })], 16, _hoisted_8)), [[_directive_ripple]])], 64); + }), 128)), _ctx.showEmptyMessage && (!items || items && items.length === 0) ? (openBlock(), createElementBlock("li", mergeProps({ + key: 0, + "class": _ctx.cx("emptyMessage"), + role: "option" + }, _ctx.ptm("emptyMessage")), [renderSlot(_ctx.$slots, "empty", {}, function() { + return [createTextVNode(toDisplayString($options.searchResultMessageText), 1)]; + })], 16)) : createCommentVNode("", true)], 16, _hoisted_6$2)]; + }), + _: 2 + }, [_ctx.$slots.loader ? { + name: "loader", + fn: withCtx(function(_ref2) { + var options = _ref2.options; + return [renderSlot(_ctx.$slots, "loader", { + options + })]; + }), + key: "0" + } : void 0]), 1040, ["style", "items", "disabled", "pt"])], 16), renderSlot(_ctx.$slots, "footer", { + value: _ctx.d_value, + suggestions: $options.visibleOptions + }), createBaseVNode("span", mergeProps({ + role: "status", + "aria-live": "polite", + "class": "p-hidden-accessible" + }, _ctx.ptm("hiddenSelectedMessage"), { + "data-p-hidden-accessible": true + }), toDisplayString($options.selectedMessageText), 17)], 16, _hoisted_5$3)) : createCommentVNode("", true)]; + }), + _: 3 + }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])]; + }), + _: 3 + }, 8, ["appendTo"])], 16); +} +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +__name(render$g, "render$g"); +script$a.render = render$g; +const _sfc_main$k = { + name: "AutoCompletePlus", + extends: script$a, + emits: ["focused-option-changed"], + mounted() { + if (typeof script$a.mounted === "function") { + script$a.mounted.call(this); +======== +__name(render$c, "render$c"); +script$7.render = render$c; +const _sfc_main$j = { + name: "AutoCompletePlus", + extends: script$7, + emits: ["focused-option-changed"], + mounted() { + if (typeof script$7.mounted === "function") { + script$7.mounted.call(this); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + } + this.$watch( + () => this.focusedOptionIndex, + (newVal, oldVal) => { + this.$emit("focused-option-changed", newVal); + } + ); + } +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const _hoisted_1$i = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" }; +const _hoisted_2$6 = { class: "option-display-name font-semibold flex flex-col" }; +const _hoisted_3$5 = { key: 0 }; +const _hoisted_4$2 = ["innerHTML"]; +const _hoisted_5$2 = ["innerHTML"]; +const _hoisted_6$1 = { +======== +const _withScopeId$5 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-5741c9ae"), n = n(), popScopeId(), n), "_withScopeId$5"); +const _hoisted_1$g = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" }; +const _hoisted_2$d = { class: "option-display-name font-semibold flex flex-col" }; +const _hoisted_3$b = { key: 0 }; +const _hoisted_4$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-bookmark-fill text-sm mr-1" }, null, -1)); +const _hoisted_5$2 = [ + _hoisted_4$3 +]; +const _hoisted_6$1 = ["innerHTML"]; +const _hoisted_7 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ createBaseVNode("span", null, " ", -1)); +const _hoisted_8 = ["innerHTML"]; +const _hoisted_9 = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 0, + class: "option-category font-light text-sm text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap" +}; +const _hoisted_7 = { class: "option-badges" }; +const _sfc_main$j = /* @__PURE__ */ defineComponent({ + __name: "NodeSearchItem", + props: { + nodeDef: {}, + currentQuery: {} + }, + setup(__props) { + const settingStore = useSettingStore(); + const showCategory = computed( + () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowCategory") + ); + const showIdName = computed( + () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowIdName") + ); + const showNodeFrequency = computed( + () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowNodeFrequency") + ); + const nodeFrequencyStore = useNodeFrequencyStore(); + const nodeFrequency = computed( + () => nodeFrequencyStore.getNodeFrequency(props.nodeDef) + ); + const nodeBookmarkStore = useNodeBookmarkStore(); + const isBookmarked = computed( + () => nodeBookmarkStore.isBookmarked(props.nodeDef) + ); + const props = __props; + return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + return openBlock(), createElementBlock("div", _hoisted_1$i, [ + createBaseVNode("div", _hoisted_2$6, [ + createBaseVNode("div", null, [ + isBookmarked.value ? (openBlock(), createElementBlock("span", _hoisted_3$5, _cache[0] || (_cache[0] = [ + createBaseVNode("i", { class: "pi pi-bookmark-fill text-sm mr-1" }, null, -1) + ]))) : createCommentVNode("", true), + createBaseVNode("span", { + innerHTML: unref(highlightQuery)(_ctx.nodeDef.display_name, _ctx.currentQuery) + }, null, 8, _hoisted_4$2), + _cache[1] || (_cache[1] = createBaseVNode("span", null, " ", -1)), + showIdName.value ? (openBlock(), createBlock(unref(script$t), { +======== + return openBlock(), createElementBlock("div", _hoisted_1$g, [ + createBaseVNode("div", _hoisted_2$d, [ + createBaseVNode("div", null, [ + isBookmarked.value ? (openBlock(), createElementBlock("span", _hoisted_3$b, _hoisted_5$2)) : createCommentVNode("", true), + createBaseVNode("span", { + innerHTML: unref(highlightQuery)(_ctx.nodeDef.display_name, _ctx.currentQuery) + }, null, 8, _hoisted_6$1), + _hoisted_7, + showIdName.value ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 1, + severity: "secondary" + }, { + default: withCtx(() => [ + createBaseVNode("span", { + innerHTML: unref(highlightQuery)(_ctx.nodeDef.name, _ctx.currentQuery) + }, null, 8, _hoisted_5$2) + ]), + _: 1 + })) : createCommentVNode("", true) + ]), + showCategory.value ? (openBlock(), createElementBlock("div", _hoisted_6$1, toDisplayString(_ctx.nodeDef.category.replaceAll("/", " > ")), 1)) : createCommentVNode("", true) + ]), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createBaseVNode("div", _hoisted_7, [ + _ctx.nodeDef.experimental ? (openBlock(), createBlock(unref(script$t), { +======== + createBaseVNode("div", _hoisted_10, [ + _ctx.nodeDef.experimental ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 0, + value: _ctx.$t("g.experimental"), + severity: "primary" + }, null, 8, ["value"])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + _ctx.nodeDef.deprecated ? (openBlock(), createBlock(unref(script$t), { +======== + _ctx.nodeDef.deprecated ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 1, + value: _ctx.$t("g.deprecated"), + severity: "danger" + }, null, 8, ["value"])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + showNodeFrequency.value && nodeFrequency.value > 0 ? (openBlock(), createBlock(unref(script$t), { +======== + showNodeFrequency.value && nodeFrequency.value > 0 ? (openBlock(), createBlock(unref(script$o), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 2, + value: unref(formatNumberWithSuffix)(nodeFrequency.value, { roundToInt: true }), + severity: "secondary" + }, null, 8, ["value"])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + _ctx.nodeDef.nodeSource.type !== unref(NodeSourceType).Unknown ? (openBlock(), createBlock(unref(script$s), { +======== + _ctx.nodeDef.nodeSource.type !== unref(NodeSourceType).Unknown ? (openBlock(), createBlock(unref(script$n), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 3, + class: "text-sm font-light" + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.nodeDef.nodeSource.displayText), 1) + ]), + _: 1 + })) : createCommentVNode("", true) + ]) + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-d7cc0bce"]]); +const _hoisted_1$h = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96 pointer-events-auto" }; +const _hoisted_2$5 = { + key: 0, + class: "comfy-vue-node-preview-container absolute left-[-350px] top-[50px]" +}; +const _hoisted_3$4 = { class: "_dialog-body" }; +const _sfc_main$i = /* @__PURE__ */ defineComponent({ +======== +const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-5741c9ae"]]); +const _hoisted_1$f = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96 pointer-events-auto" }; +const _hoisted_2$c = { + key: 0, + class: "comfy-vue-node-preview-container absolute left-[-350px] top-[50px]" +}; +const _hoisted_3$a = /* @__PURE__ */ createBaseVNode("h3", null, "Add node filter condition", -1); +const _hoisted_4$2 = { class: "_dialog-body" }; +const _sfc_main$h = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + __name: "NodeSearchBox", + props: { + filters: {}, + searchLimit: { default: 64 } + }, + emits: ["addFilter", "removeFilter", "addNode"], + setup(__props, { emit: __emit }) { + const settingStore = useSettingStore(); + const { t } = useI18n(); + const enableNodePreview = computed( + () => settingStore.get("Comfy.NodeSearchBoxImpl.NodePreview") + ); + const props = __props; + const nodeSearchFilterVisible = ref(false); + const inputId = `comfy-vue-node-search-box-input-${Math.random()}`; + const suggestions2 = ref([]); + const hoveredSuggestion = ref(null); + const currentQuery = ref(""); + const placeholder = computed(() => { + return props.filters.length === 0 ? t("g.searchNodes") + "..." : ""; + }); + const nodeDefStore = useNodeDefStore(); + const nodeFrequencyStore = useNodeFrequencyStore(); + const search2 = /* @__PURE__ */ __name((query) => { + const queryIsEmpty = query === "" && props.filters.length === 0; + currentQuery.value = query; + suggestions2.value = queryIsEmpty ? nodeFrequencyStore.topNodeDefs : [ + ...nodeDefStore.nodeSearchService.searchNode(query, props.filters, { + limit: props.searchLimit + }) + ]; + }, "search"); + const emit = __emit; + let inputElement = null; + const reFocusInput = /* @__PURE__ */ __name(() => { + inputElement ??= document.getElementById(inputId); + if (inputElement) { + inputElement.blur(); + nextTick(() => inputElement?.focus()); + } + }, "reFocusInput"); + onMounted(reFocusInput); + const onAddFilter = /* @__PURE__ */ __name((filterAndValue) => { + nodeSearchFilterVisible.value = false; + emit("addFilter", filterAndValue); + reFocusInput(); + }, "onAddFilter"); + const onRemoveFilter = /* @__PURE__ */ __name((event, filterAndValue) => { + event.stopPropagation(); + event.preventDefault(); + emit("removeFilter", filterAndValue); + reFocusInput(); + }, "onRemoveFilter"); + const setHoverSuggestion = /* @__PURE__ */ __name((index) => { + if (index === -1) { + hoveredSuggestion.value = null; + return; + } + const value = suggestions2.value[index]; + hoveredSuggestion.value = value; + }, "setHoverSuggestion"); + return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + return openBlock(), createElementBlock("div", _hoisted_1$h, [ + enableNodePreview.value ? (openBlock(), createElementBlock("div", _hoisted_2$5, [ +======== + return openBlock(), createElementBlock("div", _hoisted_1$f, [ + enableNodePreview.value ? (openBlock(), createElementBlock("div", _hoisted_2$c, [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + hoveredSuggestion.value ? (openBlock(), createBlock(NodePreview, { + nodeDef: hoveredSuggestion.value, + key: hoveredSuggestion.value?.name || "" + }, null, 8, ["nodeDef"])) : createCommentVNode("", true) + ])) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(unref(script$h), { +======== + createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + icon: "pi pi-filter", + severity: "secondary", + class: "filter-button z-10", + onClick: _cache[0] || (_cache[0] = ($event) => nodeSearchFilterVisible.value = true) + }), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(unref(script$u), { +======== + createVNode(unref(script$p), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + visible: nodeSearchFilterVisible.value, + "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => nodeSearchFilterVisible.value = $event), + class: "min-w-96" + }, { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + header: withCtx(() => _cache[5] || (_cache[5] = [ + createBaseVNode("h3", null, "Add node filter condition", -1) + ])), + default: withCtx(() => [ + createBaseVNode("div", _hoisted_3$4, [ +======== + header: withCtx(() => [ + _hoisted_3$a + ]), + default: withCtx(() => [ + createBaseVNode("div", _hoisted_4$2, [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + createVNode(NodeSearchFilter, { onAddFilter }) + ]) + ]), + _: 1 + }, 8, ["visible"]), + createVNode(_sfc_main$k, { + "model-value": props.filters, + class: "comfy-vue-node-search-box z-10 flex-grow", + scrollHeight: "40vh", + placeholder: placeholder.value, + "input-id": inputId, + "append-to": "self", + suggestions: suggestions2.value, + "min-length": 0, + delay: 100, + loading: !unref(nodeFrequencyStore).isLoaded, + onComplete: _cache[2] || (_cache[2] = ($event) => search2($event.query)), + onOptionSelect: _cache[3] || (_cache[3] = ($event) => emit("addNode", $event.value)), + onFocusedOptionChanged: _cache[4] || (_cache[4] = ($event) => setHoverSuggestion($event)), + "complete-on-focus": "", + "auto-option-focus": "", + "force-selection": "", + multiple: "", + optionLabel: "display_name" + }, { + option: withCtx(({ option: option2 }) => [ + createVNode(NodeSearchItem, { + nodeDef: option2, + currentQuery: currentQuery.value + }, null, 8, ["nodeDef", "currentQuery"]) + ]), + chip: withCtx(({ value }) => [ + (openBlock(), createBlock(SearchFilterChip, { + key: `${value[0].id}-${value[1]}`, + onRemove: /* @__PURE__ */ __name(($event) => onRemoveFilter($event, value), "onRemove"), + text: value[1], + badge: value[0].invokeSequence.toUpperCase(), + "badge-class": value[0].invokeSequence + "-badge" + }, null, 8, ["onRemove", "text", "badge", "badge-class"])) + ]), + _: 1 + }, 8, ["model-value", "placeholder", "suggestions", "loading"]) + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +class ConnectingLinkImpl { + static { + __name(this, "ConnectingLinkImpl"); + } + constructor(node, slot, input, output, pos, afterRerouteId) { + this.node = node; + this.slot = slot; + this.input = input; + this.output = output; + this.pos = pos; + this.afterRerouteId = afterRerouteId; + } + static createFromPlainObject(obj) { + return new ConnectingLinkImpl( + obj.node, + obj.slot, + obj.input, + obj.output, + obj.pos, + obj.afterRerouteId + ); + } + get type() { + const result = this.input ? this.input.type : this.output?.type ?? null; + return result === -1 ? null : result; + } + /** + * Which slot type is release and need to be reconnected. + * - 'output' means we need a new node's outputs slot to connect with this link + */ + get releaseSlotType() { + return this.output ? "input" : "output"; + } + connectTo(newNode) { + const newNodeSlots = this.releaseSlotType === "output" ? newNode.outputs : newNode.inputs; + if (!newNodeSlots) return; + const newNodeSlot = newNodeSlots.findIndex( + (slot) => LiteGraph.isValidConnection(slot.type, this.type) + ); + if (newNodeSlot === -1) { + console.warn( + `Could not find slot with type ${this.type} on node ${newNode.title}. This should never happen` + ); + return; + } + if (this.releaseSlotType === "input") { + this.node.connect(this.slot, newNode, newNodeSlot, this.afterRerouteId); + } else { + newNode.connect(newNodeSlot, this.node, this.slot, this.afterRerouteId); + } + } +} +const useSearchBoxStore = defineStore("searchBox", () => { + const visible = ref(false); + function toggleVisible() { + visible.value = !visible.value; + } + __name(toggleVisible, "toggleVisible"); + return { + visible, + toggleVisible + }; +}); +const _sfc_main$h = /* @__PURE__ */ defineComponent({ +======== +const _sfc_main$g = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + __name: "NodeSearchBoxPopover", + setup(__props) { + const settingStore = useSettingStore(); + const litegraphService = useLitegraphService(); + const { visible } = storeToRefs(useSearchBoxStore()); + const dismissable = ref(true); + const triggerEvent = ref(null); + const getNewNodeLocation = /* @__PURE__ */ __name(() => { + if (!triggerEvent.value) { + return litegraphService.getCanvasCenter(); + } + const originalEvent = triggerEvent.value.detail.originalEvent; + return [originalEvent.canvasX, originalEvent.canvasY]; + }, "getNewNodeLocation"); + const nodeFilters = ref([]); + const addFilter = /* @__PURE__ */ __name((filter) => { + nodeFilters.value.push(filter); + }, "addFilter"); + const removeFilter = /* @__PURE__ */ __name((filter) => { + nodeFilters.value = nodeFilters.value.filter( + (f) => toRaw(f) !== toRaw(filter) + ); + }, "removeFilter"); + const clearFilters = /* @__PURE__ */ __name(() => { + nodeFilters.value = []; + }, "clearFilters"); + const closeDialog = /* @__PURE__ */ __name(() => { + visible.value = false; + }, "closeDialog"); + const addNode = /* @__PURE__ */ __name((nodeDef) => { + const node = litegraphService.addNodeOnGraph(nodeDef, { + pos: getNewNodeLocation() + }); + const eventDetail = triggerEvent.value?.detail; + if (eventDetail && eventDetail.subType === "empty-release") { + eventDetail.linkReleaseContext.links.forEach((link) => { + ConnectingLinkImpl.createFromPlainObject(link).connectTo(node); + }); + } + window.setTimeout(() => { + closeDialog(); + }, 100); + }, "addNode"); + const newSearchBoxEnabled = computed( + () => settingStore.get("Comfy.NodeSearchBoxImpl") === "default" + ); + const showSearchBox = /* @__PURE__ */ __name((e) => { + const detail = e.detail; + if (newSearchBoxEnabled.value) { + if (detail.originalEvent?.pointerType === "touch") { + setTimeout(() => { + showNewSearchBox(e); + }, 128); + } else { + showNewSearchBox(e); + } + } else { + canvasStore.canvas.showSearchBox(detail.originalEvent); + } + }, "showSearchBox"); + const nodeDefStore = useNodeDefStore(); + const showNewSearchBox = /* @__PURE__ */ __name((e) => { + if (e.detail.subType === "empty-release") { + const links = e.detail.linkReleaseContext.links; + if (links.length === 0) { + console.warn("Empty release with no links! This should never happen"); + return; + } + const firstLink = ConnectingLinkImpl.createFromPlainObject(links[0]); + const filter = nodeDefStore.nodeSearchService.getFilterById( + firstLink.releaseSlotType + ); + const dataType = firstLink.type.toString(); + addFilter([filter, dataType]); + } + visible.value = true; + triggerEvent.value = e; + dismissable.value = false; + setTimeout(() => { + dismissable.value = true; + }, 300); + }, "showNewSearchBox"); + const showContextMenu = /* @__PURE__ */ __name((e) => { + if (e.detail.subType !== "empty-release") { + return; + } + const links = e.detail.linkReleaseContext.links; + if (links.length === 0) { + console.warn("Empty release with no links! This should never happen"); + return; + } + const firstLink = ConnectingLinkImpl.createFromPlainObject(links[0]); + const mouseEvent = e.detail.originalEvent; + const commonOptions = { + e: mouseEvent, + allow_searchbox: true, + showSearchBox: /* @__PURE__ */ __name(() => showSearchBox(e), "showSearchBox") + }; + const connectionOptions = firstLink.output ? { + nodeFrom: firstLink.node, + slotFrom: firstLink.output, + afterRerouteId: firstLink.afterRerouteId + } : { + nodeTo: firstLink.node, + slotTo: firstLink.input, + afterRerouteId: firstLink.afterRerouteId + }; + canvasStore.canvas.showConnectionMenu({ + ...connectionOptions, + ...commonOptions + }); + }, "showContextMenu"); + const canvasStore = useCanvasStore(); + watchEffect(() => { + if (canvasStore.canvas) { + LiteGraph.release_link_on_empty_shows_menu = false; + canvasStore.canvas.allow_searchbox = false; + } + }); + const canvasEventHandler = /* @__PURE__ */ __name((e) => { + if (e.detail.subType === "empty-double-click") { + showSearchBox(e); + } else if (e.detail.subType === "empty-release") { + handleCanvasEmptyRelease(e); + } else if (e.detail.subType === "group-double-click") { + const group = e.detail.group; + const [x, y] = group.pos; + const relativeY = e.detail.originalEvent.canvasY - y; + if (relativeY > group.titleHeight) { + showSearchBox(e); + } + } + }, "canvasEventHandler"); + const linkReleaseAction = computed(() => { + return settingStore.get("Comfy.LinkRelease.Action"); + }); + const linkReleaseActionShift = computed(() => { + return settingStore.get("Comfy.LinkRelease.ActionShift"); + }); + const handleCanvasEmptyRelease = /* @__PURE__ */ __name((e) => { + const detail = e.detail; + const shiftPressed = detail.originalEvent.shiftKey; + const action = shiftPressed ? linkReleaseActionShift.value : linkReleaseAction.value; + switch (action) { + case LinkReleaseTriggerAction.SEARCH_BOX: + showSearchBox(e); + break; + case LinkReleaseTriggerAction.CONTEXT_MENU: + showContextMenu(e); + break; + case LinkReleaseTriggerAction.NO_ACTION: + default: + break; + } + }, "handleCanvasEmptyRelease"); + useEventListener(document, "litegraph:canvas", canvasEventHandler); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", null, [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(unref(script$u), { +======== + createVNode(unref(script$p), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + visible: unref(visible), + "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => isRef(visible) ? visible.value = $event : null), + modal: "", + "dismissable-mask": dismissable.value, + onHide: clearFilters, + pt: { + root: { + class: "invisible-dialog-root", + role: "search" + }, + mask: { class: "node-search-box-dialog-mask" }, + transition: { + enterFromClass: "opacity-0 scale-75", + // 100ms is the duration of the transition in the dialog component + enterActiveClass: "transition-all duration-100 ease-out", + leaveActiveClass: "transition-all duration-100 ease-in", + leaveToClass: "opacity-0 scale-75" + } + } + }, { + container: withCtx(() => [ + createVNode(_sfc_main$i, { + filters: nodeFilters.value, + onAddFilter: addFilter, + onRemoveFilter: removeFilter, + onAddNode: addNode + }, null, 8, ["filters"]) + ]), + _: 1 + }, 8, ["visible", "dismissable-mask"]) + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const _sfc_main$g = /* @__PURE__ */ defineComponent({ + __name: "NodeTooltip", + setup(__props) { + let idleTimeout; + const nodeDefStore = useNodeDefStore(); + const tooltipRef = ref(); + const tooltipText = ref(""); + const left = ref(); + const top = ref(); + const hideTooltip = /* @__PURE__ */ __name(() => tooltipText.value = null, "hideTooltip"); + const showTooltip = /* @__PURE__ */ __name(async (tooltip) => { + if (!tooltip) return; + left.value = app.canvas.mouse[0] + "px"; + top.value = app.canvas.mouse[1] + "px"; + tooltipText.value = tooltip; + await nextTick(); + const rect = tooltipRef.value.getBoundingClientRect(); + if (rect.right > window.innerWidth) { + left.value = app.canvas.mouse[0] - rect.width + "px"; + } + if (rect.top < 0) { + top.value = app.canvas.mouse[1] + rect.height + "px"; + } + }, "showTooltip"); + const onIdle = /* @__PURE__ */ __name(() => { + const { canvas } = app; + const node = canvas.node_over; + if (!node) return; + const ctor = node.constructor; + const nodeDef = nodeDefStore.nodeDefsByName[node.type]; + if (ctor.title_mode !== LiteGraph.NO_TITLE && canvas.graph_mouse[1] < node.pos[1]) { + return showTooltip(nodeDef.description); + } + if (node.flags?.collapsed) return; + const inputSlot = canvas.isOverNodeInput( + node, + canvas.graph_mouse[0], + canvas.graph_mouse[1], + [0, 0] + ); + if (inputSlot !== -1) { + const inputName = node.inputs[inputSlot].name; + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(inputName)}.tooltip`, + nodeDef.inputs.getInput(inputName)?.tooltip + ); + return showTooltip(translatedTooltip); + } + const outputSlot = canvas.isOverNodeOutput( + node, + canvas.graph_mouse[0], + canvas.graph_mouse[1], + [0, 0] + ); + if (outputSlot !== -1) { + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.outputs.${outputSlot}.tooltip`, + nodeDef.outputs.all?.[outputSlot]?.tooltip + ); + return showTooltip(translatedTooltip); + } + const widget = app.canvas.getWidgetAtCursor(); + if (widget && !widget.element) { + const translatedTooltip = st( + `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(widget.name)}.tooltip`, + nodeDef.inputs.getInput(widget.name)?.tooltip + ); + return showTooltip(widget.tooltip ?? translatedTooltip); + } + }, "onIdle"); + const onMouseMove = /* @__PURE__ */ __name((e) => { + hideTooltip(); + clearTimeout(idleTimeout); + if (e.target.nodeName !== "CANVAS") return; + idleTimeout = window.setTimeout(onIdle, 500); + }, "onMouseMove"); + useEventListener(window, "mousemove", onMouseMove); + useEventListener(window, "click", hideTooltip); + return (_ctx, _cache) => { + return tooltipText.value ? (openBlock(), createElementBlock("div", { + key: 0, + ref_key: "tooltipRef", + ref: tooltipRef, + class: "node-tooltip", + style: normalizeStyle({ left: left.value, top: top.value }) + }, toDisplayString(tooltipText.value), 5)) : createCommentVNode("", true); + }; + } +}); +const NodeTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-9ecc8adc"]]); +const _sfc_main$f = /* @__PURE__ */ defineComponent({ + __name: "NodeBadge", + setup(__props) { + const settingStore = useSettingStore(); + const nodeSourceBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeSourceBadgeMode") + ); + const nodeIdBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeIdBadgeMode") + ); + const nodeLifeCycleBadgeMode = computed( + () => settingStore.get("Comfy.NodeBadge.NodeLifeCycleBadgeMode") + ); + watch([nodeSourceBadgeMode, nodeIdBadgeMode, nodeLifeCycleBadgeMode], () => { + app.graph?.setDirtyCanvas(true, true); + }); + const colorPalette = computed( + () => getColorPalette(settingStore.get("Comfy.ColorPalette")) + ); + const nodeDefStore = useNodeDefStore(); + function badgeTextVisible(nodeDef, badgeMode) { + return !(badgeMode === NodeBadgeMode.None || nodeDef?.isCoreNode && badgeMode === NodeBadgeMode.HideBuiltIn); + } + __name(badgeTextVisible, "badgeTextVisible"); + onMounted(() => { + app.registerExtension({ + name: "Comfy.NodeBadge", + nodeCreated(node) { + node.badgePosition = BadgePosition.TopRight; + const badge = computed(() => { + const nodeDef = nodeDefStore.fromLGraphNode(node); + return new LGraphBadge({ + text: _.truncate( + [ + badgeTextVisible(nodeDef, nodeIdBadgeMode.value) ? `#${node.id}` : "", + badgeTextVisible(nodeDef, nodeLifeCycleBadgeMode.value) ? nodeDef?.nodeLifeCycleBadgeText ?? "" : "", + badgeTextVisible(nodeDef, nodeSourceBadgeMode.value) ? nodeDef?.nodeSource?.badgeText ?? "" : "" + ].filter((s) => s.length > 0).join(" "), + { + length: 31 + } + ), + fgColor: colorPalette.value?.colors?.litegraph_base?.BADGE_FG_COLOR || defaultColorPalette.colors.litegraph_base.BADGE_FG_COLOR, + bgColor: colorPalette.value?.colors?.litegraph_base?.BADGE_BG_COLOR || defaultColorPalette.colors.litegraph_base.BADGE_BG_COLOR + }); + }); + node.badges.push(() => badge.value); + } + }); + }); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +const _hoisted_1$g = { + viewBox: "0 0 1024 1024", + width: "1.2em", + height: "1.2em" +}; +function render$f(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$g, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "currentColor", + d: "M921.088 103.232L584.832 889.024L465.52 544.512L121.328 440.48zM1004.46.769c-6.096 0-13.52 1.728-22.096 5.36L27.708 411.2c-34.383 14.592-36.56 42.704-4.847 62.464l395.296 123.584l129.36 403.264c9.28 15.184 20.496 22.72 31.263 22.72c11.936 0 23.296-9.152 31.04-27.248l408.272-953.728C1029.148 16.368 1022.86.769 1004.46.769" + }, null, -1) + ])); +} +__name(render$f, "render$f"); +const __unplugin_components_1$2 = markRaw({ name: "simple-line-icons-cursor", render: render$f }); +const _hoisted_1$f = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +function render$e(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$f, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "currentColor", + d: "M10.05 23q-.75 0-1.4-.337T7.575 21.7L1.2 12.375l.6-.575q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v13.425l-3.7-2.6l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zM11 12V2q0-.425.288-.712T12 1t.713.288T13 2v10zm4 0V3q0-.425.288-.712T16 2t.713.288T17 3v9zm-2.85 4.5" + }, null, -1) + ])); +} +__name(render$e, "render$e"); +const __unplugin_components_0$2 = markRaw({ name: "material-symbols-pan-tool-outline", render: render$e }); +var theme$5 = /* @__PURE__ */ __name(function theme4(_ref) { + _ref.dt; + return "\n.p-buttongroup {\n display: inline-flex;\n}\n\n.p-buttongroup .p-button {\n margin: 0;\n}\n\n.p-buttongroup .p-button:not(:last-child),\n.p-buttongroup .p-button:not(:last-child):hover {\n border-inline-end: 0 none;\n}\n\n.p-buttongroup .p-button:not(:first-of-type):not(:last-of-type) {\n border-radius: 0;\n}\n\n.p-buttongroup .p-button:first-of-type:not(:only-of-type) {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n}\n\n.p-buttongroup .p-button:last-of-type:not(:only-of-type) {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.p-buttongroup .p-button:focus {\n position: relative;\n z-index: 1;\n}\n"; +======== +var theme$4 = /* @__PURE__ */ __name(function theme4(_ref) { + var dt = _ref.dt; + return "\n.p-overlaybadge {\n position: relative;\n}\n\n.p-overlaybadge .p-badge {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n transform-origin: 100% 0;\n margin: 0;\n outline-width: ".concat(dt("overlaybadge.outline.width"), ";\n outline-style: solid;\n outline-color: ").concat(dt("overlaybadge.outline.color"), ";\n}\n"); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +}, "theme"); +var classes$4 = { + root: "p-overlaybadge" +}; +var OverlayBadgeStyle = BaseStyle.extend({ + name: "overlaybadge", + theme: theme$4, + classes: classes$4 +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +var script$1$5 = { + name: "BaseButtonGroup", + "extends": script$i, + style: ButtonGroupStyle, +======== +var script$1$4 = { + name: "OverlayBadge", + "extends": script$q, + style: OverlayBadgeStyle, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + provide: /* @__PURE__ */ __name(function provide8() { + return { + $pcOverlayBadge: this, + $parentInstance: this + }; + }, "provide") +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +var script$9 = { + name: "ButtonGroup", + "extends": script$1$5, + inheritAttrs: false +}; +function render$d(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("span", mergeProps({ + "class": _ctx.cx("root"), + role: "group" + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); +} +__name(render$d, "render$d"); +script$9.render = render$d; +const _sfc_main$e = /* @__PURE__ */ defineComponent({ + __name: "GraphCanvasMenu", + setup(__props) { + const { t } = useI18n(); + const commandStore = useCommandStore(); + const canvasStore = useCanvasStore(); + const settingStore = useSettingStore(); + const linkHidden = computed( + () => settingStore.get("Comfy.LinkRenderMode") === LiteGraph.HIDDEN_LINK +======== +var script$6 = { + name: "OverlayBadge", + "extends": script$1$4, + inheritAttrs: false, + components: { + Badge: script$q + } +}; +function render$b(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Badge = resolveComponent("Badge"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default"), createVNode(_component_Badge, mergeProps(_ctx.$props, { + pt: _ctx.ptm("pcBadge") + }), null, 16, ["pt"])], 16); +} +__name(render$b, "render$b"); +script$6.render = render$b; +const _sfc_main$f = /* @__PURE__ */ defineComponent({ + __name: "SidebarIcon", + props: { + icon: String, + selected: Boolean, + tooltip: { + type: String, + default: "" + }, + class: { + type: String, + default: "" + }, + iconBadge: { + type: [String, Function], + default: "" + } + }, + emits: ["click"], + setup(__props, { emit: __emit }) { + const props = __props; + const emit = __emit; + const overlayValue = computed( + () => typeof props.iconBadge === "function" ? props.iconBadge() || "" : props.iconBadge +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + ); + const shouldShowBadge = computed(() => !!overlayValue.value); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + return openBlock(), createBlock(unref(script$9), { class: "p-buttongroup-vertical absolute bottom-[10px] right-[10px] z-[1000] pointer-events-auto" }, { + default: withCtx(() => [ + withDirectives(createVNode(unref(script$h), { + severity: "secondary", + icon: "pi pi-plus", + onMousedown: _cache[0] || (_cache[0] = ($event) => repeat2("Comfy.Canvas.ZoomIn")), + onMouseup: stopRepeat + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.zoomIn"), + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$h), { + severity: "secondary", + icon: "pi pi-minus", + onMousedown: _cache[1] || (_cache[1] = ($event) => repeat2("Comfy.Canvas.ZoomOut")), + onMouseup: stopRepeat + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.zoomOut"), + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$h), { + severity: "secondary", + icon: "pi pi-expand", + onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.Canvas.FitView")) + }, null, 512), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.fitView"), + void 0, + { left: true } + ] + ]), + withDirectives((openBlock(), createBlock(unref(script$h), { + severity: "secondary", + onClick: _cache[3] || (_cache[3] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLock")) +======== + return withDirectives((openBlock(), createBlock(unref(script$d), { + class: normalizeClass(props.class), + text: "", + pt: { + root: { + class: `side-bar-button ${props.selected ? "p-button-primary side-bar-button-selected" : "p-button-secondary"}`, + "aria-label": props.tooltip + } + }, + onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event)) + }, { + icon: withCtx(() => [ + shouldShowBadge.value ? (openBlock(), createBlock(unref(script$6), { + key: 0, + value: overlayValue.value +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }, { + default: withCtx(() => [ + createBaseVNode("i", { + class: normalizeClass(props.icon + " side-bar-button-icon") + }, null, 2) + ]), + _: 1 +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + })), [ + [ + _directive_tooltip, + unref(t)( + "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode") + ) + " (Space)", + void 0, + { left: true } + ] + ]), + withDirectives(createVNode(unref(script$h), { + severity: "secondary", + icon: linkHidden.value ? "pi pi-eye-slash" : "pi pi-eye", + onClick: _cache[4] || (_cache[4] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLinkVisibility")), + "data-testid": "toggle-link-visibility-button" + }, null, 8, ["icon"]), [ + [ + _directive_tooltip, + unref(t)("graphCanvasMenu.toggleLinkVisibility"), + void 0, + { left: true } + ] + ]) +======== + }, 8, ["value"])) : (openBlock(), createElementBlock("i", { + key: 1, + class: normalizeClass(props.icon + " side-bar-button-icon") + }, null, 2)) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + ]), + _: 1 + }, 8, ["class", "pt"])), [ + [_directive_tooltip, { value: props.tooltip, showDelay: 300, hideDelay: 300 }] + ]); + }; + } +}); +const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-6ab4daa6"]]); +const _sfc_main$e = /* @__PURE__ */ defineComponent({ + __name: "SidebarLogoutIcon", + setup(__props) { + const { t } = useI18n(); + const userStore = useUserStore(); + const tooltip = computed( + () => `${t("sideToolbar.logout")} (${userStore.currentUser?.username})` + ); + const logout = /* @__PURE__ */ __name(() => { + userStore.logout(); + window.location.reload(); + }, "logout"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: "pi pi-sign-out", + tooltip: tooltip.value, + onClick: logout + }, null, 8, ["tooltip"]); + }; + } +}); +const _sfc_main$d = /* @__PURE__ */ defineComponent({ + __name: "SidebarSettingsToggleIcon", + setup(__props) { + const dialogStore = useDialogStore(); + const showSetting = /* @__PURE__ */ __name(() => { + dialogStore.showDialog({ + key: "global-settings", + headerComponent: SettingDialogHeader, + component: SettingDialogContent + }); + }, "showSetting"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: "pi pi-cog", + class: "comfy-settings-btn", + onClick: showSetting, + tooltip: _ctx.$t("g.settings") + }, null, 8, ["tooltip"]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-94481f39"]]); +const _sfc_main$d = /* @__PURE__ */ defineComponent({ +======== +const _sfc_main$c = /* @__PURE__ */ defineComponent({ + __name: "SidebarThemeToggleIcon", + setup(__props) { + const settingStore = useSettingStore(); + const currentTheme = computed(() => settingStore.get("Comfy.ColorPalette")); + const icon = computed( + () => currentTheme.value !== "light" ? "pi pi-moon" : "pi pi-sun" + ); + const commandStore = useCommandStore(); + const toggleTheme = /* @__PURE__ */ __name(() => { + commandStore.execute("Comfy.ToggleTheme"); + }, "toggleTheme"); + return (_ctx, _cache) => { + return openBlock(), createBlock(SidebarIcon, { + icon: icon.value, + onClick: toggleTheme, + tooltip: _ctx.$t("sideToolbar.themeToggle"), + class: "comfy-vue-theme-toggle" + }, null, 8, ["icon", "tooltip"]); + }; + } +}); +const _withScopeId$4 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-37d8d7b4"), n = n(), popScopeId(), n), "_withScopeId$4"); +const _hoisted_1$e = { class: "side-tool-bar-end" }; +const _hoisted_2$b = { + key: 0, + class: "sidebar-content-container h-full overflow-y-auto overflow-x-hidden" +}; +const _sfc_main$b = /* @__PURE__ */ defineComponent({ + __name: "SideToolbar", + setup(__props) { + const workspaceStore = useWorkspaceStore(); + const settingStore = useSettingStore(); + const userStore = useUserStore(); + const teleportTarget = computed( + () => settingStore.get("Comfy.Sidebar.Location") === "left" ? ".comfyui-body-left" : ".comfyui-body-right" + ); + const isSmall = computed( + () => settingStore.get("Comfy.Sidebar.Size") === "small" + ); + const tabs = computed(() => workspaceStore.getSidebarTabs()); + const selectedTab = computed(() => workspaceStore.sidebarTab.activeSidebarTab); + const onTabClick = /* @__PURE__ */ __name((item3) => { + workspaceStore.sidebarTab.toggleSidebarTab(item3.id); + }, "onTabClick"); + const keybindingStore = useKeybindingStore(); + const getTabTooltipSuffix = /* @__PURE__ */ __name((tab) => { + const keybinding = keybindingStore.getKeybindingByCommandId( + `Workspace.ToggleSidebarTab.${tab.id}` + ); + return keybinding ? ` (${keybinding.combo.toString()})` : ""; + }, "getTabTooltipSuffix"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + (openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [ + createBaseVNode("nav", { + class: normalizeClass("side-tool-bar-container" + (isSmall.value ? " small-sidebar" : "")) + }, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(tabs.value, (tab) => { + return openBlock(), createBlock(SidebarIcon, { + key: tab.id, + icon: tab.icon, + iconBadge: tab.iconBadge, + tooltip: tab.tooltip + getTabTooltipSuffix(tab), + selected: tab.id === selectedTab.value?.id, + class: normalizeClass(tab.id + "-tab-button"), + onClick: /* @__PURE__ */ __name(($event) => onTabClick(tab), "onClick") + }, null, 8, ["icon", "iconBadge", "tooltip", "selected", "class", "onClick"]); + }), 128)), + createBaseVNode("div", _hoisted_1$e, [ + unref(userStore).isMultiUserServer ? (openBlock(), createBlock(_sfc_main$e, { key: 0 })) : createCommentVNode("", true), + createVNode(_sfc_main$c), + createVNode(_sfc_main$d) + ]) + ], 2) + ], 8, ["to"])), + selectedTab.value ? (openBlock(), createElementBlock("div", _hoisted_2$b, [ + createVNode(_sfc_main$p, { extension: selectedTab.value }, null, 8, ["extension"]) + ])) : createCommentVNode("", true) + ], 64); + }; + } +}); +const SideToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-37d8d7b4"]]); +const CORE_SETTINGS = [ + { + id: "Comfy.Validation.Workflows", + name: "Validate workflows", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.NodeSearchBoxImpl", + category: ["Comfy", "Node Search Box", "Implementation"], + experimental: true, + name: "Node search box implementation", + type: "combo", + options: ["default", "litegraph (legacy)"], + defaultValue: "default" + }, + { + id: "Comfy.LinkRelease.Action", + category: ["LiteGraph", "LinkRelease", "Action"], + name: "Action on link release (No modifier)", + type: "combo", + options: Object.values(LinkReleaseTriggerAction), + defaultValue: LinkReleaseTriggerAction.CONTEXT_MENU + }, + { + id: "Comfy.LinkRelease.ActionShift", + category: ["LiteGraph", "LinkRelease", "ActionShift"], + name: "Action on link release (Shift)", + type: "combo", + options: Object.values(LinkReleaseTriggerAction), + defaultValue: LinkReleaseTriggerAction.SEARCH_BOX + }, + { + id: "Comfy.NodeSearchBoxImpl.NodePreview", + category: ["Comfy", "Node Search Box", "NodePreview"], + name: "Node preview", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.NodeSearchBoxImpl.ShowCategory", + category: ["Comfy", "Node Search Box", "ShowCategory"], + name: "Show node category in search results", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.NodeSearchBoxImpl.ShowIdName", + category: ["Comfy", "Node Search Box", "ShowIdName"], + name: "Show node id name in search results", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.NodeSearchBoxImpl.ShowNodeFrequency", + category: ["Comfy", "Node Search Box", "ShowNodeFrequency"], + name: "Show node frequency in search results", + tooltip: "Only applies to the default implementation", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Sidebar.Location", + category: ["Appearance", "Sidebar", "Location"], + name: "Sidebar location", + type: "combo", + options: ["left", "right"], + defaultValue: "left" + }, + { + id: "Comfy.Sidebar.Size", + category: ["Appearance", "Sidebar", "Size"], + name: "Sidebar size", + type: "combo", + options: ["normal", "small"], + defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1600 ? "small" : "normal", "defaultValue") + }, + { + id: "Comfy.TextareaWidget.FontSize", + category: ["Appearance", "Node Widget", "TextareaWidget", "FontSize"], + name: "Textarea widget font size", + type: "slider", + defaultValue: 10, + attrs: { + min: 8, + max: 24 + } + }, + { + id: "Comfy.TextareaWidget.Spellcheck", + category: ["Comfy", "Node Widget", "TextareaWidget", "Spellcheck"], + name: "Textarea widget spellcheck", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Workflow.SortNodeIdOnSave", + name: "Sort node IDs when saving workflow", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Graph.CanvasInfo", + category: ["LiteGraph", "Canvas", "CanvasInfo"], + name: "Show canvas info on bottom left corner (fps, etc.)", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Node.ShowDeprecated", + name: "Show deprecated nodes in search", + tooltip: "Deprecated nodes are hidden by default in the UI, but remain functional in existing workflows that use them.", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.Node.ShowExperimental", + name: "Show experimental nodes in search", + tooltip: "Experimental nodes are marked as such in the UI and may be subject to significant changes or removal in future versions. Use with caution in production workflows", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Node.Opacity", + category: ["Appearance", "Node", "Opacity"], + name: "Node opacity", + type: "slider", + defaultValue: 1, + attrs: { + min: 0.01, + max: 1, + step: 0.01 + } + }, + { + id: "Comfy.Workflow.ShowMissingNodesWarning", + name: "Show missing nodes warning", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Workflow.ShowMissingModelsWarning", + name: "Show missing models warning", + type: "boolean", + defaultValue: false, + experimental: true + }, + { + id: "Comfy.Graph.ZoomSpeed", + category: ["LiteGraph", "Canvas", "ZoomSpeed"], + name: "Canvas zoom speed", + type: "slider", + defaultValue: 1.1, + attrs: { + min: 1.01, + max: 2.5, + step: 0.01 + } + }, + // Bookmarks are stored in the settings store. + // Bookmarks are in format of category/display_name. e.g. "conditioning/CLIPTextEncode" + { + id: "Comfy.NodeLibrary.Bookmarks", + name: "Node library bookmarks with display name (deprecated)", + type: "hidden", + defaultValue: [], + deprecated: true + }, + { + id: "Comfy.NodeLibrary.Bookmarks.V2", + name: "Node library bookmarks v2 with unique name", + type: "hidden", + defaultValue: [] + }, + // Stores mapping from bookmark folder name to its customization. + { + id: "Comfy.NodeLibrary.BookmarksCustomization", + name: "Node library bookmarks customization", + type: "hidden", + defaultValue: {} + }, + // Hidden setting used by the queue for how to fit images + { + id: "Comfy.Queue.ImageFit", + name: "Queue image fit", + type: "hidden", + defaultValue: "cover" + }, + { + id: "Comfy.GroupSelectedNodes.Padding", + category: ["LiteGraph", "Group", "Padding"], + name: "Group selected nodes padding", + type: "slider", + defaultValue: 10, + attrs: { + min: 0, + max: 100 + } + }, + { + id: "Comfy.Node.DoubleClickTitleToEdit", + category: ["LiteGraph", "Node", "DoubleClickTitleToEdit"], + name: "Double click node title to edit", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Group.DoubleClickTitleToEdit", + category: ["LiteGraph", "Group", "DoubleClickTitleToEdit"], + name: "Double click group title to edit", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Window.UnloadConfirmation", + name: "Show confirmation when closing window", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.TreeExplorer.ItemPadding", + category: ["Appearance", "Tree Explorer", "ItemPadding"], + name: "Tree explorer item padding", + type: "slider", + defaultValue: 2, + attrs: { + min: 0, + max: 8, + step: 1 + } + }, + { + id: "Comfy.ModelLibrary.AutoLoadAll", + name: "Automatically load all model folders", + tooltip: "If true, all folders will load as soon as you open the model library (this may cause delays while it loads). If false, root level model folders will only load once you click on them.", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.ModelLibrary.NameFormat", + name: "What name to display in the model library tree view", + tooltip: 'Select "filename" to render a simplified view of the raw filename (without directory or ".safetensors" extension) in the model list. Select "title" to display the configurable model metadata title.', + type: "combo", + options: ["filename", "title"], + defaultValue: "title" + }, + { + id: "Comfy.Locale", + name: "Language", + type: "combo", + options: [ + { value: "en", text: "English" }, + { value: "zh", text: "中文" }, + { value: "ru", text: "Русский" }, + { value: "ja", text: "日本語" }, + { value: "ko", text: "한국어" }, + { value: "fr", text: "Français" } + ], + defaultValue: /* @__PURE__ */ __name(() => navigator.language.split("-")[0] || "en", "defaultValue") + }, + { + id: "Comfy.NodeBadge.NodeSourceBadgeMode", + category: ["LiteGraph", "Node", "NodeSourceBadgeMode"], + name: "Node source badge mode", + type: "combo", + options: Object.values(NodeBadgeMode), + defaultValue: NodeBadgeMode.HideBuiltIn + }, + { + id: "Comfy.NodeBadge.NodeIdBadgeMode", + category: ["LiteGraph", "Node", "NodeIdBadgeMode"], + name: "Node ID badge mode", + type: "combo", + options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll], + defaultValue: NodeBadgeMode.ShowAll + }, + { + id: "Comfy.NodeBadge.NodeLifeCycleBadgeMode", + category: ["LiteGraph", "Node", "NodeLifeCycleBadgeMode"], + name: "Node life cycle badge mode", + type: "combo", + options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll], + defaultValue: NodeBadgeMode.ShowAll + }, + { + id: "Comfy.ConfirmClear", + category: ["Comfy", "Workflow", "ConfirmClear"], + name: "Require confirmation when clearing workflow", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.PromptFilename", + category: ["Comfy", "Workflow", "PromptFilename"], + name: "Prompt for filename when saving workflow", + type: "boolean", + defaultValue: true + }, + /** + * file format for preview + * + * format;quality + * + * ex) + * webp;50 -> webp, quality 50 + * jpeg;80 -> rgb, jpeg, quality 80 + * + * @type {string} + */ + { + id: "Comfy.PreviewFormat", + category: ["LiteGraph", "Node Widget", "PreviewFormat"], + name: "Preview image format", + tooltip: "When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc.", + type: "text", + defaultValue: "" + }, + { + id: "Comfy.DisableSliders", + category: ["LiteGraph", "Node Widget", "DisableSliders"], + name: "Disable node widget sliders", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.DisableFloatRounding", + category: ["LiteGraph", "Node Widget", "DisableFloatRounding"], + name: "Disable default float widget rounding.", + tooltip: "(requires page reload) Cannot disable round when round is set by the node in the backend.", + type: "boolean", + defaultValue: false + }, + { + id: "Comfy.FloatRoundingPrecision", + category: ["LiteGraph", "Node Widget", "FloatRoundingPrecision"], + name: "Float widget rounding decimal places [0 = auto].", + tooltip: "(requires page reload)", + type: "slider", + attrs: { + min: 0, + max: 6, + step: 1 + }, + defaultValue: 0 + }, + { + id: "Comfy.EnableTooltips", + category: ["LiteGraph", "Node", "EnableTooltips"], + name: "Enable Tooltips", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.DevMode", + name: "Enable dev mode options (API save, etc.)", + type: "boolean", + defaultValue: false, + onChange: /* @__PURE__ */ __name((value) => { + const element = document.getElementById("comfy-dev-save-api-button"); + if (element) { + element.style.display = value ? "flex" : "none"; + } + }, "onChange") + }, + { + id: "Comfy.UseNewMenu", + category: ["Comfy", "Menu", "UseNewMenu"], + defaultValue: "Top", + name: "Use new menu", + type: "combo", + options: ["Disabled", "Top", "Bottom"], + migrateDeprecatedValue: /* @__PURE__ */ __name((value) => { + if (value === "Floating") { + return "Top"; + } + return value; + }, "migrateDeprecatedValue") + }, + { + id: "Comfy.Workflow.WorkflowTabsPosition", + name: "Opened workflows position", + type: "combo", + options: ["Sidebar", "Topbar"], + defaultValue: "Topbar" + }, + { + id: "Comfy.Graph.CanvasMenu", + category: ["LiteGraph", "Canvas", "CanvasMenu"], + name: "Show graph canvas menu", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.QueueButton.BatchCountLimit", + name: "Batch count limit", + tooltip: "The maximum number of tasks added to the queue at one button click", + type: "number", + defaultValue: 100, + versionAdded: "1.3.5" + }, + { + id: "Comfy.Keybinding.UnsetBindings", + name: "Keybindings unset by the user", + type: "hidden", + defaultValue: [], + versionAdded: "1.3.7" + }, + { + id: "Comfy.Keybinding.NewBindings", + name: "Keybindings set by the user", + type: "hidden", + defaultValue: [], + versionAdded: "1.3.7" + }, + { + id: "Comfy.Extension.Disabled", + name: "Disabled extension names", + type: "hidden", + defaultValue: [], + versionAdded: "1.3.11" + }, + { + id: "Comfy.Validation.NodeDefs", + name: "Validate node definitions (slow)", + type: "boolean", + tooltip: "Recommended for node developers. This will validate all node definitions on startup.", + defaultValue: false, + versionAdded: "1.3.14" + }, + { + id: "Comfy.LinkRenderMode", + category: ["LiteGraph", "Graph", "LinkRenderMode"], + name: "Link Render Mode", + defaultValue: 2, + type: "combo", + options: [ + { value: LiteGraph.STRAIGHT_LINK, text: "Straight" }, + { value: LiteGraph.LINEAR_LINK, text: "Linear" }, + { value: LiteGraph.SPLINE_LINK, text: "Spline" }, + { value: LiteGraph.HIDDEN_LINK, text: "Hidden" } + ] + }, + { + id: "Comfy.Node.AutoSnapLinkToSlot", + category: ["LiteGraph", "Node", "AutoSnapLinkToSlot"], + name: "Auto snap link to node slot", + tooltip: "When dragging a link over a node, the link automatically snap to a viable input slot on the node", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.29" + }, + { + id: "Comfy.Node.SnapHighlightsNode", + category: ["LiteGraph", "Node", "SnapHighlightsNode"], + name: "Snap highlights node", + tooltip: "When dragging a link over a node with viable input slot, highlight the node", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.29" + }, + { + id: "Comfy.Node.BypassAllLinksOnDelete", + category: ["LiteGraph", "Node", "BypassAllLinksOnDelete"], + name: "Keep all links when deleting nodes", + tooltip: "When deleting a node, attempt to reconnect all of its input and output links (bypassing the deleted node)", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.40" + }, + { + id: "Comfy.Node.MiddleClickRerouteNode", + category: ["LiteGraph", "Node", "MiddleClickRerouteNode"], + name: "Middle-click creates a new Reroute node", + type: "boolean", + defaultValue: true, + versionAdded: "1.3.42" + }, + { + id: "Comfy.RerouteBeta", + category: ["LiteGraph", "RerouteBeta"], + name: "Opt-in to the reroute beta test", + tooltip: "Enables the new native reroutes.\n\nReroutes can be added by holding alt and dragging from a link line, or on the link menu.\n\nDisabling this option is non-destructive - reroutes are hidden.", + experimental: true, + type: "boolean", + defaultValue: false, + versionAdded: "1.3.42" + }, + { + id: "Comfy.Graph.LinkMarkers", + category: ["LiteGraph", "Link", "LinkMarkers"], + name: "Link midpoint markers", + defaultValue: LinkMarkerShape.Circle, + type: "combo", + options: [ + { value: LinkMarkerShape.None, text: "None" }, + { value: LinkMarkerShape.Circle, text: "Circle" }, + { value: LinkMarkerShape.Arrow, text: "Arrow" } + ], + versionAdded: "1.3.42" + }, + { + id: "Comfy.DOMClippingEnabled", + category: ["LiteGraph", "Node", "DOMClippingEnabled"], + name: "Enable DOM element clipping (enabling may reduce performance)", + type: "boolean", + defaultValue: true + }, + { + id: "Comfy.Graph.CtrlShiftZoom", + category: ["LiteGraph", "Canvas", "CtrlShiftZoom"], + name: "Enable fast-zoom shortcut (Ctrl + Shift + Drag)", + type: "boolean", + defaultValue: true, + versionAdded: "1.4.0" + }, + { + id: "Comfy.Pointer.ClickDrift", + category: ["LiteGraph", "Pointer", "ClickDrift"], + name: "Pointer click drift (maximum distance)", + tooltip: "If the pointer moves more than this distance while holding a button down, it is considered dragging (rather than clicking).\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.", + experimental: true, + type: "slider", + attrs: { + min: 0, + max: 20, + step: 1 + }, + defaultValue: 6, + versionAdded: "1.4.3" + }, + { + id: "Comfy.Pointer.ClickBufferTime", + category: ["LiteGraph", "Pointer", "ClickBufferTime"], + name: "Pointer click drift delay", + tooltip: "After pressing a pointer button down, this is the maximum time (in milliseconds) that pointer movement can be ignored for.\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.", + experimental: true, + type: "slider", + attrs: { + min: 0, + max: 1e3, + step: 25 + }, + defaultValue: 150, + versionAdded: "1.4.3" + }, + { + id: "Comfy.Pointer.DoubleClickTime", + category: ["LiteGraph", "Pointer", "DoubleClickTime"], + name: "Double click interval (maximum)", + tooltip: "The maximum time in milliseconds between the two clicks of a double-click. Increasing this value may assist if double-clicks are sometimes not registered.", + type: "slider", + attrs: { + min: 100, + max: 1e3, + step: 50 + }, + defaultValue: 300, + versionAdded: "1.4.3" + }, + { + id: "Comfy.SnapToGrid.GridSize", + category: ["LiteGraph", "Canvas", "GridSize"], + name: "Snap to grid size", + type: "slider", + attrs: { + min: 1, + max: 500 + }, + tooltip: "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid.", + defaultValue: LiteGraph.CANVAS_GRID_SIZE + }, + // Keep the 'pysssss.SnapToGrid' setting id so we don't need to migrate setting values. + // Using a new setting id can cause existing users to lose their existing settings. + { + id: "pysssss.SnapToGrid", + category: ["LiteGraph", "Canvas", "AlwaysSnapToGrid"], + name: "Always snap to grid", + type: "boolean", + defaultValue: false, + versionAdded: "1.3.13" + }, + { + id: "Comfy.Server.ServerConfigValues", + name: "Server config values for frontend display", + tooltip: "Server config values used for frontend display only", + type: "hidden", + // Mapping from server config id to value. + defaultValue: {}, + versionAdded: "1.4.8" + }, + { + id: "Comfy.Server.LaunchArgs", + name: "Server launch arguments", + tooltip: "These are the actual arguments that are passed to the server when it is launched.", + type: "hidden", + defaultValue: {}, + versionAdded: "1.4.8" + }, + { + id: "Comfy.Queue.MaxHistoryItems", + name: "Queue history size", + tooltip: "The maximum number of tasks that show in the queue history.", + type: "slider", + attrs: { + min: 16, + max: 256, + step: 16 + }, + defaultValue: 64, + versionAdded: "1.4.12" + }, + { + id: "LiteGraph.Canvas.MaximumFps", + name: "Maxium FPS", + tooltip: "The maximum frames per second that the canvas is allowed to render. Caps GPU usage at the cost of smoothness. If 0, the screen refresh rate is used. Default: 0", + type: "slider", + attrs: { + min: 0, + max: 120 + }, + defaultValue: 0, + versionAdded: "1.5.1" + }, + { + id: "Comfy.EnableWorkflowViewRestore", + category: ["Comfy", "Workflow", "EnableWorkflowViewRestore"], + name: "Save and restore canvas position and zoom level in workflows", + type: "boolean", + defaultValue: true, + versionModified: "1.5.4" + }, + { + id: "Comfy.Workflow.ConfirmDelete", + name: "Show confirmation when deleting workflows", + type: "boolean", + defaultValue: true, + versionAdded: "1.5.6" + }, + { + id: "Comfy.ColorPalette", + name: "The active color palette id", + type: "hidden", + defaultValue: "dark", + versionModified: "1.6.7", + migrateDeprecatedValue(value) { + return value.startsWith("custom_") ? value.replace("custom_", "") : value; + } + }, + { + id: "Comfy.CustomColorPalettes", + name: "Custom color palettes", + type: "hidden", + defaultValue: {}, + versionModified: "1.6.7" + }, + { + id: "Comfy.WidgetControlMode", + category: ["Comfy", "Node Widget", "WidgetControlMode"], + name: "Widget control mode", + tooltip: "Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.", + type: "combo", + defaultValue: "after", + options: ["before", "after"], + versionModified: "1.6.10" + } +]; +const _sfc_main$a = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + __name: "GraphCanvas", + emits: ["ready"], + setup(__props, { emit: __emit }) { + const emit = __emit; + const canvasRef = ref(null); + const litegraphService = useLitegraphService(); + const settingStore = useSettingStore(); + const nodeDefStore = useNodeDefStore(); + const workspaceStore = useWorkspaceStore(); + const canvasStore = useCanvasStore(); + const modelToNodeStore = useModelToNodeStore(); + const betaMenuEnabled = computed( + () => settingStore.get("Comfy.UseNewMenu") !== "Disabled" + ); + const canvasMenuEnabled = computed( + () => settingStore.get("Comfy.Graph.CanvasMenu") + ); + const tooltipEnabled = computed(() => settingStore.get("Comfy.EnableTooltips")); + watchEffect(() => { + const canvasInfoEnabled = settingStore.get("Comfy.Graph.CanvasInfo"); + if (canvasStore.canvas) { + canvasStore.canvas.show_info = canvasInfoEnabled; + } + }); + watchEffect(() => { + const zoomSpeed = settingStore.get("Comfy.Graph.ZoomSpeed"); + if (canvasStore.canvas) { + canvasStore.canvas.zoom_speed = zoomSpeed; + } + }); + watchEffect(() => { + LiteGraph.snaps_for_comfy = settingStore.get("Comfy.Node.AutoSnapLinkToSlot"); + }); + watchEffect(() => { + LiteGraph.snap_highlights_node = settingStore.get( + "Comfy.Node.SnapHighlightsNode" + ); + }); + watchEffect(() => { + LGraphNode.keepAllLinksOnBypass = settingStore.get( + "Comfy.Node.BypassAllLinksOnDelete" + ); + }); + watchEffect(() => { + LiteGraph.middle_click_slot_add_default_node = settingStore.get( + "Comfy.Node.MiddleClickRerouteNode" + ); + }); + watchEffect(() => { + nodeDefStore.showDeprecated = settingStore.get("Comfy.Node.ShowDeprecated"); + }); + watchEffect(() => { + nodeDefStore.showExperimental = settingStore.get( + "Comfy.Node.ShowExperimental" + ); + }); + watchEffect(() => { + const spellcheckEnabled = settingStore.get("Comfy.TextareaWidget.Spellcheck"); + const textareas = document.querySelectorAll("textarea.comfy-multiline-input"); + textareas.forEach((textarea) => { + textarea.spellcheck = spellcheckEnabled; + textarea.focus(); + textarea.blur(); + }); + }); + watchEffect(() => { + const linkRenderMode = settingStore.get("Comfy.LinkRenderMode"); + if (canvasStore.canvas) { + canvasStore.canvas.links_render_mode = linkRenderMode; + canvasStore.canvas.setDirty( + /* fg */ + false, + /* bg */ + true + ); + } + }); + watchEffect(() => { + const linkMarkerShape = settingStore.get("Comfy.Graph.LinkMarkers"); + const { canvas } = canvasStore; + if (canvas) { + canvas.linkMarkerShape = linkMarkerShape; + canvas.setDirty(false, true); + } + }); + watchEffect(() => { + const reroutesEnabled = settingStore.get("Comfy.RerouteBeta"); + const { canvas } = canvasStore; + if (canvas) { + canvas.reroutesEnabled = reroutesEnabled; + canvas.setDirty(false, true); + } + }); + watchEffect(() => { + const maximumFps = settingStore.get("LiteGraph.Canvas.MaximumFps"); + const { canvas } = canvasStore; + if (canvas) canvas.maximumFps = maximumFps; + }); + watchEffect(() => { + CanvasPointer.doubleClickTime = settingStore.get( + "Comfy.Pointer.DoubleClickTime" + ); + }); + watchEffect(() => { + CanvasPointer.bufferTime = settingStore.get("Comfy.Pointer.ClickBufferTime"); + }); + watchEffect(() => { + CanvasPointer.maxClickDrift = settingStore.get("Comfy.Pointer.ClickDrift"); + }); + watchEffect(() => { + LiteGraph.CANVAS_GRID_SIZE = settingStore.get("Comfy.SnapToGrid.GridSize"); + }); + watchEffect(() => { + LiteGraph.alwaysSnapToGrid = settingStore.get("pysssss.SnapToGrid"); + }); + watch( + () => settingStore.get("Comfy.WidgetControlMode"), + () => { + if (!canvasStore.canvas) return; + for (const n of app.graph.nodes) { + if (!n.widgets) continue; + for (const w of n.widgets) { + if (w[IS_CONTROL_WIDGET]) { + updateControlWidgetLabel(w); + if (w.linkedWidgets) { + for (const l of w.linkedWidgets) { + updateControlWidgetLabel(l); + } + } + } + } + } + app.graph.setDirtyCanvas(true); + } + ); + const colorPaletteService = useColorPaletteService(); + const colorPaletteStore = useColorPaletteStore(); + watch( + [() => canvasStore.canvas, () => settingStore.get("Comfy.ColorPalette")], + ([canvas, currentPaletteId]) => { + if (!canvas) return; + colorPaletteService.loadColorPalette(currentPaletteId); + } + ); + watch( + () => colorPaletteStore.activePaletteId, + (newValue) => { + settingStore.set("Comfy.ColorPalette", newValue); + } + ); + const workflowStore = useWorkflowStore(); + const persistCurrentWorkflow = /* @__PURE__ */ __name(() => { + const workflow = JSON.stringify(app.serializeGraph()); + localStorage.setItem("workflow", workflow); + if (api.clientId) { + sessionStorage.setItem(`workflow:${api.clientId}`, workflow); + } + }, "persistCurrentWorkflow"); + watchEffect(() => { + if (workflowStore.activeWorkflow) { + const workflow = workflowStore.activeWorkflow; + setStorageValue("Comfy.PreviousWorkflow", workflow.key); + persistCurrentWorkflow(); + } + }); + api.addEventListener("graphChanged", persistCurrentWorkflow); + usePragmaticDroppable(() => canvasRef.value, { + onDrop: /* @__PURE__ */ __name((event) => { + const loc = event.location.current.input; + const dndData = event.source.data; + if (dndData.type === "tree-explorer-node") { + const node = dndData.data; + if (node.data instanceof ComfyNodeDefImpl) { + const nodeDef = node.data; + const pos = app.clientPosToCanvasPos([ + loc.clientX - 20, + loc.clientY + ]); + litegraphService.addNodeOnGraph(nodeDef, { pos }); + } else if (node.data instanceof ComfyModelDef) { + const model = node.data; + const pos = app.clientPosToCanvasPos([loc.clientX, loc.clientY]); + const nodeAtPos = app.graph.getNodeOnPos(pos[0], pos[1]); + let targetProvider = null; + let targetGraphNode = null; + if (nodeAtPos) { + const providers = modelToNodeStore.getAllNodeProviders( + model.directory + ); + for (const provider of providers) { + if (provider.nodeDef.name === nodeAtPos.comfyClass) { + targetGraphNode = nodeAtPos; + targetProvider = provider; + } + } + } + if (!targetGraphNode) { + const provider = modelToNodeStore.getNodeProvider(model.directory); + if (provider) { + targetGraphNode = litegraphService.addNodeOnGraph( + provider.nodeDef, + { + pos + } + ); + targetProvider = provider; + } + } + if (targetGraphNode) { + const widget = targetGraphNode.widgets.find( + (widget2) => widget2.name === targetProvider.key + ); + if (widget) { + widget.value = model.file_name; + } + } + } + } + }, "onDrop") + }); + const comfyAppReady = ref(false); + onMounted(async () => { + window["LiteGraph"] = LiteGraph; + window["LGraph"] = LGraph; + window["LLink"] = LLink; + window["LGraphNode"] = LGraphNode; + window["LGraphGroup"] = LGraphGroup; + window["DragAndScale"] = DragAndScale; + window["LGraphCanvas"] = LGraphCanvas; + window["ContextMenu"] = ContextMenu; + window["LGraphBadge"] = LGraphBadge; + app.vueAppReady = true; + workspaceStore.spinner = true; + ChangeTracker.init(app); + await settingStore.loadSettingValues(); + CORE_SETTINGS.forEach((setting) => { + settingStore.addSetting(setting); + }); + await app.setup(canvasRef.value); + canvasStore.canvas = app.canvas; + canvasStore.canvas.render_canvas_border = false; + workspaceStore.spinner = false; + window["app"] = app; + window["graph"] = app.graph; + comfyAppReady.value = true; + colorPaletteStore.customPalettes = settingStore.get( + "Comfy.CustomColorPalettes" + ); + watch( + () => settingStore.get("Comfy.Locale"), + async () => { + await useCommandStore().execute("Comfy.RefreshNodeDefinitions"); + useWorkflowService().reloadCurrentWorkflow(); + } + ); + emit("ready"); + }); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + (openBlock(), createBlock(Teleport, { to: ".graph-canvas-container" }, [ + comfyAppReady.value && betaMenuEnabled.value && !unref(workspaceStore).focusMode ? (openBlock(), createBlock(LiteGraphCanvasSplitterOverlay, { key: 0 }, { + "side-bar-panel": withCtx(() => [ + createVNode(SideToolbar) + ]), + "bottom-panel": withCtx(() => [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(_sfc_main$m) +======== + createVNode(_sfc_main$o) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + ]), + "graph-canvas-panel": withCtx(() => [ + canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { key: 0 })) : createCommentVNode("", true) + ]), + _: 1 + })) : createCommentVNode("", true), + createVNode(TitleEditor), + !betaMenuEnabled.value && canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { key: 1 })) : createCommentVNode("", true), + createBaseVNode("canvas", { + ref_key: "canvasRef", + ref: canvasRef, + id: "graph-canvas", + tabindex: "1" + }, null, 512) + ])), + createVNode(_sfc_main$h), + tooltipEnabled.value ? (openBlock(), createBlock(NodeTooltip, { key: 0 })) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(_sfc_main$f) +======== + createVNode(_sfc_main$m) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + ], 64); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const _sfc_main$c = /* @__PURE__ */ defineComponent({ + __name: "MenuHamburger", + setup(__props) { + const workspaceState = useWorkspaceStore(); + const settingStore = useSettingStore(); + const exitFocusMode = /* @__PURE__ */ __name(() => { + workspaceState.focusMode = false; + }, "exitFocusMode"); + watchEffect(() => { + if (settingStore.get("Comfy.UseNewMenu") !== "Disabled") { + return; + } + if (workspaceState.focusMode) { + app.ui.menuContainer.style.display = "none"; + } else { + app.ui.menuContainer.style.display = "block"; + } + }); + const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu")); + const positionCSS = computed( + () => ( + // 'Bottom' menuSetting shows the hamburger button in the bottom right corner + // 'Disabled', 'Top' menuSetting shows the hamburger button in the top right corner + menuSetting.value === "Bottom" ? { bottom: "0px", right: "0px" } : { top: "0px", right: "0px" } + ) + ); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return withDirectives((openBlock(), createBlock(unref(script$h), { + class: "comfy-menu-hamburger", + style: normalizeStyle(positionCSS.value), + icon: "pi pi-bars", + severity: "secondary", + text: "", + size: "large", + onClick: exitFocusMode, + onContextmenu: unref(showNativeMenu) + }, null, 8, ["style", "onContextmenu"])), [ + [vShow, unref(workspaceState).focusMode], + [_directive_tooltip, { value: _ctx.$t("menu.showMenu"), showDelay: 300 }] + ]); + }; + } +}); +const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-962c4073"]]); +======== +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +function _typeof$3(o) { + "@babel/helpers - typeof"; + return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$3(o); +} +__name(_typeof$3, "_typeof$3"); +function _defineProperty$3(e, r, t) { + return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$3, "_defineProperty$3"); +function _toPropertyKey$3(t) { + var i = _toPrimitive$3(t, "string"); + return "symbol" == _typeof$3(i) ? i : i + ""; +} +__name(_toPropertyKey$3, "_toPropertyKey$3"); +function _toPrimitive$3(t, r) { + if ("object" != _typeof$3(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$3(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$3, "_toPrimitive$3"); +var theme$3 = /* @__PURE__ */ __name(function theme5(_ref) { + var dt = _ref.dt; + return "\n.p-toast {\n width: ".concat(dt("toast.width"), ";\n white-space: pre-line;\n word-break: break-word;\n}\n\n.p-toast-message {\n margin: 0 0 1rem 0;\n}\n\n.p-toast-message-icon {\n flex-shrink: 0;\n font-size: ").concat(dt("toast.icon.size"), ";\n width: ").concat(dt("toast.icon.size"), ";\n height: ").concat(dt("toast.icon.size"), ";\n}\n\n.p-toast-message-content {\n display: flex;\n align-items: flex-start;\n padding: ").concat(dt("toast.content.padding"), ";\n gap: ").concat(dt("toast.content.gap"), ";\n}\n\n.p-toast-message-text {\n flex: 1 1 auto;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("toast.text.gap"), ";\n}\n\n.p-toast-summary {\n font-weight: ").concat(dt("toast.summary.font.weight"), ";\n font-size: ").concat(dt("toast.summary.font.size"), ";\n}\n\n.p-toast-detail {\n font-weight: ").concat(dt("toast.detail.font.weight"), ";\n font-size: ").concat(dt("toast.detail.font.size"), ";\n}\n\n.p-toast-close-button {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n background: transparent;\n transition: background ").concat(dt("toast.transition.duration"), ", color ").concat(dt("toast.transition.duration"), ", outline-color ").concat(dt("toast.transition.duration"), ", box-shadow ").concat(dt("toast.transition.duration"), ";\n outline-color: transparent;\n color: inherit;\n width: ").concat(dt("toast.close.button.width"), ";\n height: ").concat(dt("toast.close.button.height"), ";\n border-radius: ").concat(dt("toast.close.button.border.radius"), ";\n margin: -25% 0 0 0;\n right: -25%;\n padding: 0;\n border: none;\n user-select: none;\n}\n\n.p-toast-close-button:dir(rtl) {\n margin: -25% 0 0 auto;\n left: -25%;\n right: auto;\n}\n\n.p-toast-message-info,\n.p-toast-message-success,\n.p-toast-message-warn,\n.p-toast-message-error,\n.p-toast-message-secondary,\n.p-toast-message-contrast {\n border-width: ").concat(dt("toast.border.width"), ";\n border-style: solid;\n backdrop-filter: blur(").concat(dt("toast.blur"), ");\n border-radius: ").concat(dt("toast.border.radius"), ";\n}\n\n.p-toast-close-icon {\n font-size: ").concat(dt("toast.close.icon.size"), ";\n width: ").concat(dt("toast.close.icon.size"), ";\n height: ").concat(dt("toast.close.icon.size"), ";\n}\n\n.p-toast-close-button:focus-visible {\n outline-width: ").concat(dt("focus.ring.width"), ";\n outline-style: ").concat(dt("focus.ring.style"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-toast-message-info {\n background: ").concat(dt("toast.info.background"), ";\n border-color: ").concat(dt("toast.info.border.color"), ";\n color: ").concat(dt("toast.info.color"), ";\n box-shadow: ").concat(dt("toast.info.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-detail {\n color: ").concat(dt("toast.info.detail.color"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.info.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.info.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:hover {\n background: ").concat(dt("toast.info.close.button.hover.background"), ";\n}\n\n.p-toast-message-success {\n background: ").concat(dt("toast.success.background"), ";\n border-color: ").concat(dt("toast.success.border.color"), ";\n color: ").concat(dt("toast.success.color"), ";\n box-shadow: ").concat(dt("toast.success.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-detail {\n color: ").concat(dt("toast.success.detail.color"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.success.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.success.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:hover {\n background: ").concat(dt("toast.success.close.button.hover.background"), ";\n}\n\n.p-toast-message-warn {\n background: ").concat(dt("toast.warn.background"), ";\n border-color: ").concat(dt("toast.warn.border.color"), ";\n color: ").concat(dt("toast.warn.color"), ";\n box-shadow: ").concat(dt("toast.warn.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-detail {\n color: ").concat(dt("toast.warn.detail.color"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.warn.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.warn.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:hover {\n background: ").concat(dt("toast.warn.close.button.hover.background"), ";\n}\n\n.p-toast-message-error {\n background: ").concat(dt("toast.error.background"), ";\n border-color: ").concat(dt("toast.error.border.color"), ";\n color: ").concat(dt("toast.error.color"), ";\n box-shadow: ").concat(dt("toast.error.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-detail {\n color: ").concat(dt("toast.error.detail.color"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.error.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.error.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:hover {\n background: ").concat(dt("toast.error.close.button.hover.background"), ";\n}\n\n.p-toast-message-secondary {\n background: ").concat(dt("toast.secondary.background"), ";\n border-color: ").concat(dt("toast.secondary.border.color"), ";\n color: ").concat(dt("toast.secondary.color"), ";\n box-shadow: ").concat(dt("toast.secondary.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-detail {\n color: ").concat(dt("toast.secondary.detail.color"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.secondary.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.secondary.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:hover {\n background: ").concat(dt("toast.secondary.close.button.hover.background"), ";\n}\n\n.p-toast-message-contrast {\n background: ").concat(dt("toast.contrast.background"), ";\n border-color: ").concat(dt("toast.contrast.border.color"), ";\n color: ").concat(dt("toast.contrast.color"), ";\n box-shadow: ").concat(dt("toast.contrast.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-detail {\n color: ").concat(dt("toast.contrast.detail.color"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.contrast.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.contrast.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:hover {\n background: ").concat(dt("toast.contrast.close.button.hover.background"), ";\n}\n\n.p-toast-top-center {\n transform: translateX(-50%);\n}\n\n.p-toast-bottom-center {\n transform: translateX(-50%);\n}\n\n.p-toast-center {\n min-width: 20vw;\n transform: translate(-50%, -50%);\n}\n\n.p-toast-message-enter-from {\n opacity: 0;\n transform: translateY(50%);\n}\n\n.p-toast-message-leave-from {\n max-height: 1000px;\n}\n\n.p-toast .p-toast-message.p-toast-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin-bottom: 0;\n overflow: hidden;\n}\n\n.p-toast-message-enter-active {\n transition: transform 0.3s, opacity 0.3s;\n}\n\n.p-toast-message-leave-active {\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;\n}\n"); +}, "theme"); +var inlineStyles$2 = { + root: /* @__PURE__ */ __name(function root6(_ref2) { + var position = _ref2.position; + return { + position: "fixed", + top: position === "top-right" || position === "top-left" || position === "top-center" ? "20px" : position === "center" ? "50%" : null, + right: (position === "top-right" || position === "bottom-right") && "20px", + bottom: (position === "bottom-left" || position === "bottom-right" || position === "bottom-center") && "20px", + left: position === "top-left" || position === "bottom-left" ? "20px" : position === "center" || position === "top-center" || position === "bottom-center" ? "50%" : null + }; + }, "root") +}; +var classes$3 = { + root: /* @__PURE__ */ __name(function root7(_ref3) { + var props = _ref3.props; + return ["p-toast p-component p-toast-" + props.position]; + }, "root"), + message: /* @__PURE__ */ __name(function message(_ref4) { + var props = _ref4.props; + return ["p-toast-message", { + "p-toast-message-info": props.message.severity === "info" || props.message.severity === void 0, + "p-toast-message-warn": props.message.severity === "warn", + "p-toast-message-error": props.message.severity === "error", + "p-toast-message-success": props.message.severity === "success", + "p-toast-message-secondary": props.message.severity === "secondary", + "p-toast-message-contrast": props.message.severity === "contrast" + }]; + }, "message"), + messageContent: "p-toast-message-content", + messageIcon: /* @__PURE__ */ __name(function messageIcon(_ref5) { + var props = _ref5.props; + return ["p-toast-message-icon", _defineProperty$3(_defineProperty$3(_defineProperty$3(_defineProperty$3({}, props.infoIcon, props.message.severity === "info"), props.warnIcon, props.message.severity === "warn"), props.errorIcon, props.message.severity === "error"), props.successIcon, props.message.severity === "success")]; + }, "messageIcon"), + messageText: "p-toast-message-text", + summary: "p-toast-summary", + detail: "p-toast-detail", + closeButton: "p-toast-close-button", + closeIcon: "p-toast-close-icon" +}; +var ToastStyle = BaseStyle.extend({ + name: "toast", + theme: theme$3, + classes: classes$3, + inlineStyles: inlineStyles$2 +}); +var script$8 = { + name: "ExclamationTriangleIcon", + "extends": script$v +}; +function render$c(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + d: "M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z", + fill: "currentColor" + }, null, -1), createBaseVNode("path", { + d: "M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z", + fill: "currentColor" + }, null, -1), createBaseVNode("path", { + d: "M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$c, "render$c"); +script$8.render = render$c; +var script$7 = { + name: "InfoCircleIcon", + "extends": script$v +}; +function render$b(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$b, "render$b"); +script$7.render = render$b; +var script$2$2 = { + name: "BaseToast", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + props: { + group: { + type: String, + "default": null + }, + position: { + type: String, + "default": "top-right" + }, + autoZIndex: { + type: Boolean, + "default": true + }, + baseZIndex: { + type: Number, + "default": 0 + }, + breakpoints: { + type: Object, + "default": null + }, + closeIcon: { + type: String, + "default": void 0 + }, + infoIcon: { + type: String, + "default": void 0 + }, + warnIcon: { + type: String, + "default": void 0 + }, + errorIcon: { + type: String, + "default": void 0 + }, + successIcon: { + type: String, + "default": void 0 + }, + closeButtonProps: { + type: null, + "default": null + } + }, + style: ToastStyle, + provide: /* @__PURE__ */ __name(function provide9() { + return { + $pcToast: this, + $parentInstance: this + }; + }, "provide") +}; +var script$1$3 = { + name: "ToastMessage", + hostName: "Toast", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + emits: ["close"], + closeTimeout: null, + props: { + message: { + type: null, + "default": null + }, + templates: { + type: Object, + "default": null + }, + closeIcon: { + type: String, + "default": null + }, + infoIcon: { + type: String, + "default": null + }, + warnIcon: { + type: String, + "default": null + }, + errorIcon: { + type: String, + "default": null + }, + successIcon: { + type: String, + "default": null + }, + closeButtonProps: { + type: null, + "default": null + } + }, + mounted: /* @__PURE__ */ __name(function mounted4() { + var _this = this; + if (this.message.life) { + this.closeTimeout = setTimeout(function() { + _this.close({ + message: _this.message, + type: "life-end" + }); + }, this.message.life); + } + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount4() { + this.clearCloseTimeout(); + }, "beforeUnmount"), + methods: { + close: /* @__PURE__ */ __name(function close(params) { + this.$emit("close", params); + }, "close"), + onCloseClick: /* @__PURE__ */ __name(function onCloseClick() { + this.clearCloseTimeout(); + this.close({ + message: this.message, + type: "close" + }); + }, "onCloseClick"), + clearCloseTimeout: /* @__PURE__ */ __name(function clearCloseTimeout() { + if (this.closeTimeout) { + clearTimeout(this.closeTimeout); + this.closeTimeout = null; + } + }, "clearCloseTimeout") + }, + computed: { + iconComponent: /* @__PURE__ */ __name(function iconComponent() { + return { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + info: !this.infoIcon && script$7, + success: !this.successIcon && script$w, + warn: !this.warnIcon && script$8, + error: !this.errorIcon && script$x +======== + info: !this.infoIcon && script$r, + success: !this.successIcon && script$s, + warn: !this.warnIcon && script$t, + error: !this.errorIcon && script$u +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }[this.message.severity]; + }, "iconComponent"), + closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0; + }, "closeAriaLabel") + }, + components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + TimesIcon: script$y, + InfoCircleIcon: script$7, + CheckIcon: script$w, + ExclamationTriangleIcon: script$8, + TimesCircleIcon: script$x +======== + TimesIcon: script$v, + InfoCircleIcon: script$r, + CheckIcon: script$s, + ExclamationTriangleIcon: script$t, + TimesCircleIcon: script$u +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }, + directives: { + ripple: Ripple + } +}; +function _typeof$1(o) { + "@babel/helpers - typeof"; + return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$1(o); +} +__name(_typeof$1, "_typeof$1"); +function ownKeys$1(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$1, "ownKeys$1"); +function _objectSpread$1(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) { + _defineProperty$1(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$1, "_objectSpread$1"); +function _defineProperty$1(e, r, t) { + return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$1, "_defineProperty$1"); +function _toPropertyKey$1(t) { + var i = _toPrimitive$1(t, "string"); + return "symbol" == _typeof$1(i) ? i : i + ""; +} +__name(_toPropertyKey$1, "_toPropertyKey$1"); +function _toPrimitive$1(t, r) { + if ("object" != _typeof$1(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$1(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$1, "_toPrimitive$1"); +var _hoisted_1$d = ["aria-label"]; +function render$1$2(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": [_ctx.cx("message"), $props.message.styleClass], + role: "alert", + "aria-live": "assertive", + "aria-atomic": "true" + }, _ctx.ptm("message")), [$props.templates.container ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.container), { + key: 0, + message: $props.message, + closeCallback: $options.onCloseClick + }, null, 8, ["message", "closeCallback"])) : (openBlock(), createElementBlock("div", mergeProps({ + key: 1, + "class": [_ctx.cx("messageContent"), $props.message.contentStyleClass] + }, _ctx.ptm("messageContent")), [!$props.templates.message ? (openBlock(), createElementBlock(Fragment, { + key: 0 + }, [(openBlock(), createBlock(resolveDynamicComponent($props.templates.messageicon ? $props.templates.messageicon : $props.templates.icon ? $props.templates.icon : $options.iconComponent && $options.iconComponent.name ? $options.iconComponent : "span"), mergeProps({ + "class": _ctx.cx("messageIcon") + }, _ctx.ptm("messageIcon")), null, 16, ["class"])), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("messageText") + }, _ctx.ptm("messageText")), [createBaseVNode("span", mergeProps({ + "class": _ctx.cx("summary") + }, _ctx.ptm("summary")), toDisplayString($props.message.summary), 17), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("detail") + }, _ctx.ptm("detail")), toDisplayString($props.message.detail), 17)], 16)], 64)) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.message), { + key: 1, + message: $props.message + }, null, 8, ["message"])), $props.message.closable !== false ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ + key: 2 + }, _ctx.ptm("buttonContainer"))), [withDirectives((openBlock(), createElementBlock("button", mergeProps({ + "class": _ctx.cx("closeButton"), + type: "button", + "aria-label": $options.closeAriaLabel, + onClick: _cache[0] || (_cache[0] = function() { + return $options.onCloseClick && $options.onCloseClick.apply($options, arguments); + }), + autofocus: "" + }, _objectSpread$1(_objectSpread$1({}, $props.closeButtonProps), _ctx.ptm("closeButton"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.closeicon || "TimesIcon"), mergeProps({ + "class": [_ctx.cx("closeIcon"), $props.closeIcon] + }, _ctx.ptm("closeIcon")), null, 16, ["class"]))], 16, _hoisted_1$d)), [[_directive_ripple]])], 16)) : createCommentVNode("", true)], 16))], 16); +} +__name(render$1$2, "render$1$2"); +script$1$3.render = render$1$2; +function _toConsumableArray(r) { + return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); +} +__name(_toConsumableArray, "_toConsumableArray"); +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +__name(_nonIterableSpread, "_nonIterableSpread"); +function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; + } +} +__name(_unsupportedIterableToArray, "_unsupportedIterableToArray"); +function _iterableToArray(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +__name(_iterableToArray, "_iterableToArray"); +function _arrayWithoutHoles(r) { + if (Array.isArray(r)) return _arrayLikeToArray(r); +} +__name(_arrayWithoutHoles, "_arrayWithoutHoles"); +function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +__name(_arrayLikeToArray, "_arrayLikeToArray"); +var messageIdx = 0; +var script$5 = { + name: "Toast", + "extends": script$2$2, + inheritAttrs: false, + emits: ["close", "life-end"], + data: /* @__PURE__ */ __name(function data5() { + return { + messages: [] + }; + }, "data"), + styleElement: null, + mounted: /* @__PURE__ */ __name(function mounted5() { + ToastEventBus.on("add", this.onAdd); + ToastEventBus.on("remove", this.onRemove); + ToastEventBus.on("remove-group", this.onRemoveGroup); + ToastEventBus.on("remove-all-groups", this.onRemoveAllGroups); + if (this.breakpoints) { + this.createStyle(); + } + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount5() { + this.destroyStyle(); + if (this.$refs.container && this.autoZIndex) { + ZIndex.clear(this.$refs.container); + } + ToastEventBus.off("add", this.onAdd); + ToastEventBus.off("remove", this.onRemove); + ToastEventBus.off("remove-group", this.onRemoveGroup); + ToastEventBus.off("remove-all-groups", this.onRemoveAllGroups); + }, "beforeUnmount"), + methods: { + add: /* @__PURE__ */ __name(function add(message2) { + if (message2.id == null) { + message2.id = messageIdx++; + } + this.messages = [].concat(_toConsumableArray(this.messages), [message2]); + }, "add"), + remove: /* @__PURE__ */ __name(function remove(params) { + var index = this.messages.findIndex(function(m) { + return m.id === params.message.id; + }); + if (index !== -1) { + this.messages.splice(index, 1); + this.$emit(params.type, { + message: params.message + }); + } + }, "remove"), + onAdd: /* @__PURE__ */ __name(function onAdd(message2) { + if (this.group == message2.group) { + this.add(message2); + } + }, "onAdd"), + onRemove: /* @__PURE__ */ __name(function onRemove(message2) { + this.remove({ + message: message2, + type: "close" + }); + }, "onRemove"), + onRemoveGroup: /* @__PURE__ */ __name(function onRemoveGroup(group) { + if (this.group === group) { + this.messages = []; + } + }, "onRemoveGroup"), + onRemoveAllGroups: /* @__PURE__ */ __name(function onRemoveAllGroups() { + this.messages = []; + }, "onRemoveAllGroups"), + onEnter: /* @__PURE__ */ __name(function onEnter() { + if (this.autoZIndex) { + ZIndex.set("modal", this.$refs.container, this.baseZIndex || this.$primevue.config.zIndex.modal); + } + }, "onEnter"), + onLeave: /* @__PURE__ */ __name(function onLeave() { + var _this = this; + if (this.$refs.container && this.autoZIndex && isEmpty(this.messages)) { + setTimeout(function() { + ZIndex.clear(_this.$refs.container); + }, 200); + } + }, "onLeave"), + createStyle: /* @__PURE__ */ __name(function createStyle() { + if (!this.styleElement && !this.isUnstyled) { + var _this$$primevue; + this.styleElement = document.createElement("style"); + this.styleElement.type = "text/css"; + setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce); + document.head.appendChild(this.styleElement); + var innerHTML = ""; + for (var breakpoint in this.breakpoints) { + var breakpointStyle = ""; + for (var styleProp in this.breakpoints[breakpoint]) { + breakpointStyle += styleProp + ":" + this.breakpoints[breakpoint][styleProp] + "!important;"; + } + innerHTML += "\n @media screen and (max-width: ".concat(breakpoint, ") {\n .p-toast[").concat(this.$attrSelector, "] {\n ").concat(breakpointStyle, "\n }\n }\n "); + } + this.styleElement.innerHTML = innerHTML; + } + }, "createStyle"), + destroyStyle: /* @__PURE__ */ __name(function destroyStyle() { + if (this.styleElement) { + document.head.removeChild(this.styleElement); + this.styleElement = null; + } + }, "destroyStyle") + }, + components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + ToastMessage: script$1$4, + Portal: script$p +======== + ToastMessage: script$1$3, + Portal: script$k +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + } +}; +function _typeof$2(o) { + "@babel/helpers - typeof"; + return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$2(o); +} +__name(_typeof$2, "_typeof$2"); +function ownKeys$2(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$2, "ownKeys$2"); +function _objectSpread$2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$2(Object(t), true).forEach(function(r2) { + _defineProperty$2(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$2, "_objectSpread$2"); +function _defineProperty$2(e, r, t) { + return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$2, "_defineProperty$2"); +function _toPropertyKey$2(t) { + var i = _toPrimitive$2(t, "string"); + return "symbol" == _typeof$2(i) ? i : i + ""; +} +__name(_toPropertyKey$2, "_toPropertyKey$2"); +function _toPrimitive$2(t, r) { + if ("object" != _typeof$2(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$2(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$2, "_toPrimitive$2"); +function render$a(_ctx, _cache, $props, $setup, $data, $options) { + var _component_ToastMessage = resolveComponent("ToastMessage"); + var _component_Portal = resolveComponent("Portal"); + return openBlock(), createBlock(_component_Portal, null, { + "default": withCtx(function() { + return [createBaseVNode("div", mergeProps({ + ref: "container", + "class": _ctx.cx("root"), + style: _ctx.sx("root", true, { + position: _ctx.position + }) + }, _ctx.ptmi("root")), [createVNode(TransitionGroup, mergeProps({ + name: "p-toast-message", + tag: "div", + onEnter: $options.onEnter, + onLeave: $options.onLeave + }, _objectSpread$2({}, _ctx.ptm("transition"))), { + "default": withCtx(function() { + return [(openBlock(true), createElementBlock(Fragment, null, renderList($data.messages, function(msg) { + return openBlock(), createBlock(_component_ToastMessage, { + key: msg.id, + message: msg, + templates: _ctx.$slots, + closeIcon: _ctx.closeIcon, + infoIcon: _ctx.infoIcon, + warnIcon: _ctx.warnIcon, + errorIcon: _ctx.errorIcon, + successIcon: _ctx.successIcon, + closeButtonProps: _ctx.closeButtonProps, + unstyled: _ctx.unstyled, + onClose: _cache[0] || (_cache[0] = function($event) { + return $options.remove($event); + }), + pt: _ctx.pt + }, null, 8, ["message", "templates", "closeIcon", "infoIcon", "warnIcon", "errorIcon", "successIcon", "closeButtonProps", "unstyled", "pt"]); + }), 128))]; + }), + _: 1 + }, 16, ["onEnter", "onLeave"])], 16)]; + }), + _: 1 + }); +} +__name(render$a, "render$a"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +script$6.render = render$a; +const _sfc_main$b = /* @__PURE__ */ defineComponent({ +======== +script$5.render = render$a; +const _sfc_main$9 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + __name: "GlobalToast", + setup(__props) { + const toast = useToast(); + const toastStore = useToastStore(); + const settingStore = useSettingStore(); + watch( + () => toastStore.messagesToAdd, + (newMessages) => { + if (newMessages.length === 0) { + return; + } + newMessages.forEach((message2) => { + toast.add(message2); + }); + toastStore.messagesToAdd = []; + }, + { deep: true } + ); + watch( + () => toastStore.messagesToRemove, + (messagesToRemove) => { + if (messagesToRemove.length === 0) { + return; + } + messagesToRemove.forEach((message2) => { + toast.remove(message2); + }); + toastStore.messagesToRemove = []; + }, + { deep: true } + ); + watch( + () => toastStore.removeAllRequested, + (requested) => { + if (requested) { + toast.removeAllGroups(); + toastStore.removeAllRequested = false; + } + } + ); + function updateToastPosition() { + const styleElement = document.getElementById("dynamic-toast-style") || createStyleElement(); + const rect = document.querySelector(".graph-canvas-container").getBoundingClientRect(); + styleElement.textContent = ` + .p-toast.p-component.p-toast-top-right { + top: ${rect.top + 20}px !important; + right: ${window.innerWidth - (rect.left + rect.width) + 20}px !important; + } + `; + } + __name(updateToastPosition, "updateToastPosition"); + function createStyleElement() { + const style = document.createElement("style"); + style.id = "dynamic-toast-style"; + document.head.appendChild(style); + return style; + } + __name(createStyleElement, "createStyleElement"); + watch( + () => settingStore.get("Comfy.UseNewMenu"), + () => nextTick(updateToastPosition), + { immediate: true } + ); + watch( + () => settingStore.get("Comfy.Sidebar.Location"), + () => nextTick(updateToastPosition), + { immediate: true } + ); + return (_ctx, _cache) => { + return openBlock(), createBlock(unref(script$5)); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const _sfc_main$a = /* @__PURE__ */ defineComponent({ + __name: "UnloadWindowConfirmDialog", + setup(__props) { + const settingStore = useSettingStore(); + const handleBeforeUnload = /* @__PURE__ */ __name((event) => { + if (settingStore.get("Comfy.Window.UnloadConfirmation")) { + event.preventDefault(); + return true; + } + return void 0; + }, "handleBeforeUnload"); + onMounted(() => { + window.addEventListener("beforeunload", handleBeforeUnload); + }); + onBeforeUnmount(() => { + window.removeEventListener("beforeunload", handleBeforeUnload); + }); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +const DEFAULT_TITLE = "ComfyUI"; +const TITLE_SUFFIX = " - ComfyUI"; +const _sfc_main$9 = /* @__PURE__ */ defineComponent({ + __name: "BrowserTabTitle", + setup(__props) { + const executionStore = useExecutionStore(); + const executionText = computed( + () => executionStore.isIdle ? "" : `[${executionStore.executionProgress}%]` + ); + const settingStore = useSettingStore(); + const betaMenuEnabled = computed( + () => settingStore.get("Comfy.UseNewMenu") !== "Disabled" + ); + const workflowStore = useWorkflowStore(); + const isUnsavedText = computed( + () => workflowStore.activeWorkflow?.isModified || !workflowStore.activeWorkflow?.isPersisted ? " *" : "" + ); + const workflowNameText = computed(() => { + const workflowName = workflowStore.activeWorkflow?.filename; + return workflowName ? isUnsavedText.value + workflowName + TITLE_SUFFIX : DEFAULT_TITLE; + }); + const nodeExecutionTitle = computed( + () => executionStore.executingNode && executionStore.executingNodeProgress ? `${executionText.value}[${executionStore.executingNodeProgress}%] ${executionStore.executingNode.type}` : "" + ); + const workflowTitle = computed( + () => executionText.value + (betaMenuEnabled.value ? workflowNameText.value : DEFAULT_TITLE) + ); + const title = computed(() => nodeExecutionTitle.value || workflowTitle.value); + useTitle(title); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div"); + }; + } +}); +const _hoisted_1$d = { class: "workflow-label text-sm max-w-[150px] truncate inline-block" }; +const _hoisted_2$4 = { class: "relative" }; +const _hoisted_3$3 = { + key: 0, + class: "status-indicator" +}; +const _sfc_main$8 = /* @__PURE__ */ defineComponent({ + __name: "WorkflowTab", + props: { + class: {}, + workflowOption: {} + }, + setup(__props) { + const props = __props; + const workspaceStore = useWorkspaceStore(); + const workflowStore = useWorkflowStore(); + const workflowTabRef = ref(null); + const closeWorkflows = /* @__PURE__ */ __name(async (options) => { + for (const opt of options) { + if (!await workflowService.closeWorkflow(opt.workflow, { + warnIfUnsaved: !workspaceStore.shiftDown + })) { + break; + } + } + }, "closeWorkflows"); + const onCloseWorkflow = /* @__PURE__ */ __name((option2) => { + closeWorkflows([option2]); + }, "onCloseWorkflow"); + const tabGetter = /* @__PURE__ */ __name(() => workflowTabRef.value, "tabGetter"); + usePragmaticDraggable(tabGetter, { + getInitialData: /* @__PURE__ */ __name(() => { + return { + workflowKey: props.workflowOption.workflow.key + }; + }, "getInitialData") + }); + usePragmaticDroppable(tabGetter, { + getData: /* @__PURE__ */ __name(() => { + return { + workflowKey: props.workflowOption.workflow.key + }; + }, "getData"), + onDrop: /* @__PURE__ */ __name((e) => { + const fromIndex = workflowStore.openWorkflows.findIndex( + (wf) => wf.key === e.source.data.workflowKey + ); + const toIndex = workflowStore.openWorkflows.findIndex( + (wf) => wf.key === e.location.current.dropTargets[0]?.data.workflowKey + ); + if (fromIndex !== toIndex) { + workflowStore.reorderWorkflows(fromIndex, toIndex); + } + }, "onDrop") + }); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createElementBlock("div", mergeProps({ + class: "flex p-2 gap-2 workflow-tab", + ref_key: "workflowTabRef", + ref: workflowTabRef + }, _ctx.$attrs), [ + withDirectives((openBlock(), createElementBlock("span", _hoisted_1$d, [ + createTextVNode(toDisplayString(_ctx.workflowOption.workflow.filename), 1) + ])), [ + [ + _directive_tooltip, + _ctx.workflowOption.workflow.key, + void 0, + { bottom: true } + ] + ]), + createBaseVNode("div", _hoisted_2$4, [ + !unref(workspaceStore).shiftDown && (_ctx.workflowOption.workflow.isModified || !_ctx.workflowOption.workflow.isPersisted) ? (openBlock(), createElementBlock("span", _hoisted_3$3, "•")) : createCommentVNode("", true), + createVNode(unref(script$h), { + class: "close-button p-0 w-auto", + icon: "pi pi-times", + text: "", + severity: "secondary", + size: "small", + onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onCloseWorkflow(_ctx.workflowOption), ["stop"])) + }) + ]) + ], 16); + }; + } +}); +const WorkflowTab = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-7381014c"]]); +const _sfc_main$7 = /* @__PURE__ */ defineComponent({ + __name: "WorkflowTabs", + props: { + class: {} + }, + setup(__props) { + const props = __props; + const { t } = useI18n(); + const workspaceStore = useWorkspaceStore(); + const workflowStore = useWorkflowStore(); + const rightClickedTab = ref(null); + const menu = ref(); + const workflowToOption = /* @__PURE__ */ __name((workflow) => ({ + value: workflow.path, + workflow + }), "workflowToOption"); + const options = computed( + () => workflowStore.openWorkflows.map(workflowToOption) + ); + const selectedWorkflow = computed( + () => workflowStore.activeWorkflow ? workflowToOption(workflowStore.activeWorkflow) : null + ); + const onWorkflowChange = /* @__PURE__ */ __name((option2) => { + if (!option2) { + return; + } + if (selectedWorkflow.value?.value === option2.value) { + return; + } + workflowService.openWorkflow(option2.workflow); + }, "onWorkflowChange"); + const closeWorkflows = /* @__PURE__ */ __name(async (options2) => { + for (const opt of options2) { + if (!await workflowService.closeWorkflow(opt.workflow, { + warnIfUnsaved: !workspaceStore.shiftDown + })) { + break; + } + } + }, "closeWorkflows"); + const onCloseWorkflow = /* @__PURE__ */ __name((option2) => { + closeWorkflows([option2]); + }, "onCloseWorkflow"); + const showContextMenu = /* @__PURE__ */ __name((event, option2) => { + rightClickedTab.value = option2; + menu.value.show(event); + }, "showContextMenu"); + const contextMenuItems = computed(() => { + const tab = rightClickedTab.value; + if (!tab) return []; + const index = options.value.findIndex((v) => v.workflow === tab.workflow); + return [ + { + label: t("tabMenu.duplicateTab"), + command: /* @__PURE__ */ __name(() => { + workflowService.duplicateWorkflow(tab.workflow); + }, "command") + }, + { + separator: true + }, + { + label: t("tabMenu.closeTab"), + command: /* @__PURE__ */ __name(() => onCloseWorkflow(tab), "command") + }, + { + label: t("tabMenu.closeTabsToLeft"), + command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(0, index)), "command"), + disabled: index <= 0 + }, + { + label: t("tabMenu.closeTabsToRight"), + command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(index + 1)), "command"), + disabled: index === options.value.length - 1 + }, + { + label: t("tabMenu.closeOtherTabs"), + command: /* @__PURE__ */ __name(() => closeWorkflows([ + ...options.value.slice(index + 1), + ...options.value.slice(0, index) + ]), "command"), + disabled: options.value.length <= 1 + } + ]; + }); + const commandStore = useCommandStore(); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + createVNode(unref(script$z), { + class: normalizeClass(["workflow-tabs bg-transparent inline", props.class]), + modelValue: selectedWorkflow.value, + "onUpdate:modelValue": onWorkflowChange, + options: options.value, + optionLabel: "label", + dataKey: "value" + }, { + option: withCtx(({ option: option2 }) => [ + createVNode(WorkflowTab, { + onContextmenu: /* @__PURE__ */ __name(($event) => showContextMenu($event, option2), "onContextmenu"), + onMouseup: withModifiers(($event) => onCloseWorkflow(option2), ["middle"]), + "workflow-option": option2 + }, null, 8, ["onContextmenu", "onMouseup", "workflow-option"]) + ]), + _: 1 + }, 8, ["class", "modelValue", "options"]), + createVNode(unref(script$h), { + class: "new-blank-workflow-button", + icon: "pi pi-plus", + text: "", + severity: "secondary", + onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow")) + }), + createVNode(unref(script$A), { + ref_key: "menu", + ref: menu, + model: contextMenuItems.value + }, null, 8, ["model"]) + ], 64); + }; + } +}); +const WorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-b447982f"]]); +var theme$3 = /* @__PURE__ */ __name(function theme6(_ref) { + var dt = _ref.dt; + return "\n.p-menubar {\n display: flex;\n align-items: center;\n background: ".concat(dt("menubar.background"), ";\n border: 1px solid ").concat(dt("menubar.border.color"), ";\n border-radius: ").concat(dt("menubar.border.radius"), ";\n color: ").concat(dt("menubar.color"), ";\n padding: ").concat(dt("menubar.padding"), ";\n gap: ").concat(dt("menubar.gap"), ";\n}\n\n.p-menubar-start,\n.p-megamenu-end {\n display: flex;\n align-items: center;\n}\n\n.p-menubar-root-list,\n.p-menubar-submenu {\n display: flex;\n margin: 0;\n padding: 0;\n list-style: none;\n outline: 0 none;\n}\n\n.p-menubar-root-list {\n align-items: center;\n flex-wrap: wrap;\n gap: ").concat(dt("menubar.gap"), ";\n}\n\n.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content {\n border-radius: ").concat(dt("menubar.base.item.border.radius"), ";\n}\n\n.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {\n padding: ").concat(dt("menubar.base.item.padding"), ";\n}\n\n.p-menubar-item-content {\n transition: background ").concat(dt("menubar.transition.duration"), ", color ").concat(dt("menubar.transition.duration"), ";\n border-radius: ").concat(dt("menubar.item.border.radius"), ";\n color: ").concat(dt("menubar.item.color"), ";\n}\n\n.p-menubar-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ").concat(dt("menubar.item.padding"), ";\n gap: ").concat(dt("menubar.item.gap"), ";\n user-select: none;\n outline: 0 none;\n}\n\n.p-menubar-item-label {\n line-height: 1;\n}\n\n.p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.color"), ";\n}\n\n.p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.color"), ";\n margin-left: auto;\n font-size: ").concat(dt("menubar.submenu.icon.size"), ";\n width: ").concat(dt("menubar.submenu.icon.size"), ";\n height: ").concat(dt("menubar.submenu.icon.size"), ";\n}\n\n.p-menubar-submenu .p-menubar-submenu-icon:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content {\n color: ").concat(dt("menubar.item.focus.color"), ";\n background: ").concat(dt("menubar.item.focus.background"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.focus.color"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.focus.color"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover {\n color: ").concat(dt("menubar.item.focus.color"), ";\n background: ").concat(dt("menubar.item.focus.background"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.focus.color"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.focus.color"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content {\n color: ").concat(dt("menubar.item.active.color"), ";\n background: ").concat(dt("menubar.item.active.background"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.active.color"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.active.color"), ";\n}\n\n.p-menubar-submenu {\n display: none;\n position: absolute;\n min-width: 12.5rem;\n z-index: 1;\n background: ").concat(dt("menubar.submenu.background"), ";\n border: 1px solid ").concat(dt("menubar.submenu.border.color"), ";\n border-radius: ").concat(dt("menubar.submenu.border.radius"), ";\n box-shadow: ").concat(dt("menubar.submenu.shadow"), ";\n color: ").concat(dt("menubar.submenu.color"), ";\n flex-direction: column;\n padding: ").concat(dt("menubar.submenu.padding"), ";\n gap: ").concat(dt("menubar.submenu.gap"), ";\n}\n\n.p-menubar-submenu .p-menubar-separator {\n border-block-start: 1px solid ").concat(dt("menubar.separator.border.color"), ";\n}\n\n.p-menubar-submenu .p-menubar-item {\n position: relative;\n}\n\n.p-menubar-submenu > .p-menubar-item-active > .p-menubar-submenu {\n display: block;\n left: 100%;\n top: 0;\n}\n\n.p-menubar-end {\n margin-left: auto;\n align-self: center;\n}\n\n.p-menubar-end:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n}\n\n.p-menubar-button {\n display: none;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n width: ").concat(dt("menubar.mobile.button.size"), ";\n height: ").concat(dt("menubar.mobile.button.size"), ";\n position: relative;\n color: ").concat(dt("menubar.mobile.button.color"), ";\n border: 0 none;\n background: transparent;\n border-radius: ").concat(dt("menubar.mobile.button.border.radius"), ";\n transition: background ").concat(dt("menubar.transition.duration"), ", color ").concat(dt("menubar.transition.duration"), ", outline-color ").concat(dt("menubar.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-menubar-button:hover {\n color: ").concat(dt("menubar.mobile.button.hover.color"), ";\n background: ").concat(dt("menubar.mobile.button.hover.background"), ";\n}\n\n.p-menubar-button:focus-visible {\n box-shadow: ").concat(dt("menubar.mobile.button.focus.ring.shadow"), ";\n outline: ").concat(dt("menubar.mobile.button.focus.ring.width"), " ").concat(dt("menubar.mobile.button.focus.ring.style"), " ").concat(dt("menubar.mobile.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("menubar.mobile.button.focus.ring.offset"), ";\n}\n\n.p-menubar-mobile {\n position: relative;\n}\n\n.p-menubar-mobile .p-menubar-button {\n display: flex;\n}\n\n.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n padding: ").concat(dt("menubar.submenu.padding"), ";\n background: ").concat(dt("menubar.submenu.background"), ";\n border: 1px solid ").concat(dt("menubar.submenu.border.color"), ";\n box-shadow: ").concat(dt("menubar.submenu.shadow"), ";\n border-radius: ").concat(dt("menubar.submenu.border.radius"), ";\n gap: ").concat(dt("menubar.submenu.gap"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list:dir(rtl) {\n left: auto;\n right: 0;\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {\n padding: ").concat(dt("menubar.item.padding"), ";\n}\n\n.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n}\n\n.p-menubar-mobile .p-menubar-root-list .p-menubar-item {\n width: 100%;\n position: static;\n}\n\n.p-menubar-mobile .p-menubar-root-list .p-menubar-separator {\n border-block-start: 1px solid ").concat(dt("menubar.separator.border.color"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content .p-menubar-submenu-icon {\n margin-left: auto;\n transition: transform 0.2s;\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content .p-menubar-submenu-icon:dir(rtl),\n.p-menubar-mobile .p-menubar-submenu-icon:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n transform: rotate(-180deg);\n}\n\n.p-menubar-mobile .p-menubar-submenu .p-menubar-submenu-icon {\n transition: transform 0.2s;\n transform: rotate(90deg);\n}\n\n.p-menubar-mobile .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n transform: rotate(-90deg);\n}\n\n.p-menubar-mobile .p-menubar-submenu {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n padding-inline-start: ").concat(dt("menubar.submenu.mobile.indent"), ";\n padding-inline-end: 0;\n}\n"); +}, "theme"); +var inlineStyles$1 = { + submenu: /* @__PURE__ */ __name(function submenu(_ref2) { + var instance = _ref2.instance, processedItem = _ref2.processedItem; + return { + display: instance.isItemActive(processedItem) ? "flex" : "none" + }; + }, "submenu") +}; +var classes$3 = { + root: /* @__PURE__ */ __name(function root8(_ref3) { + var instance = _ref3.instance; + return ["p-menubar p-component", { + "p-menubar-mobile": instance.queryMatches, + "p-menubar-mobile-active": instance.mobileActive + }]; + }, "root"), + start: "p-menubar-start", + button: "p-menubar-button", + rootList: "p-menubar-root-list", + item: /* @__PURE__ */ __name(function item(_ref4) { + var instance = _ref4.instance, processedItem = _ref4.processedItem; + return ["p-menubar-item", { + "p-menubar-item-active": instance.isItemActive(processedItem), + "p-focus": instance.isItemFocused(processedItem), + "p-disabled": instance.isItemDisabled(processedItem) + }]; + }, "item"), + itemContent: "p-menubar-item-content", + itemLink: "p-menubar-item-link", + itemIcon: "p-menubar-item-icon", + itemLabel: "p-menubar-item-label", + submenuIcon: "p-menubar-submenu-icon", + submenu: "p-menubar-submenu", + separator: "p-menubar-separator", + end: "p-menubar-end" +}; +var MenubarStyle = BaseStyle.extend({ + name: "menubar", + theme: theme$3, + classes: classes$3, + inlineStyles: inlineStyles$1 +}); +var script$2$1 = { + name: "BaseMenubar", + "extends": script$i, + props: { + model: { + type: Array, + "default": null + }, + buttonProps: { + type: null, + "default": null + }, + breakpoint: { + type: String, + "default": "960px" + }, + ariaLabelledby: { + type: String, + "default": null + }, + ariaLabel: { + type: String, + "default": null + } + }, + style: MenubarStyle, + provide: /* @__PURE__ */ __name(function provide10() { + return { + $pcMenubar: this, + $parentInstance: this + }; + }, "provide") +}; +var script$1$3 = { + name: "MenubarSub", + hostName: "Menubar", + "extends": script$i, + emits: ["item-mouseenter", "item-click", "item-mousemove"], + props: { + items: { + type: Array, + "default": null + }, + root: { + type: Boolean, + "default": false + }, + popup: { + type: Boolean, + "default": false + }, + mobileActive: { + type: Boolean, + "default": false + }, + templates: { + type: Object, + "default": null + }, + level: { + type: Number, + "default": 0 + }, + menuId: { + type: String, + "default": null + }, + focusedItemId: { + type: String, + "default": null + }, + activeItemPath: { + type: Object, + "default": null + } + }, + list: null, + methods: { + getItemId: /* @__PURE__ */ __name(function getItemId(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key); + }, "getItemId"), + getItemKey: /* @__PURE__ */ __name(function getItemKey(processedItem) { + return this.getItemId(processedItem); + }, "getItemKey"), + getItemProp: /* @__PURE__ */ __name(function getItemProp(processedItem, name, params) { + return processedItem && processedItem.item ? resolve(processedItem.item[name], params) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel(processedItem) { + return this.getItemProp(processedItem, "label"); + }, "getItemLabel"), + getItemLabelId: /* @__PURE__ */ __name(function getItemLabelId(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key, "_label"); + }, "getItemLabelId"), + getPTOptions: /* @__PURE__ */ __name(function getPTOptions4(processedItem, index, key) { + return this.ptm(key, { + context: { + item: processedItem.item, + index, + active: this.isItemActive(processedItem), + focused: this.isItemFocused(processedItem), + disabled: this.isItemDisabled(processedItem), + level: this.level + } + }); + }, "getPTOptions"), + isItemActive: /* @__PURE__ */ __name(function isItemActive(processedItem) { + return this.activeItemPath.some(function(path) { + return path.key === processedItem.key; + }); + }, "isItemActive"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible(processedItem) { + return this.getItemProp(processedItem, "visible") !== false; + }, "isItemVisible"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled(processedItem) { + return this.getItemProp(processedItem, "disabled"); + }, "isItemDisabled"), + isItemFocused: /* @__PURE__ */ __name(function isItemFocused(processedItem) { + return this.focusedItemId === this.getItemId(processedItem); + }, "isItemFocused"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup(processedItem) { + return isNotEmpty(processedItem.items); + }, "isItemGroup"), + onItemClick: /* @__PURE__ */ __name(function onItemClick(event, processedItem) { + this.getItemProp(processedItem, "command", { + originalEvent: event, + item: processedItem.item + }); + this.$emit("item-click", { + originalEvent: event, + processedItem, + isFocus: true + }); + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter(event, processedItem) { + this.$emit("item-mouseenter", { + originalEvent: event, + processedItem + }); + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove(event, processedItem) { + this.$emit("item-mousemove", { + originalEvent: event, + processedItem + }); + }, "onItemMouseMove"), + getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset2(index) { + return index - this.calculateAriaSetSize.slice(0, index).length + 1; + }, "getAriaPosInset"), + getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps(processedItem, index) { + return { + action: mergeProps({ + "class": this.cx("itemLink"), + tabindex: -1 + }, this.getPTOptions(processedItem, index, "itemLink")), + icon: mergeProps({ + "class": [this.cx("itemIcon"), this.getItemProp(processedItem, "icon")] + }, this.getPTOptions(processedItem, index, "itemIcon")), + label: mergeProps({ + "class": this.cx("itemLabel") + }, this.getPTOptions(processedItem, index, "itemLabel")), + submenuicon: mergeProps({ + "class": this.cx("submenuIcon") + }, this.getPTOptions(processedItem, index, "submenuIcon")) + }; + }, "getMenuItemProps") + }, + computed: { + calculateAriaSetSize: /* @__PURE__ */ __name(function calculateAriaSetSize() { + var _this = this; + return this.items.filter(function(processedItem) { + return _this.isItemVisible(processedItem) && _this.getItemProp(processedItem, "separator"); + }); + }, "calculateAriaSetSize"), + getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize() { + var _this2 = this; + return this.items.filter(function(processedItem) { + return _this2.isItemVisible(processedItem) && !_this2.getItemProp(processedItem, "separator"); + }).length; + }, "getAriaSetSize") + }, + components: { + AngleRightIcon: script$B, + AngleDownIcon: script$C + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$1$2 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"]; +var _hoisted_2$3 = ["onClick", "onMouseenter", "onMousemove"]; +var _hoisted_3$2 = ["href", "target"]; +var _hoisted_4$1 = ["id"]; +var _hoisted_5$1 = ["id"]; +function render$1$2(_ctx, _cache, $props, $setup, $data, $options) { + var _component_MenubarSub = resolveComponent("MenubarSub", true); + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("ul", mergeProps({ + "class": $props.level === 0 ? _ctx.cx("rootList") : _ctx.cx("submenu") + }, $props.level === 0 ? _ctx.ptm("rootList") : _ctx.ptm("submenu")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.items, function(processedItem, index) { + return openBlock(), createElementBlock(Fragment, { + key: $options.getItemKey(processedItem) + }, [$options.isItemVisible(processedItem) && !$options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ + key: 0, + id: $options.getItemId(processedItem), + style: $options.getItemProp(processedItem, "style"), + "class": [_ctx.cx("item", { + processedItem + }), $options.getItemProp(processedItem, "class")], + role: "menuitem", + "aria-label": $options.getItemLabel(processedItem), + "aria-disabled": $options.isItemDisabled(processedItem) || void 0, + "aria-expanded": $options.isItemGroup(processedItem) ? $options.isItemActive(processedItem) : void 0, + "aria-haspopup": $options.isItemGroup(processedItem) && !$options.getItemProp(processedItem, "to") ? "menu" : void 0, + "aria-level": $props.level + 1, + "aria-setsize": $options.getAriaSetSize, + "aria-posinset": $options.getAriaPosInset(index), + ref_for: true + }, $options.getPTOptions(processedItem, index, "item"), { + "data-p-active": $options.isItemActive(processedItem), + "data-p-focused": $options.isItemFocused(processedItem), + "data-p-disabled": $options.isItemDisabled(processedItem) + }), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("itemContent"), + onClick: /* @__PURE__ */ __name(function onClick2($event) { + return $options.onItemClick($event, processedItem); + }, "onClick"), + onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) { + return $options.onItemMouseEnter($event, processedItem); + }, "onMouseenter"), + onMousemove: /* @__PURE__ */ __name(function onMousemove($event) { + return $options.onItemMouseMove($event, processedItem); + }, "onMousemove"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemContent")), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({ + key: 0, + href: $options.getItemProp(processedItem, "url"), + "class": _ctx.cx("itemLink"), + target: $options.getItemProp(processedItem, "target"), + tabindex: "-1", + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLink")), [$props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), { + key: 0, + item: processedItem.item, + "class": normalizeClass(_ctx.cx("itemIcon")) + }, null, 8, ["item", "class"])) : $options.getItemProp(processedItem, "icon") ? (openBlock(), createElementBlock("span", mergeProps({ + key: 1, + "class": [_ctx.cx("itemIcon"), $options.getItemProp(processedItem, "icon")], + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemIcon")), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({ + id: $options.getItemLabelId(processedItem), + "class": _ctx.cx("itemLabel"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_4$1), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, { + key: 2 + }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), { + key: 0, + root: $props.root, + active: $options.isItemActive(processedItem), + "class": normalizeClass(_ctx.cx("submenuIcon")) + }, null, 8, ["root", "active", "class"])) : (openBlock(), createBlock(resolveDynamicComponent($props.root ? "AngleDownIcon" : "AngleRightIcon"), mergeProps({ + key: 1, + "class": _ctx.cx("submenuIcon"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_3$2)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), { + key: 1, + item: processedItem.item, + root: $props.root, + hasSubmenu: $options.getItemProp(processedItem, "items"), + label: $options.getItemLabel(processedItem), + props: $options.getMenuItemProps(processedItem, index) + }, null, 8, ["item", "root", "hasSubmenu", "label", "props"]))], 16, _hoisted_2$3), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_MenubarSub, { + key: 0, + id: $options.getItemId(processedItem) + "_list", + menuId: $props.menuId, + role: "menu", + style: normalizeStyle(_ctx.sx("submenu", true, { + processedItem + })), + focusedItemId: $props.focusedItemId, + items: processedItem.items, + mobileActive: $props.mobileActive, + activeItemPath: $props.activeItemPath, + templates: $props.templates, + level: $props.level + 1, + "aria-labelledby": $options.getItemLabelId(processedItem), + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onItemClick: _cache[0] || (_cache[0] = function($event) { + return _ctx.$emit("item-click", $event); + }), + onItemMouseenter: _cache[1] || (_cache[1] = function($event) { + return _ctx.$emit("item-mouseenter", $event); + }), + onItemMousemove: _cache[2] || (_cache[2] = function($event) { + return _ctx.$emit("item-mousemove", $event); + }) + }, null, 8, ["id", "menuId", "style", "focusedItemId", "items", "mobileActive", "activeItemPath", "templates", "level", "aria-labelledby", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_1$1$2)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ + key: 1, + id: $options.getItemId(processedItem), + "class": [_ctx.cx("separator"), $options.getItemProp(processedItem, "class")], + style: $options.getItemProp(processedItem, "style"), + role: "separator", + ref_for: true + }, _ctx.ptm("separator")), null, 16, _hoisted_5$1)) : createCommentVNode("", true)], 64); + }), 128))], 16); +} +__name(render$1$2, "render$1$2"); +script$1$3.render = render$1$2; +var script$5 = { + name: "Menubar", + "extends": script$2$1, + inheritAttrs: false, + emits: ["focus", "blur"], + matchMediaListener: null, + data: /* @__PURE__ */ __name(function data6() { + return { + id: this.$attrs.id, + mobileActive: false, + focused: false, + focusedItemInfo: { + index: -1, + level: 0, + parentKey: "" + }, + activeItemPath: [], + dirty: false, + query: null, + queryMatches: false + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId2(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + activeItemPath: /* @__PURE__ */ __name(function activeItemPath(newPath) { + if (isNotEmpty(newPath)) { + this.bindOutsideClickListener(); + this.bindResizeListener(); + } else { + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + } + }, "activeItemPath") + }, + outsideClickListener: null, + container: null, + menubar: null, + mounted: /* @__PURE__ */ __name(function mounted6() { + this.id = this.id || UniqueComponentId(); + this.bindMatchMediaListener(); + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount6() { + this.mobileActive = false; + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + this.unbindMatchMediaListener(); + if (this.container) { + ZIndex.clear(this.container); + } + this.container = null; + }, "beforeUnmount"), + methods: { + getItemProp: /* @__PURE__ */ __name(function getItemProp2(item3, name) { + return item3 ? resolve(item3[name]) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel2(item3) { + return this.getItemProp(item3, "label"); + }, "getItemLabel"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled2(item3) { + return this.getItemProp(item3, "disabled"); + }, "isItemDisabled"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible2(item3) { + return this.getItemProp(item3, "visible") !== false; + }, "isItemVisible"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup2(item3) { + return isNotEmpty(this.getItemProp(item3, "items")); + }, "isItemGroup"), + isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator(item3) { + return this.getItemProp(item3, "separator"); + }, "isItemSeparator"), + getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel(processedItem) { + return processedItem ? this.getItemLabel(processedItem.item) : void 0; + }, "getProccessedItemLabel"), + isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup(processedItem) { + return processedItem && isNotEmpty(processedItem.items); + }, "isProccessedItemGroup"), + toggle: /* @__PURE__ */ __name(function toggle(event) { + var _this = this; + if (this.mobileActive) { + this.mobileActive = false; + ZIndex.clear(this.menubar); + this.hide(); + } else { + this.mobileActive = true; + ZIndex.set("menu", this.menubar, this.$primevue.config.zIndex.menu); + setTimeout(function() { + _this.show(); + }, 1); + } + this.bindOutsideClickListener(); + event.preventDefault(); + }, "toggle"), + show: /* @__PURE__ */ __name(function show2() { + focus(this.menubar); + }, "show"), + hide: /* @__PURE__ */ __name(function hide2(event, isFocus) { + var _this2 = this; + if (this.mobileActive) { + this.mobileActive = false; + setTimeout(function() { + focus(_this2.$refs.menubutton); + }, 0); + } + this.activeItemPath = []; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + isFocus && focus(this.menubar); + this.dirty = false; + }, "hide"), + onFocus: /* @__PURE__ */ __name(function onFocus3(event) { + this.focused = true; + this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { + index: this.findFirstFocusedItemIndex(), + level: 0, + parentKey: "" + }; + this.$emit("focus", event); + }, "onFocus"), + onBlur: /* @__PURE__ */ __name(function onBlur2(event) { + this.focused = false; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + this.searchValue = ""; + this.dirty = false; + this.$emit("blur", event); + }, "onBlur"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown2(event) { + var metaKey = event.metaKey || event.ctrlKey; + switch (event.code) { + case "ArrowDown": + this.onArrowDownKey(event); + break; + case "ArrowUp": + this.onArrowUpKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "Space": + this.onSpaceKey(event); + break; + case "Enter": + case "NumpadEnter": + this.onEnterKey(event); + break; + case "Escape": + this.onEscapeKey(event); + break; + case "Tab": + this.onTabKey(event); + break; + case "PageDown": + case "PageUp": + case "Backspace": + case "ShiftLeft": + case "ShiftRight": + break; + default: + if (!metaKey && isPrintableCharacter(event.key)) { + this.searchItems(event, event.key); + } + break; + } + }, "onKeyDown"), + onItemChange: /* @__PURE__ */ __name(function onItemChange(event, type) { + var processedItem = event.processedItem, isFocus = event.isFocus; + if (isEmpty(processedItem)) return; + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey, items = processedItem.items; + var grouped = isNotEmpty(items); + var activeItemPath3 = this.activeItemPath.filter(function(p) { + return p.parentKey !== parentKey && p.parentKey !== key; + }); + grouped && activeItemPath3.push(processedItem); + this.focusedItemInfo = { + index, + level, + parentKey + }; + grouped && (this.dirty = true); + isFocus && focus(this.menubar); + if (type === "hover" && this.queryMatches) { + return; + } + this.activeItemPath = activeItemPath3; + }, "onItemChange"), + onItemClick: /* @__PURE__ */ __name(function onItemClick2(event) { + var originalEvent = event.originalEvent, processedItem = event.processedItem; + var grouped = this.isProccessedItemGroup(processedItem); + var root12 = isEmpty(processedItem.parent); + var selected = this.isSelected(processedItem); + if (selected) { + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey; + this.activeItemPath = this.activeItemPath.filter(function(p) { + return key !== p.key && key.startsWith(p.key); + }); + this.focusedItemInfo = { + index, + level, + parentKey + }; + this.dirty = !root12; + focus(this.menubar); + } else { + if (grouped) { + this.onItemChange(event); + } else { + var rootProcessedItem = root12 ? processedItem : this.activeItemPath.find(function(p) { + return p.parentKey === ""; + }); + this.hide(originalEvent); + this.changeFocusedItemIndex(originalEvent, rootProcessedItem ? rootProcessedItem.index : -1); + this.mobileActive = false; + focus(this.menubar); + } + } + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter2(event) { + if (this.dirty) { + this.onItemChange(event, "hover"); + } + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove2(event) { + if (this.focused) { + this.changeFocusedItemIndex(event, event.processedItem.index); + } + }, "onItemMouseMove"), + menuButtonClick: /* @__PURE__ */ __name(function menuButtonClick(event) { + this.toggle(event); + }, "menuButtonClick"), + menuButtonKeydown: /* @__PURE__ */ __name(function menuButtonKeydown(event) { + (event.code === "Enter" || event.code === "NumpadEnter" || event.code === "Space") && this.menuButtonClick(event); + }, "menuButtonKeydown"), + onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey2(event) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var root12 = processedItem ? isEmpty(processedItem.parent) : null; + if (root12) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + this.onArrowRightKey(event); + } + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + } + event.preventDefault(); + }, "onArrowDownKey"), + onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey2(event) { + var _this3 = this; + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var root12 = isEmpty(processedItem.parent); + if (root12) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + var itemIndex = this.findLastItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + } + } else { + var parentItem = this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }); + if (this.focusedItemInfo.index === 0) { + this.focusedItemInfo = { + index: -1, + parentKey: parentItem ? parentItem.parentKey : "" + }; + this.searchValue = ""; + this.onArrowLeftKey(event); + this.activeItemPath = this.activeItemPath.filter(function(p) { + return p.parentKey !== _this3.focusedItemInfo.parentKey; + }); + } else { + var _itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex(); + this.changeFocusedItemIndex(event, _itemIndex); + } + } + event.preventDefault(); + }, "onArrowUpKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey3(event) { + var _this4 = this; + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var parentItem = processedItem ? this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }) : null; + if (parentItem) { + this.onItemChange({ + originalEvent: event, + processedItem: parentItem + }); + this.activeItemPath = this.activeItemPath.filter(function(p) { + return p.parentKey !== _this4.focusedItemInfo.parentKey; + }); + event.preventDefault(); + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + } + }, "onArrowLeftKey"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey3(event) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var parentItem = processedItem ? this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }) : null; + if (parentItem) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + this.onArrowDownKey(event); + } + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + } + }, "onArrowRightKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey3(event) { + this.changeFocusedItemIndex(event, this.findFirstItemIndex()); + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey3(event) { + this.changeFocusedItemIndex(event, this.findLastItemIndex()); + event.preventDefault(); + }, "onEndKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey3(event) { + if (this.focusedItemInfo.index !== -1) { + var element = findSingle(this.menubar, 'li[id="'.concat("".concat(this.focusedItemId), '"]')); + var anchorElement = element && findSingle(element, 'a[data-pc-section="itemlink"]'); + anchorElement ? anchorElement.click() : element && element.click(); + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex()); + } + event.preventDefault(); + }, "onEnterKey"), + onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey(event) { + this.onEnterKey(event); + }, "onSpaceKey"), + onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey2(event) { + if (this.focusedItemInfo.level !== 0) { + var _focusedItemInfo = this.focusedItemInfo; + this.hide(event, false); + this.focusedItemInfo = { + index: Number(_focusedItemInfo.parentKey.split("_")[0]), + level: 0, + parentKey: "" + }; + } + event.preventDefault(); + }, "onEscapeKey"), + onTabKey: /* @__PURE__ */ __name(function onTabKey2(event) { + if (this.focusedItemInfo.index !== -1) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && this.onItemChange({ + originalEvent: event, + processedItem + }); + } + this.hide(); + }, "onTabKey"), + bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener2() { + var _this5 = this; + if (!this.outsideClickListener) { + this.outsideClickListener = function(event) { + var isOutsideContainer = _this5.container && !_this5.container.contains(event.target); + var isOutsideTarget = !(_this5.target && (_this5.target === event.target || _this5.target.contains(event.target))); + if (isOutsideContainer && isOutsideTarget) { + _this5.hide(); + } + }; + document.addEventListener("click", this.outsideClickListener); + } + }, "bindOutsideClickListener"), + unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener2() { + if (this.outsideClickListener) { + document.removeEventListener("click", this.outsideClickListener); + this.outsideClickListener = null; + } + }, "unbindOutsideClickListener"), + bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener2() { + var _this6 = this; + if (!this.resizeListener) { + this.resizeListener = function(event) { + if (!isTouchDevice()) { + _this6.hide(event, true); + } + _this6.mobileActive = false; + }; + window.addEventListener("resize", this.resizeListener); + } + }, "bindResizeListener"), + unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener2() { + if (this.resizeListener) { + window.removeEventListener("resize", this.resizeListener); + this.resizeListener = null; + } + }, "unbindResizeListener"), + bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener() { + var _this7 = this; + if (!this.matchMediaListener) { + var query = matchMedia("(max-width: ".concat(this.breakpoint, ")")); + this.query = query; + this.queryMatches = query.matches; + this.matchMediaListener = function() { + _this7.queryMatches = query.matches; + _this7.mobileActive = false; + }; + this.query.addEventListener("change", this.matchMediaListener); + } + }, "bindMatchMediaListener"), + unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener() { + if (this.matchMediaListener) { + this.query.removeEventListener("change", this.matchMediaListener); + this.matchMediaListener = null; + } + }, "unbindMatchMediaListener"), + isItemMatched: /* @__PURE__ */ __name(function isItemMatched(processedItem) { + var _this$getProccessedIt; + return this.isValidItem(processedItem) && ((_this$getProccessedIt = this.getProccessedItemLabel(processedItem)) === null || _this$getProccessedIt === void 0 ? void 0 : _this$getProccessedIt.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())); + }, "isItemMatched"), + isValidItem: /* @__PURE__ */ __name(function isValidItem(processedItem) { + return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item); + }, "isValidItem"), + isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem(processedItem) { + return this.isValidItem(processedItem) && this.isSelected(processedItem); + }, "isValidSelectedItem"), + isSelected: /* @__PURE__ */ __name(function isSelected2(processedItem) { + return this.activeItemPath.some(function(p) { + return p.key === processedItem.key; + }); + }, "isSelected"), + findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex() { + var _this8 = this; + return this.visibleItems.findIndex(function(processedItem) { + return _this8.isValidItem(processedItem); + }); + }, "findFirstItemIndex"), + findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex() { + var _this9 = this; + return findLastIndex(this.visibleItems, function(processedItem) { + return _this9.isValidItem(processedItem); + }); + }, "findLastItemIndex"), + findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex(index) { + var _this10 = this; + var matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex(function(processedItem) { + return _this10.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index; + }, "findNextItemIndex"), + findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex(index) { + var _this11 = this; + var matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems.slice(0, index), function(processedItem) { + return _this11.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex : index; + }, "findPrevItemIndex"), + findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex() { + var _this12 = this; + return this.visibleItems.findIndex(function(processedItem) { + return _this12.isValidSelectedItem(processedItem); + }); + }, "findSelectedItemIndex"), + findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex; + }, "findFirstFocusedItemIndex"), + findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex; + }, "findLastFocusedItemIndex"), + searchItems: /* @__PURE__ */ __name(function searchItems(event, _char) { + var _this13 = this; + this.searchValue = (this.searchValue || "") + _char; + var itemIndex = -1; + var matched = false; + if (this.focusedItemInfo.index !== -1) { + itemIndex = this.visibleItems.slice(this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }); + itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }) : itemIndex + this.focusedItemInfo.index; + } else { + itemIndex = this.visibleItems.findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }); + } + if (itemIndex !== -1) { + matched = true; + } + if (itemIndex === -1 && this.focusedItemInfo.index === -1) { + itemIndex = this.findFirstFocusedItemIndex(); + } + if (itemIndex !== -1) { + this.changeFocusedItemIndex(event, itemIndex); + } + if (this.searchTimeout) { + clearTimeout(this.searchTimeout); + } + this.searchTimeout = setTimeout(function() { + _this13.searchValue = ""; + _this13.searchTimeout = null; + }, 500); + return matched; + }, "searchItems"), + changeFocusedItemIndex: /* @__PURE__ */ __name(function changeFocusedItemIndex(event, index) { + if (this.focusedItemInfo.index !== index) { + this.focusedItemInfo.index = index; + this.scrollInView(); + } + }, "changeFocusedItemIndex"), + scrollInView: /* @__PURE__ */ __name(function scrollInView3() { + var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1; + var id2 = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedItemId; + var element = findSingle(this.menubar, 'li[id="'.concat(id2, '"]')); + if (element) { + element.scrollIntoView && element.scrollIntoView({ + block: "nearest", + inline: "start" + }); + } + }, "scrollInView"), + createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems(items) { + var _this14 = this; + var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ""; + var processedItems3 = []; + items && items.forEach(function(item3, index) { + var key = (parentKey !== "" ? parentKey + "_" : "") + index; + var newItem = { + item: item3, + index, + level, + key, + parent, + parentKey + }; + newItem["items"] = _this14.createProcessedItems(item3.items, level + 1, newItem, key); + processedItems3.push(newItem); + }); + return processedItems3; + }, "createProcessedItems"), + containerRef: /* @__PURE__ */ __name(function containerRef(el) { + this.container = el; + }, "containerRef"), + menubarRef: /* @__PURE__ */ __name(function menubarRef(el) { + this.menubar = el ? el.$el : void 0; + }, "menubarRef") + }, + computed: { + processedItems: /* @__PURE__ */ __name(function processedItems() { + return this.createProcessedItems(this.model || []); + }, "processedItems"), + visibleItems: /* @__PURE__ */ __name(function visibleItems() { + var _this15 = this; + var processedItem = this.activeItemPath.find(function(p) { + return p.key === _this15.focusedItemInfo.parentKey; + }); + return processedItem ? processedItem.items : this.processedItems; + }, "visibleItems"), + focusedItemId: /* @__PURE__ */ __name(function focusedItemId() { + return this.focusedItemInfo.index !== -1 ? "".concat(this.id).concat(isNotEmpty(this.focusedItemInfo.parentKey) ? "_" + this.focusedItemInfo.parentKey : "", "_").concat(this.focusedItemInfo.index) : null; + }, "focusedItemId") + }, + components: { + MenubarSub: script$1$3, + BarsIcon: script$D + } +}; +function _typeof(o) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof(o); +} +__name(_typeof, "_typeof"); +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys, "ownKeys"); +function _objectSpread(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread, "_objectSpread"); +function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty, "_defineProperty"); +function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : i + ""; +} +__name(_toPropertyKey, "_toPropertyKey"); +function _toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive, "_toPrimitive"); +var _hoisted_1$c = ["aria-haspopup", "aria-expanded", "aria-controls", "aria-label"]; +function render$9(_ctx, _cache, $props, $setup, $data, $options) { + var _component_BarsIcon = resolveComponent("BarsIcon"); + var _component_MenubarSub = resolveComponent("MenubarSub"); + return openBlock(), createElementBlock("div", mergeProps({ + ref: $options.containerRef, + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("start") + }, _ctx.ptm("start")), [renderSlot(_ctx.$slots, "start")], 16)) : createCommentVNode("", true), renderSlot(_ctx.$slots, _ctx.$slots.button ? "button" : "menubutton", { + id: $data.id, + "class": normalizeClass(_ctx.cx("button")), + toggleCallback: /* @__PURE__ */ __name(function toggleCallback(event) { + return $options.menuButtonClick(event); + }, "toggleCallback") + }, function() { + var _ctx$$primevue$config; + return [_ctx.model && _ctx.model.length > 0 ? (openBlock(), createElementBlock("a", mergeProps({ + key: 0, + ref: "menubutton", + role: "button", + tabindex: "0", + "class": _ctx.cx("button"), + "aria-haspopup": _ctx.model.length && _ctx.model.length > 0 ? true : false, + "aria-expanded": $data.mobileActive, + "aria-controls": $data.id, + "aria-label": (_ctx$$primevue$config = _ctx.$primevue.config.locale.aria) === null || _ctx$$primevue$config === void 0 ? void 0 : _ctx$$primevue$config.navigation, + onClick: _cache[0] || (_cache[0] = function($event) { + return $options.menuButtonClick($event); + }), + onKeydown: _cache[1] || (_cache[1] = function($event) { + return $options.menuButtonKeydown($event); + }) + }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.ptm("button"))), [renderSlot(_ctx.$slots, _ctx.$slots.buttonicon ? "buttonicon" : "menubuttonicon", {}, function() { + return [createVNode(_component_BarsIcon, normalizeProps(guardReactiveProps(_ctx.ptm("buttonicon"))), null, 16)]; + })], 16, _hoisted_1$c)) : createCommentVNode("", true)]; + }), createVNode(_component_MenubarSub, { + ref: $options.menubarRef, + id: $data.id + "_list", + role: "menubar", + items: $options.processedItems, + templates: _ctx.$slots, + root: true, + mobileActive: $data.mobileActive, + tabindex: "0", + "aria-activedescendant": $data.focused ? $options.focusedItemId : void 0, + menuId: $data.id, + focusedItemId: $data.focused ? $options.focusedItemId : void 0, + activeItemPath: $data.activeItemPath, + level: 0, + "aria-labelledby": _ctx.ariaLabelledby, + "aria-label": _ctx.ariaLabel, + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onFocus: $options.onFocus, + onBlur: $options.onBlur, + onKeydown: $options.onKeyDown, + onItemClick: $options.onItemClick, + onItemMouseenter: $options.onItemMouseEnter, + onItemMousemove: $options.onItemMouseMove + }, null, 8, ["id", "items", "templates", "mobileActive", "aria-activedescendant", "menuId", "focusedItemId", "activeItemPath", "aria-labelledby", "aria-label", "pt", "unstyled", "onFocus", "onBlur", "onKeydown", "onItemClick", "onItemMouseenter", "onItemMousemove"]), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({ + key: 1, + "class": _ctx.cx("end") + }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16); +} +__name(render$9, "render$9"); +script$5.render = render$9; +const _hoisted_1$b = ["href"]; +const _hoisted_2$2 = { class: "p-menubar-item-label" }; +const _hoisted_3$1 = { + key: 1, + class: "ml-auto border border-surface rounded text-muted text-xs p-1 keybinding-tag" +}; +const _sfc_main$6 = /* @__PURE__ */ defineComponent({ + __name: "CommandMenubar", + setup(__props) { + const settingStore = useSettingStore(); + const dropdownDirection = computed( + () => settingStore.get("Comfy.UseNewMenu") === "Top" ? "down" : "up" + ); + const menuItemsStore = useMenuItemStore(); + const { t } = useI18n(); + const translateMenuItem = /* @__PURE__ */ __name((item3) => { + const label = typeof item3.label === "function" ? item3.label() : item3.label; + const translatedLabel = label ? t(`menuLabels.${normalizeI18nKey(label)}`, label) : void 0; + return { + ...item3, + label: translatedLabel, + items: item3.items?.map(translateMenuItem) + }; + }, "translateMenuItem"); + const translatedItems = computed( + () => menuItemsStore.menuItems.map(translateMenuItem) + ); + return (_ctx, _cache) => { + return openBlock(), createBlock(unref(script$5), { + model: translatedItems.value, + class: "top-menubar border-none p-0 bg-transparent", + pt: { + rootList: "gap-0 flex-nowrap w-auto", + submenu: `dropdown-direction-${dropdownDirection.value}`, + item: "relative" + } + }, { + item: withCtx(({ item: item3, props }) => [ + createBaseVNode("a", mergeProps({ class: "p-menubar-item-link" }, props.action, { + href: item3.url, + target: "_blank" + }), [ + item3.icon ? (openBlock(), createElementBlock("span", { + key: 0, + class: normalizeClass(["p-menubar-item-icon", item3.icon]) + }, null, 2)) : createCommentVNode("", true), + createBaseVNode("span", _hoisted_2$2, toDisplayString(item3.label), 1), + item3?.comfyCommand?.keybinding ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(item3.comfyCommand.keybinding.combo.toString()), 1)) : createCommentVNode("", true) + ], 16, _hoisted_1$b) + ]), + _: 1 + }, 8, ["model", "pt"]); + }; + } +}); +const CommandMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-a2b12676"]]); +var theme$2 = /* @__PURE__ */ __name(function theme7(_ref) { + var dt = _ref.dt; + return "\n.p-panel {\n border: 1px solid ".concat(dt("panel.border.color"), ";\n border-radius: ").concat(dt("panel.border.radius"), ";\n background: ").concat(dt("panel.background"), ";\n color: ").concat(dt("panel.color"), ";\n}\n\n.p-panel-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: ").concat(dt("panel.header.padding"), ";\n background: ").concat(dt("panel.header.background"), ";\n color: ").concat(dt("panel.header.color"), ";\n border-style: solid;\n border-width: ").concat(dt("panel.header.border.width"), ";\n border-color: ").concat(dt("panel.header.border.color"), ";\n border-radius: ").concat(dt("panel.header.border.radius"), ";\n}\n\n.p-panel-toggleable .p-panel-header {\n padding: ").concat(dt("panel.toggleable.header.padding"), ";\n}\n\n.p-panel-title {\n line-height: 1;\n font-weight: ").concat(dt("panel.title.font.weight"), ";\n}\n\n.p-panel-content {\n padding: ").concat(dt("panel.content.padding"), ";\n}\n\n.p-panel-footer {\n padding: ").concat(dt("panel.footer.padding"), ";\n}\n"); +}, "theme"); +var classes$2 = { + root: /* @__PURE__ */ __name(function root9(_ref2) { + var props = _ref2.props; + return ["p-panel p-component", { + "p-panel-toggleable": props.toggleable + }]; + }, "root"), + header: "p-panel-header", + title: "p-panel-title", + headerActions: "p-panel-header-actions", + pcToggleButton: "p-panel-toggle-button", + contentContainer: "p-panel-content-container", + content: "p-panel-content", + footer: "p-panel-footer" +}; +var PanelStyle = BaseStyle.extend({ + name: "panel", + theme: theme$2, + classes: classes$2 +}); +var script$1$2 = { + name: "BasePanel", + "extends": script$i, + props: { + header: String, + toggleable: Boolean, + collapsed: Boolean, + toggleButtonProps: { + type: Object, + "default": /* @__PURE__ */ __name(function _default() { + return { + severity: "secondary", + text: true, + rounded: true + }; + }, "_default") + } + }, + style: PanelStyle, + provide: /* @__PURE__ */ __name(function provide11() { + return { + $pcPanel: this, + $parentInstance: this + }; + }, "provide") +}; +var script$4 = { + name: "Panel", + "extends": script$1$2, + inheritAttrs: false, + emits: ["update:collapsed", "toggle"], + data: /* @__PURE__ */ __name(function data7() { + return { + id: this.$attrs.id, + d_collapsed: this.collapsed + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId3(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + collapsed: /* @__PURE__ */ __name(function collapsed(newValue) { + this.d_collapsed = newValue; + }, "collapsed") + }, + mounted: /* @__PURE__ */ __name(function mounted7() { + this.id = this.id || UniqueComponentId(); + }, "mounted"), + methods: { + toggle: /* @__PURE__ */ __name(function toggle2(event) { + this.d_collapsed = !this.d_collapsed; + this.$emit("update:collapsed", this.d_collapsed); + this.$emit("toggle", { + originalEvent: event, + value: this.d_collapsed + }); + }, "toggle"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown3(event) { + if (event.code === "Enter" || event.code === "NumpadEnter" || event.code === "Space") { + this.toggle(event); + event.preventDefault(); + } + }, "onKeyDown") + }, + computed: { + buttonAriaLabel: /* @__PURE__ */ __name(function buttonAriaLabel() { + return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.header; + }, "buttonAriaLabel") + }, + components: { + PlusIcon: script$E, + MinusIcon: script$F, + Button: script$h + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$a = ["id"]; +var _hoisted_2$1 = ["id", "aria-labelledby"]; +function render$8(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Button = resolveComponent("Button"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("header") + }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header", { + id: $data.id + "_header", + "class": normalizeClass(_ctx.cx("title")) + }, function() { + return [_ctx.header ? (openBlock(), createElementBlock("span", mergeProps({ + key: 0, + id: $data.id + "_header", + "class": _ctx.cx("title") + }, _ctx.ptm("title")), toDisplayString(_ctx.header), 17, _hoisted_1$a)) : createCommentVNode("", true)]; + }), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("headerActions") + }, _ctx.ptm("headerActions")), [renderSlot(_ctx.$slots, "icons"), _ctx.toggleable ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 0, + id: $data.id + "_header", + "class": _ctx.cx("pcToggleButton"), + "aria-label": $options.buttonAriaLabel, + "aria-controls": $data.id + "_content", + "aria-expanded": !$data.d_collapsed, + unstyled: _ctx.unstyled, + onClick: $options.toggle, + onKeydown: $options.onKeyDown + }, _ctx.toggleButtonProps, { + pt: _ctx.ptm("pcToggleButton") + }), { + icon: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, _ctx.$slots.toggleicon ? "toggleicon" : "togglericon", { + collapsed: $data.d_collapsed + }, function() { + return [(openBlock(), createBlock(resolveDynamicComponent($data.d_collapsed ? "PlusIcon" : "MinusIcon"), mergeProps({ + "class": slotProps["class"] + }, _ctx.ptm("pcToggleButton")["icon"]), null, 16, ["class"]))]; + })]; + }), + _: 3 + }, 16, ["id", "class", "aria-label", "aria-controls", "aria-expanded", "unstyled", "onClick", "onKeydown", "pt"])) : createCommentVNode("", true)], 16)], 16), createVNode(Transition, mergeProps({ + name: "p-toggleable-content" + }, _ctx.ptm("transition")), { + "default": withCtx(function() { + return [withDirectives(createBaseVNode("div", mergeProps({ + id: $data.id + "_content", + "class": _ctx.cx("contentContainer"), + role: "region", + "aria-labelledby": $data.id + "_header" + }, _ctx.ptm("contentContainer")), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("content") + }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("footer") + }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 16, _hoisted_2$1), [[vShow, !$data.d_collapsed]])]; + }), + _: 3 + }, 16)], 16); +} +__name(render$8, "render$8"); +script$4.render = render$8; +const _hoisted_1$9 = { +======== +const _hoisted_1$c = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +function render$7(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$9, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "M6 4v16m4-16l10 8l-10 8z" + }, null, -1) + ])); +======== +const _hoisted_2$a = /* @__PURE__ */ createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "M6 4v16m4-16l10 8l-10 8z" +}, null, -1); +const _hoisted_3$9 = [ + _hoisted_2$a +]; +function render$9(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$c, [..._hoisted_3$9]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +} +__name(render$9, "render$9"); +const __unplugin_components_3 = markRaw({ name: "lucide-step-forward", render: render$9 }); +const _hoisted_1$b = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +function render$6(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$8, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m13 19l9-7l-9-7zM2 19l9-7l-9-7z" + }, null, -1) + ])); +======== +const _hoisted_2$9 = /* @__PURE__ */ createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m13 19l9-7l-9-7zM2 19l9-7l-9-7z" +}, null, -1); +const _hoisted_3$8 = [ + _hoisted_2$9 +]; +function render$8(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$b, [..._hoisted_3$8]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +} +__name(render$8, "render$8"); +const __unplugin_components_2 = markRaw({ name: "lucide-fast-forward", render: render$8 }); +const _hoisted_1$a = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +function render$5(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$7, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m6 3l14 9l-14 9z" + }, null, -1) + ])); +======== +const _hoisted_2$8 = /* @__PURE__ */ createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m6 3l14 9l-14 9z" +}, null, -1); +const _hoisted_3$7 = [ + _hoisted_2$8 +]; +function render$7(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$a, [..._hoisted_3$7]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +} +__name(render$7, "render$7"); +const __unplugin_components_1$1 = markRaw({ name: "lucide-play", render: render$7 }); +const _hoisted_1$9 = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +function render$4(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [ + createBaseVNode("g", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2" + }, [ + createBaseVNode("path", { d: "M16 12H3m13 6H3m7-12H3m18 12V8a2 2 0 0 0-2-2h-5" }), + createBaseVNode("path", { d: "m16 8l-2-2l2-2" }) + ], -1) + ])); +======== +const _hoisted_2$7 = /* @__PURE__ */ createBaseVNode("g", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2" +}, [ + /* @__PURE__ */ createBaseVNode("path", { d: "M16 12H3m13 6H3m7-12H3m18 12V8a2 2 0 0 0-2-2h-5" }), + /* @__PURE__ */ createBaseVNode("path", { d: "m16 8l-2-2l2-2" }) +], -1); +const _hoisted_3$6 = [ + _hoisted_2$7 +]; +function render$6(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._hoisted_3$6]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +} +__name(render$6, "render$6"); +const __unplugin_components_0$1 = markRaw({ name: "lucide-list-start", render: render$6 }); +var theme$2 = /* @__PURE__ */ __name(function theme6(_ref) { + var dt = _ref.dt; + return "\n.p-tieredmenu {\n background: ".concat(dt("tieredmenu.background"), ";\n color: ").concat(dt("tieredmenu.color"), ";\n border: 1px solid ").concat(dt("tieredmenu.border.color"), ";\n border-radius: ").concat(dt("tieredmenu.border.radius"), ";\n min-width: 12.5rem;\n}\n\n.p-tieredmenu-root-list,\n.p-tieredmenu-submenu {\n margin: 0;\n padding: ").concat(dt("tieredmenu.list.padding"), ";\n list-style: none;\n outline: 0 none;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("tieredmenu.list.gap"), ";\n}\n\n.p-tieredmenu-submenu {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n background: ").concat(dt("tieredmenu.background"), ";\n color: ").concat(dt("tieredmenu.color"), ";\n border: 1px solid ").concat(dt("tieredmenu.border.color"), ";\n border-radius: ").concat(dt("tieredmenu.border.radius"), ";\n box-shadow: ").concat(dt("tieredmenu.shadow"), ";\n}\n\n.p-tieredmenu-item {\n position: relative;\n}\n\n.p-tieredmenu-item-content {\n transition: background ").concat(dt("tieredmenu.transition.duration"), ", color ").concat(dt("tieredmenu.transition.duration"), ";\n border-radius: ").concat(dt("tieredmenu.item.border.radius"), ";\n color: ").concat(dt("tieredmenu.item.color"), ";\n}\n\n.p-tieredmenu-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ").concat(dt("tieredmenu.item.padding"), ";\n gap: ").concat(dt("tieredmenu.item.gap"), ";\n user-select: none;\n outline: 0 none;\n}\n\n.p-tieredmenu-item-label {\n line-height: 1;\n}\n\n.p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.color"), ";\n}\n\n.p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.color"), ";\n margin-left: auto;\n font-size: ").concat(dt("tieredmenu.submenu.icon.size"), ";\n width: ").concat(dt("tieredmenu.submenu.icon.size"), ";\n height: ").concat(dt("tieredmenu.submenu.icon.size"), ";\n}\n\n.p-tieredmenu-submenu-icon:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n}\n\n.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content {\n color: ").concat(dt("tieredmenu.item.focus.color"), ";\n background: ").concat(dt("tieredmenu.item.focus.background"), ";\n}\n\n.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover {\n color: ").concat(dt("tieredmenu.item.focus.color"), ";\n background: ").concat(dt("tieredmenu.item.focus.background"), ";\n}\n\n.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.focus.color"), ";\n}\n\n.p-tieredmenu-item-active > .p-tieredmenu-item-content {\n color: ").concat(dt("tieredmenu.item.active.color"), ";\n background: ").concat(dt("tieredmenu.item.active.background"), ";\n}\n\n.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-item-icon {\n color: ").concat(dt("tieredmenu.item.icon.active.color"), ";\n}\n\n.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {\n color: ").concat(dt("tieredmenu.submenu.icon.active.color"), ";\n}\n\n.p-tieredmenu-separator {\n border-block-start: 1px solid ").concat(dt("tieredmenu.separator.border.color"), ";\n}\n\n.p-tieredmenu-overlay {\n box-shadow: ").concat(dt("tieredmenu.shadow"), ";\n}\n\n.p-tieredmenu-enter-from,\n.p-tieredmenu-leave-active {\n opacity: 0;\n}\n\n.p-tieredmenu-enter-active {\n transition: opacity 250ms;\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-submenu {\n position: static;\n box-shadow: none;\n border: 0 none;\n padding-inline-start: ").concat(dt("tieredmenu.submenu.mobile.indent"), ";\n padding-inline-end: 0;\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-submenu:dir(rtl) {\n padding-inline-start: 0;\n padding-inline-end: ").concat(dt("tieredmenu.submenu.mobile.indent"), ";\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-submenu-icon {\n transition: transform 0.2s;\n transform: rotate(90deg);\n}\n\n.p-tieredmenu-mobile .p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {\n transform: rotate(-90deg);\n}\n"); +}, "theme"); +var inlineStyles$1 = { + submenu: /* @__PURE__ */ __name(function submenu(_ref2) { + var instance = _ref2.instance, processedItem = _ref2.processedItem; + return { + display: instance.isItemActive(processedItem) ? "flex" : "none" + }; + }, "submenu") +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +var classes$1 = { + root: /* @__PURE__ */ __name(function root10(_ref3) { + var props = _ref3.props, instance = _ref3.instance; +======== +var classes$2 = { + root: /* @__PURE__ */ __name(function root8(_ref3) { + _ref3.instance; + var props = _ref3.props; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + return ["p-tieredmenu p-component", { + "p-tieredmenu-overlay": props.popup, + "p-tieredmenu-mobile": instance.queryMatches + }]; + }, "root"), + start: "p-tieredmenu-start", + rootList: "p-tieredmenu-root-list", + item: /* @__PURE__ */ __name(function item(_ref4) { + var instance = _ref4.instance, processedItem = _ref4.processedItem; + return ["p-tieredmenu-item", { + "p-tieredmenu-item-active": instance.isItemActive(processedItem), + "p-focus": instance.isItemFocused(processedItem), + "p-disabled": instance.isItemDisabled(processedItem) + }]; + }, "item"), + itemContent: "p-tieredmenu-item-content", + itemLink: "p-tieredmenu-item-link", + itemIcon: "p-tieredmenu-item-icon", + itemLabel: "p-tieredmenu-item-label", + submenuIcon: "p-tieredmenu-submenu-icon", + submenu: "p-tieredmenu-submenu", + separator: "p-tieredmenu-separator", + end: "p-tieredmenu-end" +}; +var TieredMenuStyle = BaseStyle.extend({ + name: "tieredmenu", + theme: theme$2, + classes: classes$2, + inlineStyles: inlineStyles$1 +}); +var script$2$1 = { + name: "BaseTieredMenu", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + props: { + popup: { + type: Boolean, + "default": false + }, + model: { + type: Array, + "default": null + }, + appendTo: { + type: [String, Object], + "default": "body" + }, + breakpoint: { + type: String, + "default": "960px" + }, + autoZIndex: { + type: Boolean, + "default": true + }, + baseZIndex: { + type: Number, + "default": 0 + }, + disabled: { + type: Boolean, + "default": false + }, + tabindex: { + type: Number, + "default": 0 + }, + ariaLabelledby: { + type: String, + "default": null + }, + ariaLabel: { + type: String, + "default": null + } + }, + style: TieredMenuStyle, + provide: /* @__PURE__ */ __name(function provide10() { + return { + $pcTieredMenu: this, + $parentInstance: this + }; + }, "provide") +}; +var script$1$2 = { + name: "TieredMenuSub", + hostName: "TieredMenu", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + emits: ["item-click", "item-mouseenter", "item-mousemove"], + container: null, + props: { + menuId: { + type: String, + "default": null + }, + focusedItemId: { + type: String, + "default": null + }, + items: { + type: Array, + "default": null + }, + visible: { + type: Boolean, + "default": false + }, + level: { + type: Number, + "default": 0 + }, + templates: { + type: Object, + "default": null + }, + activeItemPath: { + type: Object, + "default": null + }, + tabindex: { + type: Number, + "default": 0 + } + }, + methods: { + getItemId: /* @__PURE__ */ __name(function getItemId(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key); + }, "getItemId"), + getItemKey: /* @__PURE__ */ __name(function getItemKey(processedItem) { + return this.getItemId(processedItem); + }, "getItemKey"), + getItemProp: /* @__PURE__ */ __name(function getItemProp(processedItem, name, params) { + return processedItem && processedItem.item ? resolve(processedItem.item[name], params) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel(processedItem) { + return this.getItemProp(processedItem, "label"); + }, "getItemLabel"), + getItemLabelId: /* @__PURE__ */ __name(function getItemLabelId(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key, "_label"); + }, "getItemLabelId"), + getPTOptions: /* @__PURE__ */ __name(function getPTOptions4(processedItem, index, key) { + return this.ptm(key, { + context: { + item: processedItem.item, + index, + active: this.isItemActive(processedItem), + focused: this.isItemFocused(processedItem), + disabled: this.isItemDisabled(processedItem) + } + }); + }, "getPTOptions"), + isItemActive: /* @__PURE__ */ __name(function isItemActive(processedItem) { + return this.activeItemPath.some(function(path) { + return path.key === processedItem.key; + }); + }, "isItemActive"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible(processedItem) { + return this.getItemProp(processedItem, "visible") !== false; + }, "isItemVisible"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled(processedItem) { + return this.getItemProp(processedItem, "disabled"); + }, "isItemDisabled"), + isItemFocused: /* @__PURE__ */ __name(function isItemFocused(processedItem) { + return this.focusedItemId === this.getItemId(processedItem); + }, "isItemFocused"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup(processedItem) { + return isNotEmpty(processedItem.items); + }, "isItemGroup"), + onEnter: /* @__PURE__ */ __name(function onEnter2() { + nestedPosition(this.container, this.level); + }, "onEnter"), + onItemClick: /* @__PURE__ */ __name(function onItemClick(event, processedItem) { + this.getItemProp(processedItem, "command", { + originalEvent: event, + item: processedItem.item + }); + this.$emit("item-click", { + originalEvent: event, + processedItem, + isFocus: true + }); + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter(event, processedItem) { + this.$emit("item-mouseenter", { + originalEvent: event, + processedItem + }); + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove(event, processedItem) { + this.$emit("item-mousemove", { + originalEvent: event, + processedItem + }); + }, "onItemMouseMove"), + getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize() { + var _this = this; + return this.items.filter(function(processedItem) { + return _this.isItemVisible(processedItem) && !_this.getItemProp(processedItem, "separator"); + }).length; + }, "getAriaSetSize"), + getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset2(index) { + var _this2 = this; + return index - this.items.slice(0, index).filter(function(processedItem) { + return _this2.isItemVisible(processedItem) && _this2.getItemProp(processedItem, "separator"); + }).length + 1; + }, "getAriaPosInset"), + getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps(processedItem, index) { + return { + action: mergeProps({ + "class": this.cx("itemLink"), + tabindex: -1 + }, this.getPTOptions(processedItem, index, "itemLink")), + icon: mergeProps({ + "class": [this.cx("itemIcon"), this.getItemProp(processedItem, "icon")] + }, this.getPTOptions(processedItem, index, "itemIcon")), + label: mergeProps({ + "class": this.cx("itemLabel") + }, this.getPTOptions(processedItem, index, "itemLabel")), + submenuicon: mergeProps({ + "class": this.cx("submenuIcon") + }, this.getPTOptions(processedItem, index, "submenuIcon")) + }; + }, "getMenuItemProps"), + containerRef: /* @__PURE__ */ __name(function containerRef(el) { + this.container = el; + }, "containerRef") + }, + components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + AngleRightIcon: script$B +======== + AngleRightIcon: script$w +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }, + directives: { + ripple: Ripple + } +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +var _hoisted_1$1$1 = ["tabindex"]; +var _hoisted_2 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"]; +var _hoisted_3 = ["onClick", "onMouseenter", "onMousemove"]; +var _hoisted_4 = ["href", "target"]; +var _hoisted_5 = ["id"]; +======== +var _hoisted_1$1$2 = ["tabindex"]; +var _hoisted_2$6 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"]; +var _hoisted_3$5 = ["onClick", "onMouseenter", "onMousemove"]; +var _hoisted_4$1 = ["href", "target"]; +var _hoisted_5$1 = ["id"]; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +var _hoisted_6 = ["id"]; +function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_AngleRightIcon = resolveComponent("AngleRightIcon"); + var _component_TieredMenuSub = resolveComponent("TieredMenuSub", true); + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createBlock(Transition, mergeProps({ + name: "p-tieredmenu", + onEnter: $options.onEnter + }, _ctx.ptm("menu.transition")), { + "default": withCtx(function() { + return [($props.level === 0 ? true : $props.visible) ? (openBlock(), createElementBlock("ul", { + key: 0, + ref: $options.containerRef, + tabindex: $props.tabindex + }, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.items, function(processedItem, index) { + return openBlock(), createElementBlock(Fragment, { + key: $options.getItemKey(processedItem) + }, [$options.isItemVisible(processedItem) && !$options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ + key: 0, + id: $options.getItemId(processedItem), + style: $options.getItemProp(processedItem, "style"), + "class": [_ctx.cx("item", { + processedItem + }), $options.getItemProp(processedItem, "class")], + role: "menuitem", + "aria-label": $options.getItemLabel(processedItem), + "aria-disabled": $options.isItemDisabled(processedItem) || void 0, + "aria-expanded": $options.isItemGroup(processedItem) ? $options.isItemActive(processedItem) : void 0, + "aria-haspopup": $options.isItemGroup(processedItem) && !$options.getItemProp(processedItem, "to") ? "menu" : void 0, + "aria-level": $props.level + 1, + "aria-setsize": $options.getAriaSetSize(), + "aria-posinset": $options.getAriaPosInset(index), + ref_for: true + }, $options.getPTOptions(processedItem, index, "item"), { + "data-p-active": $options.isItemActive(processedItem), + "data-p-focused": $options.isItemFocused(processedItem), + "data-p-disabled": $options.isItemDisabled(processedItem) + }), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("itemContent"), + onClick: /* @__PURE__ */ __name(function onClick2($event) { + return $options.onItemClick($event, processedItem); + }, "onClick"), + onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) { + return $options.onItemMouseEnter($event, processedItem); + }, "onMouseenter"), + onMousemove: /* @__PURE__ */ __name(function onMousemove($event) { + return $options.onItemMouseMove($event, processedItem); + }, "onMousemove"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemContent")), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({ + key: 0, + href: $options.getItemProp(processedItem, "url"), + "class": _ctx.cx("itemLink"), + target: $options.getItemProp(processedItem, "target"), + tabindex: "-1", + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLink")), [$props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), { + key: 0, + item: processedItem.item, + "class": normalizeClass(_ctx.cx("itemIcon")) + }, null, 8, ["item", "class"])) : $options.getItemProp(processedItem, "icon") ? (openBlock(), createElementBlock("span", mergeProps({ + key: 1, + "class": [_ctx.cx("itemIcon"), $options.getItemProp(processedItem, "icon")], + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemIcon")), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({ + id: $options.getItemLabelId(processedItem), + "class": _ctx.cx("itemLabel"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_5$1), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, { + key: 2 + }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), mergeProps({ + key: 0, + "class": _ctx.cx("submenuIcon"), + active: $options.isItemActive(processedItem), + ref_for: true + }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class", "active"])) : (openBlock(), createBlock(_component_AngleRightIcon, mergeProps({ + key: 1, + "class": _ctx.cx("submenuIcon"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_4$1)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), { + key: 1, + item: processedItem.item, + hasSubmenu: $options.getItemProp(processedItem, "items"), + label: $options.getItemLabel(processedItem), + props: $options.getMenuItemProps(processedItem, index) +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + }, null, 8, ["item", "hasSubmenu", "label", "props"]))], 16, _hoisted_3), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_TieredMenuSub, mergeProps({ +======== + }, null, 8, ["item", "hasSubmenu", "label", "props"]))], 16, _hoisted_3$5), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_TieredMenuSub, { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 0, + id: $options.getItemId(processedItem) + "_list", + "class": _ctx.cx("submenu"), + style: _ctx.sx("submenu", true, { + processedItem + }), + "aria-labelledby": $options.getItemLabelId(processedItem), + role: "menu", + menuId: $props.menuId, + focusedItemId: $props.focusedItemId, + items: processedItem.items, + templates: $props.templates, + activeItemPath: $props.activeItemPath, + level: $props.level + 1, + visible: $options.isItemActive(processedItem) && $options.isItemGroup(processedItem), + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onItemClick: _cache[0] || (_cache[0] = function($event) { + return _ctx.$emit("item-click", $event); + }), + onItemMouseenter: _cache[1] || (_cache[1] = function($event) { + return _ctx.$emit("item-mouseenter", $event); + }), + onItemMousemove: _cache[2] || (_cache[2] = function($event) { + return _ctx.$emit("item-mousemove", $event); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + }), + ref_for: true + }, _ctx.ptm("submenu")), null, 16, ["id", "class", "style", "aria-labelledby", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "level", "visible", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_2)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ +======== + }) + }, null, 8, ["id", "style", "aria-labelledby", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "level", "visible", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_2$6)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + key: 1, + id: $options.getItemId(processedItem), + style: $options.getItemProp(processedItem, "style"), + "class": [_ctx.cx("separator"), $options.getItemProp(processedItem, "class")], + role: "separator", + ref_for: true + }, _ctx.ptm("separator")), null, 16, _hoisted_6)) : createCommentVNode("", true)], 64); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + }), 128))], 8, _hoisted_1$1$1)) : createCommentVNode("", true)]; +======== + }), 128))], 16, _hoisted_1$1$2)) : createCommentVNode("", true)]; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }), + _: 1 + }, 16, ["onEnter"]); +} +__name(render$1$1, "render$1$1"); +script$1$2.render = render$1$1; +var script$4 = { + name: "TieredMenu", + "extends": script$2$1, + inheritAttrs: false, + emits: ["focus", "blur", "before-show", "before-hide", "hide", "show"], + outsideClickListener: null, + matchMediaListener: null, + scrollHandler: null, + resizeListener: null, + target: null, + container: null, + menubar: null, + searchTimeout: null, + searchValue: null, + data: /* @__PURE__ */ __name(function data6() { + return { + id: this.$attrs.id, + focused: false, + focusedItemInfo: { + index: -1, + level: 0, + parentKey: "" + }, + activeItemPath: [], + visible: !this.popup, + submenuVisible: false, + dirty: false, + query: null, + queryMatches: false + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId2(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + activeItemPath: /* @__PURE__ */ __name(function activeItemPath(newPath) { + if (!this.popup) { + if (isNotEmpty(newPath)) { + this.bindOutsideClickListener(); + this.bindResizeListener(); + } else { + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + } + } + }, "activeItemPath") + }, + mounted: /* @__PURE__ */ __name(function mounted6() { + this.id = this.id || UniqueComponentId(); + this.bindMatchMediaListener(); + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount6() { + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + this.unbindMatchMediaListener(); + if (this.scrollHandler) { + this.scrollHandler.destroy(); + this.scrollHandler = null; + } + if (this.container && this.autoZIndex) { + ZIndex.clear(this.container); + } + this.target = null; + this.container = null; + }, "beforeUnmount"), + methods: { + getItemProp: /* @__PURE__ */ __name(function getItemProp2(item3, name) { + return item3 ? resolve(item3[name]) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel2(item3) { + return this.getItemProp(item3, "label"); + }, "getItemLabel"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled2(item3) { + return this.getItemProp(item3, "disabled"); + }, "isItemDisabled"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible2(item3) { + return this.getItemProp(item3, "visible") !== false; + }, "isItemVisible"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup2(item3) { + return isNotEmpty(this.getItemProp(item3, "items")); + }, "isItemGroup"), + isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator(item3) { + return this.getItemProp(item3, "separator"); + }, "isItemSeparator"), + getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel(processedItem) { + return processedItem ? this.getItemLabel(processedItem.item) : void 0; + }, "getProccessedItemLabel"), + isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup(processedItem) { + return processedItem && isNotEmpty(processedItem.items); + }, "isProccessedItemGroup"), + toggle: /* @__PURE__ */ __name(function toggle(event) { + this.visible ? this.hide(event, true) : this.show(event); + }, "toggle"), + show: /* @__PURE__ */ __name(function show2(event, isFocus) { + if (this.popup) { + this.$emit("before-show"); + this.visible = true; + this.target = this.target || event.currentTarget; + this.relatedTarget = event.relatedTarget || null; + } + isFocus && focus(this.menubar); + }, "show"), + hide: /* @__PURE__ */ __name(function hide2(event, isFocus) { + if (this.popup) { + this.$emit("before-hide"); + this.visible = false; + } + this.activeItemPath = []; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + isFocus && focus(this.relatedTarget || this.target || this.menubar); + this.dirty = false; + }, "hide"), + onFocus: /* @__PURE__ */ __name(function onFocus3(event) { + this.focused = true; + if (!this.popup) { + this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { + index: this.findFirstFocusedItemIndex(), + level: 0, + parentKey: "" + }; + } + this.$emit("focus", event); + }, "onFocus"), + onBlur: /* @__PURE__ */ __name(function onBlur2(event) { + this.focused = false; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + this.searchValue = ""; + this.dirty = false; + this.$emit("blur", event); + }, "onBlur"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown2(event) { + if (this.disabled) { + event.preventDefault(); + return; + } + var metaKey = event.metaKey || event.ctrlKey; + switch (event.code) { + case "ArrowDown": + this.onArrowDownKey(event); + break; + case "ArrowUp": + this.onArrowUpKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "Space": + this.onSpaceKey(event); + break; + case "Enter": + case "NumpadEnter": + this.onEnterKey(event); + break; + case "Escape": + this.onEscapeKey(event); + break; + case "Tab": + this.onTabKey(event); + break; + case "PageDown": + case "PageUp": + case "Backspace": + case "ShiftLeft": + case "ShiftRight": + break; + default: + if (!metaKey && isPrintableCharacter(event.key)) { + this.searchItems(event, event.key); + } + break; + } + }, "onKeyDown"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + onItemChange: /* @__PURE__ */ __name(function onItemChange2(event, type) { +======== + onItemChange: /* @__PURE__ */ __name(function onItemChange(event) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var processedItem = event.processedItem, isFocus = event.isFocus; + if (isEmpty(processedItem)) return; + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey, items = processedItem.items; + var grouped = isNotEmpty(items); + var activeItemPath3 = this.activeItemPath.filter(function(p) { + return p.parentKey !== parentKey && p.parentKey !== key; + }); + if (grouped) { + activeItemPath3.push(processedItem); + this.submenuVisible = true; + } + this.focusedItemInfo = { + index, + level, + parentKey + }; + grouped && (this.dirty = true); + isFocus && focus(this.menubar); + if (type === "hover" && this.queryMatches) { + return; + } + this.activeItemPath = activeItemPath3; + }, "onItemChange"), + onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick2(event) { + OverlayEventBus.emit("overlay-click", { + originalEvent: event, + target: this.target + }); + }, "onOverlayClick"), + onItemClick: /* @__PURE__ */ __name(function onItemClick2(event) { + var originalEvent = event.originalEvent, processedItem = event.processedItem; + var grouped = this.isProccessedItemGroup(processedItem); + var root11 = isEmpty(processedItem.parent); + var selected = this.isSelected(processedItem); + if (selected) { + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey; + this.activeItemPath = this.activeItemPath.filter(function(p) { + return key !== p.key && key.startsWith(p.key); + }); + this.focusedItemInfo = { + index, + level, + parentKey + }; + this.dirty = !root11; + focus(this.menubar); + } else { + if (grouped) { + this.onItemChange(event); + } else { + var rootProcessedItem = root11 ? processedItem : this.activeItemPath.find(function(p) { + return p.parentKey === ""; + }); + this.hide(originalEvent); + this.changeFocusedItemIndex(originalEvent, rootProcessedItem ? rootProcessedItem.index : -1); + focus(this.menubar); + } + } + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter2(event) { + if (this.dirty) { + this.onItemChange(event, "hover"); + } + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove2(event) { + if (this.focused) { + this.changeFocusedItemIndex(event, event.processedItem.index); + } + }, "onItemMouseMove"), + onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey2(event) { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + }, "onArrowDownKey"), + onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey2(event) { + if (event.altKey) { + if (this.focusedItemInfo.index !== -1) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && this.onItemChange({ + originalEvent: event, + processedItem + }); + } + this.popup && this.hide(event, true); + event.preventDefault(); + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + } + }, "onArrowUpKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey3(event) { + var _this = this; + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var parentItem = this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }); + var root11 = isEmpty(processedItem.parent); + if (!root11) { + this.focusedItemInfo = { + index: -1, + parentKey: parentItem ? parentItem.parentKey : "" + }; + this.searchValue = ""; + this.onArrowDownKey(event); + } + this.activeItemPath = this.activeItemPath.filter(function(p) { + return p.parentKey !== _this.focusedItemInfo.parentKey; + }); + event.preventDefault(); + }, "onArrowLeftKey"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey3(event) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + this.searchValue = ""; + this.onArrowDownKey(event); + } + event.preventDefault(); + }, "onArrowRightKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey3(event) { + this.changeFocusedItemIndex(event, this.findFirstItemIndex()); + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey3(event) { + this.changeFocusedItemIndex(event, this.findLastItemIndex()); + event.preventDefault(); + }, "onEndKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey3(event) { + if (this.focusedItemInfo.index !== -1) { + var element = findSingle(this.menubar, 'li[id="'.concat("".concat(this.focusedItemId), '"]')); + var anchorElement = element && findSingle(element, '[data-pc-section="itemlink"]'); + anchorElement ? anchorElement.click() : element && element.click(); + if (!this.popup) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex()); + } + } + event.preventDefault(); + }, "onEnterKey"), + onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey(event) { + this.onEnterKey(event); + }, "onSpaceKey"), + onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey2(event) { + if (this.popup || this.focusedItemInfo.level !== 0) { + var _focusedItemInfo = this.focusedItemInfo; + this.hide(event, false); + this.focusedItemInfo = { + index: Number(_focusedItemInfo.parentKey.split("_")[0]), + level: 0, + parentKey: "" + }; + this.popup && focus(this.target); + } + event.preventDefault(); + }, "onEscapeKey"), + onTabKey: /* @__PURE__ */ __name(function onTabKey2(event) { + if (this.focusedItemInfo.index !== -1) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && this.onItemChange({ + originalEvent: event, + processedItem + }); + } + this.hide(); + }, "onTabKey"), + onEnter: /* @__PURE__ */ __name(function onEnter3(el) { + if (this.autoZIndex) { + ZIndex.set("menu", el, this.baseZIndex + this.$primevue.config.zIndex.menu); + } + addStyle(el, { + position: "absolute", + top: "0", + left: "0" + }); + this.alignOverlay(); + focus(this.menubar); + this.scrollInView(); + }, "onEnter"), + onAfterEnter: /* @__PURE__ */ __name(function onAfterEnter() { + this.bindOutsideClickListener(); + this.bindScrollListener(); + this.bindResizeListener(); + this.$emit("show"); + }, "onAfterEnter"), + onLeave: /* @__PURE__ */ __name(function onLeave2() { + this.unbindOutsideClickListener(); + this.unbindScrollListener(); + this.unbindResizeListener(); + this.$emit("hide"); + this.container = null; + this.dirty = false; + }, "onLeave"), + onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave(el) { + if (this.autoZIndex) { + ZIndex.clear(el); + } + }, "onAfterLeave"), + alignOverlay: /* @__PURE__ */ __name(function alignOverlay2() { + absolutePosition(this.container, this.target); + var targetWidth = getOuterWidth(this.target); + if (targetWidth > getOuterWidth(this.container)) { + this.container.style.minWidth = getOuterWidth(this.target) + "px"; + } + }, "alignOverlay"), + bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener2() { + var _this2 = this; + if (!this.outsideClickListener) { + this.outsideClickListener = function(event) { + var isOutsideContainer = _this2.container && !_this2.container.contains(event.target); + var isOutsideTarget = _this2.popup ? !(_this2.target && (_this2.target === event.target || _this2.target.contains(event.target))) : true; + if (isOutsideContainer && isOutsideTarget) { + _this2.hide(); + } + }; + document.addEventListener("click", this.outsideClickListener); + } + }, "bindOutsideClickListener"), + unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener2() { + if (this.outsideClickListener) { + document.removeEventListener("click", this.outsideClickListener); + this.outsideClickListener = null; + } + }, "unbindOutsideClickListener"), + bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener2() { + var _this3 = this; + if (!this.scrollHandler) { + this.scrollHandler = new ConnectedOverlayScrollHandler(this.target, function(event) { + _this3.hide(event, true); + }); + } + this.scrollHandler.bindScrollListener(); + }, "bindScrollListener"), + unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener2() { + if (this.scrollHandler) { + this.scrollHandler.unbindScrollListener(); + } + }, "unbindScrollListener"), + bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener2() { + var _this4 = this; + if (!this.resizeListener) { + this.resizeListener = function(event) { + if (!isTouchDevice()) { + _this4.hide(event, true); + } + }; + window.addEventListener("resize", this.resizeListener); + } + }, "bindResizeListener"), + unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener2() { + if (this.resizeListener) { + window.removeEventListener("resize", this.resizeListener); + this.resizeListener = null; + } + }, "unbindResizeListener"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener2() { + var _this5 = this; + if (!this.matchMediaListener) { + var query = matchMedia("(max-width: ".concat(this.breakpoint, ")")); + this.query = query; + this.queryMatches = query.matches; + this.matchMediaListener = function() { + _this5.queryMatches = query.matches; + }; + this.query.addEventListener("change", this.matchMediaListener); + } + }, "bindMatchMediaListener"), + unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener2() { + if (this.matchMediaListener) { + this.query.removeEventListener("change", this.matchMediaListener); + this.matchMediaListener = null; + } + }, "unbindMatchMediaListener"), + isItemMatched: /* @__PURE__ */ __name(function isItemMatched2(processedItem) { +======== + isItemMatched: /* @__PURE__ */ __name(function isItemMatched(processedItem) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var _this$getProccessedIt; + return this.isValidItem(processedItem) && ((_this$getProccessedIt = this.getProccessedItemLabel(processedItem)) === null || _this$getProccessedIt === void 0 ? void 0 : _this$getProccessedIt.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())); + }, "isItemMatched"), + isValidItem: /* @__PURE__ */ __name(function isValidItem(processedItem) { + return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item); + }, "isValidItem"), + isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem(processedItem) { + return this.isValidItem(processedItem) && this.isSelected(processedItem); + }, "isValidSelectedItem"), + isSelected: /* @__PURE__ */ __name(function isSelected2(processedItem) { + return this.activeItemPath.some(function(p) { + return p.key === processedItem.key; + }); + }, "isSelected"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex2() { + var _this6 = this; +======== + findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex() { + var _this5 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + return this.visibleItems.findIndex(function(processedItem) { + return _this6.isValidItem(processedItem); + }); + }, "findFirstItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex2() { + var _this7 = this; +======== + findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex() { + var _this6 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + return findLastIndex(this.visibleItems, function(processedItem) { + return _this7.isValidItem(processedItem); + }); + }, "findLastItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex2(index) { + var _this8 = this; +======== + findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex(index) { + var _this7 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex(function(processedItem) { + return _this8.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index; + }, "findNextItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex2(index) { + var _this9 = this; +======== + findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex(index) { + var _this8 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems.slice(0, index), function(processedItem) { + return _this9.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex : index; + }, "findPrevItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex2() { + var _this10 = this; +======== + findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex() { + var _this9 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + return this.visibleItems.findIndex(function(processedItem) { + return _this10.isValidSelectedItem(processedItem); + }); + }, "findSelectedItemIndex"), + findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex; + }, "findFirstFocusedItemIndex"), + findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex; + }, "findLastFocusedItemIndex"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + searchItems: /* @__PURE__ */ __name(function searchItems2(event, _char) { + var _this11 = this; +======== + searchItems: /* @__PURE__ */ __name(function searchItems(event, _char) { + var _this10 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + this.searchValue = (this.searchValue || "") + _char; + var itemIndex = -1; + var matched = false; + if (this.focusedItemInfo.index !== -1) { + itemIndex = this.visibleItems.slice(this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this11.isItemMatched(processedItem); + }); + itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this11.isItemMatched(processedItem); + }) : itemIndex + this.focusedItemInfo.index; + } else { + itemIndex = this.visibleItems.findIndex(function(processedItem) { + return _this11.isItemMatched(processedItem); + }); + } + if (itemIndex !== -1) { + matched = true; + } + if (itemIndex === -1 && this.focusedItemInfo.index === -1) { + itemIndex = this.findFirstFocusedItemIndex(); + } + if (itemIndex !== -1) { + this.changeFocusedItemIndex(event, itemIndex); + } + if (this.searchTimeout) { + clearTimeout(this.searchTimeout); + } + this.searchTimeout = setTimeout(function() { + _this11.searchValue = ""; + _this11.searchTimeout = null; + }, 500); + return matched; + }, "searchItems"), + changeFocusedItemIndex: /* @__PURE__ */ __name(function changeFocusedItemIndex(event, index) { + if (this.focusedItemInfo.index !== index) { + this.focusedItemInfo.index = index; + this.scrollInView(); + } + }, "changeFocusedItemIndex"), + scrollInView: /* @__PURE__ */ __name(function scrollInView3() { + var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1; + var id2 = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedItemId; + var element = findSingle(this.menubar, 'li[id="'.concat(id2, '"]')); + if (element) { + element.scrollIntoView && element.scrollIntoView({ + block: "nearest", + inline: "start" + }); + } + }, "scrollInView"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems2(items) { + var _this12 = this; +======== + createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems(items) { + var _this11 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ""; + var processedItems3 = []; + items && items.forEach(function(item3, index) { + var key = (parentKey !== "" ? parentKey + "_" : "") + index; + var newItem = { + item: item3, + index, + level, + key, + parent, + parentKey + }; + newItem["items"] = _this12.createProcessedItems(item3.items, level + 1, newItem, key); + processedItems3.push(newItem); + }); + return processedItems3; + }, "createProcessedItems"), + containerRef: /* @__PURE__ */ __name(function containerRef2(el) { + this.container = el; + }, "containerRef"), + menubarRef: /* @__PURE__ */ __name(function menubarRef(el) { + this.menubar = el ? el.$el : void 0; + }, "menubarRef") + }, + computed: { + processedItems: /* @__PURE__ */ __name(function processedItems() { + return this.createProcessedItems(this.model || []); + }, "processedItems"), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + visibleItems: /* @__PURE__ */ __name(function visibleItems2() { + var _this13 = this; +======== + visibleItems: /* @__PURE__ */ __name(function visibleItems() { + var _this12 = this; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + var processedItem = this.activeItemPath.find(function(p) { + return p.key === _this13.focusedItemInfo.parentKey; + }); + return processedItem ? processedItem.items : this.processedItems; + }, "visibleItems"), + focusedItemId: /* @__PURE__ */ __name(function focusedItemId() { + return this.focusedItemInfo.index !== -1 ? "".concat(this.id).concat(isNotEmpty(this.focusedItemInfo.parentKey) ? "_" + this.focusedItemInfo.parentKey : "", "_").concat(this.focusedItemInfo.index) : null; + }, "focusedItemId") + }, + components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + TieredMenuSub: script$1$1, + Portal: script$p +======== + TieredMenuSub: script$1$2, + Portal: script$k +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + } +}; +var _hoisted_1$8 = ["id"]; +function render$5(_ctx, _cache, $props, $setup, $data, $options) { + var _component_TieredMenuSub = resolveComponent("TieredMenuSub"); + var _component_Portal = resolveComponent("Portal"); + return openBlock(), createBlock(_component_Portal, { + appendTo: _ctx.appendTo, + disabled: !_ctx.popup + }, { + "default": withCtx(function() { + return [createVNode(Transition, mergeProps({ + name: "p-connected-overlay", + onEnter: $options.onEnter, + onAfterEnter: $options.onAfterEnter, + onLeave: $options.onLeave, + onAfterLeave: $options.onAfterLeave + }, _ctx.ptm("transition")), { + "default": withCtx(function() { + return [$data.visible ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + ref: $options.containerRef, + id: $data.id, + "class": _ctx.cx("root"), + onClick: _cache[0] || (_cache[0] = function() { + return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments); + }) + }, _ctx.ptmi("root")), [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("start") + }, _ctx.ptm("start")), [renderSlot(_ctx.$slots, "start")], 16)) : createCommentVNode("", true), createVNode(_component_TieredMenuSub, mergeProps({ + ref: $options.menubarRef, + id: $data.id + "_list", + "class": _ctx.cx("rootList"), + tabindex: !_ctx.disabled ? _ctx.tabindex : -1, + role: "menubar", + "aria-label": _ctx.ariaLabel, + "aria-labelledby": _ctx.ariaLabelledby, + "aria-disabled": _ctx.disabled || void 0, + "aria-orientation": "vertical", + "aria-activedescendant": $data.focused ? $options.focusedItemId : void 0, + menuId: $data.id, + focusedItemId: $data.focused ? $options.focusedItemId : void 0, + items: $options.processedItems, + templates: _ctx.$slots, + activeItemPath: $data.activeItemPath, + level: 0, + visible: $data.submenuVisible, + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onFocus: $options.onFocus, + onBlur: $options.onBlur, + onKeydown: $options.onKeyDown, + onItemClick: $options.onItemClick, + onItemMouseenter: $options.onItemMouseEnter, + onItemMousemove: $options.onItemMouseMove + }, _ctx.ptm("rootList")), null, 16, ["id", "class", "tabindex", "aria-label", "aria-labelledby", "aria-disabled", "aria-activedescendant", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "visible", "pt", "unstyled", "onFocus", "onBlur", "onKeydown", "onItemClick", "onItemMouseenter", "onItemMousemove"]), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({ + key: 1, + "class": _ctx.cx("end") + }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16, _hoisted_1$8)) : createCommentVNode("", true)]; + }), + _: 3 + }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])]; + }), + _: 3 + }, 8, ["appendTo", "disabled"]); +} +__name(render$5, "render$5"); +script$4.render = render$5; +var theme$1 = /* @__PURE__ */ __name(function theme7(_ref) { + var dt = _ref.dt; + return "\n.p-splitbutton {\n display: inline-flex;\n position: relative;\n border-radius: ".concat(dt("splitbutton.border.radius"), ";\n}\n\n.p-splitbutton-button {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n border-inline-end: 0 none;\n}\n\n.p-splitbutton-button:focus-visible,\n.p-splitbutton-dropdown:focus-visible {\n z-index: 1;\n}\n\n.p-splitbutton-button:not(:disabled):hover,\n.p-splitbutton-button:not(:disabled):active {\n border-inline-end: 0 none;\n}\n\n.p-splitbutton-dropdown {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.p-splitbutton .p-menu {\n min-width: 100%;\n}\n\n.p-splitbutton-fluid {\n display: flex;\n}\n\n.p-splitbutton-rounded .p-splitbutton-dropdown {\n border-start-end-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n border-end-end-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n}\n\n.p-splitbutton-rounded .p-splitbutton-button {\n border-start-start-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n border-end-start-radius: ").concat(dt("splitbutton.rounded.border.radius"), ";\n}\n\n.p-splitbutton-raised {\n box-shadow: ").concat(dt("splitbutton.raised.shadow"), ";\n}\n"); +}, "theme"); +var classes$1 = { + root: /* @__PURE__ */ __name(function root9(_ref2) { + var instance = _ref2.instance, props = _ref2.props; + return ["p-splitbutton p-component", { + "p-splitbutton-raised": props.raised, + "p-splitbutton-rounded": props.rounded, + "p-splitbutton-fluid": instance.hasFluid + }]; + }, "root"), + pcButton: "p-splitbutton-button", + pcDropdown: "p-splitbutton-dropdown" +}; +var SplitButtonStyle = BaseStyle.extend({ + name: "splitbutton", + theme: theme$1, + classes: classes$1 +}); +var script$1$1 = { + name: "BaseSplitButton", +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + "extends": script$i, +======== + "extends": script$e, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + props: { + label: { + type: String, + "default": null + }, + icon: { + type: String, + "default": null + }, + model: { + type: Array, + "default": null + }, + autoZIndex: { + type: Boolean, + "default": true + }, + baseZIndex: { + type: Number, + "default": 0 + }, + appendTo: { + type: [String, Object], + "default": "body" + }, + disabled: { + type: Boolean, + "default": false + }, + fluid: { + type: Boolean, + "default": null + }, + "class": { + type: null, + "default": null + }, + style: { + type: null, + "default": null + }, + buttonProps: { + type: null, + "default": null + }, + menuButtonProps: { + type: null, + "default": null + }, + menuButtonIcon: { + type: String, + "default": void 0 + }, + dropdownIcon: { + type: String, + "default": void 0 + }, + severity: { + type: String, + "default": null + }, + raised: { + type: Boolean, + "default": false + }, + rounded: { + type: Boolean, + "default": false + }, + text: { + type: Boolean, + "default": false + }, + outlined: { + type: Boolean, + "default": false + }, + size: { + type: String, + "default": null + }, + plain: { + type: Boolean, + "default": false + } + }, + style: SplitButtonStyle, + provide: /* @__PURE__ */ __name(function provide11() { + return { + $pcSplitButton: this, + $parentInstance: this + }; + }, "provide") +}; +var script$3 = { + name: "SplitButton", + "extends": script$1$1, + inheritAttrs: false, + emits: ["click"], + inject: { + $pcFluid: { + "default": null + } + }, + data: /* @__PURE__ */ __name(function data7() { + return { + id: this.$attrs.id, + isExpanded: false + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId3(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId") + }, + mounted: /* @__PURE__ */ __name(function mounted7() { + var _this = this; + this.id = this.id || UniqueComponentId(); + this.$watch("$refs.menu.visible", function(newValue) { + _this.isExpanded = newValue; + }); + }, "mounted"), + methods: { + onDropdownButtonClick: /* @__PURE__ */ __name(function onDropdownButtonClick(event) { + if (event) { + event.preventDefault(); + } + this.$refs.menu.toggle({ + currentTarget: this.$el, + relatedTarget: this.$refs.button.$el + }); + this.isExpanded = this.$refs.menu.visible; + }, "onDropdownButtonClick"), + onDropdownKeydown: /* @__PURE__ */ __name(function onDropdownKeydown(event) { + if (event.code === "ArrowDown" || event.code === "ArrowUp") { + this.onDropdownButtonClick(); + event.preventDefault(); + } + }, "onDropdownKeydown"), + onDefaultButtonClick: /* @__PURE__ */ __name(function onDefaultButtonClick(event) { + if (this.isExpanded) { + this.$refs.menu.hide(event); + } + this.$emit("click", event); + }, "onDefaultButtonClick") + }, + computed: { + containerClass: /* @__PURE__ */ __name(function containerClass() { + return [this.cx("root"), this["class"]]; + }, "containerClass"), + hasFluid: /* @__PURE__ */ __name(function hasFluid() { + return isEmpty(this.fluid) ? !!this.$pcFluid : this.fluid; + }, "hasFluid") + }, + components: { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + PVSButton: script$h, + PVSMenu: script$3, + ChevronDownIcon: script$q +======== + PVSButton: script$d, + PVSMenu: script$4, + ChevronDownIcon: script$l +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + } +}; +var _hoisted_1$7 = ["data-p-severity"]; +function render$4(_ctx, _cache, $props, $setup, $data, $options) { + var _component_PVSButton = resolveComponent("PVSButton"); + var _component_PVSMenu = resolveComponent("PVSMenu"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": $options.containerClass, + style: _ctx.style + }, _ctx.ptmi("root"), { + "data-p-severity": _ctx.severity + }), [createVNode(_component_PVSButton, mergeProps({ + type: "button", + "class": _ctx.cx("pcButton"), + label: _ctx.label, + disabled: _ctx.disabled, + severity: _ctx.severity, + text: _ctx.text, + icon: _ctx.icon, + outlined: _ctx.outlined, + size: _ctx.size, + fluid: _ctx.fluid, + "aria-label": _ctx.label, + onClick: $options.onDefaultButtonClick + }, _ctx.buttonProps, { + pt: _ctx.ptm("pcButton"), + unstyled: _ctx.unstyled + }), createSlots({ + "default": withCtx(function() { + return [renderSlot(_ctx.$slots, "default")]; + }), + _: 2 + }, [_ctx.$slots.icon ? { + name: "icon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "icon", { + "class": normalizeClass(slotProps["class"]) + }, function() { + return [createBaseVNode("span", mergeProps({ + "class": [_ctx.icon, slotProps["class"]] + }, _ctx.ptm("pcButton")["icon"], { + "data-pc-section": "buttonicon" + }), null, 16)]; + })]; + }), + key: "0" + } : void 0]), 1040, ["class", "label", "disabled", "severity", "text", "icon", "outlined", "size", "fluid", "aria-label", "onClick", "pt", "unstyled"]), createVNode(_component_PVSButton, mergeProps({ + ref: "button", + type: "button", + "class": _ctx.cx("pcDropdown"), + disabled: _ctx.disabled, + "aria-haspopup": "true", + "aria-expanded": $data.isExpanded, + "aria-controls": $data.id + "_overlay", + onClick: $options.onDropdownButtonClick, + onKeydown: $options.onDropdownKeydown, + severity: _ctx.severity, + text: _ctx.text, + outlined: _ctx.outlined, + size: _ctx.size, + unstyled: _ctx.unstyled + }, _ctx.menuButtonProps, { + pt: _ctx.ptm("pcDropdown") + }), { + icon: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, _ctx.$slots.dropdownicon ? "dropdownicon" : "menubuttonicon", { + "class": normalizeClass(slotProps["class"]) + }, function() { + return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.menuButtonIcon || _ctx.dropdownIcon ? "span" : "ChevronDownIcon"), mergeProps({ + "class": [_ctx.dropdownIcon || _ctx.menuButtonIcon, slotProps["class"]] + }, _ctx.ptm("pcDropdown")["icon"], { + "data-pc-section": "menubuttonicon" + }), null, 16, ["class"]))]; + })]; + }), + _: 3 + }, 16, ["class", "disabled", "aria-expanded", "aria-controls", "onClick", "onKeydown", "severity", "text", "outlined", "size", "unstyled", "pt"]), createVNode(_component_PVSMenu, { + ref: "menu", + id: $data.id + "_overlay", + model: _ctx.model, + popup: true, + autoZIndex: _ctx.autoZIndex, + baseZIndex: _ctx.baseZIndex, + appendTo: _ctx.appendTo, + unstyled: _ctx.unstyled, + pt: _ctx.ptm("pcMenu") + }, createSlots({ + _: 2 + }, [_ctx.$slots.menuitemicon ? { + name: "itemicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "menuitemicon", { + item: slotProps.item, + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "0" + } : void 0, _ctx.$slots.item ? { + name: "item", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "item", { + item: slotProps.item, + hasSubmenu: slotProps.hasSubmenu, + label: slotProps.label, + props: slotProps.props + })]; + }), + key: "1" + } : void 0]), 1032, ["id", "model", "autoZIndex", "baseZIndex", "appendTo", "unstyled", "pt"])], 16, _hoisted_1$7); +} +__name(render$4, "render$4"); +script$3.render = render$4; +const minQueueCount = 1; +const _sfc_main$8 = /* @__PURE__ */ defineComponent({ + __name: "BatchCountEdit", + props: { + class: { default: "" } + }, + setup(__props) { + const props = __props; + const queueSettingsStore = useQueueSettingsStore(); + const { batchCount } = storeToRefs(queueSettingsStore); + const settingStore = useSettingStore(); + const maxQueueCount = computed( + () => settingStore.get("Comfy.QueueButton.BatchCountLimit") + ); + const handleClick = /* @__PURE__ */ __name((increment) => { + let newCount; + if (increment) { + const originalCount = batchCount.value - 1; + newCount = Math.min(originalCount * 2, maxQueueCount.value); + } else { + const originalCount = batchCount.value + 1; + newCount = Math.floor(originalCount / 2); + } + batchCount.value = newCount; + }, "handleClick"); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return withDirectives((openBlock(), createElementBlock("div", { + class: normalizeClass(["batch-count", props.class]) + }, [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(unref(script$G), { +======== + createVNode(unref(script$x), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + class: "w-14", + modelValue: unref(batchCount), + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(batchCount) ? batchCount.value = $event : null), + min: minQueueCount, + max: maxQueueCount.value, + fluid: "", + showButtons: "", + pt: { + incrementButton: { + class: "w-6", + onmousedown: /* @__PURE__ */ __name(() => { + handleClick(true); + }, "onmousedown") + }, + decrementButton: { + class: "w-6", + onmousedown: /* @__PURE__ */ __name(() => { + handleClick(false); + }, "onmousedown") + } + } + }, null, 8, ["modelValue", "max", "pt"]) + ], 2)), [ + [ + _directive_tooltip, + _ctx.$t("menu.batchCount"), + void 0, + { bottom: true } + ] + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-1163a5d2"]]); +const _hoisted_1$3 = { class: "queue-button-group flex" }; +const _sfc_main$4 = /* @__PURE__ */ defineComponent({ +======== +const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-b9328350"]]); +const _withScopeId$3 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-7f4f551b"), n = n(), popScopeId(), n), "_withScopeId$3"); +const _hoisted_1$6 = { class: "queue-button-group flex" }; +const _sfc_main$7 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + __name: "ComfyQueueButton", + setup(__props) { + const workspaceStore = useWorkspaceStore(); + const queueCountStore = storeToRefs(useQueuePendingTaskCountStore()); + const { mode: queueMode } = storeToRefs(useQueueSettingsStore()); + const { t } = useI18n(); + const queueModeMenuItemLookup = computed(() => ({ + disabled: { + key: "disabled", + label: t("menu.queue"), + tooltip: t("menu.disabledTooltip"), + command: /* @__PURE__ */ __name(() => { + queueMode.value = "disabled"; + }, "command") + }, + instant: { + key: "instant", + label: `${t("menu.queue")} (${t("menu.instant")})`, + tooltip: t("menu.instantTooltip"), + command: /* @__PURE__ */ __name(() => { + queueMode.value = "instant"; + }, "command") + }, + change: { + key: "change", + label: `${t("menu.queue")} (${t("menu.onChange")})`, + tooltip: t("menu.onChangeTooltip"), + command: /* @__PURE__ */ __name(() => { + queueMode.value = "change"; + }, "command") + } + })); + const activeQueueModeMenuItem = computed( + () => queueModeMenuItemLookup.value[queueMode.value] + ); + const queueModeMenuItems = computed( + () => Object.values(queueModeMenuItemLookup.value) + ); + const executingPrompt = computed(() => !!queueCountStore.count.value); + const hasPendingTasks = computed(() => queueCountStore.count.value > 1); + const commandStore = useCommandStore(); + const queuePrompt = /* @__PURE__ */ __name((e) => { + const commandId = e.shiftKey ? "Comfy.QueuePromptFront" : "Comfy.QueuePrompt"; + commandStore.execute(commandId); + }, "queuePrompt"); + return (_ctx, _cache) => { + const _component_i_lucide58list_start = __unplugin_components_0$1; + const _component_i_lucide58play = __unplugin_components_1$1; + const _component_i_lucide58fast_forward = __unplugin_components_2; + const _component_i_lucide58step_forward = __unplugin_components_3; + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createElementBlock("div", _hoisted_1$6, [ + withDirectives((openBlock(), createBlock(unref(script$3), { + class: "comfyui-queue-button", + label: activeQueueModeMenuItem.value.label, + severity: "primary", + size: "small", + onClick: queuePrompt, + model: queueModeMenuItems.value, + "data-testid": "queue-button" + }, { + icon: withCtx(() => [ + unref(workspaceStore).shiftDown ? (openBlock(), createBlock(_component_i_lucide58list_start, { key: 0 })) : unref(queueMode) === "disabled" ? (openBlock(), createBlock(_component_i_lucide58play, { key: 1 })) : unref(queueMode) === "instant" ? (openBlock(), createBlock(_component_i_lucide58fast_forward, { key: 2 })) : unref(queueMode) === "change" ? (openBlock(), createBlock(_component_i_lucide58step_forward, { key: 3 })) : createCommentVNode("", true) + ]), + item: withCtx(({ item: item3 }) => [ +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + withDirectives(createVNode(unref(script$h), { +======== + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + label: item3.label, + icon: item3.icon, + severity: item3.key === unref(queueMode) ? "primary" : "secondary", + size: "small", + text: "" + }, null, 8, ["label", "icon", "severity"]), [ + [_directive_tooltip, item3.tooltip] + ]) + ]), + _: 1 + }, 8, ["label", "model"])), [ + [ + _directive_tooltip, + unref(workspaceStore).shiftDown ? _ctx.$t("menu.queueWorkflowFront") : _ctx.$t("menu.queueWorkflow"), + void 0, + { bottom: true } + ] + ]), + createVNode(BatchCountEdit), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(unref(script$9), { class: "execution-actions flex flex-nowrap" }, { + default: withCtx(() => [ + withDirectives(createVNode(unref(script$h), { +======== + createVNode(unref(script$8), { class: "execution-actions flex flex-nowrap" }, { + default: withCtx(() => [ + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + icon: "pi pi-times", + severity: executingPrompt.value ? "danger" : "secondary", + disabled: !executingPrompt.value, + text: "", + onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.Interrupt")) + }, null, 8, ["severity", "disabled"]), [ + [ + _directive_tooltip, + _ctx.$t("menu.interrupt"), + void 0, + { bottom: true } + ] + ]), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + withDirectives(createVNode(unref(script$h), { +======== + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + icon: "pi pi-stop", + severity: hasPendingTasks.value ? "danger" : "secondary", + disabled: !hasPendingTasks.value, + text: "", + onClick: _cache[1] || (_cache[1] = () => unref(commandStore).execute("Comfy.ClearPendingTasks")) + }, null, 8, ["severity", "disabled"]), [ + [ + _directive_tooltip, + _ctx.$t("sideToolbar.queueTab.clearPendingTasks"), + void 0, + { bottom: true } + ] + ]) + ]), + _: 1 + }) + ]); + }; + } +}); +const ComfyQueueButton = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-7f4f551b"]]); +const overlapThreshold = 20; +const _sfc_main$6 = /* @__PURE__ */ defineComponent({ + __name: "ComfyActionbar", + setup(__props) { + const settingsStore = useSettingStore(); + const visible = computed( + () => settingsStore.get("Comfy.UseNewMenu") !== "Disabled" + ); + const panelRef = ref(null); + const dragHandleRef = ref(null); + const isDocked = useLocalStorage("Comfy.MenuPosition.Docked", false); + const storedPosition = useLocalStorage("Comfy.MenuPosition.Floating", { + x: 0, + y: 0 + }); + const { + x, + y, + style, + isDragging + } = useDraggable(panelRef, { + initialValue: { x: 0, y: 0 }, + handle: dragHandleRef, + containerElement: document.body + }); + watchDebounced( + [x, y], + ([newX, newY]) => { + storedPosition.value = { x: newX, y: newY }; + }, + { debounce: 300 } + ); + const setInitialPosition = /* @__PURE__ */ __name(() => { + if (x.value !== 0 || y.value !== 0) { + return; + } + if (storedPosition.value.x !== 0 || storedPosition.value.y !== 0) { + x.value = storedPosition.value.x; + y.value = storedPosition.value.y; + captureLastDragState(); + return; + } + if (panelRef.value) { + const screenWidth = window.innerWidth; + const screenHeight = window.innerHeight; + const menuWidth = panelRef.value.offsetWidth; + const menuHeight = panelRef.value.offsetHeight; + if (menuWidth === 0 || menuHeight === 0) { + return; + } + x.value = (screenWidth - menuWidth) / 2; + y.value = screenHeight - menuHeight - 10; + captureLastDragState(); + } + }, "setInitialPosition"); + onMounted(setInitialPosition); + watch(visible, (newVisible) => { + if (newVisible) { + nextTick(setInitialPosition); + } + }); + const lastDragState = ref({ + x: x.value, + y: y.value, + windowWidth: window.innerWidth, + windowHeight: window.innerHeight + }); + const captureLastDragState = /* @__PURE__ */ __name(() => { + lastDragState.value = { + x: x.value, + y: y.value, + windowWidth: window.innerWidth, + windowHeight: window.innerHeight + }; + }, "captureLastDragState"); + watch( + isDragging, + (newIsDragging) => { + if (!newIsDragging) { + captureLastDragState(); + } + }, + { immediate: true } + ); + const adjustMenuPosition = /* @__PURE__ */ __name(() => { + if (panelRef.value) { + const screenWidth = window.innerWidth; + const screenHeight = window.innerHeight; + const menuWidth = panelRef.value.offsetWidth; + const menuHeight = panelRef.value.offsetHeight; + const distanceLeft = lastDragState.value.x; + const distanceRight = lastDragState.value.windowWidth - (lastDragState.value.x + menuWidth); + const distanceTop = lastDragState.value.y; + const distanceBottom = lastDragState.value.windowHeight - (lastDragState.value.y + menuHeight); + const distances = [ + { edge: "left", distance: distanceLeft }, + { edge: "right", distance: distanceRight }, + { edge: "top", distance: distanceTop }, + { edge: "bottom", distance: distanceBottom } + ]; + const closestEdge = distances.reduce( + (min, curr) => curr.distance < min.distance ? curr : min + ); + const verticalRatio = lastDragState.value.y / lastDragState.value.windowHeight; + const horizontalRatio = lastDragState.value.x / lastDragState.value.windowWidth; + if (closestEdge.edge === "left") { + x.value = closestEdge.distance; + y.value = verticalRatio * screenHeight; + } else if (closestEdge.edge === "right") { + x.value = screenWidth - menuWidth - closestEdge.distance; + y.value = verticalRatio * screenHeight; + } else if (closestEdge.edge === "top") { + x.value = horizontalRatio * screenWidth; + y.value = closestEdge.distance; + } else { + x.value = horizontalRatio * screenWidth; + y.value = screenHeight - menuHeight - closestEdge.distance; + } + x.value = lodashExports.clamp(x.value, 0, screenWidth - menuWidth); + y.value = lodashExports.clamp(y.value, 0, screenHeight - menuHeight); + } + }, "adjustMenuPosition"); + useEventListener(window, "resize", adjustMenuPosition); + const topMenuRef = inject("topMenuRef"); + const topMenuBounds = useElementBounding(topMenuRef); + const isOverlappingWithTopMenu = computed(() => { + if (!panelRef.value) { + return false; + } + const { height } = panelRef.value.getBoundingClientRect(); + const actionbarBottom = y.value + height; + const topMenuBottom = topMenuBounds.bottom.value; + const overlapPixels = Math.min(actionbarBottom, topMenuBottom) - Math.max(y.value, topMenuBounds.top.value); + return overlapPixels > overlapThreshold; + }); + watch(isDragging, (newIsDragging) => { + if (!newIsDragging) { + isDocked.value = isOverlappingWithTopMenu.value; + } else { + isDocked.value = false; + } + }); + const eventBus = useEventBus("topMenu"); + watch([isDragging, isOverlappingWithTopMenu], ([dragging, overlapping]) => { + eventBus.emit("updateHighlight", { + isDragging: dragging, + isOverlapping: overlapping + }); + }); + return (_ctx, _cache) => { + return openBlock(), createBlock(unref(script$y), { + class: normalizeClass(["actionbar w-fit", { "is-dragging": unref(isDragging), "is-docked": unref(isDocked) }]), + style: normalizeStyle(unref(style)) + }, { + default: withCtx(() => [ + createBaseVNode("div", { + class: "actionbar-content flex items-center", + ref_key: "panelRef", + ref: panelRef + }, [ + createBaseVNode("span", { + class: "drag-handle cursor-move mr-2 p-0!", + ref_key: "dragHandleRef", + ref: dragHandleRef + }, null, 512), + createVNode(ComfyQueueButton) + ], 512) + ]), + _: 1 + }, 8, ["style", "class"]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-6a1bcb8c"]]); +const _hoisted_1$2 = { +======== +const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-915e5456"]]); +const _hoisted_1$5 = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +function render$1(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "currentColor", + d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-5v3h14v-3zm0-2h14V5H5zm0 2v3z" + }, null, -1) + ])); +======== +const _hoisted_2$5 = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-5v3h14v-3zm0-2h14V5H5zm0 2v3z" +}, null, -1); +const _hoisted_3$4 = [ + _hoisted_2$5 +]; +function render$3(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$5, [..._hoisted_3$4]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +} +__name(render$3, "render$3"); +const __unplugin_components_1 = markRaw({ name: "material-symbols-dock-to-bottom-outline", render: render$3 }); +const _hoisted_1$4 = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +function render(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "currentColor", + d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-7h14V5H5z" + }, null, -1) + ])); +======== +const _hoisted_2$4 = /* @__PURE__ */ createBaseVNode("path", { + fill: "currentColor", + d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-7h14V5H5z" +}, null, -1); +const _hoisted_3$3 = [ + _hoisted_2$4 +]; +function render$2(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._hoisted_3$3]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +} +__name(render$2, "render$2"); +const __unplugin_components_0 = markRaw({ name: "material-symbols-dock-to-bottom", render: render$2 }); +const _sfc_main$5 = /* @__PURE__ */ defineComponent({ + __name: "BottomPanelToggleButton", + setup(__props) { + const bottomPanelStore = useBottomPanelStore(); + return (_ctx, _cache) => { + const _component_i_material_symbols58dock_to_bottom = __unplugin_components_0; + const _component_i_material_symbols58dock_to_bottom_outline = __unplugin_components_1; + const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + return withDirectives((openBlock(), createBlock(unref(script$h), { +======== + return withDirectives((openBlock(), createBlock(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + severity: "secondary", + text: "", + onClick: unref(bottomPanelStore).toggleBottomPanel + }, { + icon: withCtx(() => [ + unref(bottomPanelStore).bottomPanelVisible ? (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom, { key: 0 })) : (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom_outline, { key: 1 })) + ]), + _: 1 + }, 8, ["onClick"])), [ + [vShow, unref(bottomPanelStore).bottomPanelTabs.length > 0], + [_directive_tooltip, { value: _ctx.$t("menu.toggleBottomPanel"), showDelay: 300 }] + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +const _hoisted_1 = { class: "flex-grow" }; +======== +var theme8 = /* @__PURE__ */ __name(function theme9(_ref) { + var dt = _ref.dt; + return "\n.p-menubar {\n display: flex;\n align-items: center;\n background: ".concat(dt("menubar.background"), ";\n border: 1px solid ").concat(dt("menubar.border.color"), ";\n border-radius: ").concat(dt("menubar.border.radius"), ";\n color: ").concat(dt("menubar.color"), ";\n padding: ").concat(dt("menubar.padding"), ";\n gap: ").concat(dt("menubar.gap"), ";\n}\n\n.p-menubar-start,\n.p-megamenu-end {\n display: flex;\n align-items: center;\n}\n\n.p-menubar-root-list,\n.p-menubar-submenu {\n display: flex;\n margin: 0;\n padding: 0;\n list-style: none;\n outline: 0 none;\n}\n\n.p-menubar-root-list {\n align-items: center;\n flex-wrap: wrap;\n gap: ").concat(dt("menubar.gap"), ";\n}\n\n.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content {\n border-radius: ").concat(dt("menubar.base.item.border.radius"), ";\n}\n\n.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {\n padding: ").concat(dt("menubar.base.item.padding"), ";\n}\n\n.p-menubar-item-content {\n transition: background ").concat(dt("menubar.transition.duration"), ", color ").concat(dt("menubar.transition.duration"), ";\n border-radius: ").concat(dt("menubar.item.border.radius"), ";\n color: ").concat(dt("menubar.item.color"), ";\n}\n\n.p-menubar-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ").concat(dt("menubar.item.padding"), ";\n gap: ").concat(dt("menubar.item.gap"), ";\n user-select: none;\n outline: 0 none;\n}\n\n.p-menubar-item-label {\n line-height: 1;\n}\n\n.p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.color"), ";\n}\n\n.p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.color"), ";\n margin-left: auto;\n font-size: ").concat(dt("menubar.submenu.icon.size"), ";\n width: ").concat(dt("menubar.submenu.icon.size"), ";\n height: ").concat(dt("menubar.submenu.icon.size"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content {\n color: ").concat(dt("menubar.item.focus.color"), ";\n background: ").concat(dt("menubar.item.focus.background"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.focus.color"), ";\n}\n\n.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.focus.color"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover {\n color: ").concat(dt("menubar.item.focus.color"), ";\n background: ").concat(dt("menubar.item.focus.background"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.focus.color"), ";\n}\n\n.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.focus.color"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content {\n color: ").concat(dt("menubar.item.active.color"), ";\n background: ").concat(dt("menubar.item.active.background"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content .p-menubar-item-icon {\n color: ").concat(dt("menubar.item.icon.active.color"), ";\n}\n\n.p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n color: ").concat(dt("menubar.submenu.icon.active.color"), ";\n}\n\n.p-menubar-submenu {\n display: none;\n position: absolute;\n min-width: 12.5rem;\n z-index: 1;\n background: ").concat(dt("menubar.submenu.background"), ";\n border: 1px solid ").concat(dt("menubar.submenu.border.color"), ";\n border-radius: ").concat(dt("menubar.border.radius"), ";\n box-shadow: ").concat(dt("menubar.submenu.shadow"), ";\n color: ").concat(dt("menubar.submenu.color"), ";\n flex-direction: column;\n padding: ").concat(dt("menubar.submenu.padding"), ";\n gap: ").concat(dt("menubar.submenu.gap"), ";\n}\n\n.p-menubar-submenu .p-menubar-separator {\n border-top: 1px solid ").concat(dt("menubar.separator.border.color"), ";\n}\n\n.p-menubar-submenu .p-menubar-item {\n position: relative;\n}\n\n .p-menubar-submenu > .p-menubar-item-active > .p-menubar-submenu {\n display: block;\n left: 100%;\n top: 0;\n}\n\n.p-menubar-end {\n margin-left: auto;\n align-self: center;\n}\n\n.p-menubar-button {\n display: none;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n width: ").concat(dt("menubar.mobile.button.size"), ";\n height: ").concat(dt("menubar.mobile.button.size"), ";\n position: relative;\n color: ").concat(dt("menubar.mobile.button.color"), ";\n border: 0 none;\n background: transparent;\n border-radius: ").concat(dt("menubar.mobile.button.border.radius"), ";\n transition: background ").concat(dt("menubar.transition.duration"), ", color ").concat(dt("menubar.transition.duration"), ", outline-color ").concat(dt("menubar.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-menubar-button:hover {\n color: ").concat(dt("menubar.mobile.button.hover.color"), ";\n background: ").concat(dt("menubar.mobile.button.hover.background"), ";\n}\n\n.p-menubar-button:focus-visible {\n box-shadow: ").concat(dt("menubar.mobile.button.focus.ring.shadow"), ";\n outline: ").concat(dt("menubar.mobile.button.focus.ring.width"), " ").concat(dt("menubar.mobile.button.focus.ring.style"), " ").concat(dt("menubar.mobile.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("menubar.mobile.button.focus.ring.offset"), ";\n}\n\n.p-menubar-mobile {\n position: relative;\n}\n\n.p-menubar-mobile .p-menubar-button {\n display: flex;\n}\n\n.p-menubar-mobile .p-menubar-root-list {\n position: absolute;\n display: none;\n width: 100%;\n padding: ").concat(dt("menubar.submenu.padding"), ";\n background: ").concat(dt("menubar.submenu.background"), ";\n border: 1px solid ").concat(dt("menubar.submenu.border.color"), ";\n box-shadow: ").concat(dt("menubar.submenu.shadow"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content {\n border-radius: ").concat(dt("menubar.item.border.radius"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {\n padding: ").concat(dt("menubar.item.padding"), ";\n}\n\n.p-menubar-mobile-active .p-menubar-root-list {\n display: flex;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n}\n\n.p-menubar-mobile .p-menubar-root-list .p-menubar-item {\n width: 100%;\n position: static;\n}\n\n.p-menubar-mobile .p-menubar-root-list .p-menubar-separator {\n border-top: 1px solid ").concat(dt("menubar.separator.border.color"), ";\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content .p-menubar-submenu-icon {\n margin-left: auto;\n transition: transform 0.2s;\n}\n\n.p-menubar-mobile .p-menubar-root-list > .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n transform: rotate(-180deg);\n}\n\n.p-menubar-mobile .p-menubar-submenu .p-menubar-submenu-icon {\n transition: transform 0.2s;\n transform: rotate(90deg);\n}\n\n.p-menubar-mobile .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {\n transform: rotate(-90deg);\n}\n\n.p-menubar-mobile .p-menubar-submenu {\n width: 100%;\n position: static;\n box-shadow: none;\n border: 0 none;\n padding-left: ").concat(dt("menubar.submenu.mobile.indent"), ";\n}\n"); +}, "theme"); +var inlineStyles = { + submenu: /* @__PURE__ */ __name(function submenu2(_ref2) { + var instance = _ref2.instance, processedItem = _ref2.processedItem; + return { + display: instance.isItemActive(processedItem) ? "flex" : "none" + }; + }, "submenu") +}; +var classes = { + root: /* @__PURE__ */ __name(function root10(_ref3) { + var instance = _ref3.instance; + return ["p-menubar p-component", { + "p-menubar-mobile": instance.queryMatches, + "p-menubar-mobile-active": instance.mobileActive + }]; + }, "root"), + start: "p-menubar-start", + button: "p-menubar-button", + rootList: "p-menubar-root-list", + item: /* @__PURE__ */ __name(function item2(_ref4) { + var instance = _ref4.instance, processedItem = _ref4.processedItem; + return ["p-menubar-item", { + "p-menubar-item-active": instance.isItemActive(processedItem), + "p-focus": instance.isItemFocused(processedItem), + "p-disabled": instance.isItemDisabled(processedItem) + }]; + }, "item"), + itemContent: "p-menubar-item-content", + itemLink: "p-menubar-item-link", + itemIcon: "p-menubar-item-icon", + itemLabel: "p-menubar-item-label", + submenuIcon: "p-menubar-submenu-icon", + submenu: "p-menubar-submenu", + separator: "p-menubar-separator", + end: "p-menubar-end" +}; +var MenubarStyle = BaseStyle.extend({ + name: "menubar", + theme: theme8, + classes, + inlineStyles +}); +var script$2 = { + name: "BaseMenubar", + "extends": script$e, + props: { + model: { + type: Array, + "default": null + }, + buttonProps: { + type: null, + "default": null + }, + breakpoint: { + type: String, + "default": "960px" + }, + ariaLabelledby: { + type: String, + "default": null + }, + ariaLabel: { + type: String, + "default": null + } + }, + style: MenubarStyle, + provide: /* @__PURE__ */ __name(function provide12() { + return { + $pcMenubar: this, + $parentInstance: this + }; + }, "provide") +}; +var script$1 = { + name: "MenubarSub", + hostName: "Menubar", + "extends": script$e, + emits: ["item-mouseenter", "item-click", "item-mousemove"], + props: { + items: { + type: Array, + "default": null + }, + root: { + type: Boolean, + "default": false + }, + popup: { + type: Boolean, + "default": false + }, + mobileActive: { + type: Boolean, + "default": false + }, + templates: { + type: Object, + "default": null + }, + level: { + type: Number, + "default": 0 + }, + menuId: { + type: String, + "default": null + }, + focusedItemId: { + type: String, + "default": null + }, + activeItemPath: { + type: Object, + "default": null + } + }, + list: null, + methods: { + getItemId: /* @__PURE__ */ __name(function getItemId2(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key); + }, "getItemId"), + getItemKey: /* @__PURE__ */ __name(function getItemKey2(processedItem) { + return this.getItemId(processedItem); + }, "getItemKey"), + getItemProp: /* @__PURE__ */ __name(function getItemProp3(processedItem, name, params) { + return processedItem && processedItem.item ? resolve(processedItem.item[name], params) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel3(processedItem) { + return this.getItemProp(processedItem, "label"); + }, "getItemLabel"), + getItemLabelId: /* @__PURE__ */ __name(function getItemLabelId2(processedItem) { + return "".concat(this.menuId, "_").concat(processedItem.key, "_label"); + }, "getItemLabelId"), + getPTOptions: /* @__PURE__ */ __name(function getPTOptions5(processedItem, index, key) { + return this.ptm(key, { + context: { + item: processedItem.item, + index, + active: this.isItemActive(processedItem), + focused: this.isItemFocused(processedItem), + disabled: this.isItemDisabled(processedItem), + level: this.level + } + }); + }, "getPTOptions"), + isItemActive: /* @__PURE__ */ __name(function isItemActive2(processedItem) { + return this.activeItemPath.some(function(path) { + return path.key === processedItem.key; + }); + }, "isItemActive"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible3(processedItem) { + return this.getItemProp(processedItem, "visible") !== false; + }, "isItemVisible"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled3(processedItem) { + return this.getItemProp(processedItem, "disabled"); + }, "isItemDisabled"), + isItemFocused: /* @__PURE__ */ __name(function isItemFocused2(processedItem) { + return this.focusedItemId === this.getItemId(processedItem); + }, "isItemFocused"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup3(processedItem) { + return isNotEmpty(processedItem.items); + }, "isItemGroup"), + onItemClick: /* @__PURE__ */ __name(function onItemClick3(event, processedItem) { + this.getItemProp(processedItem, "command", { + originalEvent: event, + item: processedItem.item + }); + this.$emit("item-click", { + originalEvent: event, + processedItem, + isFocus: true + }); + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter3(event, processedItem) { + this.$emit("item-mouseenter", { + originalEvent: event, + processedItem + }); + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove3(event, processedItem) { + this.$emit("item-mousemove", { + originalEvent: event, + processedItem + }); + }, "onItemMouseMove"), + getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset3(index) { + return index - this.calculateAriaSetSize.slice(0, index).length + 1; + }, "getAriaPosInset"), + getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps2(processedItem, index) { + return { + action: mergeProps({ + "class": this.cx("itemLink"), + tabindex: -1, + "aria-hidden": true + }, this.getPTOptions(processedItem, index, "itemLink")), + icon: mergeProps({ + "class": [this.cx("itemIcon"), this.getItemProp(processedItem, "icon")] + }, this.getPTOptions(processedItem, index, "itemIcon")), + label: mergeProps({ + "class": this.cx("itemLabel") + }, this.getPTOptions(processedItem, index, "itemLabel")), + submenuicon: mergeProps({ + "class": this.cx("submenuIcon") + }, this.getPTOptions(processedItem, index, "submenuIcon")) + }; + }, "getMenuItemProps") + }, + computed: { + calculateAriaSetSize: /* @__PURE__ */ __name(function calculateAriaSetSize() { + var _this = this; + return this.items.filter(function(processedItem) { + return _this.isItemVisible(processedItem) && _this.getItemProp(processedItem, "separator"); + }); + }, "calculateAriaSetSize"), + getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize2() { + var _this2 = this; + return this.items.filter(function(processedItem) { + return _this2.isItemVisible(processedItem) && !_this2.getItemProp(processedItem, "separator"); + }).length; + }, "getAriaSetSize") + }, + components: { + AngleRightIcon: script$w, + AngleDownIcon: script$z + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$1$1 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"]; +var _hoisted_2$3 = ["onClick", "onMouseenter", "onMousemove"]; +var _hoisted_3$2 = ["href", "target"]; +var _hoisted_4 = ["id"]; +var _hoisted_5 = ["id"]; +function render$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_MenubarSub = resolveComponent("MenubarSub", true); + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("ul", mergeProps({ + "class": $props.level === 0 ? _ctx.cx("rootList") : _ctx.cx("submenu") + }, $props.level === 0 ? _ctx.ptm("rootList") : _ctx.ptm("submenu")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.items, function(processedItem, index) { + return openBlock(), createElementBlock(Fragment, { + key: $options.getItemKey(processedItem) + }, [$options.isItemVisible(processedItem) && !$options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ + key: 0, + id: $options.getItemId(processedItem), + style: $options.getItemProp(processedItem, "style"), + "class": [_ctx.cx("item", { + processedItem + }), $options.getItemProp(processedItem, "class")], + role: "menuitem", + "aria-label": $options.getItemLabel(processedItem), + "aria-disabled": $options.isItemDisabled(processedItem) || void 0, + "aria-expanded": $options.isItemGroup(processedItem) ? $options.isItemActive(processedItem) : void 0, + "aria-haspopup": $options.isItemGroup(processedItem) && !$options.getItemProp(processedItem, "to") ? "menu" : void 0, + "aria-level": $props.level + 1, + "aria-setsize": $options.getAriaSetSize, + "aria-posinset": $options.getAriaPosInset(index), + ref_for: true + }, $options.getPTOptions(processedItem, index, "item"), { + "data-p-active": $options.isItemActive(processedItem), + "data-p-focused": $options.isItemFocused(processedItem), + "data-p-disabled": $options.isItemDisabled(processedItem) + }), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("itemContent"), + onClick: /* @__PURE__ */ __name(function onClick2($event) { + return $options.onItemClick($event, processedItem); + }, "onClick"), + onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) { + return $options.onItemMouseEnter($event, processedItem); + }, "onMouseenter"), + onMousemove: /* @__PURE__ */ __name(function onMousemove($event) { + return $options.onItemMouseMove($event, processedItem); + }, "onMousemove"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemContent")), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({ + key: 0, + href: $options.getItemProp(processedItem, "url"), + "class": _ctx.cx("itemLink"), + target: $options.getItemProp(processedItem, "target"), + tabindex: "-1", + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLink")), [$props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), { + key: 0, + item: processedItem.item, + "class": normalizeClass(_ctx.cx("itemIcon")) + }, null, 8, ["item", "class"])) : $options.getItemProp(processedItem, "icon") ? (openBlock(), createElementBlock("span", mergeProps({ + key: 1, + "class": [_ctx.cx("itemIcon"), $options.getItemProp(processedItem, "icon")], + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemIcon")), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({ + id: $options.getItemLabelId(processedItem), + "class": _ctx.cx("itemLabel"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_4), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, { + key: 2 + }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), { + key: 0, + root: $props.root, + active: $options.isItemActive(processedItem), + "class": normalizeClass(_ctx.cx("submenuIcon")) + }, null, 8, ["root", "active", "class"])) : (openBlock(), createBlock(resolveDynamicComponent($props.root ? "AngleDownIcon" : "AngleRightIcon"), mergeProps({ + key: 1, + "class": _ctx.cx("submenuIcon"), + ref_for: true + }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_3$2)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), { + key: 1, + item: processedItem.item, + root: $props.root, + hasSubmenu: $options.getItemProp(processedItem, "items"), + label: $options.getItemLabel(processedItem), + props: $options.getMenuItemProps(processedItem, index) + }, null, 8, ["item", "root", "hasSubmenu", "label", "props"]))], 16, _hoisted_2$3), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_MenubarSub, { + key: 0, + id: $options.getItemId(processedItem) + "_list", + menuId: $props.menuId, + role: "menu", + style: normalizeStyle(_ctx.sx("submenu", true, { + processedItem + })), + focusedItemId: $props.focusedItemId, + items: processedItem.items, + mobileActive: $props.mobileActive, + activeItemPath: $props.activeItemPath, + templates: $props.templates, + level: $props.level + 1, + "aria-labelledby": $options.getItemLabelId(processedItem), + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onItemClick: _cache[0] || (_cache[0] = function($event) { + return _ctx.$emit("item-click", $event); + }), + onItemMouseenter: _cache[1] || (_cache[1] = function($event) { + return _ctx.$emit("item-mouseenter", $event); + }), + onItemMousemove: _cache[2] || (_cache[2] = function($event) { + return _ctx.$emit("item-mousemove", $event); + }) + }, null, 8, ["id", "menuId", "style", "focusedItemId", "items", "mobileActive", "activeItemPath", "templates", "level", "aria-labelledby", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_1$1$1)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({ + key: 1, + id: $options.getItemId(processedItem), + "class": [_ctx.cx("separator"), $options.getItemProp(processedItem, "class")], + style: $options.getItemProp(processedItem, "style"), + role: "separator", + ref_for: true + }, _ctx.ptm("separator")), null, 16, _hoisted_5)) : createCommentVNode("", true)], 64); + }), 128))], 16); +} +__name(render$1, "render$1"); +script$1.render = render$1; +var script = { + name: "Menubar", + "extends": script$2, + inheritAttrs: false, + emits: ["focus", "blur"], + matchMediaListener: null, + data: /* @__PURE__ */ __name(function data8() { + return { + id: this.$attrs.id, + mobileActive: false, + focused: false, + focusedItemInfo: { + index: -1, + level: 0, + parentKey: "" + }, + activeItemPath: [], + dirty: false, + query: null, + queryMatches: false + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId4(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + activeItemPath: /* @__PURE__ */ __name(function activeItemPath2(newPath) { + if (isNotEmpty(newPath)) { + this.bindOutsideClickListener(); + this.bindResizeListener(); + } else { + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + } + }, "activeItemPath") + }, + outsideClickListener: null, + container: null, + menubar: null, + mounted: /* @__PURE__ */ __name(function mounted8() { + this.id = this.id || UniqueComponentId(); + this.bindMatchMediaListener(); + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount7() { + this.mobileActive = false; + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + this.unbindMatchMediaListener(); + if (this.container) { + ZIndex.clear(this.container); + } + this.container = null; + }, "beforeUnmount"), + methods: { + getItemProp: /* @__PURE__ */ __name(function getItemProp4(item3, name) { + return item3 ? resolve(item3[name]) : void 0; + }, "getItemProp"), + getItemLabel: /* @__PURE__ */ __name(function getItemLabel4(item3) { + return this.getItemProp(item3, "label"); + }, "getItemLabel"), + isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled4(item3) { + return this.getItemProp(item3, "disabled"); + }, "isItemDisabled"), + isItemVisible: /* @__PURE__ */ __name(function isItemVisible4(item3) { + return this.getItemProp(item3, "visible") !== false; + }, "isItemVisible"), + isItemGroup: /* @__PURE__ */ __name(function isItemGroup4(item3) { + return isNotEmpty(this.getItemProp(item3, "items")); + }, "isItemGroup"), + isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator2(item3) { + return this.getItemProp(item3, "separator"); + }, "isItemSeparator"), + getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel2(processedItem) { + return processedItem ? this.getItemLabel(processedItem.item) : void 0; + }, "getProccessedItemLabel"), + isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup2(processedItem) { + return processedItem && isNotEmpty(processedItem.items); + }, "isProccessedItemGroup"), + toggle: /* @__PURE__ */ __name(function toggle2(event) { + var _this = this; + if (this.mobileActive) { + this.mobileActive = false; + ZIndex.clear(this.menubar); + this.hide(); + } else { + this.mobileActive = true; + ZIndex.set("menu", this.menubar, this.$primevue.config.zIndex.menu); + setTimeout(function() { + _this.show(); + }, 1); + } + this.bindOutsideClickListener(); + event.preventDefault(); + }, "toggle"), + show: /* @__PURE__ */ __name(function show3() { + focus(this.menubar); + }, "show"), + hide: /* @__PURE__ */ __name(function hide3(event, isFocus) { + var _this2 = this; + if (this.mobileActive) { + this.mobileActive = false; + setTimeout(function() { + focus(_this2.$refs.menubutton); + }, 0); + } + this.activeItemPath = []; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + isFocus && focus(this.menubar); + this.dirty = false; + }, "hide"), + onFocus: /* @__PURE__ */ __name(function onFocus4(event) { + this.focused = true; + this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { + index: this.findFirstFocusedItemIndex(), + level: 0, + parentKey: "" + }; + this.$emit("focus", event); + }, "onFocus"), + onBlur: /* @__PURE__ */ __name(function onBlur3(event) { + this.focused = false; + this.focusedItemInfo = { + index: -1, + level: 0, + parentKey: "" + }; + this.searchValue = ""; + this.dirty = false; + this.$emit("blur", event); + }, "onBlur"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown3(event) { + var metaKey = event.metaKey || event.ctrlKey; + switch (event.code) { + case "ArrowDown": + this.onArrowDownKey(event); + break; + case "ArrowUp": + this.onArrowUpKey(event); + break; + case "ArrowLeft": + this.onArrowLeftKey(event); + break; + case "ArrowRight": + this.onArrowRightKey(event); + break; + case "Home": + this.onHomeKey(event); + break; + case "End": + this.onEndKey(event); + break; + case "Space": + this.onSpaceKey(event); + break; + case "Enter": + case "NumpadEnter": + this.onEnterKey(event); + break; + case "Escape": + this.onEscapeKey(event); + break; + case "Tab": + this.onTabKey(event); + break; + case "PageDown": + case "PageUp": + case "Backspace": + case "ShiftLeft": + case "ShiftRight": + break; + default: + if (!metaKey && isPrintableCharacter(event.key)) { + this.searchItems(event, event.key); + } + break; + } + }, "onKeyDown"), + onItemChange: /* @__PURE__ */ __name(function onItemChange2(event) { + var processedItem = event.processedItem, isFocus = event.isFocus; + if (isEmpty(processedItem)) return; + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey, items = processedItem.items; + var grouped = isNotEmpty(items); + var activeItemPath3 = this.activeItemPath.filter(function(p) { + return p.parentKey !== parentKey && p.parentKey !== key; + }); + grouped && activeItemPath3.push(processedItem); + this.focusedItemInfo = { + index, + level, + parentKey + }; + this.activeItemPath = activeItemPath3; + grouped && (this.dirty = true); + isFocus && focus(this.menubar); + }, "onItemChange"), + onItemClick: /* @__PURE__ */ __name(function onItemClick4(event) { + var originalEvent = event.originalEvent, processedItem = event.processedItem; + var grouped = this.isProccessedItemGroup(processedItem); + var root11 = isEmpty(processedItem.parent); + var selected = this.isSelected(processedItem); + if (selected) { + var index = processedItem.index, key = processedItem.key, level = processedItem.level, parentKey = processedItem.parentKey; + this.activeItemPath = this.activeItemPath.filter(function(p) { + return key !== p.key && key.startsWith(p.key); + }); + this.focusedItemInfo = { + index, + level, + parentKey + }; + this.dirty = !root11; + focus(this.menubar); + } else { + if (grouped) { + this.onItemChange(event); + } else { + var rootProcessedItem = root11 ? processedItem : this.activeItemPath.find(function(p) { + return p.parentKey === ""; + }); + this.hide(originalEvent); + this.changeFocusedItemIndex(originalEvent, rootProcessedItem ? rootProcessedItem.index : -1); + this.mobileActive = false; + focus(this.menubar); + } + } + }, "onItemClick"), + onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter4(event) { + if (this.dirty) { + this.onItemChange(event); + } + }, "onItemMouseEnter"), + onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove4(event) { + if (this.focused) { + this.changeFocusedItemIndex(event, event.processedItem.index); + } + }, "onItemMouseMove"), + menuButtonClick: /* @__PURE__ */ __name(function menuButtonClick(event) { + this.toggle(event); + }, "menuButtonClick"), + menuButtonKeydown: /* @__PURE__ */ __name(function menuButtonKeydown(event) { + (event.code === "Enter" || event.code === "NumpadEnter" || event.code === "Space") && this.menuButtonClick(event); + }, "menuButtonKeydown"), + onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey3(event) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var root11 = processedItem ? isEmpty(processedItem.parent) : null; + if (root11) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + this.onArrowRightKey(event); + } + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + } + event.preventDefault(); + }, "onArrowDownKey"), + onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey3(event) { + var _this3 = this; + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var root11 = isEmpty(processedItem.parent); + if (root11) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + var itemIndex = this.findLastItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + } + } else { + var parentItem = this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }); + if (this.focusedItemInfo.index === 0) { + this.focusedItemInfo = { + index: -1, + parentKey: parentItem ? parentItem.parentKey : "" + }; + this.searchValue = ""; + this.onArrowLeftKey(event); + this.activeItemPath = this.activeItemPath.filter(function(p) { + return p.parentKey !== _this3.focusedItemInfo.parentKey; + }); + } else { + var _itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex(); + this.changeFocusedItemIndex(event, _itemIndex); + } + } + event.preventDefault(); + }, "onArrowUpKey"), + onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey4(event) { + var _this4 = this; + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var parentItem = processedItem ? this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }) : null; + if (parentItem) { + this.onItemChange({ + originalEvent: event, + processedItem: parentItem + }); + this.activeItemPath = this.activeItemPath.filter(function(p) { + return p.parentKey !== _this4.focusedItemInfo.parentKey; + }); + event.preventDefault(); + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + } + }, "onArrowLeftKey"), + onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey4(event) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var parentItem = processedItem ? this.activeItemPath.find(function(p) { + return p.key === processedItem.parentKey; + }) : null; + if (parentItem) { + var grouped = this.isProccessedItemGroup(processedItem); + if (grouped) { + this.onItemChange({ + originalEvent: event, + processedItem + }); + this.focusedItemInfo = { + index: -1, + parentKey: processedItem.key + }; + this.onArrowDownKey(event); + } + } else { + var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex(); + this.changeFocusedItemIndex(event, itemIndex); + event.preventDefault(); + } + }, "onArrowRightKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey4(event) { + this.changeFocusedItemIndex(event, this.findFirstItemIndex()); + event.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey4(event) { + this.changeFocusedItemIndex(event, this.findLastItemIndex()); + event.preventDefault(); + }, "onEndKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey4(event) { + if (this.focusedItemInfo.index !== -1) { + var element = findSingle(this.menubar, 'li[id="'.concat("".concat(this.focusedItemId), '"]')); + var anchorElement = element && findSingle(element, 'a[data-pc-section="itemlink"]'); + anchorElement ? anchorElement.click() : element && element.click(); + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex()); + } + event.preventDefault(); + }, "onEnterKey"), + onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey2(event) { + this.onEnterKey(event); + }, "onSpaceKey"), + onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey3(event) { + if (this.focusedItemInfo.level !== 0) { + var _focusedItemInfo = this.focusedItemInfo; + this.hide(event, false); + this.focusedItemInfo = { + index: Number(_focusedItemInfo.parentKey.split("_")[0]), + level: 0, + parentKey: "" + }; + } + event.preventDefault(); + }, "onEscapeKey"), + onTabKey: /* @__PURE__ */ __name(function onTabKey3(event) { + if (this.focusedItemInfo.index !== -1) { + var processedItem = this.visibleItems[this.focusedItemInfo.index]; + var grouped = this.isProccessedItemGroup(processedItem); + !grouped && this.onItemChange({ + originalEvent: event, + processedItem + }); + } + this.hide(); + }, "onTabKey"), + bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener3() { + var _this5 = this; + if (!this.outsideClickListener) { + this.outsideClickListener = function(event) { + var isOutsideContainer = _this5.container && !_this5.container.contains(event.target); + var isOutsideTarget = !(_this5.target && (_this5.target === event.target || _this5.target.contains(event.target))); + if (isOutsideContainer && isOutsideTarget) { + _this5.hide(); + } + }; + document.addEventListener("click", this.outsideClickListener); + } + }, "bindOutsideClickListener"), + unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener3() { + if (this.outsideClickListener) { + document.removeEventListener("click", this.outsideClickListener); + this.outsideClickListener = null; + } + }, "unbindOutsideClickListener"), + bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener3() { + var _this6 = this; + if (!this.resizeListener) { + this.resizeListener = function(event) { + if (!isTouchDevice()) { + _this6.hide(event, true); + } + _this6.mobileActive = false; + }; + window.addEventListener("resize", this.resizeListener); + } + }, "bindResizeListener"), + unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener3() { + if (this.resizeListener) { + window.removeEventListener("resize", this.resizeListener); + this.resizeListener = null; + } + }, "unbindResizeListener"), + bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener() { + var _this7 = this; + if (!this.matchMediaListener) { + var query = matchMedia("(max-width: ".concat(this.breakpoint, ")")); + this.query = query; + this.queryMatches = query.matches; + this.matchMediaListener = function() { + _this7.queryMatches = query.matches; + _this7.mobileActive = false; + }; + this.query.addEventListener("change", this.matchMediaListener); + } + }, "bindMatchMediaListener"), + unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener() { + if (this.matchMediaListener) { + this.query.removeEventListener("change", this.matchMediaListener); + this.matchMediaListener = null; + } + }, "unbindMatchMediaListener"), + isItemMatched: /* @__PURE__ */ __name(function isItemMatched2(processedItem) { + var _this$getProccessedIt; + return this.isValidItem(processedItem) && ((_this$getProccessedIt = this.getProccessedItemLabel(processedItem)) === null || _this$getProccessedIt === void 0 ? void 0 : _this$getProccessedIt.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())); + }, "isItemMatched"), + isValidItem: /* @__PURE__ */ __name(function isValidItem2(processedItem) { + return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item); + }, "isValidItem"), + isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem2(processedItem) { + return this.isValidItem(processedItem) && this.isSelected(processedItem); + }, "isValidSelectedItem"), + isSelected: /* @__PURE__ */ __name(function isSelected3(processedItem) { + return this.activeItemPath.some(function(p) { + return p.key === processedItem.key; + }); + }, "isSelected"), + findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex2() { + var _this8 = this; + return this.visibleItems.findIndex(function(processedItem) { + return _this8.isValidItem(processedItem); + }); + }, "findFirstItemIndex"), + findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex2() { + var _this9 = this; + return findLastIndex(this.visibleItems, function(processedItem) { + return _this9.isValidItem(processedItem); + }); + }, "findLastItemIndex"), + findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex2(index) { + var _this10 = this; + var matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex(function(processedItem) { + return _this10.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index; + }, "findNextItemIndex"), + findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex2(index) { + var _this11 = this; + var matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems.slice(0, index), function(processedItem) { + return _this11.isValidItem(processedItem); + }) : -1; + return matchedItemIndex > -1 ? matchedItemIndex : index; + }, "findPrevItemIndex"), + findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex2() { + var _this12 = this; + return this.visibleItems.findIndex(function(processedItem) { + return _this12.isValidSelectedItem(processedItem); + }); + }, "findSelectedItemIndex"), + findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex2() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex; + }, "findFirstFocusedItemIndex"), + findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex2() { + var selectedIndex = this.findSelectedItemIndex(); + return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex; + }, "findLastFocusedItemIndex"), + searchItems: /* @__PURE__ */ __name(function searchItems2(event, _char) { + var _this13 = this; + this.searchValue = (this.searchValue || "") + _char; + var itemIndex = -1; + var matched = false; + if (this.focusedItemInfo.index !== -1) { + itemIndex = this.visibleItems.slice(this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }); + itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo.index).findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }) : itemIndex + this.focusedItemInfo.index; + } else { + itemIndex = this.visibleItems.findIndex(function(processedItem) { + return _this13.isItemMatched(processedItem); + }); + } + if (itemIndex !== -1) { + matched = true; + } + if (itemIndex === -1 && this.focusedItemInfo.index === -1) { + itemIndex = this.findFirstFocusedItemIndex(); + } + if (itemIndex !== -1) { + this.changeFocusedItemIndex(event, itemIndex); + } + if (this.searchTimeout) { + clearTimeout(this.searchTimeout); + } + this.searchTimeout = setTimeout(function() { + _this13.searchValue = ""; + _this13.searchTimeout = null; + }, 500); + return matched; + }, "searchItems"), + changeFocusedItemIndex: /* @__PURE__ */ __name(function changeFocusedItemIndex2(event, index) { + if (this.focusedItemInfo.index !== index) { + this.focusedItemInfo.index = index; + this.scrollInView(); + } + }, "changeFocusedItemIndex"), + scrollInView: /* @__PURE__ */ __name(function scrollInView4() { + var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1; + var id2 = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedItemId; + var element = findSingle(this.menubar, 'li[id="'.concat(id2, '"]')); + if (element) { + element.scrollIntoView && element.scrollIntoView({ + block: "nearest", + inline: "start" + }); + } + }, "scrollInView"), + createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems2(items) { + var _this14 = this; + var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ""; + var processedItems3 = []; + items && items.forEach(function(item3, index) { + var key = (parentKey !== "" ? parentKey + "_" : "") + index; + var newItem = { + item: item3, + index, + level, + key, + parent, + parentKey + }; + newItem["items"] = _this14.createProcessedItems(item3.items, level + 1, newItem, key); + processedItems3.push(newItem); + }); + return processedItems3; + }, "createProcessedItems"), + containerRef: /* @__PURE__ */ __name(function containerRef3(el) { + this.container = el; + }, "containerRef"), + menubarRef: /* @__PURE__ */ __name(function menubarRef2(el) { + this.menubar = el ? el.$el : void 0; + }, "menubarRef") + }, + computed: { + processedItems: /* @__PURE__ */ __name(function processedItems2() { + return this.createProcessedItems(this.model || []); + }, "processedItems"), + visibleItems: /* @__PURE__ */ __name(function visibleItems2() { + var _this15 = this; + var processedItem = this.activeItemPath.find(function(p) { + return p.key === _this15.focusedItemInfo.parentKey; + }); + return processedItem ? processedItem.items : this.processedItems; + }, "visibleItems"), + focusedItemId: /* @__PURE__ */ __name(function focusedItemId2() { + return this.focusedItemInfo.index !== -1 ? "".concat(this.id).concat(isNotEmpty(this.focusedItemInfo.parentKey) ? "_" + this.focusedItemInfo.parentKey : "", "_").concat(this.focusedItemInfo.index) : null; + }, "focusedItemId") + }, + components: { + MenubarSub: script$1, + BarsIcon: script$A + } +}; +function _typeof(o) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof(o); +} +__name(_typeof, "_typeof"); +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys, "ownKeys"); +function _objectSpread(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread, "_objectSpread"); +function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty, "_defineProperty"); +function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : i + ""; +} +__name(_toPropertyKey, "_toPropertyKey"); +function _toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive, "_toPrimitive"); +var _hoisted_1$3 = ["aria-haspopup", "aria-expanded", "aria-controls", "aria-label"]; +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_BarsIcon = resolveComponent("BarsIcon"); + var _component_MenubarSub = resolveComponent("MenubarSub"); + return openBlock(), createElementBlock("div", mergeProps({ + ref: $options.containerRef, + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("start") + }, _ctx.ptm("start")), [renderSlot(_ctx.$slots, "start")], 16)) : createCommentVNode("", true), renderSlot(_ctx.$slots, _ctx.$slots.button ? "button" : "menubutton", { + id: $data.id, + "class": normalizeClass(_ctx.cx("button")), + toggleCallback: /* @__PURE__ */ __name(function toggleCallback(event) { + return $options.menuButtonClick(event); + }, "toggleCallback") + }, function() { + var _ctx$$primevue$config; + return [_ctx.model && _ctx.model.length > 0 ? (openBlock(), createElementBlock("a", mergeProps({ + key: 0, + ref: "menubutton", + role: "button", + tabindex: "0", + "class": _ctx.cx("button"), + "aria-haspopup": _ctx.model.length && _ctx.model.length > 0 ? true : false, + "aria-expanded": $data.mobileActive, + "aria-controls": $data.id, + "aria-label": (_ctx$$primevue$config = _ctx.$primevue.config.locale.aria) === null || _ctx$$primevue$config === void 0 ? void 0 : _ctx$$primevue$config.navigation, + onClick: _cache[0] || (_cache[0] = function($event) { + return $options.menuButtonClick($event); + }), + onKeydown: _cache[1] || (_cache[1] = function($event) { + return $options.menuButtonKeydown($event); + }) + }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.ptm("button"))), [renderSlot(_ctx.$slots, _ctx.$slots.buttonicon ? "buttonicon" : "menubuttonicon", {}, function() { + return [createVNode(_component_BarsIcon, normalizeProps(guardReactiveProps(_ctx.ptm("buttonicon"))), null, 16)]; + })], 16, _hoisted_1$3)) : createCommentVNode("", true)]; + }), createVNode(_component_MenubarSub, { + ref: $options.menubarRef, + id: $data.id + "_list", + role: "menubar", + items: $options.processedItems, + templates: _ctx.$slots, + root: true, + mobileActive: $data.mobileActive, + tabindex: "0", + "aria-activedescendant": $data.focused ? $options.focusedItemId : void 0, + menuId: $data.id, + focusedItemId: $data.focused ? $options.focusedItemId : void 0, + activeItemPath: $data.activeItemPath, + level: 0, + "aria-labelledby": _ctx.ariaLabelledby, + "aria-label": _ctx.ariaLabel, + pt: _ctx.pt, + unstyled: _ctx.unstyled, + onFocus: $options.onFocus, + onBlur: $options.onBlur, + onKeydown: $options.onKeyDown, + onItemClick: $options.onItemClick, + onItemMouseenter: $options.onItemMouseEnter, + onItemMousemove: $options.onItemMouseMove + }, null, 8, ["id", "items", "templates", "mobileActive", "aria-activedescendant", "menuId", "focusedItemId", "activeItemPath", "aria-labelledby", "aria-label", "pt", "unstyled", "onFocus", "onBlur", "onKeydown", "onItemClick", "onItemMouseenter", "onItemMousemove"]), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({ + key: 1, + "class": _ctx.cx("end") + }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16); +} +__name(render, "render"); +script.render = render; +const _withScopeId$2 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-6fecd137"), n = n(), popScopeId(), n), "_withScopeId$2"); +const _hoisted_1$2 = ["href"]; +const _hoisted_2$2 = { class: "p-menubar-item-label" }; +const _hoisted_3$1 = { + key: 1, + class: "ml-auto border border-surface rounded text-muted text-xs p-1 keybinding-tag" +}; +const _sfc_main$4 = /* @__PURE__ */ defineComponent({ + __name: "CommandMenubar", + setup(__props) { + const settingStore = useSettingStore(); + const dropdownDirection = computed( + () => settingStore.get("Comfy.UseNewMenu") === "Top" ? "down" : "up" + ); + const menuItemsStore = useMenuItemStore(); + const { t } = useI18n(); + const translateMenuItem = /* @__PURE__ */ __name((item3) => { + const label = typeof item3.label === "function" ? item3.label() : item3.label; + const translatedLabel = label ? t(`menuLabels.${normalizeI18nKey(label)}`, label) : void 0; + return { + ...item3, + label: translatedLabel, + items: item3.items?.map(translateMenuItem) + }; + }, "translateMenuItem"); + const translatedItems = computed( + () => menuItemsStore.menuItems.map(translateMenuItem) + ); + return (_ctx, _cache) => { + return openBlock(), createBlock(unref(script), { + model: translatedItems.value, + class: "top-menubar border-none p-0 bg-transparent", + pt: { + rootList: "gap-0 flex-nowrap w-auto", + submenu: `dropdown-direction-${dropdownDirection.value}`, + item: "relative" + } + }, { + item: withCtx(({ item: item3, props }) => [ + createBaseVNode("a", mergeProps({ class: "p-menubar-item-link" }, props.action, { + href: item3.url, + target: "_blank" + }), [ + item3.icon ? (openBlock(), createElementBlock("span", { + key: 0, + class: normalizeClass(["p-menubar-item-icon", item3.icon]) + }, null, 2)) : createCommentVNode("", true), + createBaseVNode("span", _hoisted_2$2, toDisplayString(item3.label), 1), + item3?.comfyCommand?.keybinding ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(item3.comfyCommand.keybinding.combo.toString()), 1)) : createCommentVNode("", true) + ], 16, _hoisted_1$2) + ]), + _: 1 + }, 8, ["model", "pt"]); + }; + } +}); +const CommandMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6fecd137"]]); +const _withScopeId$1 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-8d011a31"), n = n(), popScopeId(), n), "_withScopeId$1"); +const _hoisted_1$1 = { class: "workflow-label text-sm max-w-[150px] truncate inline-block" }; +const _hoisted_2$1 = { class: "relative" }; +const _hoisted_3 = { + key: 0, + class: "status-indicator" +}; +const _sfc_main$3 = /* @__PURE__ */ defineComponent({ + __name: "WorkflowTab", + props: { + class: {}, + workflowOption: {} + }, + setup(__props) { + const props = __props; + const workspaceStore = useWorkspaceStore(); + const workflowStore = useWorkflowStore(); + const workflowTabRef = ref(null); + const closeWorkflows = /* @__PURE__ */ __name(async (options) => { + for (const opt of options) { + if (!await useWorkflowService().closeWorkflow(opt.workflow, { + warnIfUnsaved: !workspaceStore.shiftDown + })) { + break; + } + } + }, "closeWorkflows"); + const onCloseWorkflow = /* @__PURE__ */ __name((option2) => { + closeWorkflows([option2]); + }, "onCloseWorkflow"); + const tabGetter = /* @__PURE__ */ __name(() => workflowTabRef.value, "tabGetter"); + usePragmaticDraggable(tabGetter, { + getInitialData: /* @__PURE__ */ __name(() => { + return { + workflowKey: props.workflowOption.workflow.key + }; + }, "getInitialData") + }); + usePragmaticDroppable(tabGetter, { + getData: /* @__PURE__ */ __name(() => { + return { + workflowKey: props.workflowOption.workflow.key + }; + }, "getData"), + onDrop: /* @__PURE__ */ __name((e) => { + const fromIndex = workflowStore.openWorkflows.findIndex( + (wf) => wf.key === e.source.data.workflowKey + ); + const toIndex = workflowStore.openWorkflows.findIndex( + (wf) => wf.key === e.location.current.dropTargets[0]?.data.workflowKey + ); + if (fromIndex !== toIndex) { + workflowStore.reorderWorkflows(fromIndex, toIndex); + } + }, "onDrop") + }); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createElementBlock("div", mergeProps({ + class: "flex p-2 gap-2 workflow-tab", + ref_key: "workflowTabRef", + ref: workflowTabRef + }, _ctx.$attrs), [ + withDirectives((openBlock(), createElementBlock("span", _hoisted_1$1, [ + createTextVNode(toDisplayString(_ctx.workflowOption.workflow.filename), 1) + ])), [ + [ + _directive_tooltip, + _ctx.workflowOption.workflow.key, + void 0, + { bottom: true } + ] + ]), + createBaseVNode("div", _hoisted_2$1, [ + !unref(workspaceStore).shiftDown && (_ctx.workflowOption.workflow.isModified || !_ctx.workflowOption.workflow.isPersisted) ? (openBlock(), createElementBlock("span", _hoisted_3, "•")) : createCommentVNode("", true), + createVNode(unref(script$d), { + class: "close-button p-0 w-auto", + icon: "pi pi-times", + text: "", + severity: "secondary", + size: "small", + onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onCloseWorkflow(_ctx.workflowOption), ["stop"])) + }) + ]) + ], 16); + }; + } +}); +const WorkflowTab = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-8d011a31"]]); +const _sfc_main$2 = /* @__PURE__ */ defineComponent({ + __name: "WorkflowTabs", + props: { + class: {} + }, + setup(__props) { + const props = __props; + const { t } = useI18n(); + const workspaceStore = useWorkspaceStore(); + const workflowStore = useWorkflowStore(); + const workflowService = useWorkflowService(); + const rightClickedTab = ref(null); + const menu = ref(); + const workflowToOption = /* @__PURE__ */ __name((workflow) => ({ + value: workflow.path, + workflow + }), "workflowToOption"); + const options = computed( + () => workflowStore.openWorkflows.map(workflowToOption) + ); + const selectedWorkflow = computed( + () => workflowStore.activeWorkflow ? workflowToOption(workflowStore.activeWorkflow) : null + ); + const onWorkflowChange = /* @__PURE__ */ __name((option2) => { + if (!option2) { + return; + } + if (selectedWorkflow.value?.value === option2.value) { + return; + } + workflowService.openWorkflow(option2.workflow); + }, "onWorkflowChange"); + const closeWorkflows = /* @__PURE__ */ __name(async (options2) => { + for (const opt of options2) { + if (!await workflowService.closeWorkflow(opt.workflow, { + warnIfUnsaved: !workspaceStore.shiftDown + })) { + break; + } + } + }, "closeWorkflows"); + const onCloseWorkflow = /* @__PURE__ */ __name((option2) => { + closeWorkflows([option2]); + }, "onCloseWorkflow"); + const showContextMenu = /* @__PURE__ */ __name((event, option2) => { + rightClickedTab.value = option2; + menu.value.show(event); + }, "showContextMenu"); + const contextMenuItems = computed(() => { + const tab = rightClickedTab.value; + if (!tab) return []; + const index = options.value.findIndex((v) => v.workflow === tab.workflow); + return [ + { + label: t("tabMenu.duplicateTab"), + command: /* @__PURE__ */ __name(() => { + workflowService.duplicateWorkflow(tab.workflow); + }, "command") + }, + { + separator: true + }, + { + label: t("tabMenu.closeTab"), + command: /* @__PURE__ */ __name(() => onCloseWorkflow(tab), "command") + }, + { + label: t("tabMenu.closeTabsToLeft"), + command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(0, index)), "command"), + disabled: index <= 0 + }, + { + label: t("tabMenu.closeTabsToRight"), + command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(index + 1)), "command"), + disabled: index === options.value.length - 1 + }, + { + label: t("tabMenu.closeOtherTabs"), + command: /* @__PURE__ */ __name(() => closeWorkflows([ + ...options.value.slice(index + 1), + ...options.value.slice(0, index) + ]), "command"), + disabled: options.value.length <= 1 + } + ]; + }); + const commandStore = useCommandStore(); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + createVNode(unref(script$B), { + class: normalizeClass(["workflow-tabs bg-transparent inline", props.class]), + modelValue: selectedWorkflow.value, + "onUpdate:modelValue": onWorkflowChange, + options: options.value, + optionLabel: "label", + dataKey: "value" + }, { + option: withCtx(({ option: option2 }) => [ + createVNode(WorkflowTab, { + onContextmenu: /* @__PURE__ */ __name(($event) => showContextMenu($event, option2), "onContextmenu"), + onMouseup: withModifiers(($event) => onCloseWorkflow(option2), ["middle"]), + "workflow-option": option2 + }, null, 8, ["onContextmenu", "onMouseup", "workflow-option"]) + ]), + _: 1 + }, 8, ["class", "modelValue", "options"]), + createVNode(unref(script$d), { + class: "new-blank-workflow-button", + icon: "pi pi-plus", + text: "", + severity: "secondary", + onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow")) + }), + createVNode(unref(script$C), { + ref_key: "menu", + ref: menu, + model: contextMenuItems.value + }, null, 8, ["model"]) + ], 64); + }; + } +}); +const WorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d485c044"]]); +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-878b63b8"), n = n(), popScopeId(), n), "_withScopeId"); +const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("h1", { class: "comfyui-logo mx-2" }, "ComfyUI", -1)); +const _hoisted_2 = { class: "flex-grow" }; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js +const _sfc_main$1 = /* @__PURE__ */ defineComponent({ + __name: "TopMenubar", + setup(__props) { + const workspaceState = useWorkspaceStore(); + const settingStore = useSettingStore(); + const workflowTabsPosition = computed( + () => settingStore.get("Comfy.Workflow.WorkflowTabsPosition") + ); + const betaMenuEnabled = computed( + () => settingStore.get("Comfy.UseNewMenu") !== "Disabled" + ); + const teleportTarget = computed( + () => settingStore.get("Comfy.UseNewMenu") === "Top" ? ".comfyui-body-top" : ".comfyui-body-bottom" + ); + const menuRight = ref(null); + onMounted(() => { + if (menuRight.value) { + menuRight.value.appendChild(app.menu.element); + } + }); + const topMenuRef = ref(null); + provide("topMenuRef", topMenuRef); + const eventBus = useEventBus("topMenu"); + const isDropZone = ref(false); + const isDroppable = ref(false); + eventBus.on((event, payload) => { + if (event === "updateHighlight") { + isDropZone.value = payload.isDragging; + isDroppable.value = payload.isOverlapping && payload.isDragging; + } + }); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [ + withDirectives(createBaseVNode("div", { + ref_key: "topMenuRef", + ref: topMenuRef, + class: normalizeClass(["comfyui-menu flex items-center", { dropzone: isDropZone.value, "dropzone-active": isDroppable.value }]) + }, [ + _cache[1] || (_cache[1] = createBaseVNode("h1", { class: "comfyui-logo mx-2" }, "ComfyUI", -1)), + createVNode(CommandMenubar), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(unref(script$H), { +======== + createVNode(unref(script$D), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + layout: "vertical", + class: "mx-2" + }), + createBaseVNode("div", _hoisted_1, [ + workflowTabsPosition.value === "Topbar" ? (openBlock(), createBlock(WorkflowTabs, { key: 0 })) : createCommentVNode("", true) + ]), + createBaseVNode("div", { + class: "comfyui-menu-right", + ref_key: "menuRight", + ref: menuRight + }, null, 512), + createVNode(Actionbar), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(_sfc_main$2), + withDirectives(createVNode(unref(script$h), { +======== + createVNode(_sfc_main$5), + withDirectives(createVNode(unref(script$d), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + icon: "pi pi-bars", + severity: "secondary", + text: "", + onClick: _cache[0] || (_cache[0] = ($event) => unref(workspaceState).focusMode = true), + onContextmenu: unref(showNativeMenu) + }, null, 8, ["onContextmenu"]), [ + [_directive_tooltip, { value: _ctx.$t("menu.hideMenu"), showDelay: 300 }] + ]) + ], 2), [ + [vShow, betaMenuEnabled.value && !unref(workspaceState).focusMode] + ]) + ], 8, ["to"]); + }; + } +}); +const TopMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-878b63b8"]]); +var LatentPreviewMethod = /* @__PURE__ */ ((LatentPreviewMethod2) => { + LatentPreviewMethod2["NoPreviews"] = "none"; + LatentPreviewMethod2["Auto"] = "auto"; + LatentPreviewMethod2["Latent2RGB"] = "latent2rgb"; + LatentPreviewMethod2["TAESD"] = "taesd"; + return LatentPreviewMethod2; +})(LatentPreviewMethod || {}); +var LogLevel = /* @__PURE__ */ ((LogLevel2) => { + LogLevel2["DEBUG"] = "DEBUG"; + LogLevel2["INFO"] = "INFO"; + LogLevel2["WARNING"] = "WARNING"; + LogLevel2["ERROR"] = "ERROR"; + LogLevel2["CRITICAL"] = "CRITICAL"; + return LogLevel2; +})(LogLevel || {}); +var HashFunction = /* @__PURE__ */ ((HashFunction2) => { + HashFunction2["MD5"] = "md5"; + HashFunction2["SHA1"] = "sha1"; + HashFunction2["SHA256"] = "sha256"; + HashFunction2["SHA512"] = "sha512"; + return HashFunction2; +})(HashFunction || {}); +var AutoLaunch = /* @__PURE__ */ ((AutoLaunch2) => { + AutoLaunch2["Auto"] = "auto"; + AutoLaunch2["Disable"] = "disable"; + AutoLaunch2["Enable"] = "enable"; + return AutoLaunch2; +})(AutoLaunch || {}); +var CudaMalloc = /* @__PURE__ */ ((CudaMalloc2) => { + CudaMalloc2["Auto"] = "auto"; + CudaMalloc2["Disable"] = "disable"; + CudaMalloc2["Enable"] = "enable"; + return CudaMalloc2; +})(CudaMalloc || {}); +var FloatingPointPrecision = /* @__PURE__ */ ((FloatingPointPrecision2) => { + FloatingPointPrecision2["AUTO"] = "auto"; + FloatingPointPrecision2["FP64"] = "fp64"; + FloatingPointPrecision2["FP32"] = "fp32"; + FloatingPointPrecision2["FP16"] = "fp16"; + FloatingPointPrecision2["BF16"] = "bf16"; + FloatingPointPrecision2["FP8E4M3FN"] = "fp8_e4m3fn"; + FloatingPointPrecision2["FP8E5M2"] = "fp8_e5m2"; + return FloatingPointPrecision2; +})(FloatingPointPrecision || {}); +var CrossAttentionMethod = /* @__PURE__ */ ((CrossAttentionMethod2) => { + CrossAttentionMethod2["Auto"] = "auto"; + CrossAttentionMethod2["Split"] = "split"; + CrossAttentionMethod2["Quad"] = "quad"; + CrossAttentionMethod2["Pytorch"] = "pytorch"; + return CrossAttentionMethod2; +})(CrossAttentionMethod || {}); +var VramManagement = /* @__PURE__ */ ((VramManagement2) => { + VramManagement2["Auto"] = "auto"; + VramManagement2["GPUOnly"] = "gpu-only"; + VramManagement2["HighVram"] = "highvram"; + VramManagement2["NormalVram"] = "normalvram"; + VramManagement2["LowVram"] = "lowvram"; + VramManagement2["NoVram"] = "novram"; + VramManagement2["CPU"] = "cpu"; + return VramManagement2; +})(VramManagement || {}); +const WEB_ONLY_CONFIG_ITEMS = [ + // Launch behavior + { + id: "auto-launch", + name: "Automatically opens in the browser on startup", + category: ["Launch"], + type: "combo", + options: Object.values(AutoLaunch), + defaultValue: AutoLaunch.Auto, + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case AutoLaunch.Auto: + return {}; + case AutoLaunch.Enable: + return { + ["auto-launch"]: true + }; + case AutoLaunch.Disable: + return { + ["disable-auto-launch"]: true + }; + } + }, "getValue") + } +]; +const SERVER_CONFIG_ITEMS = [ + // Network settings + { + id: "listen", + name: "Host: The IP address to listen on", + category: ["Network"], + type: "text", + defaultValue: "127.0.0.1" + }, + { + id: "port", + name: "Port: The port to listen on", + category: ["Network"], + type: "number", + // The default launch port for desktop app is 8000 instead of 8188. + defaultValue: 8e3 + }, + { + id: "tls-keyfile", + name: "TLS Key File: Path to TLS key file for HTTPS", + category: ["Network"], + type: "text", + defaultValue: "" + }, + { + id: "tls-certfile", + name: "TLS Certificate File: Path to TLS certificate file for HTTPS", + category: ["Network"], + type: "text", + defaultValue: "" + }, + { + id: "enable-cors-header", + name: 'Enable CORS header: Use "*" for all origins or specify domain', + category: ["Network"], + type: "text", + defaultValue: "" + }, + { + id: "max-upload-size", + name: "Maximum upload size (MB)", + category: ["Network"], + type: "number", + defaultValue: 100 + }, + // CUDA settings + { + id: "cuda-device", + name: "CUDA device index to use", + category: ["CUDA"], + type: "number", + defaultValue: null + }, + { + id: "cuda-malloc", + name: "Use CUDA malloc for memory allocation", + category: ["CUDA"], + type: "combo", + options: Object.values(CudaMalloc), + defaultValue: CudaMalloc.Auto, + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case CudaMalloc.Auto: + return {}; + case CudaMalloc.Enable: + return { + ["cuda-malloc"]: true + }; + case CudaMalloc.Disable: + return { + ["disable-cuda-malloc"]: true + }; + } + }, "getValue") + }, + // Precision settings + { + id: "global-precision", + name: "Global floating point precision", + category: ["Inference"], + type: "combo", + options: [ + FloatingPointPrecision.AUTO, + FloatingPointPrecision.FP32, + FloatingPointPrecision.FP16 + ], + defaultValue: FloatingPointPrecision.AUTO, + tooltip: "Global floating point precision", + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case FloatingPointPrecision.AUTO: + return {}; + case FloatingPointPrecision.FP32: + return { + ["force-fp32"]: true + }; + case FloatingPointPrecision.FP16: + return { + ["force-fp16"]: true + }; + default: + return {}; + } + }, "getValue") + }, + // UNET precision + { + id: "unet-precision", + name: "UNET precision", + category: ["Inference"], + type: "combo", + options: [ + FloatingPointPrecision.AUTO, + FloatingPointPrecision.FP64, + FloatingPointPrecision.FP32, + FloatingPointPrecision.FP16, + FloatingPointPrecision.BF16, + FloatingPointPrecision.FP8E4M3FN, + FloatingPointPrecision.FP8E5M2 + ], + defaultValue: FloatingPointPrecision.AUTO, + tooltip: "UNET precision", + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case FloatingPointPrecision.AUTO: + return {}; + default: + return { + [`${value.toLowerCase()}-unet`]: true + }; + } + }, "getValue") + }, + // VAE settings + { + id: "vae-precision", + name: "VAE precision", + category: ["Inference"], + type: "combo", + options: [ + FloatingPointPrecision.AUTO, + FloatingPointPrecision.FP16, + FloatingPointPrecision.FP32, + FloatingPointPrecision.BF16 + ], + defaultValue: FloatingPointPrecision.AUTO, + tooltip: "VAE precision", + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case FloatingPointPrecision.AUTO: + return {}; + default: + return { + [`${value.toLowerCase()}-vae`]: true + }; + } + }, "getValue") + }, + { + id: "cpu-vae", + name: "Run VAE on CPU", + category: ["Inference"], + type: "boolean", + defaultValue: false + }, + // Text Encoder settings + { + id: "text-encoder-precision", + name: "Text Encoder precision", + category: ["Inference"], + type: "combo", + options: [ + FloatingPointPrecision.AUTO, + FloatingPointPrecision.FP8E4M3FN, + FloatingPointPrecision.FP8E5M2, + FloatingPointPrecision.FP16, + FloatingPointPrecision.FP32 + ], + defaultValue: FloatingPointPrecision.AUTO, + tooltip: "Text Encoder precision", + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case FloatingPointPrecision.AUTO: + return {}; + default: + return { + [`${value.toLowerCase()}-text-enc`]: true + }; + } + }, "getValue") + }, + // Memory and performance settings + { + id: "force-channels-last", + name: "Force channels-last memory format", + category: ["Memory"], + type: "boolean", + defaultValue: false + }, + { + id: "directml", + name: "DirectML device index", + category: ["Memory"], + type: "number", + defaultValue: null + }, + { + id: "disable-ipex-optimize", + name: "Disable IPEX optimization", + category: ["Memory"], + type: "boolean", + defaultValue: false + }, + // Preview settings + { + id: "preview-method", + name: "Method used for latent previews", + category: ["Preview"], + type: "combo", + options: Object.values(LatentPreviewMethod), + defaultValue: LatentPreviewMethod.NoPreviews + }, + { + id: "preview-size", + name: "Size of preview images", + category: ["Preview"], + type: "slider", + defaultValue: 512, + attrs: { + min: 128, + max: 2048, + step: 128 + } + }, + // Cache settings + { + id: "cache-classic", + name: "Use classic cache system", + category: ["Cache"], + type: "boolean", + defaultValue: false + }, + { + id: "cache-lru", + name: "Use LRU caching with a maximum of N node results cached.", + category: ["Cache"], + type: "number", + defaultValue: null, + tooltip: "May use more RAM/VRAM." + }, + // Attention settings + { + id: "cross-attention-method", + name: "Cross attention method", + category: ["Attention"], + type: "combo", + options: Object.values(CrossAttentionMethod), + defaultValue: CrossAttentionMethod.Auto, + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case CrossAttentionMethod.Auto: + return {}; + default: + return { + [`use-${value.toLowerCase()}-cross-attention`]: true + }; + } + }, "getValue") + }, + { + id: "disable-xformers", + name: "Disable xFormers optimization", + type: "boolean", + defaultValue: false + }, + { + id: "force-upcast-attention", + name: "Force attention upcast", + category: ["Attention"], + type: "boolean", + defaultValue: false + }, + { + id: "dont-upcast-attention", + name: "Prevent attention upcast", + category: ["Attention"], + type: "boolean", + defaultValue: false + }, + // VRAM management + { + id: "vram-management", + name: "VRAM management mode", + category: ["Memory"], + type: "combo", + options: Object.values(VramManagement), + defaultValue: VramManagement.Auto, + getValue: /* @__PURE__ */ __name((value) => { + switch (value) { + case VramManagement.Auto: + return {}; + default: + return { + [value]: true + }; + } + }, "getValue") + }, + { + id: "reserve-vram", + name: "Reserved VRAM (GB)", + category: ["Memory"], + type: "number", + defaultValue: null, + tooltip: "Set the amount of vram in GB you want to reserve for use by your OS/other software. By default some amount is reverved depending on your OS." + }, + // Misc settings + { + id: "default-hashing-function", + name: "Default hashing function for model files", + type: "combo", + options: Object.values(HashFunction), + defaultValue: HashFunction.SHA256 + }, + { + id: "disable-smart-memory", + name: "Disable smart memory management", + tooltip: "Force ComfyUI to aggressively offload to regular ram instead of keeping models in vram when it can.", + category: ["Memory"], + type: "boolean", + defaultValue: false + }, + { + id: "deterministic", + name: "Make pytorch use slower deterministic algorithms when it can.", + type: "boolean", + defaultValue: false, + tooltip: "Note that this might not make images deterministic in all cases." + }, + { + id: "fast", + name: "Enable some untested and potentially quality deteriorating optimizations.", + type: "boolean", + defaultValue: false + }, + { + id: "dont-print-server", + name: "Don't print server output to console.", + type: "boolean", + defaultValue: false + }, + { + id: "disable-metadata", + name: "Disable saving prompt metadata in files.", + type: "boolean", + defaultValue: false + }, + { + id: "disable-all-custom-nodes", + name: "Disable loading all custom nodes.", + type: "boolean", + defaultValue: false + }, + { + id: "log-level", + name: "Logging verbosity level", + type: "combo", + options: Object.values(LogLevel), + defaultValue: LogLevel.INFO, + getValue: /* @__PURE__ */ __name((value) => { + return { + verbose: value + }; + }, "getValue") + }, + // Directories + { + id: "input-directory", + name: "Input directory", + category: ["Directories"], + type: "text", + defaultValue: "" + }, + { + id: "output-directory", + name: "Output directory", + category: ["Directories"], + type: "text", + defaultValue: "" + } +]; +function useCoreCommands() { + const workflowService = useWorkflowService(); + const workflowStore = useWorkflowStore(); + const dialogService = useDialogService(); + const getTracker = /* @__PURE__ */ __name(() => workflowStore.activeWorkflow?.changeTracker, "getTracker"); + const getSelectedNodes = /* @__PURE__ */ __name(() => { + const selectedNodes = app.canvas.selected_nodes; + const result = []; + if (selectedNodes) { + for (const i in selectedNodes) { + const node = selectedNodes[i]; + result.push(node); + } + } + return result; + }, "getSelectedNodes"); + const toggleSelectedNodesMode = /* @__PURE__ */ __name((mode) => { + getSelectedNodes().forEach((node) => { + if (node.mode === mode) { + node.mode = LGraphEventMode.ALWAYS; + } else { + node.mode = mode; + } + }); + }, "toggleSelectedNodesMode"); + return [ + { + id: "Comfy.NewBlankWorkflow", + icon: "pi pi-plus", + label: "New Blank Workflow", + menubarLabel: "New", + function: /* @__PURE__ */ __name(() => workflowService.loadBlankWorkflow(), "function") + }, + { + id: "Comfy.OpenWorkflow", + icon: "pi pi-folder-open", + label: "Open Workflow", + menubarLabel: "Open", + function: /* @__PURE__ */ __name(() => { + app.ui.loadFile(); + }, "function") + }, + { + id: "Comfy.LoadDefaultWorkflow", + icon: "pi pi-code", + label: "Load Default Workflow", + function: /* @__PURE__ */ __name(() => workflowService.loadDefaultWorkflow(), "function") + }, + { + id: "Comfy.SaveWorkflow", + icon: "pi pi-save", + label: "Save Workflow", + menubarLabel: "Save", + function: /* @__PURE__ */ __name(async () => { + const workflow = useWorkflowStore().activeWorkflow; + if (!workflow) return; + await workflowService.saveWorkflow(workflow); + }, "function") + }, + { + id: "Comfy.SaveWorkflowAs", + icon: "pi pi-save", + label: "Save Workflow As", + menubarLabel: "Save As", + function: /* @__PURE__ */ __name(async () => { + const workflow = useWorkflowStore().activeWorkflow; + if (!workflow) return; + await workflowService.saveWorkflowAs(workflow); + }, "function") + }, + { + id: "Comfy.ExportWorkflow", + icon: "pi pi-download", + label: "Export Workflow", + menubarLabel: "Export", + function: /* @__PURE__ */ __name(() => { + workflowService.exportWorkflow("workflow", "workflow"); + }, "function") + }, + { + id: "Comfy.ExportWorkflowAPI", + icon: "pi pi-download", + label: "Export Workflow (API Format)", + menubarLabel: "Export (API)", + function: /* @__PURE__ */ __name(() => { + workflowService.exportWorkflow("workflow_api", "output"); + }, "function") + }, + { + id: "Comfy.Undo", + icon: "pi pi-undo", + label: "Undo", + function: /* @__PURE__ */ __name(async () => { + await getTracker()?.undo?.(); + }, "function") + }, + { + id: "Comfy.Redo", + icon: "pi pi-refresh", + label: "Redo", + function: /* @__PURE__ */ __name(async () => { + await getTracker()?.redo?.(); + }, "function") + }, + { + id: "Comfy.ClearWorkflow", + icon: "pi pi-trash", + label: "Clear Workflow", + function: /* @__PURE__ */ __name(() => { + const settingStore = useSettingStore(); + if (!settingStore.get("Comfy.ComfirmClear") || confirm("Clear workflow?")) { + app.clean(); + app.graph.clear(); + api.dispatchCustomEvent("graphCleared"); + } + }, "function") + }, + { + id: "Comfy.Canvas.ResetView", + icon: "pi pi-expand", + label: "Reset View", + function: /* @__PURE__ */ __name(() => { + app.resetView(); + }, "function") + }, + { + id: "Comfy.OpenClipspace", + icon: "pi pi-clipboard", + label: "Clipspace", + function: /* @__PURE__ */ __name(() => { + app.openClipspace(); + }, "function") + }, + { + id: "Comfy.RefreshNodeDefinitions", + icon: "pi pi-refresh", + label: "Refresh Node Definitions", + function: /* @__PURE__ */ __name(async () => { + await app.refreshComboInNodes(); + }, "function") + }, + { + id: "Comfy.Interrupt", + icon: "pi pi-stop", + label: "Interrupt", + function: /* @__PURE__ */ __name(async () => { + await api.interrupt(); + useToastStore().add({ + severity: "info", + summary: "Interrupted", + detail: "Execution has been interrupted", + life: 1e3 + }); + }, "function") + }, + { + id: "Comfy.ClearPendingTasks", + icon: "pi pi-stop", + label: "Clear Pending Tasks", + function: /* @__PURE__ */ __name(async () => { + await useQueueStore().clear(["queue"]); + useToastStore().add({ + severity: "info", + summary: "Confirmed", + detail: "Pending tasks deleted", + life: 3e3 + }); + }, "function") + }, + { + id: "Comfy.BrowseTemplates", + icon: "pi pi-folder-open", + label: "Browse Templates", + function: /* @__PURE__ */ __name(() => { + dialogService.showTemplateWorkflowsDialog(); + }, "function") + }, + { + id: "Comfy.Canvas.ZoomIn", + icon: "pi pi-plus", + label: "Zoom In", + function: /* @__PURE__ */ __name(() => { + const ds = app.canvas.ds; + ds.changeScale( + ds.scale * 1.1, + ds.element ? [ds.element.width / 2, ds.element.height / 2] : void 0 + ); + app.canvas.setDirty(true, true); + }, "function") + }, + { + id: "Comfy.Canvas.ZoomOut", + icon: "pi pi-minus", + label: "Zoom Out", + function: /* @__PURE__ */ __name(() => { + const ds = app.canvas.ds; + ds.changeScale( + ds.scale / 1.1, + ds.element ? [ds.element.width / 2, ds.element.height / 2] : void 0 + ); + app.canvas.setDirty(true, true); + }, "function") + }, + { + id: "Comfy.Canvas.FitView", + icon: "pi pi-expand", + label: "Fit view to selected nodes", + function: /* @__PURE__ */ __name(() => { + if (app.canvas.empty) { + useToastStore().add({ + severity: "error", + summary: "Empty canvas", + life: 3e3 + }); + return; + } + app.canvas.fitViewToSelectionAnimated(); + }, "function") + }, + { + id: "Comfy.Canvas.ToggleLock", + icon: "pi pi-lock", + label: "Canvas Toggle Lock", + function: /* @__PURE__ */ __name(() => { + app.canvas["read_only"] = !app.canvas["read_only"]; + }, "function") + }, + { + id: "Comfy.Canvas.ToggleLinkVisibility", + icon: "pi pi-eye", + label: "Canvas Toggle Link Visibility", + versionAdded: "1.3.6", + function: (() => { + const settingStore = useSettingStore(); + let lastLinksRenderMode = LiteGraph.SPLINE_LINK; + return () => { + const currentMode = settingStore.get("Comfy.LinkRenderMode"); + if (currentMode === LiteGraph.HIDDEN_LINK) { + settingStore.set("Comfy.LinkRenderMode", lastLinksRenderMode); + } else { + lastLinksRenderMode = currentMode; + settingStore.set("Comfy.LinkRenderMode", LiteGraph.HIDDEN_LINK); + } + }; + })() + }, + { + id: "Comfy.QueuePrompt", + icon: "pi pi-play", + label: "Queue Prompt", + versionAdded: "1.3.7", + function: /* @__PURE__ */ __name(() => { + const batchCount = useQueueSettingsStore().batchCount; + app.queuePrompt(0, batchCount); + }, "function") + }, + { + id: "Comfy.QueuePromptFront", + icon: "pi pi-play", + label: "Queue Prompt (Front)", + versionAdded: "1.3.7", + function: /* @__PURE__ */ __name(() => { + const batchCount = useQueueSettingsStore().batchCount; + app.queuePrompt(-1, batchCount); + }, "function") + }, + { + id: "Comfy.ShowSettingsDialog", + icon: "pi pi-cog", + label: "Show Settings Dialog", + versionAdded: "1.3.7", + function: /* @__PURE__ */ __name(() => { + dialogService.showSettingsDialog(); + }, "function") + }, + { + id: "Comfy.Graph.GroupSelectedNodes", + icon: "pi pi-sitemap", + label: "Group Selected Nodes", + versionAdded: "1.3.7", + function: /* @__PURE__ */ __name(() => { + const { canvas } = app; + if (!canvas.selectedItems?.size) { + useToastStore().add({ + severity: "error", + summary: "Nothing to group", + detail: "Please select the nodes (or other groups) to create a group for", + life: 3e3 + }); + return; + } + const group = new LGraphGroup(); + const padding = useSettingStore().get( + "Comfy.GroupSelectedNodes.Padding" + ); + group.resizeTo(canvas.selectedItems, padding); + canvas.graph.add(group); + useTitleEditorStore().titleEditorTarget = group; + }, "function") + }, + { + id: "Workspace.NextOpenedWorkflow", + icon: "pi pi-step-forward", + label: "Next Opened Workflow", + versionAdded: "1.3.9", + function: /* @__PURE__ */ __name(() => { + workflowService.loadNextOpenedWorkflow(); + }, "function") + }, + { + id: "Workspace.PreviousOpenedWorkflow", + icon: "pi pi-step-backward", + label: "Previous Opened Workflow", + versionAdded: "1.3.9", + function: /* @__PURE__ */ __name(() => { + workflowService.loadPreviousOpenedWorkflow(); + }, "function") + }, + { + id: "Comfy.Canvas.ToggleSelectedNodes.Mute", + icon: "pi pi-volume-off", + label: "Mute/Unmute Selected Nodes", + versionAdded: "1.3.11", + function: /* @__PURE__ */ __name(() => { + toggleSelectedNodesMode(LGraphEventMode.NEVER); + }, "function") + }, + { + id: "Comfy.Canvas.ToggleSelectedNodes.Bypass", + icon: "pi pi-shield", + label: "Bypass/Unbypass Selected Nodes", + versionAdded: "1.3.11", + function: /* @__PURE__ */ __name(() => { + toggleSelectedNodesMode(LGraphEventMode.BYPASS); + }, "function") + }, + { + id: "Comfy.Canvas.ToggleSelectedNodes.Pin", + icon: "pi pi-pin", + label: "Pin/Unpin Selected Nodes", + versionAdded: "1.3.11", + function: /* @__PURE__ */ __name(() => { + getSelectedNodes().forEach((node) => { + node.pin(!node.pinned); + }); + }, "function") + }, + { + id: "Comfy.Canvas.ToggleSelected.Pin", + icon: "pi pi-pin", + label: "Pin/Unpin Selected Items", + versionAdded: "1.3.33", + function: /* @__PURE__ */ __name(() => { + for (const item3 of app.canvas.selectedItems) { + if (item3 instanceof LGraphNode || item3 instanceof LGraphGroup) { + item3.pin(!item3.pinned); + } + } + }, "function") + }, + { + id: "Comfy.Canvas.ToggleSelectedNodes.Collapse", + icon: "pi pi-minus", + label: "Collapse/Expand Selected Nodes", + versionAdded: "1.3.11", + function: /* @__PURE__ */ __name(() => { + getSelectedNodes().forEach((node) => { + node.collapse(); + }); + }, "function") + }, + { + id: "Comfy.ToggleTheme", + icon: "pi pi-moon", + label: "Toggle Theme (Dark/Light)", + versionAdded: "1.3.12", + function: /* @__PURE__ */ (() => { + let previousDarkTheme = "dark"; + const isDarkMode = /* @__PURE__ */ __name((themeId) => themeId !== "light", "isDarkMode"); + return () => { + const settingStore = useSettingStore(); + const currentTheme = settingStore.get("Comfy.ColorPalette"); + if (isDarkMode(currentTheme)) { + previousDarkTheme = currentTheme; + settingStore.set("Comfy.ColorPalette", "light"); + } else { + settingStore.set("Comfy.ColorPalette", previousDarkTheme); + } + }; + })() + }, + { + id: "Workspace.ToggleBottomPanel", + icon: "pi pi-list", + label: "Toggle Bottom Panel", + versionAdded: "1.3.22", + function: /* @__PURE__ */ __name(() => { + useBottomPanelStore().toggleBottomPanel(); + }, "function") + }, + { + id: "Workspace.ToggleFocusMode", + icon: "pi pi-eye", + label: "Toggle Focus Mode", + versionAdded: "1.3.27", + function: /* @__PURE__ */ __name(() => { + useWorkspaceStore().toggleFocusMode(); + }, "function") + }, + { + id: "Comfy.Graph.FitGroupToContents", + icon: "pi pi-expand", + label: "Fit Group To Contents", + versionAdded: "1.4.9", + function: /* @__PURE__ */ __name(() => { + for (const group of app.canvas.selectedItems) { + if (group instanceof LGraphGroup) { + group.recomputeInsideNodes(); + const padding = useSettingStore().get( + "Comfy.GroupSelectedNodes.Padding" + ); + group.resizeTo(group.children, padding); + app.graph.change(); + } + } + }, "function") + }, + { + id: "Comfy.Help.OpenComfyUIIssues", + icon: "pi pi-github", + label: "Open ComfyUI Issues", + menubarLabel: "ComfyUI Issues", + versionAdded: "1.5.5", + function: /* @__PURE__ */ __name(() => { + window.open( + "https://github.com/comfyanonymous/ComfyUI/issues", + "_blank" + ); + }, "function") + }, + { + id: "Comfy.Help.OpenComfyUIDocs", + icon: "pi pi-info-circle", + label: "Open ComfyUI Docs", + menubarLabel: "ComfyUI Docs", + versionAdded: "1.5.5", + function: /* @__PURE__ */ __name(() => { + window.open("https://docs.comfy.org/", "_blank"); + }, "function") + }, + { + id: "Comfy.Help.OpenComfyOrgDiscord", + icon: "pi pi-discord", + label: "Open Comfy-Org Discord", + menubarLabel: "Comfy-Org Discord", + versionAdded: "1.5.5", + function: /* @__PURE__ */ __name(() => { + window.open("https://www.comfy.org/discord", "_blank"); + }, "function") + }, + { + id: "Workspace.SearchBox.Toggle", + icon: "pi pi-search", + label: "Toggle Search Box", + versionAdded: "1.5.7", + function: /* @__PURE__ */ __name(() => { + useSearchBoxStore().toggleVisible(); + }, "function") + }, + { + id: "Comfy.Help.AboutComfyUI", + icon: "pi pi-info-circle", + label: "Open About ComfyUI", + menubarLabel: "About ComfyUI", + versionAdded: "1.6.4", + function: /* @__PURE__ */ __name(() => { +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + showSettingsDialog("about"); +======== + dialogService.showSettingsDialog("about"); + }, "function") + }, + { + id: "Comfy.DuplicateWorkflow", + icon: "pi pi-clone", + label: "Duplicate Current Workflow", + versionAdded: "1.6.15", + function: /* @__PURE__ */ __name(() => { + workflowService.duplicateWorkflow(workflowStore.activeWorkflow); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + }, "function") + } + ]; +} +__name(useCoreCommands, "useCoreCommands"); +function setupAutoQueueHandler() { + const queueCountStore = useQueuePendingTaskCountStore(); + const queueSettingsStore = useQueueSettingsStore(); + let graphHasChanged = false; + let internalCount = 0; + api.addEventListener("graphChanged", () => { + if (queueSettingsStore.mode === "change") { + if (internalCount) { + graphHasChanged = true; + } else { + graphHasChanged = false; + app.queuePrompt(0, queueSettingsStore.batchCount); + internalCount++; + } + } + }); + queueCountStore.$subscribe( + () => { + internalCount = queueCountStore.count; + if (!internalCount && !app.lastExecutionError) { + if (queueSettingsStore.mode === "instant" || queueSettingsStore.mode === "change" && graphHasChanged) { + graphHasChanged = false; + app.queuePrompt(0, queueSettingsStore.batchCount); + } + } + }, + { detached: true } + ); +} +__name(setupAutoQueueHandler, "setupAutoQueueHandler"); +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "GraphView", + setup(__props) { + setupAutoQueueHandler(); + const { t } = useI18n(); + const toast = useToast(); + const settingStore = useSettingStore(); + const executionStore = useExecutionStore(); + const theme10 = computed(() => settingStore.get("Comfy.ColorPalette")); + watch( + theme10, + (newTheme) => { + const DARK_THEME_CLASS = "dark-theme"; + const isDarkTheme = newTheme !== "light"; + if (isDarkTheme) { + document.body.classList.add(DARK_THEME_CLASS); + } else { + document.body.classList.remove(DARK_THEME_CLASS); + } + }, + { immediate: true } + ); + watchEffect(() => { + const fontSize = settingStore.get("Comfy.TextareaWidget.FontSize"); + document.documentElement.style.setProperty( + "--comfy-textarea-font-size", + `${fontSize}px` + ); + }); + watchEffect(() => { + const padding = settingStore.get("Comfy.TreeExplorer.ItemPadding"); + document.documentElement.style.setProperty( + "--comfy-tree-explorer-item-padding", + `${padding}px` + ); + }); + watchEffect(() => { + const locale = settingStore.get("Comfy.Locale"); + if (locale) { + i18n.global.locale.value = locale; + } + }); + watchEffect(() => { + const useNewMenu = settingStore.get("Comfy.UseNewMenu"); + if (useNewMenu === "Disabled") { + app.ui.menuContainer.style.setProperty("display", "block"); + app.ui.restoreMenuPosition(); + } else { + app.ui.menuContainer.style.setProperty("display", "none"); + } + }); + watchEffect(() => { + useQueueStore().maxHistoryItems = settingStore.get( + "Comfy.Queue.MaxHistoryItems" + ); + }); + const init = /* @__PURE__ */ __name(() => { + const coreCommands = useCoreCommands(); + useCommandStore().registerCommands(coreCommands); + useMenuItemStore().registerCoreMenuCommands(); + useKeybindingService().registerCoreKeybindings(); + useSidebarTabStore().registerCoreSidebarTabs(); + useBottomPanelStore().registerCoreBottomPanelTabs(); + app.extensionManager = useWorkspaceStore(); + }, "init"); + const queuePendingTaskCountStore = useQueuePendingTaskCountStore(); + const onStatus = /* @__PURE__ */ __name((e) => { + queuePendingTaskCountStore.update(e); + }, "onStatus"); + const reconnectingMessage = { + severity: "error", + summary: t("g.reconnecting") + }; + const onReconnecting = /* @__PURE__ */ __name(() => { + toast.remove(reconnectingMessage); + toast.add(reconnectingMessage); + }, "onReconnecting"); + const onReconnected = /* @__PURE__ */ __name(() => { + toast.remove(reconnectingMessage); + toast.add({ + severity: "success", + summary: t("g.reconnected"), + life: 2e3 + }); + }, "onReconnected"); + onMounted(() => { + api.addEventListener("status", onStatus); + api.addEventListener("reconnecting", onReconnecting); + api.addEventListener("reconnected", onReconnected); + executionStore.bindExecutionEvents(); + try { + init(); + } catch (e) { + console.error("Failed to init ComfyUI frontend", e); + } + }); + onBeforeUnmount(() => { + api.removeEventListener("status", onStatus); + api.removeEventListener("reconnecting", onReconnecting); + api.removeEventListener("reconnected", onReconnected); + executionStore.unbindExecutionEvents(); + }); + useEventListener(window, "keydown", useKeybindingService().keybindHandler); + const onGraphReady = /* @__PURE__ */ __name(() => { + requestIdleCallback( + () => { + useKeybindingService().registerUserKeybindings(); + useServerConfigStore().loadServerConfig( + SERVER_CONFIG_ITEMS, + settingStore.get("Comfy.Server.ServerConfigValues") + ); + useModelStore().loadModelFolders(); + useNodeDefStore().nodeSearchService.endsWithFilterStartSequence(""); + useNodeFrequencyStore().loadNodeFrequencies(); + }, + { timeout: 1e3 } + ); + }, "onGraphReady"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock(Fragment, null, [ + createVNode(TopMenubar), +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js + createVNode(_sfc_main$d, { onReady: onGraphReady }), + createVNode(_sfc_main$b), + createVNode(_sfc_main$a), + createVNode(_sfc_main$9), +======== + createVNode(_sfc_main$a, { onReady: onGraphReady }), + createVNode(_sfc_main$9), + createVNode(_sfc_main$r), + createVNode(_sfc_main$t), +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js + createVNode(MenuHamburger) + ], 64); + }; + } +}); +export { + _sfc_main as default +}; +<<<<<<<< HEAD:comfy/web/assets/GraphView-CtNN12CD.js +//# sourceMappingURL=GraphView-CtNN12CD.js.map +======== +//# sourceMappingURL=GraphView-HVeNbkaW.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/GraphView-HVeNbkaW.js diff --git a/comfy/web/assets/InstallView-CAcYt0HL.js b/comfy/web/assets/InstallView-CAcYt0HL.js new file mode 100644 index 000000000..055b001ec --- /dev/null +++ b/comfy/web/assets/InstallView-CAcYt0HL.js @@ -0,0 +1,1820 @@ +var __defProp = Object.defineProperty; +var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js +import { B as BaseStyle, Q as script$7, ad as UniqueComponentId, o as openBlock, f as createElementBlock, m as mergeProps, l as renderSlot, h as createCommentVNode, bZ as findIndexInList, b_ as find, k as resolveComponent, v as createBlock, K as resolveDynamicComponent, x as withCtx, z as createBaseVNode, a5 as toDisplayString, A as normalizeClass, U as findSingle, O as Fragment, au as Transition, t as withDirectives, aa as vShow, a as defineComponent, H as useI18n, b$ as useModel, r as ref, aE as onMounted, q as resolveDirective, g as createVNode, y as unref, ao as script$8, c0 as script$9, c1 as script$a, C as script$b, aw as createTextVNode, bV as script$c, bY as electronAPI, c2 as MigrationItems, p as computed, aL as watchEffect, P as renderList, bp as withModifiers, c3 as script$d, c4 as script$e, bL as script$f, aH as script$g, aA as script$h, bS as useRouter, aN as toRaw, _ as _export_sfc } from "./index-BK27PIiK.js"; +var theme = /* @__PURE__ */ __name(function theme2(_ref) { + var dt = _ref.dt; + return "\n.p-steplist {\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow-x: auto;\n}\n\n.p-step {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: ".concat(dt("stepper.step.gap"), ";\n padding: ").concat(dt("stepper.step.padding"), ";\n}\n\n.p-step:last-of-type {\n flex: initial;\n}\n\n.p-step-header {\n border: 0 none;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ";\n border-radius: ").concat(dt("stepper.step.header.border.radius"), ";\n outline-color: transparent;\n background: transparent;\n padding: ").concat(dt("stepper.step.header.padding"), ";\n gap: ").concat(dt("stepper.step.header.gap"), ";\n}\n\n.p-step-header:focus-visible {\n box-shadow: ").concat(dt("stepper.step.header.focus.ring.shadow"), ";\n outline: ").concat(dt("stepper.step.header.focus.ring.width"), " ").concat(dt("stepper.step.header.focus.ring.style"), " ").concat(dt("stepper.step.header.focus.ring.color"), ";\n outline-offset: ").concat(dt("stepper.step.header.focus.ring.offset"), ";\n}\n\n.p-stepper.p-stepper-readonly .p-step {\n cursor: auto;\n}\n\n.p-step-title {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n color: ").concat(dt("stepper.step.title.color"), ";\n font-weight: ").concat(dt("stepper.step.title.font.weight"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n color: ").concat(dt("stepper.step.number.color"), ";\n border: 2px solid ").concat(dt("stepper.step.number.border.color"), ";\n background: ").concat(dt("stepper.step.number.background"), ";\n min-width: ").concat(dt("stepper.step.number.size"), ";\n height: ").concat(dt("stepper.step.number.size"), ";\n line-height: ").concat(dt("stepper.step.number.size"), ";\n font-size: ").concat(dt("stepper.step.number.font.size"), ";\n z-index: 1;\n border-radius: ").concat(dt("stepper.step.number.border.radius"), ";\n position: relative;\n font-weight: ").concat(dt("stepper.step.number.font.weight"), ';\n}\n\n.p-step-number::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ').concat(dt("stepper.step.number.border.radius"), ";\n box-shadow: ").concat(dt("stepper.step.number.shadow"), ";\n}\n\n.p-step-active .p-step-header {\n cursor: default;\n}\n\n.p-step-active .p-step-number {\n background: ").concat(dt("stepper.step.number.active.background"), ";\n border-color: ").concat(dt("stepper.step.number.active.border.color"), ";\n color: ").concat(dt("stepper.step.number.active.color"), ";\n}\n\n.p-step-active .p-step-title {\n color: ").concat(dt("stepper.step.title.active.color"), ";\n}\n\n.p-step:not(.p-disabled):focus-visible {\n outline: ").concat(dt("focus.ring.width"), " ").concat(dt("focus.ring.style"), " ").concat(dt("focus.ring.color"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-step:has(~ .p-step-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepper-separator {\n flex: 1 1 0;\n background: ").concat(dt("stepper.separator.background"), ";\n width: 100%;\n height: ").concat(dt("stepper.separator.size"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-steppanels {\n padding: ").concat(dt("stepper.steppanels.padding"), ";\n}\n\n.p-steppanel {\n background: ").concat(dt("stepper.steppanel.background"), ";\n color: ").concat(dt("stepper.steppanel.color"), ";\n}\n\n.p-stepper:has(.p-stepitem) {\n display: flex;\n flex-direction: column;\n}\n\n.p-stepitem {\n display: flex;\n flex-direction: column;\n flex: initial;\n}\n\n.p-stepitem.p-stepitem-active {\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-step {\n flex: initial;\n}\n\n.p-stepitem .p-steppanel-content {\n width: 100%;\n padding: ").concat(dt("stepper.steppanel.padding"), ";\n margin-inline-start: 1rem;\n}\n\n.p-stepitem .p-steppanel {\n display: flex;\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-stepper-separator {\n flex: 0 0 auto;\n width: ").concat(dt("stepper.separator.size"), ";\n height: auto;\n margin: ").concat(dt("stepper.separator.margin"), ";\n position: relative;\n left: calc(-1 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem .p-stepper-separator:dir(rtl) {\n left: calc(-9 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem:has(~ .p-stepitem-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepitem:last-of-type .p-steppanel {\n padding-inline-start: ").concat(dt("stepper.step.number.size"), ";\n}\n"); +}, "theme"); +======== +import { B as BaseStyle, q as script$6, o as openBlock, f as createElementBlock, D as mergeProps, c1 as findIndexInList, c2 as find, aB as resolveComponent, k as createBlock, G as resolveDynamicComponent, M as withCtx, H as createBaseVNode, X as toDisplayString, J as renderSlot, I as createCommentVNode, T as normalizeClass, P as findSingle, F as Fragment, aC as Transition, i as withDirectives, v as vShow, ak as UniqueComponentId, d as defineComponent, ab as ref, c3 as useModel, N as createVNode, j as unref, c4 as script$7, bQ as script$8, bM as withModifiers, aP as script$9, a1 as useI18n, c as computed, aI as script$a, aE as createTextVNode, c0 as electronAPI, m as onMounted, r as resolveDirective, av as script$b, c5 as script$c, c6 as script$d, l as script$e, bZ as script$f, c7 as MigrationItems, w as watchEffect, E as renderList, c8 as script$g, bW as useRouter, aL as pushScopeId, aM as popScopeId, aU as toRaw, _ as _export_sfc } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$5 } from "./BaseViewTemplate-BNGF4K22.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js +var classes$4 = { + root: /* @__PURE__ */ __name(function root(_ref) { + var instance = _ref.instance; + return ["p-step", { + "p-step-active": instance.active, + "p-disabled": instance.isStepDisabled + }]; + }, "root"), + header: "p-step-header", + number: "p-step-number", + title: "p-step-title" +}; +var StepStyle = BaseStyle.extend({ + name: "step", + classes: classes$4 +}); +var script$2$2 = { + name: "StepperSeparator", + hostName: "Stepper", + "extends": script$6 +}; +function render$1$2(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("span", mergeProps({ + "class": _ctx.cx("separator") + }, _ctx.ptm("separator")), null, 16); +} +__name(render$1$2, "render$1$2"); +script$2$2.render = render$1$2; +var script$1$4 = { + name: "BaseStep", + "extends": script$6, + props: { + value: { + type: [String, Number], + "default": void 0 + }, + disabled: { + type: Boolean, + "default": false + }, + asChild: { + type: Boolean, + "default": false + }, + as: { + type: [String, Object], + "default": "DIV" + } + }, + style: StepStyle, + provide: /* @__PURE__ */ __name(function provide() { + return { + $pcStep: this, + $parentInstance: this + }; + }, "provide") +}; +var script$5 = { + name: "Step", + "extends": script$1$4, + inheritAttrs: false, + inject: { + $pcStepper: { + "default": null + }, + $pcStepList: { + "default": null + }, + $pcStepItem: { + "default": null + } + }, + data: /* @__PURE__ */ __name(function data() { + return { + isSeparatorVisible: false + }; + }, "data"), + mounted: /* @__PURE__ */ __name(function mounted() { + if (this.$el && this.$pcStepList) { + var index = findIndexInList(this.$el, find(this.$pcStepper.$el, '[data-pc-name="step"]')); + var stepLen = find(this.$pcStepper.$el, '[data-pc-name="step"]').length; + this.isSeparatorVisible = index !== stepLen - 1; + } + }, "mounted"), + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions(key) { + var _ptm = key === "root" ? this.ptmi : this.ptm; + return _ptm(key, { + context: { + active: this.active, + disabled: this.isStepDisabled + } + }); + }, "getPTOptions"), + onStepClick: /* @__PURE__ */ __name(function onStepClick() { + this.$pcStepper.updateValue(this.activeValue); + }, "onStepClick") + }, + computed: { + active: /* @__PURE__ */ __name(function active() { + return this.$pcStepper.isStepActive(this.activeValue); + }, "active"), + activeValue: /* @__PURE__ */ __name(function activeValue() { + var _this$$pcStepItem; + return !!this.$pcStepItem ? (_this$$pcStepItem = this.$pcStepItem) === null || _this$$pcStepItem === void 0 ? void 0 : _this$$pcStepItem.value : this.value; + }, "activeValue"), + isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled() { + return !this.active && (this.$pcStepper.isStepDisabled() || this.disabled); + }, "isStepDisabled"), + id: /* @__PURE__ */ __name(function id() { + var _this$$pcStepper; + return "".concat((_this$$pcStepper = this.$pcStepper) === null || _this$$pcStepper === void 0 ? void 0 : _this$$pcStepper.id, "_step_").concat(this.activeValue); + }, "id"), + ariaControls: /* @__PURE__ */ __name(function ariaControls() { + var _this$$pcStepper2; + return "".concat((_this$$pcStepper2 = this.$pcStepper) === null || _this$$pcStepper2 === void 0 ? void 0 : _this$$pcStepper2.id, "_steppanel_").concat(this.activeValue); + }, "ariaControls"), + a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs() { + return { + root: { + role: "presentation", + "aria-current": this.active ? "step" : void 0, + "data-pc-name": "step", + "data-pc-section": "root", + "data-p-disabled": this.disabled, + "data-p-active": this.active + }, + header: { + id: this.id, + role: "tab", + taindex: this.disabled ? -1 : void 0, + "aria-controls": this.ariaControls, + "data-pc-section": "header", + disabled: this.disabled, + onClick: this.onStepClick + } + }; + }, "a11yAttrs") + }, + components: { + StepperSeparator: script$2$2 + } +}; +var _hoisted_1$5 = ["id", "tabindex", "aria-controls", "disabled"]; +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js +function render$2(_ctx, _cache, $props, $setup, $data, $options) { +======== +function render$4(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + var _component_StepperSeparator = resolveComponent("StepperSeparator"); + return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ + key: 0, + "class": _ctx.cx("root"), + "aria-current": $options.active ? "step" : void 0, + role: "presentation", + "data-p-active": $options.active, + "data-p-disabled": $options.isStepDisabled + }, $options.getPTOptions("root")), { + "default": withCtx(function() { + return [createBaseVNode("button", mergeProps({ + id: $options.id, + "class": _ctx.cx("header"), + role: "tab", + type: "button", + tabindex: $options.isStepDisabled ? -1 : void 0, + "aria-controls": $options.ariaControls, + disabled: $options.isStepDisabled, + onClick: _cache[0] || (_cache[0] = function() { + return $options.onStepClick && $options.onStepClick.apply($options, arguments); + }) + }, $options.getPTOptions("header")), [createBaseVNode("span", mergeProps({ + "class": _ctx.cx("number") + }, $options.getPTOptions("number")), toDisplayString($options.activeValue), 17), createBaseVNode("span", mergeProps({ + "class": _ctx.cx("title") + }, $options.getPTOptions("title")), [renderSlot(_ctx.$slots, "default")], 16)], 16, _hoisted_1$5), $data.isSeparatorVisible ? (openBlock(), createBlock(_component_StepperSeparator, { + key: 0 + })) : createCommentVNode("", true)]; + }), + _: 3 + }, 16, ["class", "aria-current", "data-p-active", "data-p-disabled"])) : renderSlot(_ctx.$slots, "default", { + key: 1, + "class": normalizeClass(_ctx.cx("root")), + active: $options.active, + value: _ctx.value, + a11yAttrs: $options.a11yAttrs, + activateCallback: $options.onStepClick + }); +} +__name(render$4, "render$4"); +script$5.render = render$4; +var classes$3 = { + root: "p-steplist" +}; +var StepListStyle = BaseStyle.extend({ + name: "steplist", + classes: classes$3 +}); +var script$1$3 = { + name: "BaseStepList", + "extends": script$6, + style: StepListStyle, + provide: /* @__PURE__ */ __name(function provide2() { + return { + $pcStepList: this, + $parentInstance: this + }; + }, "provide") +}; +var script$4 = { + name: "StepList", + "extends": script$1$3, + inheritAttrs: false +}; +function render$3(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); +} +__name(render$3, "render$3"); +script$4.render = render$3; +var classes$2 = { + root: /* @__PURE__ */ __name(function root2(_ref) { + var instance = _ref.instance; + return ["p-steppanel", { + "p-steppanel-active": instance.isVertical && instance.active + }]; + }, "root"), + content: "p-steppanel-content" +}; +var StepPanelStyle = BaseStyle.extend({ + name: "steppanel", + classes: classes$2 +}); +var script$2$1 = { + name: "StepperSeparator", + hostName: "Stepper", + "extends": script$6 +}; +function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("span", mergeProps({ + "class": _ctx.cx("separator") + }, _ctx.ptm("separator")), null, 16); +} +__name(render$1$1, "render$1$1"); +script$2$1.render = render$1$1; +var script$1$2 = { + name: "BaseStepPanel", + "extends": script$6, + props: { + value: { + type: [String, Number], + "default": void 0 + }, + asChild: { + type: Boolean, + "default": false + }, + as: { + type: [String, Object], + "default": "DIV" + } + }, + style: StepPanelStyle, + provide: /* @__PURE__ */ __name(function provide3() { + return { + $pcStepPanel: this, + $parentInstance: this + }; + }, "provide") +}; +var script$3 = { + name: "StepPanel", + "extends": script$1$2, + inheritAttrs: false, + inject: { + $pcStepper: { + "default": null + }, + $pcStepItem: { + "default": null + }, + $pcStepList: { + "default": null + } + }, + data: /* @__PURE__ */ __name(function data2() { + return { + isSeparatorVisible: false + }; + }, "data"), + mounted: /* @__PURE__ */ __name(function mounted2() { + if (this.$el) { + var _this$$pcStepItem, _this$$pcStepList; + var stepElements = find(this.$pcStepper.$el, '[data-pc-name="step"]'); + var stepPanelEl = findSingle(this.isVertical ? (_this$$pcStepItem = this.$pcStepItem) === null || _this$$pcStepItem === void 0 ? void 0 : _this$$pcStepItem.$el : (_this$$pcStepList = this.$pcStepList) === null || _this$$pcStepList === void 0 ? void 0 : _this$$pcStepList.$el, '[data-pc-name="step"]'); + var stepPanelIndex = findIndexInList(stepPanelEl, stepElements); + this.isSeparatorVisible = this.isVertical && stepPanelIndex !== stepElements.length - 1; + } + }, "mounted"), + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions2(key) { + var _ptm = key === "root" ? this.ptmi : this.ptm; + return _ptm(key, { + context: { + active: this.active + } + }); + }, "getPTOptions"), + updateValue: /* @__PURE__ */ __name(function updateValue(val) { + this.$pcStepper.updateValue(val); + }, "updateValue") + }, + computed: { + active: /* @__PURE__ */ __name(function active2() { + var _this$$pcStepItem2, _this$$pcStepper; + var activeValue3 = !!this.$pcStepItem ? (_this$$pcStepItem2 = this.$pcStepItem) === null || _this$$pcStepItem2 === void 0 ? void 0 : _this$$pcStepItem2.value : this.value; + return activeValue3 === ((_this$$pcStepper = this.$pcStepper) === null || _this$$pcStepper === void 0 ? void 0 : _this$$pcStepper.d_value); + }, "active"), + isVertical: /* @__PURE__ */ __name(function isVertical() { + return !!this.$pcStepItem; + }, "isVertical"), + activeValue: /* @__PURE__ */ __name(function activeValue2() { + var _this$$pcStepItem3; + return this.isVertical ? (_this$$pcStepItem3 = this.$pcStepItem) === null || _this$$pcStepItem3 === void 0 ? void 0 : _this$$pcStepItem3.value : this.value; + }, "activeValue"), + id: /* @__PURE__ */ __name(function id2() { + var _this$$pcStepper2; + return "".concat((_this$$pcStepper2 = this.$pcStepper) === null || _this$$pcStepper2 === void 0 ? void 0 : _this$$pcStepper2.id, "_steppanel_").concat(this.activeValue); + }, "id"), + ariaControls: /* @__PURE__ */ __name(function ariaControls2() { + var _this$$pcStepper3; + return "".concat((_this$$pcStepper3 = this.$pcStepper) === null || _this$$pcStepper3 === void 0 ? void 0 : _this$$pcStepper3.id, "_step_").concat(this.activeValue); + }, "ariaControls"), + a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs2() { + return { + id: this.id, + role: "tabpanel", + "aria-controls": this.ariaControls, + "data-pc-name": "steppanel", + "data-p-active": this.active + }; + }, "a11yAttrs") + }, + components: { + StepperSeparator: script$2$1 + } +}; +function render$2(_ctx, _cache, $props, $setup, $data, $options) { + var _component_StepperSeparator = resolveComponent("StepperSeparator"); + return $options.isVertical ? (openBlock(), createElementBlock(Fragment, { + key: 0 + }, [!_ctx.asChild ? (openBlock(), createBlock(Transition, mergeProps({ + key: 0, + name: "p-toggleable-content" + }, _ctx.ptm("transition")), { + "default": withCtx(function() { + return [withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ + id: $options.id, + "class": _ctx.cx("root"), + role: "tabpanel", + "aria-controls": $options.ariaControls + }, $options.getPTOptions("root")), { + "default": withCtx(function() { + return [$data.isSeparatorVisible ? (openBlock(), createBlock(_component_StepperSeparator, { + key: 0 + })) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("content") + }, $options.getPTOptions("content")), [renderSlot(_ctx.$slots, "default", { + active: $options.active, + activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { + return $options.updateValue(val); + }, "activateCallback") + })], 16)]; + }), + _: 3 + }, 16, ["id", "class", "aria-controls"])), [[vShow, $options.active]])]; + }), + _: 3 + }, 16)) : renderSlot(_ctx.$slots, "default", { + key: 1, + active: $options.active, + a11yAttrs: $options.a11yAttrs, + activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { + return $options.updateValue(val); + }, "activateCallback") + })], 64)) : (openBlock(), createElementBlock(Fragment, { + key: 1 + }, [!_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ + key: 0, + id: $options.id, + "class": _ctx.cx("root"), + role: "tabpanel", + "aria-controls": $options.ariaControls + }, $options.getPTOptions("root")), { + "default": withCtx(function() { + return [renderSlot(_ctx.$slots, "default", { + active: $options.active, + activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { + return $options.updateValue(val); + }, "activateCallback") + })]; + }), + _: 3 + }, 16, ["id", "class", "aria-controls"])), [[vShow, $options.active]]) : _ctx.asChild && $options.active ? renderSlot(_ctx.$slots, "default", { + key: 1, + active: $options.active, + a11yAttrs: $options.a11yAttrs, + activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { + return $options.updateValue(val); + }, "activateCallback") + }) : createCommentVNode("", true)], 64)); +} +__name(render$2, "render$2"); +script$3.render = render$2; +var classes$1 = { + root: "p-steppanels" +}; +var StepPanelsStyle = BaseStyle.extend({ + name: "steppanels", + classes: classes$1 +}); +var script$1$1 = { + name: "BaseStepPanels", + "extends": script$6, + style: StepPanelsStyle, + provide: /* @__PURE__ */ __name(function provide4() { + return { + $pcStepPanels: this, + $parentInstance: this + }; + }, "provide") +}; +var script$2 = { + name: "StepPanels", + "extends": script$1$1, + inheritAttrs: false +}; +function render$1(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); +} +__name(render$1, "render$1"); +script$2.render = render$1; +var theme = /* @__PURE__ */ __name(function theme2(_ref) { + var dt = _ref.dt; + return "\n.p-steplist {\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow-x: auto;\n}\n\n.p-step {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: ".concat(dt("stepper.step.gap"), ";\n padding: ").concat(dt("stepper.step.padding"), ";\n}\n\n.p-step:last-of-type {\n flex: initial;\n}\n\n.p-step-header {\n border: 0 none;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ";\n border-radius: ").concat(dt("stepper.step.header.border.radius"), ";\n outline-color: transparent;\n background: transparent;\n padding: ").concat(dt("stepper.step.header.padding"), ";\n gap: ").concat(dt("stepper.step.header.gap"), ";\n}\n\n.p-step-header:focus-visible {\n box-shadow: ").concat(dt("stepper.step.header.focus.ring.shadow"), ";\n outline: ").concat(dt("stepper.step.header.focus.ring.width"), " ").concat(dt("stepper.step.header.focus.ring.style"), " ").concat(dt("stepper.step.header.focus.ring.color"), ";\n outline-offset: ").concat(dt("stepper.step.header.focus.ring.offset"), ";\n}\n\n.p-stepper.p-stepper-readonly .p-step {\n cursor: auto;\n}\n\n.p-step-title {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n color: ").concat(dt("stepper.step.title.color"), ";\n font-weight: ").concat(dt("stepper.step.title.font.weight"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n color: ").concat(dt("stepper.step.number.color"), ";\n border: 2px solid ").concat(dt("stepper.step.number.border.color"), ";\n background: ").concat(dt("stepper.step.number.background"), ";\n min-width: ").concat(dt("stepper.step.number.size"), ";\n height: ").concat(dt("stepper.step.number.size"), ";\n line-height: ").concat(dt("stepper.step.number.size"), ";\n font-size: ").concat(dt("stepper.step.number.font.size"), ";\n z-index: 1;\n border-radius: ").concat(dt("stepper.step.number.border.radius"), ";\n position: relative;\n font-weight: ").concat(dt("stepper.step.number.font.weight"), ';\n}\n\n.p-step-number::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ').concat(dt("stepper.step.number.border.radius"), ";\n box-shadow: ").concat(dt("stepper.step.number.shadow"), ";\n}\n\n.p-step-active .p-step-header {\n cursor: default;\n}\n\n.p-step-active .p-step-number {\n background: ").concat(dt("stepper.step.number.active.background"), ";\n border-color: ").concat(dt("stepper.step.number.active.border.color"), ";\n color: ").concat(dt("stepper.step.number.active.color"), ";\n}\n\n.p-step-active .p-step-title {\n color: ").concat(dt("stepper.step.title.active.color"), ";\n}\n\n.p-step:not(.p-disabled):focus-visible {\n outline: ").concat(dt("focus.ring.width"), " ").concat(dt("focus.ring.style"), " ").concat(dt("focus.ring.color"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-step:has(~ .p-step-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepper-separator {\n flex: 1 1 0;\n background: ").concat(dt("stepper.separator.background"), ";\n width: 100%;\n height: ").concat(dt("stepper.separator.size"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-steppanels {\n padding: ").concat(dt("stepper.steppanels.padding"), ";\n}\n\n.p-steppanel {\n background: ").concat(dt("stepper.steppanel.background"), ";\n color: ").concat(dt("stepper.steppanel.color"), ";\n}\n\n.p-stepper:has(.p-stepitem) {\n display: flex;\n flex-direction: column;\n}\n\n.p-stepitem {\n display: flex;\n flex-direction: column;\n flex: initial;\n}\n\n.p-stepitem.p-stepitem-active {\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-step {\n flex: initial;\n}\n\n.p-stepitem .p-steppanel-content {\n width: 100%;\n padding: ").concat(dt("stepper.steppanel.padding"), ";\n}\n\n.p-stepitem .p-steppanel {\n display: flex;\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-stepper-separator {\n flex: 0 0 auto;\n width: ").concat(dt("stepper.separator.size"), ";\n height: auto;\n margin: ").concat(dt("stepper.separator.margin"), ";\n position: relative;\n left: calc(-1 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem:has(~ .p-stepitem-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepitem:last-of-type .p-steppanel {\n padding-inline-start: ").concat(dt("stepper.step.number.size"), ";\n}\n"); +}, "theme"); +var classes = { + root: /* @__PURE__ */ __name(function root3(_ref2) { + var props = _ref2.props; + return ["p-stepper p-component", { + "p-readonly": props.linear + }]; + }, "root"), + separator: "p-stepper-separator" +}; +var StepperStyle = BaseStyle.extend({ + name: "stepper", + theme, + classes +}); +var script$1 = { + name: "BaseStepper", + "extends": script$6, + props: { + value: { + type: [String, Number], + "default": void 0 + }, + linear: { + type: Boolean, + "default": false + } + }, + style: StepperStyle, + provide: /* @__PURE__ */ __name(function provide5() { + return { + $pcStepper: this, + $parentInstance: this + }; + }, "provide") +}; +var script = { + name: "Stepper", + "extends": script$1, + inheritAttrs: false, + emits: ["update:value"], + data: /* @__PURE__ */ __name(function data3() { + return { + id: this.$attrs.id, + d_value: this.value + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + value: /* @__PURE__ */ __name(function value(newValue) { + this.d_value = newValue; + }, "value") + }, + mounted: /* @__PURE__ */ __name(function mounted3() { + this.id = this.id || UniqueComponentId(); + }, "mounted"), + methods: { + updateValue: /* @__PURE__ */ __name(function updateValue2(newValue) { + if (this.d_value !== newValue) { + this.d_value = newValue; + this.$emit("update:value", newValue); + } + }, "updateValue"), + isStepActive: /* @__PURE__ */ __name(function isStepActive(value2) { + return this.d_value === value2; + }, "isStepActive"), + isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled2() { + return this.linear; + }, "isStepDisabled") + } +}; +function render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root"), + role: "tablist" + }, _ctx.ptmi("root")), [_ctx.$slots.start ? renderSlot(_ctx.$slots, "start", { + key: 0 + }) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), _ctx.$slots.end ? renderSlot(_ctx.$slots, "end", { + key: 1 + }) : createCommentVNode("", true)], 16); +} +__name(render, "render"); +script.render = render; +const _hoisted_1$4 = { class: "flex flex-col gap-6 w-[600px]" }; +const _hoisted_2$4 = { class: "flex flex-col gap-4" }; +const _hoisted_3$4 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$4 = { class: "text-neutral-400 my-0" }; +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js +const _hoisted_5$4 = { class: "flex gap-2" }; +const _hoisted_6$3 = { class: "bg-neutral-800 p-4 rounded-lg" }; +const _hoisted_7$3 = { class: "text-lg font-medium mt-0 mb-3 text-neutral-100" }; +const _hoisted_8$3 = { class: "flex flex-col gap-2" }; +const _hoisted_9$3 = { class: "flex items-center gap-2" }; +const _hoisted_10$3 = { class: "text-neutral-200" }; +const _hoisted_11$3 = { class: "pi pi-info-circle" }; +const _hoisted_12$3 = { class: "flex items-center gap-2" }; +const _hoisted_13$1 = { class: "text-neutral-200" }; +const _hoisted_14$1 = { class: "pi pi-info-circle" }; +const _sfc_main$4 = /* @__PURE__ */ defineComponent({ +======== +const _hoisted_5$3 = { class: "flex flex-col bg-neutral-800 p-4 rounded-lg" }; +const _hoisted_6$3 = { class: "flex items-center gap-4" }; +const _hoisted_7$3 = { class: "flex-1" }; +const _hoisted_8$3 = { class: "text-lg font-medium text-neutral-100" }; +const _hoisted_9$3 = { class: "text-sm text-neutral-400 mt-1" }; +const _hoisted_10$3 = { class: "flex items-center gap-4" }; +const _hoisted_11$3 = { class: "flex-1" }; +const _hoisted_12$3 = { class: "text-lg font-medium text-neutral-100" }; +const _hoisted_13$2 = { class: "text-sm text-neutral-400 mt-1" }; +const _hoisted_14$2 = { class: "text-neutral-300" }; +const _hoisted_15$2 = { class: "font-medium mb-2" }; +const _hoisted_16$2 = { class: "list-disc pl-6 space-y-1" }; +const _hoisted_17$2 = { class: "font-medium mt-4 mb-2" }; +const _hoisted_18$2 = { class: "list-disc pl-6 space-y-1" }; +const _sfc_main$4 = /* @__PURE__ */ defineComponent({ + __name: "DesktopSettingsConfiguration", + props: { + "autoUpdate": { required: true }, + "autoUpdateModifiers": {}, + "allowMetrics": { required: true }, + "allowMetricsModifiers": {} + }, + emits: ["update:autoUpdate", "update:allowMetrics"], + setup(__props) { + const showDialog = ref(false); + const autoUpdate = useModel(__props, "autoUpdate"); + const allowMetrics = useModel(__props, "allowMetrics"); + const showMetricsInfo = /* @__PURE__ */ __name(() => { + showDialog.value = true; + }, "showMetricsInfo"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$4, [ + createBaseVNode("div", _hoisted_2$4, [ + createBaseVNode("h2", _hoisted_3$4, toDisplayString(_ctx.$t("install.desktopAppSettings")), 1), + createBaseVNode("p", _hoisted_4$4, toDisplayString(_ctx.$t("install.desktopAppSettingsDescription")), 1) + ]), + createBaseVNode("div", _hoisted_5$3, [ + createBaseVNode("div", _hoisted_6$3, [ + createBaseVNode("div", _hoisted_7$3, [ + createBaseVNode("h3", _hoisted_8$3, toDisplayString(_ctx.$t("install.settings.autoUpdate")), 1), + createBaseVNode("p", _hoisted_9$3, toDisplayString(_ctx.$t("install.settings.autoUpdateDescription")), 1) + ]), + createVNode(unref(script$7), { + modelValue: autoUpdate.value, + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => autoUpdate.value = $event) + }, null, 8, ["modelValue"]) + ]), + createVNode(unref(script$8)), + createBaseVNode("div", _hoisted_10$3, [ + createBaseVNode("div", _hoisted_11$3, [ + createBaseVNode("h3", _hoisted_12$3, toDisplayString(_ctx.$t("install.settings.allowMetrics")), 1), + createBaseVNode("p", _hoisted_13$2, toDisplayString(_ctx.$t("install.settings.allowMetricsDescription")), 1), + createBaseVNode("a", { + href: "#", + class: "text-sm text-blue-400 hover:text-blue-300 mt-1 inline-block", + onClick: withModifiers(showMetricsInfo, ["prevent"]) + }, toDisplayString(_ctx.$t("install.settings.learnMoreAboutData")), 1) + ]), + createVNode(unref(script$7), { + modelValue: allowMetrics.value, + "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => allowMetrics.value = $event) + }, null, 8, ["modelValue"]) + ]) + ]), + createVNode(unref(script$9), { + visible: showDialog.value, + "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => showDialog.value = $event), + modal: "", + header: _ctx.$t("install.settings.dataCollectionDialog.title") + }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_14$2, [ + createBaseVNode("h4", _hoisted_15$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeCollect")), 1), + createBaseVNode("ul", _hoisted_16$2, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.errorReports")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.systemInfo")), 1) + ]), + createBaseVNode("h4", _hoisted_17$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeDoNotCollect")), 1), + createBaseVNode("ul", _hoisted_18$2, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.personalInformation")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.workflowContents")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.fileSystemInformation")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t( + "install.settings.dataCollectionDialog.customNodeConfigurations" + )), 1) + ]) + ]) + ]), + _: 1 + }, 8, ["visible", "header"]) + ]); + }; + } +}); +const _imports_0 = "" + new URL("images/nvidia-logo.svg", import.meta.url).href; +const _imports_1 = "" + new URL("images/apple-mps-logo.png", import.meta.url).href; +const _imports_2 = "" + new URL("images/manual-configuration.svg", import.meta.url).href; +const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px] h-[30rem] select-none" }; +const _hoisted_2$3 = { class: "grow flex flex-col gap-4 text-neutral-300" }; +const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$3 = { class: "m-1 text-neutral-400" }; +const _hoisted_5$2 = /* @__PURE__ */ createBaseVNode("img", { + class: "m-12", + alt: "NVIDIA logo", + width: "196", + height: "32", + src: _imports_0 +}, null, -1); +const _hoisted_6$2 = [ + _hoisted_5$2 +]; +const _hoisted_7$2 = /* @__PURE__ */ createBaseVNode("img", { + class: "rounded-lg hover-brighten", + alt: "Apple Metal Performance Shaders Logo", + width: "292", + ratio: "", + src: _imports_1 +}, null, -1); +const _hoisted_8$2 = [ + _hoisted_7$2 +]; +const _hoisted_9$2 = /* @__PURE__ */ createBaseVNode("img", { + class: "m-12", + alt: "Manual configuration", + width: "196", + src: _imports_2 +}, null, -1); +const _hoisted_10$2 = [ + _hoisted_9$2 +]; +const _hoisted_11$2 = { + key: 0, + class: "m-1" +}; +const _hoisted_12$2 = { + key: 1, + class: "m-1" +}; +const _hoisted_13$1 = { + key: 2, + class: "text-neutral-300" +}; +const _hoisted_14$1 = { class: "m-1" }; +const _hoisted_15$1 = { key: 3 }; +const _hoisted_16$1 = { class: "m-1" }; +const _hoisted_17$1 = { class: "m-1" }; +const _hoisted_18$1 = { + for: "cpu-mode", + class: "select-none" +}; +const _sfc_main$3 = /* @__PURE__ */ defineComponent({ + __name: "GpuPicker", + props: { + "device": { + required: true + }, + "deviceModifiers": {} + }, + emits: ["update:device"], + setup(__props) { + const { t } = useI18n(); + const cpuMode = computed({ + get: /* @__PURE__ */ __name(() => selected.value === "cpu", "get"), + set: /* @__PURE__ */ __name((value2) => { + selected.value = value2 ? "cpu" : null; + }, "set") + }); + const selected = useModel(__props, "device"); + const electron = electronAPI(); + const platform = electron.getPlatform(); + const pickGpu = /* @__PURE__ */ __name((value2) => { + const newValue = selected.value === value2 ? null : value2; + selected.value = newValue; + }, "pickGpu"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$3, [ + createBaseVNode("div", _hoisted_2$3, [ + createBaseVNode("h2", _hoisted_3$3, toDisplayString(_ctx.$t("install.gpuSelection.selectGpu")), 1), + createBaseVNode("p", _hoisted_4$3, toDisplayString(_ctx.$t("install.gpuSelection.selectGpuDescription")) + ": ", 1), + createBaseVNode("div", { + class: normalizeClass(["flex gap-2 text-center transition-opacity", { selected: selected.value }]) + }, [ + unref(platform) !== "darwin" ? (openBlock(), createElementBlock("div", { + key: 0, + class: normalizeClass(["gpu-button", { selected: selected.value === "nvidia" }]), + role: "button", + onClick: _cache[0] || (_cache[0] = ($event) => pickGpu("nvidia")) + }, _hoisted_6$2, 2)) : createCommentVNode("", true), + unref(platform) === "darwin" ? (openBlock(), createElementBlock("div", { + key: 1, + class: normalizeClass(["gpu-button", { selected: selected.value === "mps" }]), + role: "button", + onClick: _cache[1] || (_cache[1] = ($event) => pickGpu("mps")) + }, _hoisted_8$2, 2)) : createCommentVNode("", true), + createBaseVNode("div", { + class: normalizeClass(["gpu-button", { selected: selected.value === "unsupported" }]), + role: "button", + onClick: _cache[2] || (_cache[2] = ($event) => pickGpu("unsupported")) + }, _hoisted_10$2, 2) + ], 2), + selected.value === "nvidia" ? (openBlock(), createElementBlock("p", _hoisted_11$2, [ + createVNode(unref(script$a), { + icon: "pi pi-check", + severity: "success", + value: "CUDA" + }), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.nvidiaDescription")), 1) + ])) : createCommentVNode("", true), + selected.value === "mps" ? (openBlock(), createElementBlock("p", _hoisted_12$2, [ + createVNode(unref(script$a), { + icon: "pi pi-check", + severity: "success", + value: "MPS" + }), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.mpsDescription")), 1) + ])) : createCommentVNode("", true), + selected.value === "unsupported" ? (openBlock(), createElementBlock("div", _hoisted_13$1, [ + createBaseVNode("p", _hoisted_14$1, [ + createVNode(unref(script$a), { + icon: "pi pi-exclamation-triangle", + severity: "warn", + value: unref(t)("icon.exclamation-triangle") + }, null, 8, ["value"]), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.customSkipsPython")), 1) + ]), + createBaseVNode("ul", null, [ + createBaseVNode("li", null, [ + createBaseVNode("strong", null, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1) + ]), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customMayNotWork")), 1) + ]) + ])) : createCommentVNode("", true), + selected.value === "cpu" ? (openBlock(), createElementBlock("div", _hoisted_15$1, [ + createBaseVNode("p", _hoisted_16$1, [ + createVNode(unref(script$a), { + icon: "pi pi-exclamation-triangle", + severity: "warn", + value: unref(t)("icon.exclamation-triangle") + }, null, 8, ["value"]), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription")), 1) + ]), + createBaseVNode("p", _hoisted_17$1, toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription2")), 1) + ])) : createCommentVNode("", true) + ]), + createBaseVNode("div", { + class: normalizeClass(["transition-opacity flex gap-3 h-0", { + "opacity-40": selected.value && selected.value !== "cpu" + }]) + }, [ + createVNode(unref(script$7), { + modelValue: cpuMode.value, + "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => cpuMode.value = $event), + inputId: "cpu-mode", + class: "-translate-y-40" + }, null, 8, ["modelValue"]), + createBaseVNode("label", _hoisted_18$1, toDisplayString(_ctx.$t("install.gpuSelection.enableCpuMode")), 1) + ], 2) + ]); + }; + } +}); +const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" }; +const _hoisted_2$2 = { class: "flex flex-col gap-4" }; +const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$2 = { class: "text-neutral-400 my-0" }; +const _hoisted_5$1 = { class: "flex gap-2" }; +const _hoisted_6$1 = { class: "bg-neutral-800 p-4 rounded-lg" }; +const _hoisted_7$1 = { class: "text-lg font-medium mt-0 mb-3 text-neutral-100" }; +const _hoisted_8$1 = { class: "flex flex-col gap-2" }; +const _hoisted_9$1 = { class: "flex items-center gap-2" }; +const _hoisted_10$1 = /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-folder text-neutral-400" }, null, -1); +const _hoisted_11$1 = /* @__PURE__ */ createBaseVNode("span", { class: "text-neutral-400" }, "App Data:", -1); +const _hoisted_12$1 = { class: "text-neutral-200" }; +const _hoisted_13 = { class: "pi pi-info-circle" }; +const _hoisted_14 = { class: "flex items-center gap-2" }; +const _hoisted_15 = /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-desktop text-neutral-400" }, null, -1); +const _hoisted_16 = /* @__PURE__ */ createBaseVNode("span", { class: "text-neutral-400" }, "App Path:", -1); +const _hoisted_17 = { class: "text-neutral-200" }; +const _hoisted_18 = { class: "pi pi-info-circle" }; +const _sfc_main$2 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + __name: "InstallLocationPicker", + props: { + "installPath": { required: true }, + "installPathModifiers": {}, + "pathError": { required: true }, + "pathErrorModifiers": {} + }, + emits: ["update:installPath", "update:pathError"], + setup(__props) { + const { t } = useI18n(); + const installPath = useModel(__props, "installPath"); + const pathError = useModel(__props, "pathError"); + const pathExists = ref(false); + const appData = ref(""); + const appPath = ref(""); + const electron = electronAPI(); + onMounted(async () => { + const paths = await electron.getSystemPaths(); + appData.value = paths.appData; + appPath.value = paths.appPath; + installPath.value = paths.defaultInstallPath; + await validatePath(paths.defaultInstallPath); + }); + const validatePath = /* @__PURE__ */ __name(async (path) => { + try { + pathError.value = ""; + pathExists.value = false; + const validation = await electron.validateInstallPath(path); + if (!validation.isValid) { + const errors = []; + if (validation.cannotWrite) errors.push(t("install.cannotWrite")); + if (validation.freeSpace < validation.requiredSpace) { + const requiredGB = validation.requiredSpace / 1024 / 1024 / 1024; + errors.push(`${t("install.insufficientFreeSpace")}: ${requiredGB} GB`); + } + if (validation.parentMissing) errors.push(t("install.parentMissing")); + if (validation.error) + errors.push(`${t("install.unhandledError")}: ${validation.error}`); + pathError.value = errors.join("\n"); + } + if (validation.exists) pathExists.value = true; + } catch (error) { + pathError.value = t("install.pathValidationFailed"); + } + }, "validatePath"); + const browsePath = /* @__PURE__ */ __name(async () => { + try { + const result = await electron.showDirectoryPicker(); + if (result) { + installPath.value = result; + await validatePath(result); + } + } catch (error) { + pathError.value = t("install.failedToSelectDirectory"); + } + }, "browsePath"); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js + return openBlock(), createElementBlock("div", _hoisted_1$4, [ + createBaseVNode("div", _hoisted_2$4, [ + createBaseVNode("h2", _hoisted_3$4, toDisplayString(_ctx.$t("install.chooseInstallationLocation")), 1), + createBaseVNode("p", _hoisted_4$4, toDisplayString(_ctx.$t("install.installLocationDescription")), 1), + createBaseVNode("div", _hoisted_5$4, [ + createVNode(unref(script$a), { class: "flex-1" }, { +======== + return openBlock(), createElementBlock("div", _hoisted_1$2, [ + createBaseVNode("div", _hoisted_2$2, [ + createBaseVNode("h2", _hoisted_3$2, toDisplayString(_ctx.$t("install.chooseInstallationLocation")), 1), + createBaseVNode("p", _hoisted_4$2, toDisplayString(_ctx.$t("install.installLocationDescription")), 1), + createBaseVNode("div", _hoisted_5$1, [ + createVNode(unref(script$d), { class: "flex-1" }, { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + default: withCtx(() => [ + createVNode(unref(script$b), { + modelValue: installPath.value, + "onUpdate:modelValue": [ + _cache[0] || (_cache[0] = ($event) => installPath.value = $event), + validatePath + ], + class: normalizeClass(["w-full", { "p-invalid": pathError.value }]) + }, null, 8, ["modelValue", "class"]), + withDirectives(createVNode(unref(script$c), { class: "pi pi-info-circle" }, null, 512), [ + [_directive_tooltip, _ctx.$t("install.installLocationTooltip")] + ]) + ]), + _: 1 + }), + createVNode(unref(script$e), { + icon: "pi pi-folder", + onClick: browsePath, + class: "w-12" + }) + ]), + pathError.value ? (openBlock(), createBlock(unref(script$f), { + key: 0, + severity: "error", + class: "whitespace-pre-line" + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(pathError.value), 1) + ]), + _: 1 + })) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js + pathExists.value ? (openBlock(), createBlock(unref(script$c), { +======== + pathExists.value ? (openBlock(), createBlock(unref(script$f), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + key: 1, + severity: "warn" + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.pathExists")), 1) + ]), + _: 1 + })) : createCommentVNode("", true) + ]), +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js + createBaseVNode("div", _hoisted_6$3, [ + createBaseVNode("h3", _hoisted_7$3, toDisplayString(_ctx.$t("install.systemLocations")), 1), + createBaseVNode("div", _hoisted_8$3, [ + createBaseVNode("div", _hoisted_9$3, [ + _cache[1] || (_cache[1] = createBaseVNode("i", { class: "pi pi-folder text-neutral-400" }, null, -1)), + _cache[2] || (_cache[2] = createBaseVNode("span", { class: "text-neutral-400" }, "App Data:", -1)), + createBaseVNode("span", _hoisted_10$3, toDisplayString(appData.value), 1), + withDirectives(createBaseVNode("span", _hoisted_11$3, null, 512), [ + [_directive_tooltip, _ctx.$t("install.appDataLocationTooltip")] + ]) + ]), + createBaseVNode("div", _hoisted_12$3, [ + _cache[3] || (_cache[3] = createBaseVNode("i", { class: "pi pi-desktop text-neutral-400" }, null, -1)), + _cache[4] || (_cache[4] = createBaseVNode("span", { class: "text-neutral-400" }, "App Path:", -1)), + createBaseVNode("span", _hoisted_13$1, toDisplayString(appPath.value), 1), + withDirectives(createBaseVNode("span", _hoisted_14$1, null, 512), [ +======== + createBaseVNode("div", _hoisted_6$1, [ + createBaseVNode("h3", _hoisted_7$1, toDisplayString(_ctx.$t("install.systemLocations")), 1), + createBaseVNode("div", _hoisted_8$1, [ + createBaseVNode("div", _hoisted_9$1, [ + _hoisted_10$1, + _hoisted_11$1, + createBaseVNode("span", _hoisted_12$1, toDisplayString(appData.value), 1), + withDirectives(createBaseVNode("span", _hoisted_13, null, 512), [ + [_directive_tooltip, _ctx.$t("install.appDataLocationTooltip")] + ]) + ]), + createBaseVNode("div", _hoisted_14, [ + _hoisted_15, + _hoisted_16, + createBaseVNode("span", _hoisted_17, toDisplayString(appPath.value), 1), + withDirectives(createBaseVNode("span", _hoisted_18, null, 512), [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + [_directive_tooltip, _ctx.$t("install.appPathLocationTooltip")] + ]) + ]) + ]) + ]) + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js +const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px]" }; +const _hoisted_2$3 = { class: "flex flex-col gap-4" }; +const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$3 = { class: "text-neutral-400 my-0" }; +const _hoisted_5$3 = { class: "flex gap-2" }; +const _hoisted_6$2 = { + key: 0, + class: "flex flex-col gap-4 bg-neutral-800 p-4 rounded-lg" +}; +const _hoisted_7$2 = { class: "text-lg mt-0 font-medium text-neutral-100" }; +const _hoisted_8$2 = { class: "flex flex-col gap-3" }; +const _hoisted_9$2 = ["onClick"]; +const _hoisted_10$2 = ["for"]; +const _hoisted_11$2 = { class: "text-sm text-neutral-400 my-1" }; +const _hoisted_12$2 = { + key: 1, + class: "text-neutral-400 italic" +}; +const _sfc_main$3 = /* @__PURE__ */ defineComponent({ +======== +const _hoisted_1$1 = { class: "flex flex-col gap-6 w-[600px]" }; +const _hoisted_2$1 = { class: "flex flex-col gap-4" }; +const _hoisted_3$1 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$1 = { class: "text-neutral-400 my-0" }; +const _hoisted_5 = { class: "flex gap-2" }; +const _hoisted_6 = { + key: 0, + class: "flex flex-col gap-4 bg-neutral-800 p-4 rounded-lg" +}; +const _hoisted_7 = { class: "text-lg mt-0 font-medium text-neutral-100" }; +const _hoisted_8 = { class: "flex flex-col gap-3" }; +const _hoisted_9 = ["onClick"]; +const _hoisted_10 = ["for"]; +const _hoisted_11 = { class: "text-sm text-neutral-400 my-1" }; +const _hoisted_12 = { + key: 1, + class: "text-neutral-400 italic" +}; +const _sfc_main$1 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + __name: "MigrationPicker", + props: { + "sourcePath": { required: false }, + "sourcePathModifiers": {}, + "migrationItemIds": { + required: false + }, + "migrationItemIdsModifiers": {} + }, + emits: ["update:sourcePath", "update:migrationItemIds"], + setup(__props) { + const { t } = useI18n(); + const electron = electronAPI(); + const sourcePath = useModel(__props, "sourcePath"); + const migrationItemIds = useModel(__props, "migrationItemIds"); + const migrationItems = ref( + MigrationItems.map((item) => ({ + ...item, + selected: true + })) + ); + const pathError = ref(""); + const isValidSource = computed( + () => sourcePath.value !== "" && pathError.value === "" + ); + const validateSource = /* @__PURE__ */ __name(async (sourcePath2) => { + if (!sourcePath2) { + pathError.value = ""; + return; + } + try { + pathError.value = ""; + const validation = await electron.validateComfyUISource(sourcePath2); + if (!validation.isValid) pathError.value = validation.error; + } catch (error) { + console.error(error); + pathError.value = t("install.pathValidationFailed"); + } + }, "validateSource"); + const browsePath = /* @__PURE__ */ __name(async () => { + try { + const result = await electron.showDirectoryPicker(); + if (result) { + sourcePath.value = result; + await validateSource(result); + } + } catch (error) { + console.error(error); + pathError.value = t("install.failedToSelectDirectory"); + } + }, "browsePath"); + watchEffect(() => { + migrationItemIds.value = migrationItems.value.filter((item) => item.selected).map((item) => item.id); + }); + return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js + return openBlock(), createElementBlock("div", _hoisted_1$3, [ + createBaseVNode("div", _hoisted_2$3, [ + createBaseVNode("h2", _hoisted_3$3, toDisplayString(_ctx.$t("install.migrateFromExistingInstallation")), 1), + createBaseVNode("p", _hoisted_4$3, toDisplayString(_ctx.$t("install.migrationSourcePathDescription")), 1), + createBaseVNode("div", _hoisted_5$3, [ + createVNode(unref(script$8), { +======== + return openBlock(), createElementBlock("div", _hoisted_1$1, [ + createBaseVNode("div", _hoisted_2$1, [ + createBaseVNode("h2", _hoisted_3$1, toDisplayString(_ctx.$t("install.migrateFromExistingInstallation")), 1), + createBaseVNode("p", _hoisted_4$1, toDisplayString(_ctx.$t("install.migrationSourcePathDescription")), 1), + createBaseVNode("div", _hoisted_5, [ + createVNode(unref(script$b), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + modelValue: sourcePath.value, + "onUpdate:modelValue": [ + _cache[0] || (_cache[0] = ($event) => sourcePath.value = $event), + validateSource + ], + placeholder: "Select existing ComfyUI installation (optional)", + class: normalizeClass(["flex-1", { "p-invalid": pathError.value }]) + }, null, 8, ["modelValue", "class"]), + createVNode(unref(script$e), { + icon: "pi pi-folder", + onClick: browsePath, + class: "w-12" + }) + ]), + pathError.value ? (openBlock(), createBlock(unref(script$f), { + key: 0, + severity: "error" + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(pathError.value), 1) + ]), + _: 1 + })) : createCommentVNode("", true) + ]), +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js + isValidSource.value ? (openBlock(), createElementBlock("div", _hoisted_6$2, [ + createBaseVNode("h3", _hoisted_7$2, toDisplayString(_ctx.$t("install.selectItemsToMigrate")), 1), + createBaseVNode("div", _hoisted_8$2, [ +======== + isValidSource.value ? (openBlock(), createElementBlock("div", _hoisted_6, [ + createBaseVNode("h3", _hoisted_7, toDisplayString(_ctx.$t("install.selectItemsToMigrate")), 1), + createBaseVNode("div", _hoisted_8, [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + (openBlock(true), createElementBlock(Fragment, null, renderList(migrationItems.value, (item) => { + return openBlock(), createElementBlock("div", { + key: item.id, + class: "flex items-center gap-3 p-2 hover:bg-neutral-700 rounded", + onClick: /* @__PURE__ */ __name(($event) => item.selected = !item.selected, "onClick") + }, [ + createVNode(unref(script$g), { + modelValue: item.selected, + "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => item.selected = $event, "onUpdate:modelValue"), + inputId: item.id, + binary: true, + onClick: _cache[1] || (_cache[1] = withModifiers(() => { + }, ["stop"])) + }, null, 8, ["modelValue", "onUpdate:modelValue", "inputId"]), + createBaseVNode("div", null, [ + createBaseVNode("label", { + for: item.id, + class: "text-neutral-200 font-medium" +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js + }, toDisplayString(item.label), 9, _hoisted_10$2), + createBaseVNode("p", _hoisted_11$2, toDisplayString(item.description), 1) + ]) + ], 8, _hoisted_9$2); + }), 128)) + ]) + ])) : (openBlock(), createElementBlock("div", _hoisted_12$2, toDisplayString(_ctx.$t("install.migrationOptional")), 1)) +======== + }, toDisplayString(item.label), 9, _hoisted_10), + createBaseVNode("p", _hoisted_11, toDisplayString(item.description), 1) + ]) + ], 8, _hoisted_9); + }), 128)) + ]) + ])) : (openBlock(), createElementBlock("div", _hoisted_12, toDisplayString(_ctx.$t("install.migrationOptional")), 1)) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js +const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" }; +const _hoisted_2$2 = { class: "flex flex-col gap-4" }; +const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$2 = { class: "text-neutral-400 my-0" }; +const _hoisted_5$2 = { class: "flex flex-col bg-neutral-800 p-4 rounded-lg" }; +const _hoisted_6$1 = { class: "flex items-center gap-4" }; +const _hoisted_7$1 = { class: "flex-1" }; +const _hoisted_8$1 = { class: "text-lg font-medium text-neutral-100" }; +const _hoisted_9$1 = { class: "text-sm text-neutral-400 mt-1" }; +const _hoisted_10$1 = { class: "flex items-center gap-4" }; +const _hoisted_11$1 = { class: "flex-1" }; +const _hoisted_12$1 = { class: "text-lg font-medium text-neutral-100" }; +const _hoisted_13 = { class: "text-sm text-neutral-400 mt-1" }; +const _hoisted_14 = { class: "text-neutral-300" }; +const _hoisted_15 = { class: "font-medium mb-2" }; +const _hoisted_16 = { class: "list-disc pl-6 space-y-1" }; +const _hoisted_17 = { class: "font-medium mt-4 mb-2" }; +const _hoisted_18 = { class: "list-disc pl-6 space-y-1" }; +const _sfc_main$2 = /* @__PURE__ */ defineComponent({ + __name: "DesktopSettingsConfiguration", + props: { + "autoUpdate": { required: true }, + "autoUpdateModifiers": {}, + "allowMetrics": { required: true }, + "allowMetricsModifiers": {} + }, + emits: ["update:autoUpdate", "update:allowMetrics"], + setup(__props) { + const showDialog = ref(false); + const autoUpdate = useModel(__props, "autoUpdate"); + const allowMetrics = useModel(__props, "allowMetrics"); + const showMetricsInfo = /* @__PURE__ */ __name(() => { + showDialog.value = true; + }, "showMetricsInfo"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$2, [ + createBaseVNode("div", _hoisted_2$2, [ + createBaseVNode("h2", _hoisted_3$2, toDisplayString(_ctx.$t("install.desktopAppSettings")), 1), + createBaseVNode("p", _hoisted_4$2, toDisplayString(_ctx.$t("install.desktopAppSettingsDescription")), 1) + ]), + createBaseVNode("div", _hoisted_5$2, [ + createBaseVNode("div", _hoisted_6$1, [ + createBaseVNode("div", _hoisted_7$1, [ + createBaseVNode("h3", _hoisted_8$1, toDisplayString(_ctx.$t("install.settings.autoUpdate")), 1), + createBaseVNode("p", _hoisted_9$1, toDisplayString(_ctx.$t("install.settings.autoUpdateDescription")), 1) + ]), + createVNode(unref(script$e), { + modelValue: autoUpdate.value, + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => autoUpdate.value = $event) + }, null, 8, ["modelValue"]) + ]), + createVNode(unref(script$f)), + createBaseVNode("div", _hoisted_10$1, [ + createBaseVNode("div", _hoisted_11$1, [ + createBaseVNode("h3", _hoisted_12$1, toDisplayString(_ctx.$t("install.settings.allowMetrics")), 1), + createBaseVNode("p", _hoisted_13, toDisplayString(_ctx.$t("install.settings.allowMetricsDescription")), 1), + createBaseVNode("a", { + href: "#", + class: "text-sm text-blue-400 hover:text-blue-300 mt-1 inline-block", + onClick: withModifiers(showMetricsInfo, ["prevent"]) + }, toDisplayString(_ctx.$t("install.settings.learnMoreAboutData")), 1) + ]), + createVNode(unref(script$e), { + modelValue: allowMetrics.value, + "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => allowMetrics.value = $event) + }, null, 8, ["modelValue"]) + ]) + ]), + createVNode(unref(script$g), { + visible: showDialog.value, + "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => showDialog.value = $event), + modal: "", + header: _ctx.$t("install.settings.dataCollectionDialog.title") + }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_14, [ + createBaseVNode("h4", _hoisted_15, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeCollect")), 1), + createBaseVNode("ul", _hoisted_16, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.errorReports")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.systemInfo")), 1) + ]), + createBaseVNode("h4", _hoisted_17, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeDoNotCollect")), 1), + createBaseVNode("ul", _hoisted_18, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.personalInformation")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.workflowContents")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.fileSystemInformation")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t( + "install.settings.dataCollectionDialog.customNodeConfigurations" + )), 1) + ]) + ]) + ]), + _: 1 + }, 8, ["visible", "header"]) + ]); + }; + } +}); +const _imports_0 = "" + new URL("images/nvidia-logo.svg", import.meta.url).href; +const _imports_1 = "" + new URL("images/apple-mps-logo.png", import.meta.url).href; +const _imports_2 = "" + new URL("images/manual-configuration.svg", import.meta.url).href; +const _hoisted_1$1 = { class: "flex flex-col gap-6 w-[600px] h-[30rem] select-none" }; +const _hoisted_2$1 = { class: "grow flex flex-col gap-4 text-neutral-300" }; +const _hoisted_3$1 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$1 = { class: "m-1 text-neutral-400" }; +const _hoisted_5$1 = { + key: 0, + class: "m-1" +}; +const _hoisted_6 = { + key: 1, + class: "m-1" +}; +const _hoisted_7 = { + key: 2, + class: "text-neutral-300" +}; +const _hoisted_8 = { class: "m-1" }; +const _hoisted_9 = { key: 3 }; +const _hoisted_10 = { class: "m-1" }; +const _hoisted_11 = { class: "m-1" }; +const _hoisted_12 = { + for: "cpu-mode", + class: "select-none" +}; +const _sfc_main$1 = /* @__PURE__ */ defineComponent({ + __name: "GpuPicker", + props: { + "device": { + required: true + }, + "deviceModifiers": {} + }, + emits: ["update:device"], + setup(__props) { + const { t } = useI18n(); + const cpuMode = computed({ + get: /* @__PURE__ */ __name(() => selected.value === "cpu", "get"), + set: /* @__PURE__ */ __name((value2) => { + selected.value = value2 ? "cpu" : null; + }, "set") + }); + const selected = useModel(__props, "device"); + const electron = electronAPI(); + const platform = electron.getPlatform(); + const pickGpu = /* @__PURE__ */ __name((value2) => { + const newValue = selected.value === value2 ? null : value2; + selected.value = newValue; + }, "pickGpu"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$1, [ + createBaseVNode("div", _hoisted_2$1, [ + createBaseVNode("h2", _hoisted_3$1, toDisplayString(_ctx.$t("install.gpuSelection.selectGpu")), 1), + createBaseVNode("p", _hoisted_4$1, toDisplayString(_ctx.$t("install.gpuSelection.selectGpuDescription")) + ": ", 1), + createBaseVNode("div", { + class: normalizeClass(["flex gap-2 text-center transition-opacity", { selected: selected.value }]) + }, [ + unref(platform) !== "darwin" ? (openBlock(), createElementBlock("div", { + key: 0, + class: normalizeClass(["gpu-button", { selected: selected.value === "nvidia" }]), + role: "button", + onClick: _cache[0] || (_cache[0] = ($event) => pickGpu("nvidia")) + }, _cache[4] || (_cache[4] = [ + createBaseVNode("img", { + class: "m-12", + alt: "NVIDIA logo", + width: "196", + height: "32", + src: _imports_0 + }, null, -1) + ]), 2)) : createCommentVNode("", true), + unref(platform) === "darwin" ? (openBlock(), createElementBlock("div", { + key: 1, + class: normalizeClass(["gpu-button", { selected: selected.value === "mps" }]), + role: "button", + onClick: _cache[1] || (_cache[1] = ($event) => pickGpu("mps")) + }, _cache[5] || (_cache[5] = [ + createBaseVNode("img", { + class: "rounded-lg hover-brighten", + alt: "Apple Metal Performance Shaders Logo", + width: "292", + ratio: "", + src: _imports_1 + }, null, -1) + ]), 2)) : createCommentVNode("", true), + createBaseVNode("div", { + class: normalizeClass(["gpu-button", { selected: selected.value === "unsupported" }]), + role: "button", + onClick: _cache[2] || (_cache[2] = ($event) => pickGpu("unsupported")) + }, _cache[6] || (_cache[6] = [ + createBaseVNode("img", { + class: "m-12", + alt: "Manual configuration", + width: "196", + src: _imports_2 + }, null, -1) + ]), 2) + ], 2), + selected.value === "nvidia" ? (openBlock(), createElementBlock("p", _hoisted_5$1, [ + createVNode(unref(script$h), { + icon: "pi pi-check", + severity: "success", + value: "CUDA" + }), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.nvidiaDescription")), 1) + ])) : createCommentVNode("", true), + selected.value === "mps" ? (openBlock(), createElementBlock("p", _hoisted_6, [ + createVNode(unref(script$h), { + icon: "pi pi-check", + severity: "success", + value: "MPS" + }), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.mpsDescription")), 1) + ])) : createCommentVNode("", true), + selected.value === "unsupported" ? (openBlock(), createElementBlock("div", _hoisted_7, [ + createBaseVNode("p", _hoisted_8, [ + createVNode(unref(script$h), { + icon: "pi pi-exclamation-triangle", + severity: "warn", + value: unref(t)("icon.exclamation-triangle") + }, null, 8, ["value"]), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.customSkipsPython")), 1) + ]), + createBaseVNode("ul", null, [ + createBaseVNode("li", null, [ + createBaseVNode("strong", null, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1) + ]), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customMayNotWork")), 1) + ]) + ])) : createCommentVNode("", true), + selected.value === "cpu" ? (openBlock(), createElementBlock("div", _hoisted_9, [ + createBaseVNode("p", _hoisted_10, [ + createVNode(unref(script$h), { + icon: "pi pi-exclamation-triangle", + severity: "warn", + value: unref(t)("icon.exclamation-triangle") + }, null, 8, ["value"]), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription")), 1) + ]), + createBaseVNode("p", _hoisted_11, toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription2")), 1) + ])) : createCommentVNode("", true) + ]), + createBaseVNode("div", { + class: normalizeClass(["transition-opacity flex gap-3 h-0", { + "opacity-40": selected.value && selected.value !== "cpu" + }]) + }, [ + createVNode(unref(script$e), { + modelValue: cpuMode.value, + "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => cpuMode.value = $event), + inputId: "cpu-mode", + class: "-translate-y-40" + }, null, 8, ["modelValue"]), + createBaseVNode("label", _hoisted_12, toDisplayString(_ctx.$t("install.gpuSelection.enableCpuMode")), 1) + ], 2) + ]); + }; + } +}); +const _hoisted_1 = { class: "font-sans flex flex-col items-center h-screen m-0 text-neutral-300 bg-neutral-900 dark-theme pointer-events-auto" }; +const _hoisted_2 = { class: "flex pt-6 justify-end" }; +======== +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-de33872d"), n = n(), popScopeId(), n), "_withScopeId"); +const _hoisted_1 = { class: "flex pt-6 justify-end" }; +const _hoisted_2 = { class: "flex pt-6 justify-between" }; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js +const _hoisted_3 = { class: "flex pt-6 justify-between" }; +const _hoisted_4 = { class: "flex pt-6 justify-between" }; +const _hoisted_5 = { class: "flex pt-6 justify-between" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "InstallView", + setup(__props) { + const device = ref(null); + const installPath = ref(""); + const pathError = ref(""); + const migrationSourcePath = ref(""); + const migrationItemIds = ref([]); + const autoUpdate = ref(true); + const allowMetrics = ref(true); + const highestStep = ref(0); + const setHighestStep = /* @__PURE__ */ __name((value2) => { + const int = typeof value2 === "number" ? value2 : parseInt(value2, 10); + if (!isNaN(int) && int > highestStep.value) highestStep.value = int; + }, "setHighestStep"); + const hasError = computed(() => pathError.value !== ""); + const noGpu = computed(() => typeof device.value !== "string"); + const electron = electronAPI(); + const router = useRouter(); + const install = /* @__PURE__ */ __name(() => { + const options = { + installPath: installPath.value, + autoUpdate: autoUpdate.value, + allowMetrics: allowMetrics.value, + migrationSourcePath: migrationSourcePath.value, + migrationItemIds: toRaw(migrationItemIds.value), + device: device.value + }; + electron.installComfyUI(options); + const nextPage = options.device === "unsupported" ? "/manual-configuration" : "/server-start"; + router.push(nextPage); + }, "install"); + onMounted(async () => { + if (!electron) return; + const detectedGpu = await electron.Config.getDetectedGpu(); + if (detectedGpu === "mps" || detectedGpu === "nvidia") + device.value = detectedGpu; + }); + return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js + return openBlock(), createElementBlock("div", _hoisted_1, [ + createVNode(unref(script$6), { + class: "stepper", + value: "0", + "onUpdate:value": setHighestStep + }, { + default: withCtx(() => [ + createVNode(unref(script$5), { class: "select-none" }, { + default: withCtx(() => [ + createVNode(unref(script$3), { value: "0" }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.gpu")), 1) + ]), + _: 1 + }), + createVNode(unref(script$3), { + value: "1", + disabled: noGpu.value + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.installLocation")), 1) + ]), + _: 1 + }, 8, ["disabled"]), + createVNode(unref(script$3), { + value: "2", + disabled: noGpu.value || hasError.value || highestStep.value < 1 + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.migration")), 1) + ]), + _: 1 + }, 8, ["disabled"]), + createVNode(unref(script$3), { + value: "3", + disabled: noGpu.value || hasError.value || highestStep.value < 2 + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.desktopSettings")), 1) + ]), + _: 1 + }, 8, ["disabled"]) + ]), + _: 1 + }), + createVNode(unref(script$4), null, { + default: withCtx(() => [ + createVNode(unref(script), { value: "0" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$1, { + device: device.value, + "onUpdate:device": _cache[0] || (_cache[0] = ($event) => device.value = $event) + }, null, 8, ["device"]), + createBaseVNode("div", _hoisted_2, [ + createVNode(unref(script$b), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick"), + disabled: typeof device.value !== "string" + }, null, 8, ["label", "onClick", "disabled"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script), { value: "1" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$4, { + installPath: installPath.value, + "onUpdate:installPath": _cache[1] || (_cache[1] = ($event) => installPath.value = $event), + pathError: pathError.value, + "onUpdate:pathError": _cache[2] || (_cache[2] = ($event) => pathError.value = $event) + }, null, 8, ["installPath", "pathError"]), + createBaseVNode("div", _hoisted_3, [ + createVNode(unref(script$b), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("0"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$b), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick"), + disabled: pathError.value !== "" + }, null, 8, ["label", "onClick", "disabled"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script), { value: "2" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$3, { + sourcePath: migrationSourcePath.value, + "onUpdate:sourcePath": _cache[3] || (_cache[3] = ($event) => migrationSourcePath.value = $event), + migrationItemIds: migrationItemIds.value, + "onUpdate:migrationItemIds": _cache[4] || (_cache[4] = ($event) => migrationItemIds.value = $event) + }, null, 8, ["sourcePath", "migrationItemIds"]), + createBaseVNode("div", _hoisted_4, [ + createVNode(unref(script$b), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$b), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("3"), "onClick") + }, null, 8, ["label", "onClick"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script), { value: "3" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$2, { + autoUpdate: autoUpdate.value, + "onUpdate:autoUpdate": _cache[5] || (_cache[5] = ($event) => autoUpdate.value = $event), + allowMetrics: allowMetrics.value, + "onUpdate:allowMetrics": _cache[6] || (_cache[6] = ($event) => allowMetrics.value = $event) + }, null, 8, ["autoUpdate", "allowMetrics"]), + createBaseVNode("div", _hoisted_5, [ + createVNode(unref(script$b), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$b), { + label: _ctx.$t("g.install"), + icon: "pi pi-check", + iconPos: "right", + disabled: hasError.value, + onClick: _cache[7] || (_cache[7] = ($event) => install()) + }, null, 8, ["label", "disabled"]) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }) + ]), + _: 1 + }) + ]); + }; + } +}); +const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-eeee4af8"]]); +export { + InstallView as default +}; +//# sourceMappingURL=InstallView-DiTLLUby.js.map +======== + return openBlock(), createBlock(_sfc_main$5, { dark: "" }, { + default: withCtx(() => [ + createVNode(unref(script), { + class: "h-full p-8 2xl:p-16", + value: "0", + "onUpdate:value": setHighestStep + }, { + default: withCtx(() => [ + createVNode(unref(script$4), { class: "select-none" }, { + default: withCtx(() => [ + createVNode(unref(script$5), { value: "0" }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.gpu")), 1) + ]), + _: 1 + }), + createVNode(unref(script$5), { + value: "1", + disabled: noGpu.value + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.installLocation")), 1) + ]), + _: 1 + }, 8, ["disabled"]), + createVNode(unref(script$5), { + value: "2", + disabled: noGpu.value || hasError.value || highestStep.value < 1 + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.migration")), 1) + ]), + _: 1 + }, 8, ["disabled"]), + createVNode(unref(script$5), { + value: "3", + disabled: noGpu.value || hasError.value || highestStep.value < 2 + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.desktopSettings")), 1) + ]), + _: 1 + }, 8, ["disabled"]) + ]), + _: 1 + }), + createVNode(unref(script$2), null, { + default: withCtx(() => [ + createVNode(unref(script$3), { value: "0" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$3, { + device: device.value, + "onUpdate:device": _cache[0] || (_cache[0] = ($event) => device.value = $event) + }, null, 8, ["device"]), + createBaseVNode("div", _hoisted_1, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick"), + disabled: typeof device.value !== "string" + }, null, 8, ["label", "onClick", "disabled"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script$3), { value: "1" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$2, { + installPath: installPath.value, + "onUpdate:installPath": _cache[1] || (_cache[1] = ($event) => installPath.value = $event), + pathError: pathError.value, + "onUpdate:pathError": _cache[2] || (_cache[2] = ($event) => pathError.value = $event) + }, null, 8, ["installPath", "pathError"]), + createBaseVNode("div", _hoisted_2, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("0"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$e), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick"), + disabled: pathError.value !== "" + }, null, 8, ["label", "onClick", "disabled"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script$3), { value: "2" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$1, { + sourcePath: migrationSourcePath.value, + "onUpdate:sourcePath": _cache[3] || (_cache[3] = ($event) => migrationSourcePath.value = $event), + migrationItemIds: migrationItemIds.value, + "onUpdate:migrationItemIds": _cache[4] || (_cache[4] = ($event) => migrationItemIds.value = $event) + }, null, 8, ["sourcePath", "migrationItemIds"]), + createBaseVNode("div", _hoisted_3, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$e), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("3"), "onClick") + }, null, 8, ["label", "onClick"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script$3), { value: "3" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$4, { + autoUpdate: autoUpdate.value, + "onUpdate:autoUpdate": _cache[5] || (_cache[5] = ($event) => autoUpdate.value = $event), + allowMetrics: allowMetrics.value, + "onUpdate:allowMetrics": _cache[6] || (_cache[6] = ($event) => allowMetrics.value = $event) + }, null, 8, ["autoUpdate", "allowMetrics"]), + createBaseVNode("div", _hoisted_4, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$e), { + label: _ctx.$t("g.install"), + icon: "pi pi-check", + iconPos: "right", + disabled: hasError.value, + onClick: _cache[7] || (_cache[7] = ($event) => install()) + }, null, 8, ["label", "disabled"]) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }) + ]), + _: 1 + }) + ]), + _: 1 + }); + }; + } +}); +const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-de33872d"]]); +export { + InstallView as default +}; +//# sourceMappingURL=InstallView-CAcYt0HL.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js diff --git a/comfy/web/assets/InstallView-CwQdoH-C.css b/comfy/web/assets/InstallView-CwQdoH-C.css new file mode 100644 index 000000000..df5787787 --- /dev/null +++ b/comfy/web/assets/InstallView-CwQdoH-C.css @@ -0,0 +1,79 @@ + +:root { + --p-tag-gap: 0.5rem; +} +.hover-brighten { + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + transition-property: filter, box-shadow; +&:hover { + filter: brightness(107%) contrast(105%); + box-shadow: 0 0 0.25rem #ffffff79; +} +} +.p-accordioncontent-content { + border-radius: 0.5rem; + --tw-bg-opacity: 1; + background-color: rgb(23 23 23 / var(--tw-bg-opacity)); + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} +div.selected { +.gpu-button:not(.selected) { + opacity: 0.5; +} +.gpu-button:not(.selected):hover { + opacity: 1; +} +} +.gpu-button { + margin: 0px; + display: flex; + width: 50%; + cursor: pointer; + flex-direction: column; + align-items: center; + justify-content: space-around; + border-radius: 0.5rem; + background-color: rgb(38 38 38 / var(--tw-bg-opacity)); + --tw-bg-opacity: 0.5; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} +.gpu-button:hover { + --tw-bg-opacity: 0.75; +} +.gpu-button { +&.selected { + --tw-bg-opacity: 1; + background-color: rgb(64 64 64 / var(--tw-bg-opacity)); +} +&.selected { + --tw-bg-opacity: 0.5; +} +&.selected { + opacity: 1; +} +&.selected:hover { + --tw-bg-opacity: 0.6; +} +} +.disabled { + pointer-events: none; + opacity: 0.4; +} +.p-card-header { + flex-grow: 1; + text-align: center; +} +.p-card-body { + padding-top: 0px; + text-align: center; +} + +[data-v-de33872d] .p-steppanel { + background-color: transparent +} diff --git a/comfy/web/assets/InstallView-DiTLLUby.js b/comfy/web/assets/InstallView-DiTLLUby.js index 1e0c87be5..055b001ec 100644 --- a/comfy/web/assets/InstallView-DiTLLUby.js +++ b/comfy/web/assets/InstallView-DiTLLUby.js @@ -1,156 +1,17 @@ var __defProp = Object.defineProperty; var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js import { B as BaseStyle, Q as script$7, ad as UniqueComponentId, o as openBlock, f as createElementBlock, m as mergeProps, l as renderSlot, h as createCommentVNode, bZ as findIndexInList, b_ as find, k as resolveComponent, v as createBlock, K as resolveDynamicComponent, x as withCtx, z as createBaseVNode, a5 as toDisplayString, A as normalizeClass, U as findSingle, O as Fragment, au as Transition, t as withDirectives, aa as vShow, a as defineComponent, H as useI18n, b$ as useModel, r as ref, aE as onMounted, q as resolveDirective, g as createVNode, y as unref, ao as script$8, c0 as script$9, c1 as script$a, C as script$b, aw as createTextVNode, bV as script$c, bY as electronAPI, c2 as MigrationItems, p as computed, aL as watchEffect, P as renderList, bp as withModifiers, c3 as script$d, c4 as script$e, bL as script$f, aH as script$g, aA as script$h, bS as useRouter, aN as toRaw, _ as _export_sfc } from "./index-BK27PIiK.js"; var theme = /* @__PURE__ */ __name(function theme2(_ref) { var dt = _ref.dt; return "\n.p-steplist {\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow-x: auto;\n}\n\n.p-step {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: ".concat(dt("stepper.step.gap"), ";\n padding: ").concat(dt("stepper.step.padding"), ";\n}\n\n.p-step:last-of-type {\n flex: initial;\n}\n\n.p-step-header {\n border: 0 none;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ";\n border-radius: ").concat(dt("stepper.step.header.border.radius"), ";\n outline-color: transparent;\n background: transparent;\n padding: ").concat(dt("stepper.step.header.padding"), ";\n gap: ").concat(dt("stepper.step.header.gap"), ";\n}\n\n.p-step-header:focus-visible {\n box-shadow: ").concat(dt("stepper.step.header.focus.ring.shadow"), ";\n outline: ").concat(dt("stepper.step.header.focus.ring.width"), " ").concat(dt("stepper.step.header.focus.ring.style"), " ").concat(dt("stepper.step.header.focus.ring.color"), ";\n outline-offset: ").concat(dt("stepper.step.header.focus.ring.offset"), ";\n}\n\n.p-stepper.p-stepper-readonly .p-step {\n cursor: auto;\n}\n\n.p-step-title {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n color: ").concat(dt("stepper.step.title.color"), ";\n font-weight: ").concat(dt("stepper.step.title.font.weight"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n color: ").concat(dt("stepper.step.number.color"), ";\n border: 2px solid ").concat(dt("stepper.step.number.border.color"), ";\n background: ").concat(dt("stepper.step.number.background"), ";\n min-width: ").concat(dt("stepper.step.number.size"), ";\n height: ").concat(dt("stepper.step.number.size"), ";\n line-height: ").concat(dt("stepper.step.number.size"), ";\n font-size: ").concat(dt("stepper.step.number.font.size"), ";\n z-index: 1;\n border-radius: ").concat(dt("stepper.step.number.border.radius"), ";\n position: relative;\n font-weight: ").concat(dt("stepper.step.number.font.weight"), ';\n}\n\n.p-step-number::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ').concat(dt("stepper.step.number.border.radius"), ";\n box-shadow: ").concat(dt("stepper.step.number.shadow"), ";\n}\n\n.p-step-active .p-step-header {\n cursor: default;\n}\n\n.p-step-active .p-step-number {\n background: ").concat(dt("stepper.step.number.active.background"), ";\n border-color: ").concat(dt("stepper.step.number.active.border.color"), ";\n color: ").concat(dt("stepper.step.number.active.color"), ";\n}\n\n.p-step-active .p-step-title {\n color: ").concat(dt("stepper.step.title.active.color"), ";\n}\n\n.p-step:not(.p-disabled):focus-visible {\n outline: ").concat(dt("focus.ring.width"), " ").concat(dt("focus.ring.style"), " ").concat(dt("focus.ring.color"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-step:has(~ .p-step-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepper-separator {\n flex: 1 1 0;\n background: ").concat(dt("stepper.separator.background"), ";\n width: 100%;\n height: ").concat(dt("stepper.separator.size"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-steppanels {\n padding: ").concat(dt("stepper.steppanels.padding"), ";\n}\n\n.p-steppanel {\n background: ").concat(dt("stepper.steppanel.background"), ";\n color: ").concat(dt("stepper.steppanel.color"), ";\n}\n\n.p-stepper:has(.p-stepitem) {\n display: flex;\n flex-direction: column;\n}\n\n.p-stepitem {\n display: flex;\n flex-direction: column;\n flex: initial;\n}\n\n.p-stepitem.p-stepitem-active {\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-step {\n flex: initial;\n}\n\n.p-stepitem .p-steppanel-content {\n width: 100%;\n padding: ").concat(dt("stepper.steppanel.padding"), ";\n margin-inline-start: 1rem;\n}\n\n.p-stepitem .p-steppanel {\n display: flex;\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-stepper-separator {\n flex: 0 0 auto;\n width: ").concat(dt("stepper.separator.size"), ";\n height: auto;\n margin: ").concat(dt("stepper.separator.margin"), ";\n position: relative;\n left: calc(-1 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem .p-stepper-separator:dir(rtl) {\n left: calc(-9 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem:has(~ .p-stepitem-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepitem:last-of-type .p-steppanel {\n padding-inline-start: ").concat(dt("stepper.step.number.size"), ";\n}\n"); }, "theme"); +======== +import { B as BaseStyle, q as script$6, o as openBlock, f as createElementBlock, D as mergeProps, c1 as findIndexInList, c2 as find, aB as resolveComponent, k as createBlock, G as resolveDynamicComponent, M as withCtx, H as createBaseVNode, X as toDisplayString, J as renderSlot, I as createCommentVNode, T as normalizeClass, P as findSingle, F as Fragment, aC as Transition, i as withDirectives, v as vShow, ak as UniqueComponentId, d as defineComponent, ab as ref, c3 as useModel, N as createVNode, j as unref, c4 as script$7, bQ as script$8, bM as withModifiers, aP as script$9, a1 as useI18n, c as computed, aI as script$a, aE as createTextVNode, c0 as electronAPI, m as onMounted, r as resolveDirective, av as script$b, c5 as script$c, c6 as script$d, l as script$e, bZ as script$f, c7 as MigrationItems, w as watchEffect, E as renderList, c8 as script$g, bW as useRouter, aL as pushScopeId, aM as popScopeId, aU as toRaw, _ as _export_sfc } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$5 } from "./BaseViewTemplate-BNGF4K22.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js var classes$4 = { - root: /* @__PURE__ */ __name(function root(_ref2) { - var props = _ref2.props; - return ["p-stepper p-component", { - "p-readonly": props.linear - }]; - }, "root"), - separator: "p-stepper-separator" -}; -var StepperStyle = BaseStyle.extend({ - name: "stepper", - theme, - classes: classes$4 -}); -var script$1$4 = { - name: "BaseStepper", - "extends": script$7, - props: { - value: { - type: [String, Number], - "default": void 0 - }, - linear: { - type: Boolean, - "default": false - } - }, - style: StepperStyle, - provide: /* @__PURE__ */ __name(function provide() { - return { - $pcStepper: this, - $parentInstance: this - }; - }, "provide") -}; -var script$6 = { - name: "Stepper", - "extends": script$1$4, - inheritAttrs: false, - emits: ["update:value"], - data: /* @__PURE__ */ __name(function data() { - return { - id: this.$attrs.id, - d_value: this.value - }; - }, "data"), - watch: { - "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) { - this.id = newValue || UniqueComponentId(); - }, "$attrsId"), - value: /* @__PURE__ */ __name(function value(newValue) { - this.d_value = newValue; - }, "value") - }, - mounted: /* @__PURE__ */ __name(function mounted() { - this.id = this.id || UniqueComponentId(); - }, "mounted"), - methods: { - updateValue: /* @__PURE__ */ __name(function updateValue(newValue) { - if (this.d_value !== newValue) { - this.d_value = newValue; - this.$emit("update:value", newValue); - } - }, "updateValue"), - isStepActive: /* @__PURE__ */ __name(function isStepActive(value2) { - return this.d_value === value2; - }, "isStepActive"), - isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled() { - return this.linear; - }, "isStepDisabled") - } -}; -function render$5(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root"), - role: "tablist" - }, _ctx.ptmi("root")), [_ctx.$slots.start ? renderSlot(_ctx.$slots, "start", { - key: 0 - }) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), _ctx.$slots.end ? renderSlot(_ctx.$slots, "end", { - key: 1 - }) : createCommentVNode("", true)], 16); -} -__name(render$5, "render$5"); -script$6.render = render$5; -var classes$3 = { - root: "p-steplist" -}; -var StepListStyle = BaseStyle.extend({ - name: "steplist", - classes: classes$3 -}); -var script$1$3 = { - name: "BaseStepList", - "extends": script$7, - style: StepListStyle, - provide: /* @__PURE__ */ __name(function provide2() { - return { - $pcStepList: this, - $parentInstance: this - }; - }, "provide") -}; -var script$5 = { - name: "StepList", - "extends": script$1$3, - inheritAttrs: false -}; -function render$4(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root") - }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); -} -__name(render$4, "render$4"); -script$5.render = render$4; -var classes$2 = { - root: "p-steppanels" -}; -var StepPanelsStyle = BaseStyle.extend({ - name: "steppanels", - classes: classes$2 -}); -var script$1$2 = { - name: "BaseStepPanels", - "extends": script$7, - style: StepPanelsStyle, - provide: /* @__PURE__ */ __name(function provide3() { - return { - $pcStepPanels: this, - $parentInstance: this - }; - }, "provide") -}; -var script$4 = { - name: "StepPanels", - "extends": script$1$2, - inheritAttrs: false -}; -function render$3(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root") - }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); -} -__name(render$3, "render$3"); -script$4.render = render$3; -var classes$1 = { - root: /* @__PURE__ */ __name(function root2(_ref) { + root: /* @__PURE__ */ __name(function root(_ref) { var instance = _ref.instance; return ["p-step", { "p-step-active": instance.active, @@ -163,23 +24,23 @@ var classes$1 = { }; var StepStyle = BaseStyle.extend({ name: "step", - classes: classes$1 + classes: classes$4 }); -var script$2$1 = { +var script$2$2 = { name: "StepperSeparator", hostName: "Stepper", - "extends": script$7 + "extends": script$6 }; -function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { +function render$1$2(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("span", mergeProps({ "class": _ctx.cx("separator") }, _ctx.ptm("separator")), null, 16); } -__name(render$1$1, "render$1$1"); -script$2$1.render = render$1$1; -var script$1$1 = { +__name(render$1$2, "render$1$2"); +script$2$2.render = render$1$2; +var script$1$4 = { name: "BaseStep", - "extends": script$7, + "extends": script$6, props: { value: { type: [String, Number], @@ -199,16 +60,16 @@ var script$1$1 = { } }, style: StepStyle, - provide: /* @__PURE__ */ __name(function provide4() { + provide: /* @__PURE__ */ __name(function provide() { return { $pcStep: this, $parentInstance: this }; }, "provide") }; -var script$3 = { +var script$5 = { name: "Step", - "extends": script$1$1, + "extends": script$1$4, inheritAttrs: false, inject: { $pcStepper: { @@ -221,12 +82,12 @@ var script$3 = { "default": null } }, - data: /* @__PURE__ */ __name(function data2() { + data: /* @__PURE__ */ __name(function data() { return { isSeparatorVisible: false }; }, "data"), - mounted: /* @__PURE__ */ __name(function mounted2() { + mounted: /* @__PURE__ */ __name(function mounted() { if (this.$el && this.$pcStepList) { var index = findIndexInList(this.$el, find(this.$pcStepper.$el, '[data-pc-name="step"]')); var stepLen = find(this.$pcStepper.$el, '[data-pc-name="step"]').length; @@ -255,7 +116,7 @@ var script$3 = { var _this$$pcStepItem; return !!this.$pcStepItem ? (_this$$pcStepItem = this.$pcStepItem) === null || _this$$pcStepItem === void 0 ? void 0 : _this$$pcStepItem.value : this.value; }, "activeValue"), - isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled2() { + isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled() { return !this.active && (this.$pcStepper.isStepDisabled() || this.disabled); }, "isStepDisabled"), id: /* @__PURE__ */ __name(function id() { @@ -289,11 +150,15 @@ var script$3 = { }, "a11yAttrs") }, components: { - StepperSeparator: script$2$1 + StepperSeparator: script$2$2 } }; var _hoisted_1$5 = ["id", "tabindex", "aria-controls", "disabled"]; +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js function render$2(_ctx, _cache, $props, $setup, $data, $options) { +======== +function render$4(_ctx, _cache, $props, $setup, $data, $options) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js var _component_StepperSeparator = resolveComponent("StepperSeparator"); return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ key: 0, @@ -333,10 +198,40 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) { activateCallback: $options.onStepClick }); } -__name(render$2, "render$2"); -script$3.render = render$2; -var classes = { - root: /* @__PURE__ */ __name(function root3(_ref) { +__name(render$4, "render$4"); +script$5.render = render$4; +var classes$3 = { + root: "p-steplist" +}; +var StepListStyle = BaseStyle.extend({ + name: "steplist", + classes: classes$3 +}); +var script$1$3 = { + name: "BaseStepList", + "extends": script$6, + style: StepListStyle, + provide: /* @__PURE__ */ __name(function provide2() { + return { + $pcStepList: this, + $parentInstance: this + }; + }, "provide") +}; +var script$4 = { + name: "StepList", + "extends": script$1$3, + inheritAttrs: false +}; +function render$3(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); +} +__name(render$3, "render$3"); +script$4.render = render$3; +var classes$2 = { + root: /* @__PURE__ */ __name(function root2(_ref) { var instance = _ref.instance; return ["p-steppanel", { "p-steppanel-active": instance.isVertical && instance.active @@ -346,23 +241,23 @@ var classes = { }; var StepPanelStyle = BaseStyle.extend({ name: "steppanel", - classes + classes: classes$2 }); -var script$2 = { +var script$2$1 = { name: "StepperSeparator", hostName: "Stepper", - "extends": script$7 + "extends": script$6 }; -function render$1(_ctx, _cache, $props, $setup, $data, $options) { +function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("span", mergeProps({ "class": _ctx.cx("separator") }, _ctx.ptm("separator")), null, 16); } -__name(render$1, "render$1"); -script$2.render = render$1; -var script$1 = { +__name(render$1$1, "render$1$1"); +script$2$1.render = render$1$1; +var script$1$2 = { name: "BaseStepPanel", - "extends": script$7, + "extends": script$6, props: { value: { type: [String, Number], @@ -378,16 +273,16 @@ var script$1 = { } }, style: StepPanelStyle, - provide: /* @__PURE__ */ __name(function provide5() { + provide: /* @__PURE__ */ __name(function provide3() { return { $pcStepPanel: this, $parentInstance: this }; }, "provide") }; -var script = { +var script$3 = { name: "StepPanel", - "extends": script$1, + "extends": script$1$2, inheritAttrs: false, inject: { $pcStepper: { @@ -400,12 +295,12 @@ var script = { "default": null } }, - data: /* @__PURE__ */ __name(function data3() { + data: /* @__PURE__ */ __name(function data2() { return { isSeparatorVisible: false }; }, "data"), - mounted: /* @__PURE__ */ __name(function mounted3() { + mounted: /* @__PURE__ */ __name(function mounted2() { if (this.$el) { var _this$$pcStepItem, _this$$pcStepList; var stepElements = find(this.$pcStepper.$el, '[data-pc-name="step"]'); @@ -423,7 +318,7 @@ var script = { } }); }, "getPTOptions"), - updateValue: /* @__PURE__ */ __name(function updateValue2(val) { + updateValue: /* @__PURE__ */ __name(function updateValue(val) { this.$pcStepper.updateValue(val); }, "updateValue") }, @@ -459,10 +354,10 @@ var script = { }, "a11yAttrs") }, components: { - StepperSeparator: script$2 + StepperSeparator: script$2$1 } }; -function render(_ctx, _cache, $props, $setup, $data, $options) { +function render$2(_ctx, _cache, $props, $setup, $data, $options) { var _component_StepperSeparator = resolveComponent("StepperSeparator"); return $options.isVertical ? (openBlock(), createElementBlock(Fragment, { key: 0 @@ -527,12 +422,131 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }, "activateCallback") }) : createCommentVNode("", true)], 64)); } +__name(render$2, "render$2"); +script$3.render = render$2; +var classes$1 = { + root: "p-steppanels" +}; +var StepPanelsStyle = BaseStyle.extend({ + name: "steppanels", + classes: classes$1 +}); +var script$1$1 = { + name: "BaseStepPanels", + "extends": script$6, + style: StepPanelsStyle, + provide: /* @__PURE__ */ __name(function provide4() { + return { + $pcStepPanels: this, + $parentInstance: this + }; + }, "provide") +}; +var script$2 = { + name: "StepPanels", + "extends": script$1$1, + inheritAttrs: false +}; +function render$1(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); +} +__name(render$1, "render$1"); +script$2.render = render$1; +var theme = /* @__PURE__ */ __name(function theme2(_ref) { + var dt = _ref.dt; + return "\n.p-steplist {\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow-x: auto;\n}\n\n.p-step {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: ".concat(dt("stepper.step.gap"), ";\n padding: ").concat(dt("stepper.step.padding"), ";\n}\n\n.p-step:last-of-type {\n flex: initial;\n}\n\n.p-step-header {\n border: 0 none;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ";\n border-radius: ").concat(dt("stepper.step.header.border.radius"), ";\n outline-color: transparent;\n background: transparent;\n padding: ").concat(dt("stepper.step.header.padding"), ";\n gap: ").concat(dt("stepper.step.header.gap"), ";\n}\n\n.p-step-header:focus-visible {\n box-shadow: ").concat(dt("stepper.step.header.focus.ring.shadow"), ";\n outline: ").concat(dt("stepper.step.header.focus.ring.width"), " ").concat(dt("stepper.step.header.focus.ring.style"), " ").concat(dt("stepper.step.header.focus.ring.color"), ";\n outline-offset: ").concat(dt("stepper.step.header.focus.ring.offset"), ";\n}\n\n.p-stepper.p-stepper-readonly .p-step {\n cursor: auto;\n}\n\n.p-step-title {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n color: ").concat(dt("stepper.step.title.color"), ";\n font-weight: ").concat(dt("stepper.step.title.font.weight"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n color: ").concat(dt("stepper.step.number.color"), ";\n border: 2px solid ").concat(dt("stepper.step.number.border.color"), ";\n background: ").concat(dt("stepper.step.number.background"), ";\n min-width: ").concat(dt("stepper.step.number.size"), ";\n height: ").concat(dt("stepper.step.number.size"), ";\n line-height: ").concat(dt("stepper.step.number.size"), ";\n font-size: ").concat(dt("stepper.step.number.font.size"), ";\n z-index: 1;\n border-radius: ").concat(dt("stepper.step.number.border.radius"), ";\n position: relative;\n font-weight: ").concat(dt("stepper.step.number.font.weight"), ';\n}\n\n.p-step-number::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ').concat(dt("stepper.step.number.border.radius"), ";\n box-shadow: ").concat(dt("stepper.step.number.shadow"), ";\n}\n\n.p-step-active .p-step-header {\n cursor: default;\n}\n\n.p-step-active .p-step-number {\n background: ").concat(dt("stepper.step.number.active.background"), ";\n border-color: ").concat(dt("stepper.step.number.active.border.color"), ";\n color: ").concat(dt("stepper.step.number.active.color"), ";\n}\n\n.p-step-active .p-step-title {\n color: ").concat(dt("stepper.step.title.active.color"), ";\n}\n\n.p-step:not(.p-disabled):focus-visible {\n outline: ").concat(dt("focus.ring.width"), " ").concat(dt("focus.ring.style"), " ").concat(dt("focus.ring.color"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-step:has(~ .p-step-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepper-separator {\n flex: 1 1 0;\n background: ").concat(dt("stepper.separator.background"), ";\n width: 100%;\n height: ").concat(dt("stepper.separator.size"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-steppanels {\n padding: ").concat(dt("stepper.steppanels.padding"), ";\n}\n\n.p-steppanel {\n background: ").concat(dt("stepper.steppanel.background"), ";\n color: ").concat(dt("stepper.steppanel.color"), ";\n}\n\n.p-stepper:has(.p-stepitem) {\n display: flex;\n flex-direction: column;\n}\n\n.p-stepitem {\n display: flex;\n flex-direction: column;\n flex: initial;\n}\n\n.p-stepitem.p-stepitem-active {\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-step {\n flex: initial;\n}\n\n.p-stepitem .p-steppanel-content {\n width: 100%;\n padding: ").concat(dt("stepper.steppanel.padding"), ";\n}\n\n.p-stepitem .p-steppanel {\n display: flex;\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-stepper-separator {\n flex: 0 0 auto;\n width: ").concat(dt("stepper.separator.size"), ";\n height: auto;\n margin: ").concat(dt("stepper.separator.margin"), ";\n position: relative;\n left: calc(-1 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem:has(~ .p-stepitem-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepitem:last-of-type .p-steppanel {\n padding-inline-start: ").concat(dt("stepper.step.number.size"), ";\n}\n"); +}, "theme"); +var classes = { + root: /* @__PURE__ */ __name(function root3(_ref2) { + var props = _ref2.props; + return ["p-stepper p-component", { + "p-readonly": props.linear + }]; + }, "root"), + separator: "p-stepper-separator" +}; +var StepperStyle = BaseStyle.extend({ + name: "stepper", + theme, + classes +}); +var script$1 = { + name: "BaseStepper", + "extends": script$6, + props: { + value: { + type: [String, Number], + "default": void 0 + }, + linear: { + type: Boolean, + "default": false + } + }, + style: StepperStyle, + provide: /* @__PURE__ */ __name(function provide5() { + return { + $pcStepper: this, + $parentInstance: this + }; + }, "provide") +}; +var script = { + name: "Stepper", + "extends": script$1, + inheritAttrs: false, + emits: ["update:value"], + data: /* @__PURE__ */ __name(function data3() { + return { + id: this.$attrs.id, + d_value: this.value + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId"), + value: /* @__PURE__ */ __name(function value(newValue) { + this.d_value = newValue; + }, "value") + }, + mounted: /* @__PURE__ */ __name(function mounted3() { + this.id = this.id || UniqueComponentId(); + }, "mounted"), + methods: { + updateValue: /* @__PURE__ */ __name(function updateValue2(newValue) { + if (this.d_value !== newValue) { + this.d_value = newValue; + this.$emit("update:value", newValue); + } + }, "updateValue"), + isStepActive: /* @__PURE__ */ __name(function isStepActive(value2) { + return this.d_value === value2; + }, "isStepActive"), + isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled2() { + return this.linear; + }, "isStepDisabled") + } +}; +function render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root"), + role: "tablist" + }, _ctx.ptmi("root")), [_ctx.$slots.start ? renderSlot(_ctx.$slots, "start", { + key: 0 + }) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), _ctx.$slots.end ? renderSlot(_ctx.$slots, "end", { + key: 1 + }) : createCommentVNode("", true)], 16); +} __name(render, "render"); script.render = render; const _hoisted_1$4 = { class: "flex flex-col gap-6 w-[600px]" }; const _hoisted_2$4 = { class: "flex flex-col gap-4" }; const _hoisted_3$4 = { class: "text-2xl font-semibold text-neutral-100" }; const _hoisted_4$4 = { class: "text-neutral-400 my-0" }; +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js const _hoisted_5$4 = { class: "flex gap-2" }; const _hoisted_6$3 = { class: "bg-neutral-800 p-4 rounded-lg" }; const _hoisted_7$3 = { class: "text-lg font-medium mt-0 mb-3 text-neutral-100" }; @@ -544,6 +558,290 @@ const _hoisted_12$3 = { class: "flex items-center gap-2" }; const _hoisted_13$1 = { class: "text-neutral-200" }; const _hoisted_14$1 = { class: "pi pi-info-circle" }; const _sfc_main$4 = /* @__PURE__ */ defineComponent({ +======== +const _hoisted_5$3 = { class: "flex flex-col bg-neutral-800 p-4 rounded-lg" }; +const _hoisted_6$3 = { class: "flex items-center gap-4" }; +const _hoisted_7$3 = { class: "flex-1" }; +const _hoisted_8$3 = { class: "text-lg font-medium text-neutral-100" }; +const _hoisted_9$3 = { class: "text-sm text-neutral-400 mt-1" }; +const _hoisted_10$3 = { class: "flex items-center gap-4" }; +const _hoisted_11$3 = { class: "flex-1" }; +const _hoisted_12$3 = { class: "text-lg font-medium text-neutral-100" }; +const _hoisted_13$2 = { class: "text-sm text-neutral-400 mt-1" }; +const _hoisted_14$2 = { class: "text-neutral-300" }; +const _hoisted_15$2 = { class: "font-medium mb-2" }; +const _hoisted_16$2 = { class: "list-disc pl-6 space-y-1" }; +const _hoisted_17$2 = { class: "font-medium mt-4 mb-2" }; +const _hoisted_18$2 = { class: "list-disc pl-6 space-y-1" }; +const _sfc_main$4 = /* @__PURE__ */ defineComponent({ + __name: "DesktopSettingsConfiguration", + props: { + "autoUpdate": { required: true }, + "autoUpdateModifiers": {}, + "allowMetrics": { required: true }, + "allowMetricsModifiers": {} + }, + emits: ["update:autoUpdate", "update:allowMetrics"], + setup(__props) { + const showDialog = ref(false); + const autoUpdate = useModel(__props, "autoUpdate"); + const allowMetrics = useModel(__props, "allowMetrics"); + const showMetricsInfo = /* @__PURE__ */ __name(() => { + showDialog.value = true; + }, "showMetricsInfo"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$4, [ + createBaseVNode("div", _hoisted_2$4, [ + createBaseVNode("h2", _hoisted_3$4, toDisplayString(_ctx.$t("install.desktopAppSettings")), 1), + createBaseVNode("p", _hoisted_4$4, toDisplayString(_ctx.$t("install.desktopAppSettingsDescription")), 1) + ]), + createBaseVNode("div", _hoisted_5$3, [ + createBaseVNode("div", _hoisted_6$3, [ + createBaseVNode("div", _hoisted_7$3, [ + createBaseVNode("h3", _hoisted_8$3, toDisplayString(_ctx.$t("install.settings.autoUpdate")), 1), + createBaseVNode("p", _hoisted_9$3, toDisplayString(_ctx.$t("install.settings.autoUpdateDescription")), 1) + ]), + createVNode(unref(script$7), { + modelValue: autoUpdate.value, + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => autoUpdate.value = $event) + }, null, 8, ["modelValue"]) + ]), + createVNode(unref(script$8)), + createBaseVNode("div", _hoisted_10$3, [ + createBaseVNode("div", _hoisted_11$3, [ + createBaseVNode("h3", _hoisted_12$3, toDisplayString(_ctx.$t("install.settings.allowMetrics")), 1), + createBaseVNode("p", _hoisted_13$2, toDisplayString(_ctx.$t("install.settings.allowMetricsDescription")), 1), + createBaseVNode("a", { + href: "#", + class: "text-sm text-blue-400 hover:text-blue-300 mt-1 inline-block", + onClick: withModifiers(showMetricsInfo, ["prevent"]) + }, toDisplayString(_ctx.$t("install.settings.learnMoreAboutData")), 1) + ]), + createVNode(unref(script$7), { + modelValue: allowMetrics.value, + "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => allowMetrics.value = $event) + }, null, 8, ["modelValue"]) + ]) + ]), + createVNode(unref(script$9), { + visible: showDialog.value, + "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => showDialog.value = $event), + modal: "", + header: _ctx.$t("install.settings.dataCollectionDialog.title") + }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_14$2, [ + createBaseVNode("h4", _hoisted_15$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeCollect")), 1), + createBaseVNode("ul", _hoisted_16$2, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.errorReports")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.systemInfo")), 1) + ]), + createBaseVNode("h4", _hoisted_17$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeDoNotCollect")), 1), + createBaseVNode("ul", _hoisted_18$2, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.personalInformation")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.workflowContents")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.fileSystemInformation")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t( + "install.settings.dataCollectionDialog.customNodeConfigurations" + )), 1) + ]) + ]) + ]), + _: 1 + }, 8, ["visible", "header"]) + ]); + }; + } +}); +const _imports_0 = "" + new URL("images/nvidia-logo.svg", import.meta.url).href; +const _imports_1 = "" + new URL("images/apple-mps-logo.png", import.meta.url).href; +const _imports_2 = "" + new URL("images/manual-configuration.svg", import.meta.url).href; +const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px] h-[30rem] select-none" }; +const _hoisted_2$3 = { class: "grow flex flex-col gap-4 text-neutral-300" }; +const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$3 = { class: "m-1 text-neutral-400" }; +const _hoisted_5$2 = /* @__PURE__ */ createBaseVNode("img", { + class: "m-12", + alt: "NVIDIA logo", + width: "196", + height: "32", + src: _imports_0 +}, null, -1); +const _hoisted_6$2 = [ + _hoisted_5$2 +]; +const _hoisted_7$2 = /* @__PURE__ */ createBaseVNode("img", { + class: "rounded-lg hover-brighten", + alt: "Apple Metal Performance Shaders Logo", + width: "292", + ratio: "", + src: _imports_1 +}, null, -1); +const _hoisted_8$2 = [ + _hoisted_7$2 +]; +const _hoisted_9$2 = /* @__PURE__ */ createBaseVNode("img", { + class: "m-12", + alt: "Manual configuration", + width: "196", + src: _imports_2 +}, null, -1); +const _hoisted_10$2 = [ + _hoisted_9$2 +]; +const _hoisted_11$2 = { + key: 0, + class: "m-1" +}; +const _hoisted_12$2 = { + key: 1, + class: "m-1" +}; +const _hoisted_13$1 = { + key: 2, + class: "text-neutral-300" +}; +const _hoisted_14$1 = { class: "m-1" }; +const _hoisted_15$1 = { key: 3 }; +const _hoisted_16$1 = { class: "m-1" }; +const _hoisted_17$1 = { class: "m-1" }; +const _hoisted_18$1 = { + for: "cpu-mode", + class: "select-none" +}; +const _sfc_main$3 = /* @__PURE__ */ defineComponent({ + __name: "GpuPicker", + props: { + "device": { + required: true + }, + "deviceModifiers": {} + }, + emits: ["update:device"], + setup(__props) { + const { t } = useI18n(); + const cpuMode = computed({ + get: /* @__PURE__ */ __name(() => selected.value === "cpu", "get"), + set: /* @__PURE__ */ __name((value2) => { + selected.value = value2 ? "cpu" : null; + }, "set") + }); + const selected = useModel(__props, "device"); + const electron = electronAPI(); + const platform = electron.getPlatform(); + const pickGpu = /* @__PURE__ */ __name((value2) => { + const newValue = selected.value === value2 ? null : value2; + selected.value = newValue; + }, "pickGpu"); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1$3, [ + createBaseVNode("div", _hoisted_2$3, [ + createBaseVNode("h2", _hoisted_3$3, toDisplayString(_ctx.$t("install.gpuSelection.selectGpu")), 1), + createBaseVNode("p", _hoisted_4$3, toDisplayString(_ctx.$t("install.gpuSelection.selectGpuDescription")) + ": ", 1), + createBaseVNode("div", { + class: normalizeClass(["flex gap-2 text-center transition-opacity", { selected: selected.value }]) + }, [ + unref(platform) !== "darwin" ? (openBlock(), createElementBlock("div", { + key: 0, + class: normalizeClass(["gpu-button", { selected: selected.value === "nvidia" }]), + role: "button", + onClick: _cache[0] || (_cache[0] = ($event) => pickGpu("nvidia")) + }, _hoisted_6$2, 2)) : createCommentVNode("", true), + unref(platform) === "darwin" ? (openBlock(), createElementBlock("div", { + key: 1, + class: normalizeClass(["gpu-button", { selected: selected.value === "mps" }]), + role: "button", + onClick: _cache[1] || (_cache[1] = ($event) => pickGpu("mps")) + }, _hoisted_8$2, 2)) : createCommentVNode("", true), + createBaseVNode("div", { + class: normalizeClass(["gpu-button", { selected: selected.value === "unsupported" }]), + role: "button", + onClick: _cache[2] || (_cache[2] = ($event) => pickGpu("unsupported")) + }, _hoisted_10$2, 2) + ], 2), + selected.value === "nvidia" ? (openBlock(), createElementBlock("p", _hoisted_11$2, [ + createVNode(unref(script$a), { + icon: "pi pi-check", + severity: "success", + value: "CUDA" + }), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.nvidiaDescription")), 1) + ])) : createCommentVNode("", true), + selected.value === "mps" ? (openBlock(), createElementBlock("p", _hoisted_12$2, [ + createVNode(unref(script$a), { + icon: "pi pi-check", + severity: "success", + value: "MPS" + }), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.mpsDescription")), 1) + ])) : createCommentVNode("", true), + selected.value === "unsupported" ? (openBlock(), createElementBlock("div", _hoisted_13$1, [ + createBaseVNode("p", _hoisted_14$1, [ + createVNode(unref(script$a), { + icon: "pi pi-exclamation-triangle", + severity: "warn", + value: unref(t)("icon.exclamation-triangle") + }, null, 8, ["value"]), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.customSkipsPython")), 1) + ]), + createBaseVNode("ul", null, [ + createBaseVNode("li", null, [ + createBaseVNode("strong", null, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1) + ]), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customMayNotWork")), 1) + ]) + ])) : createCommentVNode("", true), + selected.value === "cpu" ? (openBlock(), createElementBlock("div", _hoisted_15$1, [ + createBaseVNode("p", _hoisted_16$1, [ + createVNode(unref(script$a), { + icon: "pi pi-exclamation-triangle", + severity: "warn", + value: unref(t)("icon.exclamation-triangle") + }, null, 8, ["value"]), + createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription")), 1) + ]), + createBaseVNode("p", _hoisted_17$1, toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription2")), 1) + ])) : createCommentVNode("", true) + ]), + createBaseVNode("div", { + class: normalizeClass(["transition-opacity flex gap-3 h-0", { + "opacity-40": selected.value && selected.value !== "cpu" + }]) + }, [ + createVNode(unref(script$7), { + modelValue: cpuMode.value, + "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => cpuMode.value = $event), + inputId: "cpu-mode", + class: "-translate-y-40" + }, null, 8, ["modelValue"]), + createBaseVNode("label", _hoisted_18$1, toDisplayString(_ctx.$t("install.gpuSelection.enableCpuMode")), 1) + ], 2) + ]); + }; + } +}); +const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" }; +const _hoisted_2$2 = { class: "flex flex-col gap-4" }; +const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$2 = { class: "text-neutral-400 my-0" }; +const _hoisted_5$1 = { class: "flex gap-2" }; +const _hoisted_6$1 = { class: "bg-neutral-800 p-4 rounded-lg" }; +const _hoisted_7$1 = { class: "text-lg font-medium mt-0 mb-3 text-neutral-100" }; +const _hoisted_8$1 = { class: "flex flex-col gap-2" }; +const _hoisted_9$1 = { class: "flex items-center gap-2" }; +const _hoisted_10$1 = /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-folder text-neutral-400" }, null, -1); +const _hoisted_11$1 = /* @__PURE__ */ createBaseVNode("span", { class: "text-neutral-400" }, "App Data:", -1); +const _hoisted_12$1 = { class: "text-neutral-200" }; +const _hoisted_13 = { class: "pi pi-info-circle" }; +const _hoisted_14 = { class: "flex items-center gap-2" }; +const _hoisted_15 = /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-desktop text-neutral-400" }, null, -1); +const _hoisted_16 = /* @__PURE__ */ createBaseVNode("span", { class: "text-neutral-400" }, "App Path:", -1); +const _hoisted_17 = { class: "text-neutral-200" }; +const _hoisted_18 = { class: "pi pi-info-circle" }; +const _sfc_main$2 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js __name: "InstallLocationPicker", props: { "installPath": { required: true }, @@ -602,14 +900,23 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ }, "browsePath"); return (_ctx, _cache) => { const _directive_tooltip = resolveDirective("tooltip"); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js return openBlock(), createElementBlock("div", _hoisted_1$4, [ createBaseVNode("div", _hoisted_2$4, [ createBaseVNode("h2", _hoisted_3$4, toDisplayString(_ctx.$t("install.chooseInstallationLocation")), 1), createBaseVNode("p", _hoisted_4$4, toDisplayString(_ctx.$t("install.installLocationDescription")), 1), createBaseVNode("div", _hoisted_5$4, [ createVNode(unref(script$a), { class: "flex-1" }, { +======== + return openBlock(), createElementBlock("div", _hoisted_1$2, [ + createBaseVNode("div", _hoisted_2$2, [ + createBaseVNode("h2", _hoisted_3$2, toDisplayString(_ctx.$t("install.chooseInstallationLocation")), 1), + createBaseVNode("p", _hoisted_4$2, toDisplayString(_ctx.$t("install.installLocationDescription")), 1), + createBaseVNode("div", _hoisted_5$1, [ + createVNode(unref(script$d), { class: "flex-1" }, { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js default: withCtx(() => [ - createVNode(unref(script$8), { + createVNode(unref(script$b), { modelValue: installPath.value, "onUpdate:modelValue": [ _cache[0] || (_cache[0] = ($event) => installPath.value = $event), @@ -617,19 +924,19 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ ], class: normalizeClass(["w-full", { "p-invalid": pathError.value }]) }, null, 8, ["modelValue", "class"]), - withDirectives(createVNode(unref(script$9), { class: "pi pi-info-circle" }, null, 512), [ + withDirectives(createVNode(unref(script$c), { class: "pi pi-info-circle" }, null, 512), [ [_directive_tooltip, _ctx.$t("install.installLocationTooltip")] ]) ]), _: 1 }), - createVNode(unref(script$b), { + createVNode(unref(script$e), { icon: "pi pi-folder", onClick: browsePath, class: "w-12" }) ]), - pathError.value ? (openBlock(), createBlock(unref(script$c), { + pathError.value ? (openBlock(), createBlock(unref(script$f), { key: 0, severity: "error", class: "whitespace-pre-line" @@ -639,7 +946,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ ]), _: 1 })) : createCommentVNode("", true), +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js pathExists.value ? (openBlock(), createBlock(unref(script$c), { +======== + pathExists.value ? (openBlock(), createBlock(unref(script$f), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js key: 1, severity: "warn" }, { @@ -649,6 +960,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ _: 1 })) : createCommentVNode("", true) ]), +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js createBaseVNode("div", _hoisted_6$3, [ createBaseVNode("h3", _hoisted_7$3, toDisplayString(_ctx.$t("install.systemLocations")), 1), createBaseVNode("div", _hoisted_8$3, [ @@ -665,6 +977,24 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ _cache[4] || (_cache[4] = createBaseVNode("span", { class: "text-neutral-400" }, "App Path:", -1)), createBaseVNode("span", _hoisted_13$1, toDisplayString(appPath.value), 1), withDirectives(createBaseVNode("span", _hoisted_14$1, null, 512), [ +======== + createBaseVNode("div", _hoisted_6$1, [ + createBaseVNode("h3", _hoisted_7$1, toDisplayString(_ctx.$t("install.systemLocations")), 1), + createBaseVNode("div", _hoisted_8$1, [ + createBaseVNode("div", _hoisted_9$1, [ + _hoisted_10$1, + _hoisted_11$1, + createBaseVNode("span", _hoisted_12$1, toDisplayString(appData.value), 1), + withDirectives(createBaseVNode("span", _hoisted_13, null, 512), [ + [_directive_tooltip, _ctx.$t("install.appDataLocationTooltip")] + ]) + ]), + createBaseVNode("div", _hoisted_14, [ + _hoisted_15, + _hoisted_16, + createBaseVNode("span", _hoisted_17, toDisplayString(appPath.value), 1), + withDirectives(createBaseVNode("span", _hoisted_18, null, 512), [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js [_directive_tooltip, _ctx.$t("install.appPathLocationTooltip")] ]) ]) @@ -674,6 +1004,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px]" }; const _hoisted_2$3 = { class: "flex flex-col gap-4" }; const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" }; @@ -693,6 +1024,27 @@ const _hoisted_12$2 = { class: "text-neutral-400 italic" }; const _sfc_main$3 = /* @__PURE__ */ defineComponent({ +======== +const _hoisted_1$1 = { class: "flex flex-col gap-6 w-[600px]" }; +const _hoisted_2$1 = { class: "flex flex-col gap-4" }; +const _hoisted_3$1 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_4$1 = { class: "text-neutral-400 my-0" }; +const _hoisted_5 = { class: "flex gap-2" }; +const _hoisted_6 = { + key: 0, + class: "flex flex-col gap-4 bg-neutral-800 p-4 rounded-lg" +}; +const _hoisted_7 = { class: "text-lg mt-0 font-medium text-neutral-100" }; +const _hoisted_8 = { class: "flex flex-col gap-3" }; +const _hoisted_9 = ["onClick"]; +const _hoisted_10 = ["for"]; +const _hoisted_11 = { class: "text-sm text-neutral-400 my-1" }; +const _hoisted_12 = { + key: 1, + class: "text-neutral-400 italic" +}; +const _sfc_main$1 = /* @__PURE__ */ defineComponent({ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js __name: "MigrationPicker", props: { "sourcePath": { required: false }, @@ -748,12 +1100,21 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({ migrationItemIds.value = migrationItems.value.filter((item) => item.selected).map((item) => item.id); }); return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js return openBlock(), createElementBlock("div", _hoisted_1$3, [ createBaseVNode("div", _hoisted_2$3, [ createBaseVNode("h2", _hoisted_3$3, toDisplayString(_ctx.$t("install.migrateFromExistingInstallation")), 1), createBaseVNode("p", _hoisted_4$3, toDisplayString(_ctx.$t("install.migrationSourcePathDescription")), 1), createBaseVNode("div", _hoisted_5$3, [ createVNode(unref(script$8), { +======== + return openBlock(), createElementBlock("div", _hoisted_1$1, [ + createBaseVNode("div", _hoisted_2$1, [ + createBaseVNode("h2", _hoisted_3$1, toDisplayString(_ctx.$t("install.migrateFromExistingInstallation")), 1), + createBaseVNode("p", _hoisted_4$1, toDisplayString(_ctx.$t("install.migrationSourcePathDescription")), 1), + createBaseVNode("div", _hoisted_5, [ + createVNode(unref(script$b), { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js modelValue: sourcePath.value, "onUpdate:modelValue": [ _cache[0] || (_cache[0] = ($event) => sourcePath.value = $event), @@ -762,13 +1123,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({ placeholder: "Select existing ComfyUI installation (optional)", class: normalizeClass(["flex-1", { "p-invalid": pathError.value }]) }, null, 8, ["modelValue", "class"]), - createVNode(unref(script$b), { + createVNode(unref(script$e), { icon: "pi pi-folder", onClick: browsePath, class: "w-12" }) ]), - pathError.value ? (openBlock(), createBlock(unref(script$c), { + pathError.value ? (openBlock(), createBlock(unref(script$f), { key: 0, severity: "error" }, { @@ -778,16 +1139,22 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({ _: 1 })) : createCommentVNode("", true) ]), +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js isValidSource.value ? (openBlock(), createElementBlock("div", _hoisted_6$2, [ createBaseVNode("h3", _hoisted_7$2, toDisplayString(_ctx.$t("install.selectItemsToMigrate")), 1), createBaseVNode("div", _hoisted_8$2, [ +======== + isValidSource.value ? (openBlock(), createElementBlock("div", _hoisted_6, [ + createBaseVNode("h3", _hoisted_7, toDisplayString(_ctx.$t("install.selectItemsToMigrate")), 1), + createBaseVNode("div", _hoisted_8, [ +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js (openBlock(true), createElementBlock(Fragment, null, renderList(migrationItems.value, (item) => { return openBlock(), createElementBlock("div", { key: item.id, class: "flex items-center gap-3 p-2 hover:bg-neutral-700 rounded", onClick: /* @__PURE__ */ __name(($event) => item.selected = !item.selected, "onClick") }, [ - createVNode(unref(script$d), { + createVNode(unref(script$g), { modelValue: item.selected, "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => item.selected = $event, "onUpdate:modelValue"), inputId: item.id, @@ -799,6 +1166,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({ createBaseVNode("label", { for: item.id, class: "text-neutral-200 font-medium" +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js }, toDisplayString(item.label), 9, _hoisted_10$2), createBaseVNode("p", _hoisted_11$2, toDisplayString(item.description), 1) ]) @@ -806,10 +1174,20 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({ }), 128)) ]) ])) : (openBlock(), createElementBlock("div", _hoisted_12$2, toDisplayString(_ctx.$t("install.migrationOptional")), 1)) +======== + }, toDisplayString(item.label), 9, _hoisted_10), + createBaseVNode("p", _hoisted_11, toDisplayString(item.description), 1) + ]) + ], 8, _hoisted_9); + }), 128)) + ]) + ])) : (openBlock(), createElementBlock("div", _hoisted_12, toDisplayString(_ctx.$t("install.migrationOptional")), 1)) +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js ]); }; } }); +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" }; const _hoisted_2$2 = { class: "flex flex-col gap-4" }; const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" }; @@ -1073,6 +1451,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({ }); const _hoisted_1 = { class: "font-sans flex flex-col items-center h-screen m-0 text-neutral-300 bg-neutral-900 dark-theme pointer-events-auto" }; const _hoisted_2 = { class: "flex pt-6 justify-end" }; +======== +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-de33872d"), n = n(), popScopeId(), n), "_withScopeId"); +const _hoisted_1 = { class: "flex pt-6 justify-end" }; +const _hoisted_2 = { class: "flex pt-6 justify-between" }; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js const _hoisted_3 = { class: "flex pt-6 justify-between" }; const _hoisted_4 = { class: "flex pt-6 justify-between" }; const _hoisted_5 = { class: "flex pt-6 justify-between" }; @@ -1115,6 +1498,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ device.value = detectedGpu; }); return (_ctx, _cache) => { +<<<<<<<< HEAD:comfy/web/assets/InstallView-DiTLLUby.js return openBlock(), createElementBlock("div", _hoisted_1, [ createVNode(unref(script$6), { class: "stepper", @@ -1272,3 +1656,165 @@ export { InstallView as default }; //# sourceMappingURL=InstallView-DiTLLUby.js.map +======== + return openBlock(), createBlock(_sfc_main$5, { dark: "" }, { + default: withCtx(() => [ + createVNode(unref(script), { + class: "h-full p-8 2xl:p-16", + value: "0", + "onUpdate:value": setHighestStep + }, { + default: withCtx(() => [ + createVNode(unref(script$4), { class: "select-none" }, { + default: withCtx(() => [ + createVNode(unref(script$5), { value: "0" }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.gpu")), 1) + ]), + _: 1 + }), + createVNode(unref(script$5), { + value: "1", + disabled: noGpu.value + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.installLocation")), 1) + ]), + _: 1 + }, 8, ["disabled"]), + createVNode(unref(script$5), { + value: "2", + disabled: noGpu.value || hasError.value || highestStep.value < 1 + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.migration")), 1) + ]), + _: 1 + }, 8, ["disabled"]), + createVNode(unref(script$5), { + value: "3", + disabled: noGpu.value || hasError.value || highestStep.value < 2 + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(_ctx.$t("install.desktopSettings")), 1) + ]), + _: 1 + }, 8, ["disabled"]) + ]), + _: 1 + }), + createVNode(unref(script$2), null, { + default: withCtx(() => [ + createVNode(unref(script$3), { value: "0" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$3, { + device: device.value, + "onUpdate:device": _cache[0] || (_cache[0] = ($event) => device.value = $event) + }, null, 8, ["device"]), + createBaseVNode("div", _hoisted_1, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick"), + disabled: typeof device.value !== "string" + }, null, 8, ["label", "onClick", "disabled"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script$3), { value: "1" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$2, { + installPath: installPath.value, + "onUpdate:installPath": _cache[1] || (_cache[1] = ($event) => installPath.value = $event), + pathError: pathError.value, + "onUpdate:pathError": _cache[2] || (_cache[2] = ($event) => pathError.value = $event) + }, null, 8, ["installPath", "pathError"]), + createBaseVNode("div", _hoisted_2, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("0"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$e), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick"), + disabled: pathError.value !== "" + }, null, 8, ["label", "onClick", "disabled"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script$3), { value: "2" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$1, { + sourcePath: migrationSourcePath.value, + "onUpdate:sourcePath": _cache[3] || (_cache[3] = ($event) => migrationSourcePath.value = $event), + migrationItemIds: migrationItemIds.value, + "onUpdate:migrationItemIds": _cache[4] || (_cache[4] = ($event) => migrationItemIds.value = $event) + }, null, 8, ["sourcePath", "migrationItemIds"]), + createBaseVNode("div", _hoisted_3, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$e), { + label: _ctx.$t("g.next"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("3"), "onClick") + }, null, 8, ["label", "onClick"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script$3), { value: "3" }, { + default: withCtx(({ activateCallback }) => [ + createVNode(_sfc_main$4, { + autoUpdate: autoUpdate.value, + "onUpdate:autoUpdate": _cache[5] || (_cache[5] = ($event) => autoUpdate.value = $event), + allowMetrics: allowMetrics.value, + "onUpdate:allowMetrics": _cache[6] || (_cache[6] = ($event) => allowMetrics.value = $event) + }, null, 8, ["autoUpdate", "allowMetrics"]), + createBaseVNode("div", _hoisted_4, [ + createVNode(unref(script$e), { + label: _ctx.$t("g.back"), + severity: "secondary", + icon: "pi pi-arrow-left", + onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick") + }, null, 8, ["label", "onClick"]), + createVNode(unref(script$e), { + label: _ctx.$t("g.install"), + icon: "pi pi-check", + iconPos: "right", + disabled: hasError.value, + onClick: _cache[7] || (_cache[7] = ($event) => install()) + }, null, 8, ["label", "disabled"]) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }) + ]), + _: 1 + }) + ]), + _: 1 + }); + }; + } +}); +const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-de33872d"]]); +export { + InstallView as default +}; +//# sourceMappingURL=InstallView-CAcYt0HL.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/InstallView-CAcYt0HL.js diff --git a/comfy/web/assets/KeybindingPanel-CCriqCI8.js b/comfy/web/assets/KeybindingPanel-CCriqCI8.js index a2c9eee59..9f237159a 100644 --- a/comfy/web/assets/KeybindingPanel-CCriqCI8.js +++ b/comfy/web/assets/KeybindingPanel-CCriqCI8.js @@ -1,8 +1,16 @@ var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/KeybindingPanel-CCriqCI8.js import { a as defineComponent, p as computed, o as openBlock, f as createElementBlock, O as Fragment, P as renderList, g as createVNode, x as withCtx, aw as createTextVNode, a5 as toDisplayString, y as unref, aA as script, h as createCommentVNode, r as ref, cj as FilterMatchMode, N as useKeybindingStore, D as useCommandStore, H as useI18n, aQ as normalizeI18nKey, aL as watchEffect, bk as useToast, q as resolveDirective, v as createBlock, ck as SearchBox, z as createBaseVNode, C as script$2, ao as script$4, bp as withModifiers, bV as script$5, aH as script$6, t as withDirectives, cl as _sfc_main$2, cg as KeyComboImpl, cm as KeybindingImpl, _ as _export_sfc } from "./index-BK27PIiK.js"; import { s as script$1, a as script$3 } from "./index-BwNYbo7J.js"; import "./index-4Y1pXkN0.js"; +======== +import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, F as Fragment, E as renderList, N as createVNode, M as withCtx, aE as createTextVNode, X as toDisplayString, j as unref, aI as script, I as createCommentVNode, ab as ref, cn as FilterMatchMode, a$ as useKeybindingStore, a2 as useCommandStore, a1 as useI18n, af as normalizeI18nKey, w as watchEffect, bs as useToast, r as resolveDirective, k as createBlock, co as SearchBox, H as createBaseVNode, l as script$2, av as script$4, bM as withModifiers, bZ as script$5, aP as script$6, i as withDirectives, cp as _sfc_main$2, aL as pushScopeId, aM as popScopeId, cq as KeyComboImpl, cr as KeybindingImpl, _ as _export_sfc } from "./index-DjNHn37O.js"; +import { s as script$1, a as script$3 } from "./index-B5F0uxTQ.js"; +import { u as useKeybindingService } from "./keybindingService-Bx7YdkXn.js"; +import "./index-B-aVupP5.js"; +import "./index-5HFeZax4.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/KeybindingPanel-Dc3C4lG1.js const _hoisted_1$1 = { key: 0, class: "px-2" @@ -35,6 +43,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/KeybindingPanel-CCriqCI8.js +======== +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-2554ab36"), n = n(), popScopeId(), n), "_withScopeId"); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/KeybindingPanel-Dc3C4lG1.js const _hoisted_1 = { class: "actions invisible flex flex-row" }; const _hoisted_2 = ["title"]; const _hoisted_3 = { key: 1 }; @@ -45,6 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ global: { value: "", matchMode: FilterMatchMode.CONTAINS } }); const keybindingStore = useKeybindingStore(); + const keybindingService = useKeybindingService(); const commandStore = useCommandStore(); const { t } = useI18n(); const commandsData = computed(() => { @@ -89,7 +102,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ function removeKeybinding(commandData) { if (commandData.keybinding) { keybindingStore.unsetKeybinding(commandData.keybinding); - keybindingStore.persistUserKeybindings(); + keybindingService.persistUserKeybindings(); } } __name(removeKeybinding, "removeKeybinding"); @@ -113,7 +126,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ }) ); if (updated) { - keybindingStore.persistUserKeybindings(); + keybindingService.persistUserKeybindings(); } } cancelEdit(); @@ -122,7 +135,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ const toast = useToast(); async function resetKeybindings() { keybindingStore.resetKeybindings(); - await keybindingStore.persistUserKeybindings(); + await keybindingService.persistUserKeybindings(); toast.add({ severity: "info", summary: "Info", @@ -273,8 +286,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ }; } }); +<<<<<<<< HEAD:comfy/web/assets/KeybindingPanel-CCriqCI8.js const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-108bdfe7"]]); export { KeybindingPanel as default }; //# sourceMappingURL=KeybindingPanel-CCriqCI8.js.map +======== +const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2554ab36"]]); +export { + KeybindingPanel as default +}; +//# sourceMappingURL=KeybindingPanel-Dc3C4lG1.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/KeybindingPanel-Dc3C4lG1.js diff --git a/comfy/web/assets/KeybindingPanel-Dc3C4lG1.js b/comfy/web/assets/KeybindingPanel-Dc3C4lG1.js new file mode 100644 index 000000000..9f237159a --- /dev/null +++ b/comfy/web/assets/KeybindingPanel-Dc3C4lG1.js @@ -0,0 +1,301 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/KeybindingPanel-CCriqCI8.js +import { a as defineComponent, p as computed, o as openBlock, f as createElementBlock, O as Fragment, P as renderList, g as createVNode, x as withCtx, aw as createTextVNode, a5 as toDisplayString, y as unref, aA as script, h as createCommentVNode, r as ref, cj as FilterMatchMode, N as useKeybindingStore, D as useCommandStore, H as useI18n, aQ as normalizeI18nKey, aL as watchEffect, bk as useToast, q as resolveDirective, v as createBlock, ck as SearchBox, z as createBaseVNode, C as script$2, ao as script$4, bp as withModifiers, bV as script$5, aH as script$6, t as withDirectives, cl as _sfc_main$2, cg as KeyComboImpl, cm as KeybindingImpl, _ as _export_sfc } from "./index-BK27PIiK.js"; +import { s as script$1, a as script$3 } from "./index-BwNYbo7J.js"; +import "./index-4Y1pXkN0.js"; +======== +import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, F as Fragment, E as renderList, N as createVNode, M as withCtx, aE as createTextVNode, X as toDisplayString, j as unref, aI as script, I as createCommentVNode, ab as ref, cn as FilterMatchMode, a$ as useKeybindingStore, a2 as useCommandStore, a1 as useI18n, af as normalizeI18nKey, w as watchEffect, bs as useToast, r as resolveDirective, k as createBlock, co as SearchBox, H as createBaseVNode, l as script$2, av as script$4, bM as withModifiers, bZ as script$5, aP as script$6, i as withDirectives, cp as _sfc_main$2, aL as pushScopeId, aM as popScopeId, cq as KeyComboImpl, cr as KeybindingImpl, _ as _export_sfc } from "./index-DjNHn37O.js"; +import { s as script$1, a as script$3 } from "./index-B5F0uxTQ.js"; +import { u as useKeybindingService } from "./keybindingService-Bx7YdkXn.js"; +import "./index-B-aVupP5.js"; +import "./index-5HFeZax4.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/KeybindingPanel-Dc3C4lG1.js +const _hoisted_1$1 = { + key: 0, + class: "px-2" +}; +const _sfc_main$1 = /* @__PURE__ */ defineComponent({ + __name: "KeyComboDisplay", + props: { + keyCombo: {}, + isModified: { type: Boolean, default: false } + }, + setup(__props) { + const props = __props; + const keySequences = computed(() => props.keyCombo.getKeySequences()); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("span", null, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(keySequences.value, (sequence, index) => { + return openBlock(), createElementBlock(Fragment, { key: index }, [ + createVNode(unref(script), { + severity: _ctx.isModified ? "info" : "secondary" + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(sequence), 1) + ]), + _: 2 + }, 1032, ["severity"]), + index < keySequences.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_1$1, "+")) : createCommentVNode("", true) + ], 64); + }), 128)) + ]); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/KeybindingPanel-CCriqCI8.js +======== +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-2554ab36"), n = n(), popScopeId(), n), "_withScopeId"); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/KeybindingPanel-Dc3C4lG1.js +const _hoisted_1 = { class: "actions invisible flex flex-row" }; +const _hoisted_2 = ["title"]; +const _hoisted_3 = { key: 1 }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "KeybindingPanel", + setup(__props) { + const filters = ref({ + global: { value: "", matchMode: FilterMatchMode.CONTAINS } + }); + const keybindingStore = useKeybindingStore(); + const keybindingService = useKeybindingService(); + const commandStore = useCommandStore(); + const { t } = useI18n(); + const commandsData = computed(() => { + return Object.values(commandStore.commands).map((command) => ({ + id: command.id, + label: t(`commands.${normalizeI18nKey(command.id)}.label`, command.label), + keybinding: keybindingStore.getKeybindingByCommandId(command.id) + })); + }); + const selectedCommandData = ref(null); + const editDialogVisible = ref(false); + const newBindingKeyCombo = ref(null); + const currentEditingCommand = ref(null); + const keybindingInput = ref(null); + const existingKeybindingOnCombo = computed(() => { + if (!currentEditingCommand.value) { + return null; + } + if (currentEditingCommand.value.keybinding?.combo?.equals( + newBindingKeyCombo.value + )) { + return null; + } + if (!newBindingKeyCombo.value) { + return null; + } + return keybindingStore.getKeybinding(newBindingKeyCombo.value); + }); + function editKeybinding(commandData) { + currentEditingCommand.value = commandData; + newBindingKeyCombo.value = commandData.keybinding ? commandData.keybinding.combo : null; + editDialogVisible.value = true; + } + __name(editKeybinding, "editKeybinding"); + watchEffect(() => { + if (editDialogVisible.value) { + setTimeout(() => { + keybindingInput.value?.$el?.focus(); + }, 300); + } + }); + function removeKeybinding(commandData) { + if (commandData.keybinding) { + keybindingStore.unsetKeybinding(commandData.keybinding); + keybindingService.persistUserKeybindings(); + } + } + __name(removeKeybinding, "removeKeybinding"); + function captureKeybinding(event) { + const keyCombo = KeyComboImpl.fromEvent(event); + newBindingKeyCombo.value = keyCombo; + } + __name(captureKeybinding, "captureKeybinding"); + function cancelEdit() { + editDialogVisible.value = false; + currentEditingCommand.value = null; + newBindingKeyCombo.value = null; + } + __name(cancelEdit, "cancelEdit"); + function saveKeybinding() { + if (currentEditingCommand.value && newBindingKeyCombo.value) { + const updated = keybindingStore.updateKeybindingOnCommand( + new KeybindingImpl({ + commandId: currentEditingCommand.value.id, + combo: newBindingKeyCombo.value + }) + ); + if (updated) { + keybindingService.persistUserKeybindings(); + } + } + cancelEdit(); + } + __name(saveKeybinding, "saveKeybinding"); + const toast = useToast(); + async function resetKeybindings() { + keybindingStore.resetKeybindings(); + await keybindingService.persistUserKeybindings(); + toast.add({ + severity: "info", + summary: "Info", + detail: "Keybindings reset", + life: 3e3 + }); + } + __name(resetKeybindings, "resetKeybindings"); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createBlock(_sfc_main$2, { + value: "Keybinding", + class: "keybinding-panel" + }, { + header: withCtx(() => [ + createVNode(SearchBox, { + modelValue: filters.value["global"].value, + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filters.value["global"].value = $event), + placeholder: _ctx.$t("g.searchKeybindings") + "..." + }, null, 8, ["modelValue", "placeholder"]) + ]), + default: withCtx(() => [ + createVNode(unref(script$3), { + value: commandsData.value, + selection: selectedCommandData.value, + "onUpdate:selection": _cache[1] || (_cache[1] = ($event) => selectedCommandData.value = $event), + "global-filter-fields": ["id"], + filters: filters.value, + selectionMode: "single", + stripedRows: "", + pt: { + header: "px-0" + } + }, { + default: withCtx(() => [ + createVNode(unref(script$1), { + field: "actions", + header: "" + }, { + body: withCtx((slotProps) => [ + createBaseVNode("div", _hoisted_1, [ + createVNode(unref(script$2), { + icon: "pi pi-pencil", + class: "p-button-text", + onClick: /* @__PURE__ */ __name(($event) => editKeybinding(slotProps.data), "onClick") + }, null, 8, ["onClick"]), + createVNode(unref(script$2), { + icon: "pi pi-trash", + class: "p-button-text p-button-danger", + onClick: /* @__PURE__ */ __name(($event) => removeKeybinding(slotProps.data), "onClick"), + disabled: !slotProps.data.keybinding + }, null, 8, ["onClick", "disabled"]) + ]) + ]), + _: 1 + }), + createVNode(unref(script$1), { + field: "id", + header: _ctx.$t("g.command"), + sortable: "", + class: "max-w-64 2xl:max-w-full" + }, { + body: withCtx((slotProps) => [ + createBaseVNode("div", { + class: "overflow-hidden text-ellipsis whitespace-nowrap", + title: slotProps.data.id + }, toDisplayString(slotProps.data.label), 9, _hoisted_2) + ]), + _: 1 + }, 8, ["header"]), + createVNode(unref(script$1), { + field: "keybinding", + header: _ctx.$t("g.keybinding") + }, { + body: withCtx((slotProps) => [ + slotProps.data.keybinding ? (openBlock(), createBlock(_sfc_main$1, { + key: 0, + keyCombo: slotProps.data.keybinding.combo, + isModified: unref(keybindingStore).isCommandKeybindingModified(slotProps.data.id) + }, null, 8, ["keyCombo", "isModified"])) : (openBlock(), createElementBlock("span", _hoisted_3, "-")) + ]), + _: 1 + }, 8, ["header"]) + ]), + _: 1 + }, 8, ["value", "selection", "filters"]), + createVNode(unref(script$6), { + class: "min-w-96", + visible: editDialogVisible.value, + "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => editDialogVisible.value = $event), + modal: "", + header: currentEditingCommand.value?.id, + onHide: cancelEdit + }, { + footer: withCtx(() => [ + createVNode(unref(script$2), { + label: "Save", + icon: "pi pi-check", + onClick: saveKeybinding, + disabled: !!existingKeybindingOnCombo.value, + autofocus: "" + }, null, 8, ["disabled"]) + ]), + default: withCtx(() => [ + createBaseVNode("div", null, [ + createVNode(unref(script$4), { + class: "mb-2 text-center", + ref_key: "keybindingInput", + ref: keybindingInput, + modelValue: newBindingKeyCombo.value?.toString() ?? "", + placeholder: "Press keys for new binding", + onKeydown: withModifiers(captureKeybinding, ["stop", "prevent"]), + autocomplete: "off", + fluid: "", + invalid: !!existingKeybindingOnCombo.value + }, null, 8, ["modelValue", "invalid"]), + existingKeybindingOnCombo.value ? (openBlock(), createBlock(unref(script$5), { + key: 0, + severity: "error" + }, { + default: withCtx(() => [ + _cache[3] || (_cache[3] = createTextVNode(" Keybinding already exists on ")), + createVNode(unref(script), { + severity: "secondary", + value: existingKeybindingOnCombo.value.commandId + }, null, 8, ["value"]) + ]), + _: 1 + })) : createCommentVNode("", true) + ]) + ]), + _: 1 + }, 8, ["visible", "header"]), + withDirectives(createVNode(unref(script$2), { + class: "mt-4", + label: _ctx.$t("g.reset"), + icon: "pi pi-trash", + severity: "danger", + fluid: "", + text: "", + onClick: resetKeybindings + }, null, 8, ["label"]), [ + [_directive_tooltip, _ctx.$t("g.resetKeybindingsTooltip")] + ]) + ]), + _: 1 + }); + }; + } +}); +<<<<<<<< HEAD:comfy/web/assets/KeybindingPanel-CCriqCI8.js +const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-108bdfe7"]]); +export { + KeybindingPanel as default +}; +//# sourceMappingURL=KeybindingPanel-CCriqCI8.js.map +======== +const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2554ab36"]]); +export { + KeybindingPanel as default +}; +//# sourceMappingURL=KeybindingPanel-Dc3C4lG1.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/KeybindingPanel-Dc3C4lG1.js diff --git a/comfy/web/assets/KeybindingPanel-DvrUYZ4S.css b/comfy/web/assets/KeybindingPanel-DvrUYZ4S.css new file mode 100644 index 000000000..8f714bcdb --- /dev/null +++ b/comfy/web/assets/KeybindingPanel-DvrUYZ4S.css @@ -0,0 +1,8 @@ + +[data-v-2554ab36] .p-datatable-tbody > tr > td { + padding: 0.25rem; + min-height: 2rem +} +[data-v-2554ab36] .p-datatable-row-selected .actions,[data-v-2554ab36] .p-datatable-selectable-row:hover .actions { + visibility: visible +} diff --git a/comfy/web/assets/ManualConfigurationView-B6ecEClB.css b/comfy/web/assets/ManualConfigurationView-B6ecEClB.css new file mode 100644 index 000000000..06a5cc3e8 --- /dev/null +++ b/comfy/web/assets/ManualConfigurationView-B6ecEClB.css @@ -0,0 +1,7 @@ + +:root { + --p-tag-gap: 0.5rem; +} +.comfy-installer { + margin-top: max(1rem, max(0px, calc((100vh - 42rem) * 0.5))); +} diff --git a/comfy/web/assets/ManualConfigurationView-Bi_qHE-n.js b/comfy/web/assets/ManualConfigurationView-Bi_qHE-n.js new file mode 100644 index 000000000..233f20fa7 --- /dev/null +++ b/comfy/web/assets/ManualConfigurationView-Bi_qHE-n.js @@ -0,0 +1,75 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +import { d as defineComponent, a1 as useI18n, ab as ref, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, aI as script, l as script$2, c0 as electronAPI } from "./index-DjNHn37O.js"; +import { s as script$1 } from "./index-jXPKy3pP.js"; +import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js"; +import "./index-5HFeZax4.js"; +const _hoisted_1 = { class: "comfy-installer grow flex flex-col gap-4 text-neutral-300 max-w-110" }; +const _hoisted_2 = { class: "text-2xl font-semibold text-neutral-100" }; +const _hoisted_3 = { class: "m-1 text-neutral-300" }; +const _hoisted_4 = { class: "ml-2" }; +const _hoisted_5 = { class: "m-1 mb-4" }; +const _hoisted_6 = { class: "m-0" }; +const _hoisted_7 = { class: "m-1" }; +const _hoisted_8 = { class: "font-mono" }; +const _hoisted_9 = { class: "m-1" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "ManualConfigurationView", + setup(__props) { + const { t } = useI18n(); + const electron = electronAPI(); + const basePath = ref(null); + const sep = ref("/"); + const restartApp = /* @__PURE__ */ __name((message) => electron.restartApp(message), "restartApp"); + onMounted(async () => { + basePath.value = await electron.getBasePath(); + if (basePath.value.indexOf("/") === -1) sep.value = "\\"; + }); + return (_ctx, _cache) => { + return openBlock(), createBlock(_sfc_main$1, { dark: "" }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_1, [ + createBaseVNode("h2", _hoisted_2, toDisplayString(_ctx.$t("install.manualConfiguration.title")), 1), + createBaseVNode("p", _hoisted_3, [ + createVNode(unref(script), { + icon: "pi pi-exclamation-triangle", + severity: "warn", + value: unref(t)("icon.exclamation-triangle") + }, null, 8, ["value"]), + createBaseVNode("strong", _hoisted_4, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1) + ]), + createBaseVNode("div", null, [ + createBaseVNode("p", _hoisted_5, toDisplayString(_ctx.$t("install.manualConfiguration.requirements")) + ": ", 1), + createBaseVNode("ul", _hoisted_6, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1) + ]) + ]), + createBaseVNode("p", _hoisted_7, toDisplayString(_ctx.$t("install.manualConfiguration.createVenv")) + ":", 1), + createVNode(unref(script$1), { + header: unref(t)("install.manualConfiguration.virtualEnvironmentPath") + }, { + default: withCtx(() => [ + createBaseVNode("span", _hoisted_8, toDisplayString(`${basePath.value}${sep.value}.venv${sep.value}`), 1) + ]), + _: 1 + }, 8, ["header"]), + createBaseVNode("p", _hoisted_9, toDisplayString(_ctx.$t("install.manualConfiguration.restartWhenFinished")), 1), + createVNode(unref(script$2), { + class: "place-self-end", + label: unref(t)("menuLabels.Restart"), + severity: "warn", + icon: "pi pi-refresh", + onClick: _cache[0] || (_cache[0] = ($event) => restartApp("Manual configuration complete")) + }, null, 8, ["label"]) + ]) + ]), + _: 1 + }); + }; + } +}); +export { + _sfc_main as default +}; +//# sourceMappingURL=ManualConfigurationView-Bi_qHE-n.js.map diff --git a/comfy/web/assets/NotSupportedView-Drz3x2d-.js b/comfy/web/assets/NotSupportedView-Drz3x2d-.js new file mode 100644 index 000000000..a24af84a2 --- /dev/null +++ b/comfy/web/assets/NotSupportedView-Drz3x2d-.js @@ -0,0 +1,86 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +import { d as defineComponent, bW as useRouter, r as resolveDirective, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, i as withDirectives } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js"; +const _imports_0 = "" + new URL("images/sad_girl.png", import.meta.url).href; +const _hoisted_1 = { class: "sad-container" }; +const _hoisted_2 = /* @__PURE__ */ createBaseVNode("img", { + class: "sad-girl", + src: _imports_0, + alt: "Sad girl illustration" +}, null, -1); +const _hoisted_3 = { class: "no-drag sad-text flex items-center" }; +const _hoisted_4 = { class: "flex flex-col gap-8 p-8 min-w-110" }; +const _hoisted_5 = { class: "text-4xl font-bold text-red-500" }; +const _hoisted_6 = { class: "space-y-4" }; +const _hoisted_7 = { class: "text-xl" }; +const _hoisted_8 = { class: "list-disc list-inside space-y-1 text-neutral-800" }; +const _hoisted_9 = { class: "flex gap-4" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "NotSupportedView", + setup(__props) { + const openDocs = /* @__PURE__ */ __name(() => { + window.open( + "https://github.com/Comfy-Org/desktop#currently-supported-platforms", + "_blank" + ); + }, "openDocs"); + const reportIssue = /* @__PURE__ */ __name(() => { + window.open("https://forum.comfy.org/c/v1-feedback/", "_blank"); + }, "reportIssue"); + const router = useRouter(); + const continueToInstall = /* @__PURE__ */ __name(() => { + router.push("/install"); + }, "continueToInstall"); + return (_ctx, _cache) => { + const _directive_tooltip = resolveDirective("tooltip"); + return openBlock(), createBlock(_sfc_main$1, null, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_1, [ + _hoisted_2, + createBaseVNode("div", _hoisted_3, [ + createBaseVNode("div", _hoisted_4, [ + createBaseVNode("h1", _hoisted_5, toDisplayString(_ctx.$t("notSupported.title")), 1), + createBaseVNode("div", _hoisted_6, [ + createBaseVNode("p", _hoisted_7, toDisplayString(_ctx.$t("notSupported.message")), 1), + createBaseVNode("ul", _hoisted_8, [ + createBaseVNode("li", null, toDisplayString(_ctx.$t("notSupported.supportedDevices.macos")), 1), + createBaseVNode("li", null, toDisplayString(_ctx.$t("notSupported.supportedDevices.windows")), 1) + ]) + ]), + createBaseVNode("div", _hoisted_9, [ + createVNode(unref(script), { + label: _ctx.$t("notSupported.learnMore"), + icon: "pi pi-github", + onClick: openDocs, + severity: "secondary" + }, null, 8, ["label"]), + createVNode(unref(script), { + label: _ctx.$t("notSupported.reportIssue"), + icon: "pi pi-flag", + onClick: reportIssue, + severity: "secondary" + }, null, 8, ["label"]), + withDirectives(createVNode(unref(script), { + label: _ctx.$t("notSupported.continue"), + icon: "pi pi-arrow-right", + iconPos: "right", + onClick: continueToInstall, + severity: "danger" + }, null, 8, ["label"]), [ + [_directive_tooltip, _ctx.$t("notSupported.continueTooltip")] + ]) + ]) + ]) + ]) + ]) + ]), + _: 1 + }); + }; + } +}); +export { + _sfc_main as default +}; +//# sourceMappingURL=NotSupportedView-Drz3x2d-.js.map diff --git a/comfy/web/assets/NotSupportedView-bFzHmqNj.css b/comfy/web/assets/NotSupportedView-bFzHmqNj.css new file mode 100644 index 000000000..80ac32982 --- /dev/null +++ b/comfy/web/assets/NotSupportedView-bFzHmqNj.css @@ -0,0 +1,17 @@ + +.sad-container { + display: grid; + align-items: center; + justify-content: space-evenly; + grid-template-columns: 25rem 1fr; +& > * { + grid-row: 1; +} +} +.sad-text { + grid-column: 1/3; +} +.sad-girl { + grid-column: 2/3; + width: min(75vw, 100vh); +} diff --git a/comfy/web/assets/ServerConfigPanel-B6kqsYbT.js b/comfy/web/assets/ServerConfigPanel-B6kqsYbT.js index 86860805b..bb3d3d750 100644 --- a/comfy/web/assets/ServerConfigPanel-B6kqsYbT.js +++ b/comfy/web/assets/ServerConfigPanel-B6kqsYbT.js @@ -1,7 +1,12 @@ var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/ServerConfigPanel-B6kqsYbT.js import { o as openBlock, f as createElementBlock, z as createBaseVNode, aX as markRaw, a as defineComponent, u as useSettingStore, aK as storeToRefs, w as watch, cH as useCopyToClipboard, H as useI18n, v as createBlock, x as withCtx, y as unref, bV as script, a5 as toDisplayString, P as renderList, O as Fragment, g as createVNode, C as script$1, h as createCommentVNode, bL as script$2, cI as FormItem, cl as _sfc_main$1, bY as electronAPI } from "./index-BK27PIiK.js"; import { u as useServerConfigStore } from "./serverConfigStore-7qHooIp9.js"; +======== +import { H as createBaseVNode, o as openBlock, f as createElementBlock, Z as markRaw, d as defineComponent, a as useSettingStore, aS as storeToRefs, a5 as watch, cO as useCopyToClipboard, a1 as useI18n, k as createBlock, M as withCtx, j as unref, bZ as script, X as toDisplayString, E as renderList, F as Fragment, N as createVNode, l as script$1, I as createCommentVNode, bQ as script$2, cP as FormItem, cp as _sfc_main$1, c0 as electronAPI } from "./index-DjNHn37O.js"; +import { u as useServerConfigStore } from "./serverConfigStore-CvyKFVuP.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ServerConfigPanel-Be4StJmv.js const _hoisted_1$1 = { viewBox: "0 0 24 24", width: "1.2em", @@ -153,4 +158,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({ export { _sfc_main as default }; +<<<<<<<< HEAD:comfy/web/assets/ServerConfigPanel-B6kqsYbT.js //# sourceMappingURL=ServerConfigPanel-B6kqsYbT.js.map +======== +//# sourceMappingURL=ServerConfigPanel-Be4StJmv.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ServerConfigPanel-Be4StJmv.js diff --git a/comfy/web/assets/ServerConfigPanel-Be4StJmv.js b/comfy/web/assets/ServerConfigPanel-Be4StJmv.js new file mode 100644 index 000000000..bb3d3d750 --- /dev/null +++ b/comfy/web/assets/ServerConfigPanel-Be4StJmv.js @@ -0,0 +1,165 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/ServerConfigPanel-B6kqsYbT.js +import { o as openBlock, f as createElementBlock, z as createBaseVNode, aX as markRaw, a as defineComponent, u as useSettingStore, aK as storeToRefs, w as watch, cH as useCopyToClipboard, H as useI18n, v as createBlock, x as withCtx, y as unref, bV as script, a5 as toDisplayString, P as renderList, O as Fragment, g as createVNode, C as script$1, h as createCommentVNode, bL as script$2, cI as FormItem, cl as _sfc_main$1, bY as electronAPI } from "./index-BK27PIiK.js"; +import { u as useServerConfigStore } from "./serverConfigStore-7qHooIp9.js"; +======== +import { H as createBaseVNode, o as openBlock, f as createElementBlock, Z as markRaw, d as defineComponent, a as useSettingStore, aS as storeToRefs, a5 as watch, cO as useCopyToClipboard, a1 as useI18n, k as createBlock, M as withCtx, j as unref, bZ as script, X as toDisplayString, E as renderList, F as Fragment, N as createVNode, l as script$1, I as createCommentVNode, bQ as script$2, cP as FormItem, cp as _sfc_main$1, c0 as electronAPI } from "./index-DjNHn37O.js"; +import { u as useServerConfigStore } from "./serverConfigStore-CvyKFVuP.js"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ServerConfigPanel-Be4StJmv.js +const _hoisted_1$1 = { + viewBox: "0 0 24 24", + width: "1.2em", + height: "1.2em" +}; +function render(_ctx, _cache) { + return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [ + createBaseVNode("path", { + fill: "none", + stroke: "currentColor", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m4 17l6-6l-6-6m8 14h8" + }, null, -1) + ])); +} +__name(render, "render"); +const __unplugin_components_0 = markRaw({ name: "lucide-terminal", render }); +const _hoisted_1 = { class: "flex flex-col gap-2" }; +const _hoisted_2 = { class: "flex justify-end gap-2" }; +const _hoisted_3 = { class: "flex items-center justify-between" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "ServerConfigPanel", + setup(__props) { + const settingStore = useSettingStore(); + const serverConfigStore = useServerConfigStore(); + const { + serverConfigsByCategory, + serverConfigValues, + launchArgs, + commandLineArgs, + modifiedConfigs + } = storeToRefs(serverConfigStore); + const revertChanges = /* @__PURE__ */ __name(() => { + serverConfigStore.revertChanges(); + }, "revertChanges"); + const restartApp = /* @__PURE__ */ __name(() => { + electronAPI().restartApp(); + }, "restartApp"); + watch(launchArgs, (newVal) => { + settingStore.set("Comfy.Server.LaunchArgs", newVal); + }); + watch(serverConfigValues, (newVal) => { + settingStore.set("Comfy.Server.ServerConfigValues", newVal); + }); + const { copyToClipboard } = useCopyToClipboard(); + const copyCommandLineArgs = /* @__PURE__ */ __name(async () => { + await copyToClipboard(commandLineArgs.value); + }, "copyCommandLineArgs"); + const { t } = useI18n(); + const translateItem = /* @__PURE__ */ __name((item) => { + return { + ...item, + name: t(`serverConfigItems.${item.id}.name`, item.name), + tooltip: item.tooltip ? t(`serverConfigItems.${item.id}.tooltip`, item.tooltip) : void 0 + }; + }, "translateItem"); + return (_ctx, _cache) => { + const _component_i_lucide58terminal = __unplugin_components_0; + return openBlock(), createBlock(_sfc_main$1, { + value: "Server-Config", + class: "server-config-panel" + }, { + header: withCtx(() => [ + createBaseVNode("div", _hoisted_1, [ + unref(modifiedConfigs).length > 0 ? (openBlock(), createBlock(unref(script), { + key: 0, + severity: "info", + "pt:text": "w-full" + }, { + default: withCtx(() => [ + createBaseVNode("p", null, toDisplayString(_ctx.$t("serverConfig.modifiedConfigs")), 1), + createBaseVNode("ul", null, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(unref(modifiedConfigs), (config) => { + return openBlock(), createElementBlock("li", { + key: config.id + }, toDisplayString(config.name) + ": " + toDisplayString(config.initialValue) + " → " + toDisplayString(config.value), 1); + }), 128)) + ]), + createBaseVNode("div", _hoisted_2, [ + createVNode(unref(script$1), { + label: _ctx.$t("serverConfig.revertChanges"), + onClick: revertChanges, + outlined: "" + }, null, 8, ["label"]), + createVNode(unref(script$1), { + label: _ctx.$t("serverConfig.restart"), + onClick: restartApp, + outlined: "", + severity: "danger" + }, null, 8, ["label"]) + ]) + ]), + _: 1 + })) : createCommentVNode("", true), + unref(commandLineArgs) ? (openBlock(), createBlock(unref(script), { + key: 1, + severity: "secondary", + "pt:text": "w-full" + }, { + icon: withCtx(() => [ + createVNode(_component_i_lucide58terminal, { class: "text-xl font-bold" }) + ]), + default: withCtx(() => [ + createBaseVNode("div", _hoisted_3, [ + createBaseVNode("p", null, toDisplayString(unref(commandLineArgs)), 1), + createVNode(unref(script$1), { + icon: "pi pi-clipboard", + onClick: copyCommandLineArgs, + severity: "secondary", + text: "" + }) + ]) + ]), + _: 1 + })) : createCommentVNode("", true) + ]) + ]), + default: withCtx(() => [ + (openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(unref(serverConfigsByCategory)), ([label, items], i) => { + return openBlock(), createElementBlock("div", { key: label }, [ + i > 0 ? (openBlock(), createBlock(unref(script$2), { key: 0 })) : createCommentVNode("", true), + createBaseVNode("h3", null, toDisplayString(_ctx.$t(`serverConfigCategories.${label}`, label)), 1), + (openBlock(true), createElementBlock(Fragment, null, renderList(items, (item) => { + return openBlock(), createElementBlock("div", { + key: item.name, + class: "mb-4" + }, [ + createVNode(FormItem, { + item: translateItem(item), + formValue: item.value, + "onUpdate:formValue": /* @__PURE__ */ __name(($event) => item.value = $event, "onUpdate:formValue"), + id: item.id, + labelClass: { + "text-highlight": item.initialValue !== item.value + } + }, null, 8, ["item", "formValue", "onUpdate:formValue", "id", "labelClass"]) + ]); + }), 128)) + ]); + }), 128)) + ]), + _: 1 + }); + }; + } +}); +export { + _sfc_main as default +}; +<<<<<<<< HEAD:comfy/web/assets/ServerConfigPanel-B6kqsYbT.js +//# sourceMappingURL=ServerConfigPanel-B6kqsYbT.js.map +======== +//# sourceMappingURL=ServerConfigPanel-Be4StJmv.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/ServerConfigPanel-Be4StJmv.js diff --git a/comfy/web/assets/ServerStartView-BOMJWAdU.css b/comfy/web/assets/ServerStartView-BOMJWAdU.css index 50d444d78..60a63414f 100644 --- a/comfy/web/assets/ServerStartView-BOMJWAdU.css +++ b/comfy/web/assets/ServerStartView-BOMJWAdU.css @@ -1,5 +1,5 @@ -[data-v-c0d3157e] .xterm-helper-textarea { +[data-v-42c1131d] .xterm-helper-textarea { /* Hide this as it moves all over when uv is running */ display: none; } diff --git a/comfy/web/assets/ServerStartView-CIDTUh4x.js b/comfy/web/assets/ServerStartView-CIDTUh4x.js new file mode 100644 index 000000000..6567eea21 --- /dev/null +++ b/comfy/web/assets/ServerStartView-CIDTUh4x.js @@ -0,0 +1,98 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +import { d as defineComponent, a1 as useI18n, ab as ref, b_ as ProgressStatus, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, aE as createTextVNode, X as toDisplayString, j as unref, f as createElementBlock, I as createCommentVNode, N as createVNode, l as script, i as withDirectives, v as vShow, b$ as BaseTerminal, aL as pushScopeId, aM as popScopeId, c0 as electronAPI, _ as _export_sfc } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js"; +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-42c1131d"), n = n(), popScopeId(), n), "_withScopeId"); +const _hoisted_1 = { class: "text-2xl font-bold" }; +const _hoisted_2 = { key: 0 }; +const _hoisted_3 = { + key: 0, + class: "flex flex-col items-center gap-4" +}; +const _hoisted_4 = { class: "flex items-center my-4 gap-2" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "ServerStartView", + setup(__props) { + const electron = electronAPI(); + const { t } = useI18n(); + const status = ref(ProgressStatus.INITIAL_STATE); + const electronVersion = ref(""); + let xterm; + const terminalVisible = ref(true); + const updateProgress = /* @__PURE__ */ __name(({ status: newStatus }) => { + status.value = newStatus; + if (newStatus === ProgressStatus.ERROR) terminalVisible.value = false; + else xterm?.clear(); + }, "updateProgress"); + const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => { + xterm = terminal; + useAutoSize(root, true, true); + electron.onLogMessage((message) => { + terminal.write(message); + }); + terminal.options.cursorBlink = false; + terminal.options.disableStdin = true; + terminal.options.cursorInactiveStyle = "block"; + }, "terminalCreated"); + const reinstall = /* @__PURE__ */ __name(() => electron.reinstall(), "reinstall"); + const reportIssue = /* @__PURE__ */ __name(() => { + window.open("https://forum.comfy.org/c/v1-feedback/", "_blank"); + }, "reportIssue"); + const openLogs = /* @__PURE__ */ __name(() => electron.openLogsFolder(), "openLogs"); + onMounted(async () => { + electron.sendReady(); + electron.onProgressUpdate(updateProgress); + electronVersion.value = await electron.getElectronVersion(); + }); + return (_ctx, _cache) => { + return openBlock(), createBlock(_sfc_main$1, { + dark: "", + class: "flex-col" + }, { + default: withCtx(() => [ + createBaseVNode("h2", _hoisted_1, [ + createTextVNode(toDisplayString(unref(t)(`serverStart.process.${status.value}`)) + " ", 1), + status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("span", _hoisted_2, " v" + toDisplayString(electronVersion.value), 1)) : createCommentVNode("", true) + ]), + status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("div", _hoisted_3, [ + createBaseVNode("div", _hoisted_4, [ + createVNode(unref(script), { + icon: "pi pi-flag", + severity: "secondary", + label: unref(t)("serverStart.reportIssue"), + onClick: reportIssue + }, null, 8, ["label"]), + createVNode(unref(script), { + icon: "pi pi-file", + severity: "secondary", + label: unref(t)("serverStart.openLogs"), + onClick: openLogs + }, null, 8, ["label"]), + createVNode(unref(script), { + icon: "pi pi-refresh", + label: unref(t)("serverStart.reinstall"), + onClick: reinstall + }, null, 8, ["label"]) + ]), + !terminalVisible.value ? (openBlock(), createBlock(unref(script), { + key: 0, + icon: "pi pi-search", + severity: "secondary", + label: unref(t)("serverStart.showTerminal"), + onClick: _cache[0] || (_cache[0] = ($event) => terminalVisible.value = true) + }, null, 8, ["label"])) : createCommentVNode("", true) + ])) : createCommentVNode("", true), + withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [ + [vShow, terminalVisible.value] + ]) + ]), + _: 1 + }); + }; + } +}); +const ServerStartView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-42c1131d"]]); +export { + ServerStartView as default +}; +//# sourceMappingURL=ServerStartView-CIDTUh4x.js.map diff --git a/comfy/web/assets/ServerStartView-CnyN4Ib6.css b/comfy/web/assets/ServerStartView-CnyN4Ib6.css new file mode 100644 index 000000000..60a63414f --- /dev/null +++ b/comfy/web/assets/ServerStartView-CnyN4Ib6.css @@ -0,0 +1,5 @@ + +[data-v-42c1131d] .xterm-helper-textarea { + /* Hide this as it moves all over when uv is running */ + display: none; +} diff --git a/comfy/web/assets/UserSelectView-B3jYchWu.js b/comfy/web/assets/UserSelectView-B3jYchWu.js new file mode 100644 index 000000000..9d2dda86c --- /dev/null +++ b/comfy/web/assets/UserSelectView-B3jYchWu.js @@ -0,0 +1,102 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +import { d as defineComponent, aX as useUserStore, bW as useRouter, ab as ref, c as computed, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, bX as withKeys, j as unref, av as script, bQ as script$1, bY as script$2, bZ as script$3, aE as createTextVNode, I as createCommentVNode, l as script$4 } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js"; +const _hoisted_1 = { + id: "comfy-user-selection", + class: "min-w-84 relative rounded-lg bg-[var(--comfy-menu-bg)] p-5 px-10 shadow-lg" +}; +const _hoisted_2 = /* @__PURE__ */ createBaseVNode("h1", { class: "my-2.5 mb-7 font-normal" }, "ComfyUI", -1); +const _hoisted_3 = { class: "flex w-full flex-col items-center" }; +const _hoisted_4 = { class: "flex w-full flex-col gap-2" }; +const _hoisted_5 = { for: "new-user-input" }; +const _hoisted_6 = { class: "flex w-full flex-col gap-2" }; +const _hoisted_7 = { for: "existing-user-select" }; +const _hoisted_8 = { class: "mt-5" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "UserSelectView", + setup(__props) { + const userStore = useUserStore(); + const router = useRouter(); + const selectedUser = ref(null); + const newUsername = ref(""); + const loginError = ref(""); + const createNewUser = computed(() => newUsername.value.trim() !== ""); + const newUserExistsError = computed(() => { + return userStore.users.find((user) => user.username === newUsername.value) ? `User "${newUsername.value}" already exists` : ""; + }); + const error = computed(() => newUserExistsError.value || loginError.value); + const login = /* @__PURE__ */ __name(async () => { + try { + const user = createNewUser.value ? await userStore.createUser(newUsername.value) : selectedUser.value; + if (!user) { + throw new Error("No user selected"); + } + userStore.login(user); + router.push("/"); + } catch (err) { + loginError.value = err.message ?? JSON.stringify(err); + } + }, "login"); + onMounted(async () => { + if (!userStore.initialized) { + await userStore.initialize(); + } + }); + return (_ctx, _cache) => { + return openBlock(), createBlock(_sfc_main$1, { dark: "" }, { + default: withCtx(() => [ + createBaseVNode("main", _hoisted_1, [ + _hoisted_2, + createBaseVNode("div", _hoisted_3, [ + createBaseVNode("div", _hoisted_4, [ + createBaseVNode("label", _hoisted_5, toDisplayString(_ctx.$t("userSelect.newUser")) + ":", 1), + createVNode(unref(script), { + id: "new-user-input", + modelValue: newUsername.value, + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newUsername.value = $event), + placeholder: _ctx.$t("userSelect.enterUsername"), + onKeyup: withKeys(login, ["enter"]) + }, null, 8, ["modelValue", "placeholder"]) + ]), + createVNode(unref(script$1)), + createBaseVNode("div", _hoisted_6, [ + createBaseVNode("label", _hoisted_7, toDisplayString(_ctx.$t("userSelect.existingUser")) + ":", 1), + createVNode(unref(script$2), { + modelValue: selectedUser.value, + "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedUser.value = $event), + class: "w-full", + inputId: "existing-user-select", + options: unref(userStore).users, + "option-label": "username", + placeholder: _ctx.$t("userSelect.selectUser"), + disabled: createNewUser.value + }, null, 8, ["modelValue", "options", "placeholder", "disabled"]), + error.value ? (openBlock(), createBlock(unref(script$3), { + key: 0, + severity: "error" + }, { + default: withCtx(() => [ + createTextVNode(toDisplayString(error.value), 1) + ]), + _: 1 + })) : createCommentVNode("", true) + ]), + createBaseVNode("footer", _hoisted_8, [ + createVNode(unref(script$4), { + label: _ctx.$t("userSelect.next"), + onClick: login + }, null, 8, ["label"]) + ]) + ]) + ]) + ]), + _: 1 + }); + }; + } +}); +export { + _sfc_main as default +}; +//# sourceMappingURL=UserSelectView-B3jYchWu.js.map diff --git a/comfy/web/assets/WelcomeView-Brz3-luE.css b/comfy/web/assets/WelcomeView-Brz3-luE.css new file mode 100644 index 000000000..522f34388 --- /dev/null +++ b/comfy/web/assets/WelcomeView-Brz3-luE.css @@ -0,0 +1,36 @@ + +.animated-gradient-text[data-v-7dfaf74c] { + font-weight: 700; + font-size: clamp(2rem, 8vw, 4rem); + background: linear-gradient(to right, #12c2e9, #c471ed, #f64f59, #12c2e9); + background-size: 300% auto; + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + animation: gradient-7dfaf74c 8s linear infinite; +} +.text-glow[data-v-7dfaf74c] { + filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3)); +} +@keyframes gradient-7dfaf74c { +0% { + background-position: 0% center; +} +100% { + background-position: 300% center; +} +} +.fade-in-up[data-v-7dfaf74c] { + animation: fadeInUp-7dfaf74c 1.5s ease-out; + animation-fill-mode: both; +} +@keyframes fadeInUp-7dfaf74c { +0% { + opacity: 0; + transform: translateY(20px); +} +100% { + opacity: 1; + transform: translateY(0); +} +} diff --git a/comfy/web/assets/WelcomeView-IDMwvMd_.css b/comfy/web/assets/WelcomeView-IDMwvMd_.css index 43c9f9339..522f34388 100644 --- a/comfy/web/assets/WelcomeView-IDMwvMd_.css +++ b/comfy/web/assets/WelcomeView-IDMwvMd_.css @@ -1,5 +1,5 @@ -.animated-gradient-text[data-v-c4d014c5] { +.animated-gradient-text[data-v-7dfaf74c] { font-weight: 700; font-size: clamp(2rem, 8vw, 4rem); background: linear-gradient(to right, #12c2e9, #c471ed, #f64f59, #12c2e9); @@ -7,12 +7,12 @@ background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; - animation: gradient-c4d014c5 8s linear infinite; + animation: gradient-7dfaf74c 8s linear infinite; } -.text-glow[data-v-c4d014c5] { +.text-glow[data-v-7dfaf74c] { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3)); } -@keyframes gradient-c4d014c5 { +@keyframes gradient-7dfaf74c { 0% { background-position: 0% center; } @@ -20,11 +20,11 @@ background-position: 300% center; } } -.fade-in-up[data-v-c4d014c5] { - animation: fadeInUp-c4d014c5 1.5s ease-out; +.fade-in-up[data-v-7dfaf74c] { + animation: fadeInUp-7dfaf74c 1.5s ease-out; animation-fill-mode: both; } -@keyframes fadeInUp-c4d014c5 { +@keyframes fadeInUp-7dfaf74c { 0% { opacity: 0; transform: translateY(20px); diff --git a/comfy/web/assets/WelcomeView-N0ZXLjdi.js b/comfy/web/assets/WelcomeView-N0ZXLjdi.js new file mode 100644 index 000000000..bec1292ec --- /dev/null +++ b/comfy/web/assets/WelcomeView-N0ZXLjdi.js @@ -0,0 +1,40 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +import { d as defineComponent, bW as useRouter, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, aL as pushScopeId, aM as popScopeId, _ as _export_sfc } from "./index-DjNHn37O.js"; +import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js"; +const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-7dfaf74c"), n = n(), popScopeId(), n), "_withScopeId"); +const _hoisted_1 = { class: "flex flex-col items-center justify-center gap-8 p-8" }; +const _hoisted_2 = { class: "animated-gradient-text text-glow select-none" }; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "WelcomeView", + setup(__props) { + const router = useRouter(); + const navigateTo = /* @__PURE__ */ __name((path) => { + router.push(path); + }, "navigateTo"); + return (_ctx, _cache) => { + return openBlock(), createBlock(_sfc_main$1, { dark: "" }, { + default: withCtx(() => [ + createBaseVNode("div", _hoisted_1, [ + createBaseVNode("h1", _hoisted_2, toDisplayString(_ctx.$t("welcome.title")), 1), + createVNode(unref(script), { + label: _ctx.$t("welcome.getStarted"), + icon: "pi pi-arrow-right", + iconPos: "right", + size: "large", + rounded: "", + onClick: _cache[0] || (_cache[0] = ($event) => navigateTo("/install")), + class: "p-4 text-lg fade-in-up" + }, null, 8, ["label"]) + ]) + ]), + _: 1 + }); + }; + } +}); +const WelcomeView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7dfaf74c"]]); +export { + WelcomeView as default +}; +//# sourceMappingURL=WelcomeView-N0ZXLjdi.js.map diff --git a/comfy/web/assets/index-5HFeZax4.js b/comfy/web/assets/index-5HFeZax4.js new file mode 100644 index 000000000..b4bc111e9 --- /dev/null +++ b/comfy/web/assets/index-5HFeZax4.js @@ -0,0 +1,27 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +import { ct as script$1, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps } from "./index-DjNHn37O.js"; +var script = { + name: "PlusIcon", + "extends": script$1 +}; +var _hoisted_1 = /* @__PURE__ */ createBaseVNode("path", { + d: "M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z", + fill: "currentColor" +}, null, -1); +var _hoisted_2 = [_hoisted_1]; +function render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _hoisted_2, 16); +} +__name(render, "render"); +script.render = render; +export { + script as s +}; +//# sourceMappingURL=index-5HFeZax4.js.map diff --git a/comfy/web/assets/index-B-aVupP5.js b/comfy/web/assets/index-B-aVupP5.js new file mode 100644 index 000000000..2f4957c2f --- /dev/null +++ b/comfy/web/assets/index-B-aVupP5.js @@ -0,0 +1,29 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +import { ct as script$1, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps } from "./index-DjNHn37O.js"; +var script = { + name: "BarsIcon", + "extends": script$1 +}; +var _hoisted_1 = /* @__PURE__ */ createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M13.3226 3.6129H0.677419C0.497757 3.6129 0.325452 3.54152 0.198411 3.41448C0.0713707 3.28744 0 3.11514 0 2.93548C0 2.75581 0.0713707 2.58351 0.198411 2.45647C0.325452 2.32943 0.497757 2.25806 0.677419 2.25806H13.3226C13.5022 2.25806 13.6745 2.32943 13.8016 2.45647C13.9286 2.58351 14 2.75581 14 2.93548C14 3.11514 13.9286 3.28744 13.8016 3.41448C13.6745 3.54152 13.5022 3.6129 13.3226 3.6129ZM13.3226 7.67741H0.677419C0.497757 7.67741 0.325452 7.60604 0.198411 7.479C0.0713707 7.35196 0 7.17965 0 6.99999C0 6.82033 0.0713707 6.64802 0.198411 6.52098C0.325452 6.39394 0.497757 6.32257 0.677419 6.32257H13.3226C13.5022 6.32257 13.6745 6.39394 13.8016 6.52098C13.9286 6.64802 14 6.82033 14 6.99999C14 7.17965 13.9286 7.35196 13.8016 7.479C13.6745 7.60604 13.5022 7.67741 13.3226 7.67741ZM0.677419 11.7419H13.3226C13.5022 11.7419 13.6745 11.6706 13.8016 11.5435C13.9286 11.4165 14 11.2442 14 11.0645C14 10.8848 13.9286 10.7125 13.8016 10.5855C13.6745 10.4585 13.5022 10.3871 13.3226 10.3871H0.677419C0.497757 10.3871 0.325452 10.4585 0.198411 10.5855C0.0713707 10.7125 0 10.8848 0 11.0645C0 11.2442 0.0713707 11.4165 0.198411 11.5435C0.325452 11.6706 0.497757 11.7419 0.677419 11.7419Z", + fill: "currentColor" +}, null, -1); +var _hoisted_2 = [_hoisted_1]; +function render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _hoisted_2, 16); +} +__name(render, "render"); +script.render = render; +export { + script as s +}; +//# sourceMappingURL=index-B-aVupP5.js.map diff --git a/comfy/web/assets/index-B5F0uxTQ.js b/comfy/web/assets/index-B5F0uxTQ.js new file mode 100644 index 000000000..2876e0a14 --- /dev/null +++ b/comfy/web/assets/index-B5F0uxTQ.js @@ -0,0 +1,8902 @@ +var __defProp = Object.defineProperty; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js +import { bc as script$s, o as openBlock, f as createElementBlock, m as mergeProps, z as createBaseVNode, B as BaseStyle, Q as script$t, a5 as toDisplayString, a0 as Ripple, q as resolveDirective, t as withDirectives, v as createBlock, K as resolveDynamicComponent, bU as script$u, k as resolveComponent, A as normalizeClass, av as createSlots, x as withCtx, bB as script$v, bt as script$w, O as Fragment, P as renderList, aw as createTextVNode, bi as setAttribute, bg as normalizeProps, l as renderSlot, h as createCommentVNode, ac as script$x, a3 as equals, bd as script$y, c3 as script$z, co as getFirstFocusableElement, ag as OverlayEventBus, a7 as getVNodeProp, af as resolveFieldData, cp as invokeElementMethod, a1 as getAttribute, cq as getNextElementSibling, X as getOuterWidth, cr as getPreviousElementSibling, C as script$A, ar as script$B, $ as script$C, bf as script$E, ab as isNotEmpty, bp as withModifiers, V as getOuterHeight, ad as UniqueComponentId, cs as _default, ae as ZIndex, a2 as focus, ai as addStyle, ak as absolutePosition, al as ConnectedOverlayScrollHandler, am as isTouchDevice, ct as FilterOperator, aq as script$F, cu as FocusTrap, g as createVNode, au as Transition, bT as withKeys, cv as getIndex, j as script$H, cw as isClickable, cx as clearSelection, cy as localeComparator, cz as sort, cA as FilterService, cj as FilterMatchMode, U as findSingle, bZ as findIndexInList, b_ as find, cB as exportCSV, W as getOffset, cC as getHiddenElementOuterWidth, cD as getHiddenElementOuterHeight, cE as reorderArray, cF as removeClass, cG as addClass, ah as isEmpty, ap as script$I, as as script$J } from "./index-BK27PIiK.js"; +import { s as script$D, a as script$G } from "./index-4Y1pXkN0.js"; +======== +import { B as BaseStyle, q as script$s, ct as script$t, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps, X as toDisplayString, S as Ripple, r as resolveDirective, i as withDirectives, k as createBlock, G as resolveDynamicComponent, bY as script$u, aB as resolveComponent, T as normalizeClass, aD as createSlots, M as withCtx, bz as script$v, bw as script$w, F as Fragment, E as renderList, aE as createTextVNode, bq as setAttribute, ak as UniqueComponentId, bo as normalizeProps, J as renderSlot, I as createCommentVNode, R as equals, bk as script$x, c8 as script$y, cu as getFirstFocusableElement, an as OverlayEventBus, A as getVNodeProp, am as resolveFieldData, cv as invokeElementMethod, O as getAttribute, cw as getNextElementSibling, y as getOuterWidth, cx as getPreviousElementSibling, l as script$z, ay as script$A, W as script$B, bn as script$D, aj as isNotEmpty, bM as withModifiers, z as getOuterHeight, cy as _default, al as ZIndex, Q as focus, ap as addStyle, ar as absolutePosition, as as ConnectedOverlayScrollHandler, at as isTouchDevice, cz as FilterOperator, ax as script$E, cA as FocusTrap, N as createVNode, aC as Transition, bX as withKeys, cB as getIndex, aW as script$G, cC as isClickable, cD as clearSelection, cE as localeComparator, cF as sort, cG as FilterService, cn as FilterMatchMode, P as findSingle, c1 as findIndexInList, c2 as find, cH as exportCSV, U as getOffset, cI as getHiddenElementOuterWidth, cJ as getHiddenElementOuterHeight, cK as reorderArray, cL as getWindowScrollTop, cM as removeClass, cN as addClass, ao as isEmpty, aw as script$H, az as script$I } from "./index-DjNHn37O.js"; +import { s as script$C } from "./index-B-aVupP5.js"; +import { s as script$F } from "./index-5HFeZax4.js"; +var ColumnStyle = BaseStyle.extend({ + name: "column" +}); +var script$1$3 = { + name: "BaseColumn", + "extends": script$s, + props: { + columnKey: { + type: null, + "default": null + }, + field: { + type: [String, Function], + "default": null + }, + sortField: { + type: [String, Function], + "default": null + }, + filterField: { + type: [String, Function], + "default": null + }, + dataType: { + type: String, + "default": "text" + }, + sortable: { + type: Boolean, + "default": false + }, + header: { + type: null, + "default": null + }, + footer: { + type: null, + "default": null + }, + style: { + type: null, + "default": null + }, + "class": { + type: String, + "default": null + }, + headerStyle: { + type: null, + "default": null + }, + headerClass: { + type: String, + "default": null + }, + bodyStyle: { + type: null, + "default": null + }, + bodyClass: { + type: String, + "default": null + }, + footerStyle: { + type: null, + "default": null + }, + footerClass: { + type: String, + "default": null + }, + showFilterMenu: { + type: Boolean, + "default": true + }, + showFilterOperator: { + type: Boolean, + "default": true + }, + showClearButton: { + type: Boolean, + "default": true + }, + showApplyButton: { + type: Boolean, + "default": true + }, + showFilterMatchModes: { + type: Boolean, + "default": true + }, + showAddButton: { + type: Boolean, + "default": true + }, + filterMatchModeOptions: { + type: Array, + "default": null + }, + maxConstraints: { + type: Number, + "default": 2 + }, + excludeGlobalFilter: { + type: Boolean, + "default": false + }, + filterHeaderClass: { + type: String, + "default": null + }, + filterHeaderStyle: { + type: null, + "default": null + }, + filterMenuClass: { + type: String, + "default": null + }, + filterMenuStyle: { + type: null, + "default": null + }, + selectionMode: { + type: String, + "default": null + }, + expander: { + type: Boolean, + "default": false + }, + colspan: { + type: Number, + "default": null + }, + rowspan: { + type: Number, + "default": null + }, + rowReorder: { + type: Boolean, + "default": false + }, + rowReorderIcon: { + type: String, + "default": void 0 + }, + reorderableColumn: { + type: Boolean, + "default": true + }, + rowEditor: { + type: Boolean, + "default": false + }, + frozen: { + type: Boolean, + "default": false + }, + alignFrozen: { + type: String, + "default": "left" + }, + exportable: { + type: Boolean, + "default": true + }, + exportHeader: { + type: String, + "default": null + }, + exportFooter: { + type: String, + "default": null + }, + filterMatchMode: { + type: String, + "default": null + }, + hidden: { + type: Boolean, + "default": false + } + }, + style: ColumnStyle, + provide: /* @__PURE__ */ __name(function provide() { + return { + $pcColumn: this, + $parentInstance: this + }; + }, "provide") +}; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js +var script$r = { + name: "Column", + "extends": script$1$3, + inheritAttrs: false, + inject: ["$columns"], + mounted: /* @__PURE__ */ __name(function mounted() { + var _this$$columns; + (_this$$columns = this.$columns) === null || _this$$columns === void 0 || _this$$columns.add(this.$); + }, "mounted"), + unmounted: /* @__PURE__ */ __name(function unmounted() { + var _this$$columns2; + (_this$$columns2 = this.$columns) === null || _this$$columns2 === void 0 || _this$$columns2["delete"](this.$); + }, "unmounted"), + render: /* @__PURE__ */ __name(function render() { + return null; + }, "render") +}; +var script$q = { + name: "ArrowDownIcon", + "extends": script$t +}; +function render$p(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M6.99994 14C6.91097 14.0004 6.82281 13.983 6.74064 13.9489C6.65843 13.9148 6.58387 13.8646 6.52133 13.8013L1.10198 8.38193C0.982318 8.25351 0.917175 8.08367 0.920272 7.90817C0.923368 7.73267 0.994462 7.56523 1.11858 7.44111C1.24269 7.317 1.41014 7.2459 1.58563 7.2428C1.76113 7.23971 1.93098 7.30485 2.0594 7.42451L6.32263 11.6877V0.677419C6.32263 0.497756 6.394 0.325452 6.52104 0.198411C6.64808 0.0713706 6.82039 0 7.00005 0C7.17971 0 7.35202 0.0713706 7.47906 0.198411C7.6061 0.325452 7.67747 0.497756 7.67747 0.677419V11.6877L11.9407 7.42451C12.0691 7.30485 12.2389 7.23971 12.4144 7.2428C12.5899 7.2459 12.7574 7.317 12.8815 7.44111C13.0056 7.56523 13.0767 7.73267 13.0798 7.90817C13.0829 8.08367 13.0178 8.25351 12.8981 8.38193L7.47875 13.8013C7.41621 13.8646 7.34164 13.9148 7.25944 13.9489C7.17727 13.983 7.08912 14.0004 7.00015 14C7.00012 14 7.00009 14 7.00005 14C7.00001 14 6.99998 14 6.99994 14Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$p, "render$p"); +script$q.render = render$p; +var script$p = { + name: "ArrowUpIcon", + "extends": script$t +}; +function render$o(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M6.51551 13.799C6.64205 13.9255 6.813 13.9977 6.99193 14C7.17087 13.9977 7.34182 13.9255 7.46835 13.799C7.59489 13.6725 7.66701 13.5015 7.66935 13.3226V2.31233L11.9326 6.57554C11.9951 6.63887 12.0697 6.68907 12.1519 6.72319C12.2341 6.75731 12.3223 6.77467 12.4113 6.77425C12.5003 6.77467 12.5885 6.75731 12.6707 6.72319C12.7529 6.68907 12.8274 6.63887 12.89 6.57554C13.0168 6.44853 13.0881 6.27635 13.0881 6.09683C13.0881 5.91732 13.0168 5.74514 12.89 5.61812L7.48846 0.216594C7.48274 0.210436 7.4769 0.204374 7.47094 0.198411C7.3439 0.0713707 7.1716 0 6.99193 0C6.81227 0 6.63997 0.0713707 6.51293 0.198411C6.50704 0.204296 6.50128 0.210278 6.49563 0.216354L1.09386 5.61812C0.974201 5.74654 0.909057 5.91639 0.912154 6.09189C0.91525 6.26738 0.986345 6.43483 1.11046 6.55894C1.23457 6.68306 1.40202 6.75415 1.57752 6.75725C1.75302 6.76035 1.92286 6.6952 2.05128 6.57554L6.31451 2.31231V13.3226C6.31685 13.5015 6.38898 13.6725 6.51551 13.799Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$o, "render$o"); +script$p.render = render$o; +function _typeof$c(o) { + "@babel/helpers - typeof"; + return _typeof$c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$c(o); +} +__name(_typeof$c, "_typeof$c"); +function _defineProperty$b(e, r, t) { + return (r = _toPropertyKey$b(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$b, "_defineProperty$b"); +function _toPropertyKey$b(t) { + var i = _toPrimitive$b(t, "string"); + return "symbol" == _typeof$c(i) ? i : i + ""; +} +__name(_toPropertyKey$b, "_toPropertyKey$b"); +function _toPrimitive$b(t, r) { + if ("object" != _typeof$c(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$c(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$b, "_toPrimitive$b"); +var theme$2 = /* @__PURE__ */ __name(function theme(_ref) { + var dt = _ref.dt; + return "\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n background: ".concat(dt("paginator.background"), ";\n color: ").concat(dt("paginator.color"), ";\n padding: ").concat(dt("paginator.padding"), ";\n border-radius: ").concat(dt("paginator.border.radius"), ";\n gap: ").concat(dt("paginator.gap"), ";\n}\n\n.p-paginator-content {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n gap: ").concat(dt("paginator.gap"), ";\n}\n\n.p-paginator-content-start {\n margin-inline-end: auto;\n}\n\n.p-paginator-content-end {\n margin-inline-start: auto;\n}\n\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n background: ").concat(dt("paginator.nav.button.background"), ";\n border: 0 none;\n color: ").concat(dt("paginator.nav.button.color"), ";\n min-width: ").concat(dt("paginator.nav.button.width"), ";\n height: ").concat(dt("paginator.nav.button.height"), ";\n transition: background ").concat(dt("paginator.transition.duration"), ", color ").concat(dt("paginator.transition.duration"), ", outline-color ").concat(dt("paginator.transition.duration"), ", box-shadow ").concat(dt("paginator.transition.duration"), ";\n border-radius: ").concat(dt("paginator.nav.button.border.radius"), ";\n padding: 0;\n margin: 0;\n}\n\n.p-paginator-page:focus-visible,\n.p-paginator-next:focus-visible,\n.p-paginator-last:focus-visible,\n.p-paginator-first:focus-visible,\n.p-paginator-prev:focus-visible {\n box-shadow: ").concat(dt("paginator.nav.button.focus.ring.shadow"), ";\n outline: ").concat(dt("paginator.nav.button.focus.ring.width"), " ").concat(dt("paginator.nav.button.focus.ring.style"), " ").concat(dt("paginator.nav.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("paginator.nav.button.focus.ring.offset"), ";\n}\n\n.p-paginator-page:not(.p-disabled):not(.p-paginator-page-selected):hover,\n.p-paginator-first:not(.p-disabled):hover,\n.p-paginator-prev:not(.p-disabled):hover,\n.p-paginator-next:not(.p-disabled):hover,\n.p-paginator-last:not(.p-disabled):hover {\n background: ").concat(dt("paginator.nav.button.hover.background"), ";\n color: ").concat(dt("paginator.nav.button.hover.color"), ";\n}\n\n.p-paginator-page.p-paginator-page-selected {\n background: ").concat(dt("paginator.nav.button.selected.background"), ";\n color: ").concat(dt("paginator.nav.button.selected.color"), ";\n}\n\n.p-paginator-current {\n color: ").concat(dt("paginator.current.page.report.color"), ";\n}\n\n.p-paginator-pages {\n display: flex;\n align-items: center;\n gap: ").concat(dt("paginator.gap"), ";\n}\n\n.p-paginator-jtp-input .p-inputtext {\n max-width: ").concat(dt("paginator.jump.to.page.input.max.width"), ";\n}\n\n.p-paginator-first:dir(rtl),\n.p-paginator-prev:dir(rtl),\n.p-paginator-next:dir(rtl),\n.p-paginator-last:dir(rtl) {\n transform: rotate(180deg);\n}\n"); +}, "theme"); +var classes$2 = { + paginator: /* @__PURE__ */ __name(function paginator(_ref2) { + var instance = _ref2.instance, key = _ref2.key; + return ["p-paginator p-component", _defineProperty$b({ + "p-paginator-default": !instance.hasBreakpoints() + }, "p-paginator-".concat(key), instance.hasBreakpoints())]; + }, "paginator"), + content: "p-paginator-content", + contentStart: "p-paginator-content-start", + contentEnd: "p-paginator-content-end", + first: /* @__PURE__ */ __name(function first(_ref4) { + var instance = _ref4.instance; + return ["p-paginator-first", { + "p-disabled": instance.$attrs.disabled + }]; + }, "first"), + firstIcon: "p-paginator-first-icon", + prev: /* @__PURE__ */ __name(function prev(_ref5) { + var instance = _ref5.instance; + return ["p-paginator-prev", { + "p-disabled": instance.$attrs.disabled + }]; + }, "prev"), + prevIcon: "p-paginator-prev-icon", + next: /* @__PURE__ */ __name(function next(_ref6) { + var instance = _ref6.instance; + return ["p-paginator-next", { + "p-disabled": instance.$attrs.disabled + }]; + }, "next"), + nextIcon: "p-paginator-next-icon", + last: /* @__PURE__ */ __name(function last(_ref7) { + var instance = _ref7.instance; + return ["p-paginator-last", { + "p-disabled": instance.$attrs.disabled + }]; + }, "last"), + lastIcon: "p-paginator-last-icon", + pages: "p-paginator-pages", + page: /* @__PURE__ */ __name(function page(_ref8) { + var props = _ref8.props, pageLink = _ref8.pageLink; + return ["p-paginator-page", { + "p-paginator-page-selected": pageLink - 1 === props.page + }]; + }, "page"), + current: "p-paginator-current", + pcRowPerPageDropdown: "p-paginator-rpp-dropdown", + pcJumpToPageDropdown: "p-paginator-jtp-dropdown", + pcJumpToPageInputText: "p-paginator-jtp-input" +}; +var PaginatorStyle = BaseStyle.extend({ + name: "paginator", + theme: theme$2, + classes: classes$2 +}); +var script$o = { + name: "AngleDoubleLeftIcon", + "extends": script$t +}; +function render$n(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M5.71602 11.164C5.80782 11.2021 5.9063 11.2215 6.00569 11.221C6.20216 11.2301 6.39427 11.1612 6.54025 11.0294C6.68191 10.8875 6.76148 10.6953 6.76148 10.4948C6.76148 10.2943 6.68191 10.1021 6.54025 9.96024L3.51441 6.9344L6.54025 3.90855C6.624 3.76126 6.65587 3.59011 6.63076 3.42254C6.60564 3.25498 6.525 3.10069 6.40175 2.98442C6.2785 2.86815 6.11978 2.79662 5.95104 2.7813C5.78229 2.76598 5.61329 2.80776 5.47112 2.89994L1.97123 6.39983C1.82957 6.54167 1.75 6.73393 1.75 6.9344C1.75 7.13486 1.82957 7.32712 1.97123 7.46896L5.47112 10.9991C5.54096 11.0698 5.62422 11.1259 5.71602 11.164ZM11.0488 10.9689C11.1775 11.1156 11.3585 11.2061 11.5531 11.221C11.7477 11.2061 11.9288 11.1156 12.0574 10.9689C12.1815 10.8302 12.25 10.6506 12.25 10.4645C12.25 10.2785 12.1815 10.0989 12.0574 9.96024L9.03158 6.93439L12.0574 3.90855C12.1248 3.76739 12.1468 3.60881 12.1204 3.45463C12.0939 3.30045 12.0203 3.15826 11.9097 3.04765C11.7991 2.93703 11.6569 2.86343 11.5027 2.83698C11.3486 2.81053 11.19 2.83252 11.0488 2.89994L7.51865 6.36957C7.37699 6.51141 7.29742 6.70367 7.29742 6.90414C7.29742 7.1046 7.37699 7.29686 7.51865 7.4387L11.0488 10.9689Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$n, "render$n"); +script$o.render = render$n; +var script$n = { + name: "AngleDoubleRightIcon", + "extends": script$t +}; +function render$m(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M7.68757 11.1451C7.7791 11.1831 7.8773 11.2024 7.9764 11.2019C8.07769 11.1985 8.17721 11.1745 8.26886 11.1312C8.36052 11.088 8.44238 11.0265 8.50943 10.9505L12.0294 7.49085C12.1707 7.34942 12.25 7.15771 12.25 6.95782C12.25 6.75794 12.1707 6.56622 12.0294 6.42479L8.50943 2.90479C8.37014 2.82159 8.20774 2.78551 8.04633 2.80192C7.88491 2.81833 7.73309 2.88635 7.6134 2.99588C7.4937 3.10541 7.41252 3.25061 7.38189 3.40994C7.35126 3.56927 7.37282 3.73423 7.44337 3.88033L10.4605 6.89748L7.44337 9.91463C7.30212 10.0561 7.22278 10.2478 7.22278 10.4477C7.22278 10.6475 7.30212 10.8393 7.44337 10.9807C7.51301 11.0512 7.59603 11.1071 7.68757 11.1451ZM1.94207 10.9505C2.07037 11.0968 2.25089 11.1871 2.44493 11.2019C2.63898 11.1871 2.81949 11.0968 2.94779 10.9505L6.46779 7.49085C6.60905 7.34942 6.68839 7.15771 6.68839 6.95782C6.68839 6.75793 6.60905 6.56622 6.46779 6.42479L2.94779 2.90479C2.80704 2.83757 2.6489 2.81563 2.49517 2.84201C2.34143 2.86839 2.19965 2.94178 2.08936 3.05207C1.97906 3.16237 1.90567 3.30415 1.8793 3.45788C1.85292 3.61162 1.87485 3.76975 1.94207 3.9105L4.95922 6.92765L1.94207 9.9448C1.81838 10.0831 1.75 10.2621 1.75 10.4477C1.75 10.6332 1.81838 10.8122 1.94207 10.9505Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$m, "render$m"); +script$n.render = render$m; +var script$m = { + name: "AngleLeftIcon", + "extends": script$t +}; +function render$l(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + d: "M8.75 11.185C8.65146 11.1854 8.55381 11.1662 8.4628 11.1284C8.37179 11.0906 8.28924 11.0351 8.22 10.965L4.72 7.46496C4.57955 7.32433 4.50066 7.13371 4.50066 6.93496C4.50066 6.73621 4.57955 6.54558 4.72 6.40496L8.22 2.93496C8.36095 2.84357 8.52851 2.80215 8.69582 2.81733C8.86312 2.83252 9.02048 2.90344 9.14268 3.01872C9.26487 3.134 9.34483 3.28696 9.36973 3.4531C9.39463 3.61924 9.36303 3.78892 9.28 3.93496L6.28 6.93496L9.28 9.93496C9.42045 10.0756 9.49934 10.2662 9.49934 10.465C9.49934 10.6637 9.42045 10.8543 9.28 10.995C9.13526 11.1257 8.9448 11.1939 8.75 11.185Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$l, "render$l"); +script$m.render = render$l; +var script$a$1 = { + name: "BasePaginator", + "extends": script$s, + props: { + totalRecords: { + type: Number, + "default": 0 + }, + rows: { + type: Number, + "default": 0 + }, + first: { + type: Number, + "default": 0 + }, + pageLinkSize: { + type: Number, + "default": 5 + }, + rowsPerPageOptions: { + type: Array, + "default": null + }, + template: { + type: [Object, String], + "default": "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown" + }, + currentPageReportTemplate: { + type: null, + "default": "({currentPage} of {totalPages})" + }, + alwaysShow: { + type: Boolean, + "default": true + } + }, + style: PaginatorStyle, + provide: /* @__PURE__ */ __name(function provide2() { + return { + $pcPaginator: this, + $parentInstance: this + }; + }, "provide") +}; +var script$9$1 = { + name: "CurrentPageReport", + hostName: "Paginator", + "extends": script$s, + props: { + pageCount: { + type: Number, + "default": 0 + }, + currentPage: { + type: Number, + "default": 0 + }, + page: { + type: Number, + "default": 0 + }, + first: { + type: Number, + "default": 0 + }, + rows: { + type: Number, + "default": 0 + }, + totalRecords: { + type: Number, + "default": 0 + }, + template: { + type: String, + "default": "({currentPage} of {totalPages})" + } + }, + computed: { + text: /* @__PURE__ */ __name(function text() { + var text2 = this.template.replace("{currentPage}", this.currentPage).replace("{totalPages}", this.pageCount).replace("{first}", this.pageCount > 0 ? this.first + 1 : 0).replace("{last}", Math.min(this.first + this.rows, this.totalRecords)).replace("{rows}", this.rows).replace("{totalRecords}", this.totalRecords); + return text2; + }, "text") + } +}; +function render$9$1(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("span", mergeProps({ + "class": _ctx.cx("current") + }, _ctx.ptm("current")), toDisplayString($options.text), 17); +} +__name(render$9$1, "render$9$1"); +script$9$1.render = render$9$1; +var script$8$1 = { + name: "FirstPageLink", + hostName: "Paginator", + "extends": script$s, + props: { + template: { + type: Function, + "default": null + } + }, + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions(key) { + return this.ptm(key, { + context: { + disabled: this.$attrs.disabled + } + }); + }, "getPTOptions") + }, + components: { + AngleDoubleLeftIcon: script$o + }, + directives: { + ripple: Ripple + } +}; +function render$8$1(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return withDirectives((openBlock(), createElementBlock("button", mergeProps({ + "class": _ctx.cx("first"), + type: "button" + }, $options.getPTOptions("first"), { + "data-pc-group-section": "pagebutton" + }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleDoubleLeftIcon"), mergeProps({ + "class": _ctx.cx("firstIcon") + }, $options.getPTOptions("firstIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); +} +__name(render$8$1, "render$8$1"); +script$8$1.render = render$8$1; +var script$7$1 = { + name: "JumpToPageDropdown", + hostName: "Paginator", + "extends": script$s, + emits: ["page-change"], + props: { + page: Number, + pageCount: Number, + disabled: Boolean, + templates: null + }, + methods: { + onChange: /* @__PURE__ */ __name(function onChange(value) { + this.$emit("page-change", value); + }, "onChange") + }, + computed: { + pageOptions: /* @__PURE__ */ __name(function pageOptions() { + var opts = []; + for (var i = 0; i < this.pageCount; i++) { + opts.push({ + label: String(i + 1), + value: i + }); + } + return opts; + }, "pageOptions") + }, + components: { + JTPSelect: script$u + } +}; +function render$7$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_JTPSelect = resolveComponent("JTPSelect"); + return openBlock(), createBlock(_component_JTPSelect, { + modelValue: $props.page, + options: $options.pageOptions, + optionLabel: "label", + optionValue: "value", + "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) { + return $options.onChange($event); + }), + "class": normalizeClass(_ctx.cx("pcJumpToPageDropdown")), + disabled: $props.disabled, + unstyled: _ctx.unstyled, + pt: _ctx.ptm("pcJumpToPageDropdown"), + "data-pc-group-section": "pagedropdown" + }, createSlots({ + _: 2 + }, [$props.templates["jumptopagedropdownicon"] ? { + name: "dropdownicon", + fn: withCtx(function(slotProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.templates["jumptopagedropdownicon"]), { + "class": normalizeClass(slotProps["class"]) + }, null, 8, ["class"]))]; + }), + key: "0" + } : void 0]), 1032, ["modelValue", "options", "class", "disabled", "unstyled", "pt"]); +} +__name(render$7$1, "render$7$1"); +script$7$1.render = render$7$1; +var script$6$1 = { + name: "JumpToPageInput", + hostName: "Paginator", + "extends": script$s, + inheritAttrs: false, + emits: ["page-change"], + props: { + page: Number, + pageCount: Number, + disabled: Boolean + }, + data: /* @__PURE__ */ __name(function data() { + return { + d_page: this.page + }; + }, "data"), + watch: { + page: /* @__PURE__ */ __name(function page2(newValue) { + this.d_page = newValue; + }, "page") + }, + methods: { + onChange: /* @__PURE__ */ __name(function onChange2(value) { + if (value !== this.page) { + this.d_page = value; + this.$emit("page-change", value - 1); + } + }, "onChange") + }, + computed: { + inputArialabel: /* @__PURE__ */ __name(function inputArialabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.jumpToPageInputLabel : void 0; + }, "inputArialabel") + }, + components: { + JTPInput: script$v + } +}; +function render$6$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_JTPInput = resolveComponent("JTPInput"); + return openBlock(), createBlock(_component_JTPInput, { + ref: "jtpInput", + modelValue: $data.d_page, + "class": normalizeClass(_ctx.cx("pcJumpToPageInputText")), + "aria-label": $options.inputArialabel, + disabled: $props.disabled, + "onUpdate:modelValue": $options.onChange, + unstyled: _ctx.unstyled, + pt: _ctx.ptm("pcJumpToPageInputText") + }, null, 8, ["modelValue", "class", "aria-label", "disabled", "onUpdate:modelValue", "unstyled", "pt"]); +} +__name(render$6$1, "render$6$1"); +script$6$1.render = render$6$1; +var script$5$1 = { + name: "LastPageLink", + hostName: "Paginator", + "extends": script$s, + props: { + template: { + type: Function, + "default": null + } + }, + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions2(key) { + return this.ptm(key, { + context: { + disabled: this.$attrs.disabled + } + }); + }, "getPTOptions") + }, + components: { + AngleDoubleRightIcon: script$n + }, + directives: { + ripple: Ripple + } +}; +function render$5$1(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return withDirectives((openBlock(), createElementBlock("button", mergeProps({ + "class": _ctx.cx("last"), + type: "button" + }, $options.getPTOptions("last"), { + "data-pc-group-section": "pagebutton" + }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleDoubleRightIcon"), mergeProps({ + "class": _ctx.cx("lastIcon") + }, $options.getPTOptions("lastIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); +} +__name(render$5$1, "render$5$1"); +script$5$1.render = render$5$1; +var script$4$1 = { + name: "NextPageLink", + hostName: "Paginator", + "extends": script$s, + props: { + template: { + type: Function, + "default": null + } + }, + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions3(key) { + return this.ptm(key, { + context: { + disabled: this.$attrs.disabled + } + }); + }, "getPTOptions") + }, + components: { + AngleRightIcon: script$w + }, + directives: { + ripple: Ripple + } +}; +function render$4$1(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return withDirectives((openBlock(), createElementBlock("button", mergeProps({ + "class": _ctx.cx("next"), + type: "button" + }, $options.getPTOptions("next"), { + "data-pc-group-section": "pagebutton" + }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleRightIcon"), mergeProps({ + "class": _ctx.cx("nextIcon") + }, $options.getPTOptions("nextIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); +} +__name(render$4$1, "render$4$1"); +script$4$1.render = render$4$1; +var script$3$1 = { + name: "PageLinks", + hostName: "Paginator", + "extends": script$s, + inheritAttrs: false, + emits: ["click"], + props: { + value: Array, + page: Number + }, + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions4(pageLink, key) { + return this.ptm(key, { + context: { + active: pageLink === this.page + } + }); + }, "getPTOptions"), + onPageLinkClick: /* @__PURE__ */ __name(function onPageLinkClick(event2, pageLink) { + this.$emit("click", { + originalEvent: event2, + value: pageLink + }); + }, "onPageLinkClick"), + ariaPageLabel: /* @__PURE__ */ __name(function ariaPageLabel(value) { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g, value) : void 0; + }, "ariaPageLabel") + }, + directives: { + ripple: Ripple + } +}; +var _hoisted_1$6 = ["aria-label", "aria-current", "onClick", "data-p-active"]; +function render$3$1(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return openBlock(), createElementBlock("span", mergeProps({ + "class": _ctx.cx("pages") + }, _ctx.ptm("pages")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.value, function(pageLink) { + return withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: pageLink, + "class": _ctx.cx("page", { + pageLink + }), + type: "button", + "aria-label": $options.ariaPageLabel(pageLink), + "aria-current": pageLink - 1 === $props.page ? "page" : void 0, + onClick: /* @__PURE__ */ __name(function onClick3($event) { + return $options.onPageLinkClick($event, pageLink); + }, "onClick"), + ref_for: true + }, $options.getPTOptions(pageLink - 1, "page"), { + "data-p-active": pageLink - 1 === $props.page + }), [createTextVNode(toDisplayString(pageLink), 1)], 16, _hoisted_1$6)), [[_directive_ripple]]); + }), 128))], 16); +} +__name(render$3$1, "render$3$1"); +script$3$1.render = render$3$1; +var script$2$1 = { + name: "PrevPageLink", + hostName: "Paginator", + "extends": script$s, + props: { + template: { + type: Function, + "default": null + } + }, + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions5(key) { + return this.ptm(key, { + context: { + disabled: this.$attrs.disabled + } + }); + }, "getPTOptions") + }, + components: { + AngleLeftIcon: script$m + }, + directives: { + ripple: Ripple + } +}; +function render$2$1(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_ripple = resolveDirective("ripple"); + return withDirectives((openBlock(), createElementBlock("button", mergeProps({ + "class": _ctx.cx("prev"), + type: "button" + }, $options.getPTOptions("prev"), { + "data-pc-group-section": "pagebutton" + }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleLeftIcon"), mergeProps({ + "class": _ctx.cx("prevIcon") + }, $options.getPTOptions("prevIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); +} +__name(render$2$1, "render$2$1"); +script$2$1.render = render$2$1; +var script$1$2 = { + name: "RowsPerPageDropdown", + hostName: "Paginator", + "extends": script$s, + emits: ["rows-change"], + props: { + options: Array, + rows: Number, + disabled: Boolean, + templates: null + }, + methods: { + onChange: /* @__PURE__ */ __name(function onChange3(value) { + this.$emit("rows-change", value); + }, "onChange") + }, + computed: { + rowsOptions: /* @__PURE__ */ __name(function rowsOptions() { + var opts = []; + if (this.options) { + for (var i = 0; i < this.options.length; i++) { + opts.push({ + label: String(this.options[i]), + value: this.options[i] + }); + } + } + return opts; + }, "rowsOptions") + }, + components: { + RPPSelect: script$u + } +}; +function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_RPPSelect = resolveComponent("RPPSelect"); + return openBlock(), createBlock(_component_RPPSelect, { + modelValue: $props.rows, + options: $options.rowsOptions, + optionLabel: "label", + optionValue: "value", + "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) { + return $options.onChange($event); + }), + "class": normalizeClass(_ctx.cx("pcRowPerPageDropdown")), + disabled: $props.disabled, + unstyled: _ctx.unstyled, + pt: _ctx.ptm("pcRowPerPageDropdown"), + "data-pc-group-section": "pagedropdown" + }, createSlots({ + _: 2 + }, [$props.templates["rowsperpagedropdownicon"] ? { + name: "dropdownicon", + fn: withCtx(function(slotProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.templates["rowsperpagedropdownicon"]), { + "class": normalizeClass(slotProps["class"]) + }, null, 8, ["class"]))]; + }), + key: "0" + } : void 0]), 1032, ["modelValue", "options", "class", "disabled", "unstyled", "pt"]); +} +__name(render$1$1, "render$1$1"); +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js +script$1$3.render = render$1$1; +======== +script$1$2.render = render$1$1; +function _toConsumableArray$1(r) { + return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$3(r) || _nonIterableSpread$1(); +} +__name(_toConsumableArray$1, "_toConsumableArray$1"); +function _nonIterableSpread$1() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +__name(_nonIterableSpread$1, "_nonIterableSpread$1"); +function _iterableToArray$1(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +__name(_iterableToArray$1, "_iterableToArray$1"); +function _arrayWithoutHoles$1(r) { + if (Array.isArray(r)) return _arrayLikeToArray$3(r); +} +__name(_arrayWithoutHoles$1, "_arrayWithoutHoles$1"); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js +function _typeof$b(o) { + "@babel/helpers - typeof"; + return _typeof$b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$b(o); +} +__name(_typeof$b, "_typeof$b"); +function _slicedToArray$1(r, e) { + return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest$1(); +} +__name(_slicedToArray$1, "_slicedToArray$1"); +function _nonIterableRest$1() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +__name(_nonIterableRest$1, "_nonIterableRest$1"); +function _unsupportedIterableToArray$3(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray$3(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; + } +} +__name(_unsupportedIterableToArray$3, "_unsupportedIterableToArray$3"); +function _arrayLikeToArray$3(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +__name(_arrayLikeToArray$3, "_arrayLikeToArray$3"); +function _iterableToArrayLimit$1(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, n, i, u, a = [], f = true, o = false; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = false; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ; + } catch (r2) { + o = true, n = r2; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } +} +__name(_iterableToArrayLimit$1, "_iterableToArrayLimit$1"); +function _arrayWithHoles$1(r) { + if (Array.isArray(r)) return r; +} +__name(_arrayWithHoles$1, "_arrayWithHoles$1"); +var script$l = { + name: "Paginator", + "extends": script$a$1, + inheritAttrs: false, + emits: ["update:first", "update:rows", "page"], + data: /* @__PURE__ */ __name(function data2() { + return { + d_first: this.first, + d_rows: this.rows + }; + }, "data"), + watch: { + first: /* @__PURE__ */ __name(function first2(newValue) { + this.d_first = newValue; + }, "first"), + rows: /* @__PURE__ */ __name(function rows(newValue) { + this.d_rows = newValue; + }, "rows"), + totalRecords: /* @__PURE__ */ __name(function totalRecords(newValue) { + if (this.page > 0 && newValue && this.d_first >= newValue) { + this.changePage(this.pageCount - 1); + } + }, "totalRecords") + }, +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js + mounted: /* @__PURE__ */ __name(function mounted() { +======== + mounted: /* @__PURE__ */ __name(function mounted2() { + this.setPaginatorAttribute(); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js + this.createStyle(); + }, "mounted"), + methods: { + changePage: /* @__PURE__ */ __name(function changePage(p) { + var pc = this.pageCount; + if (p >= 0 && p < pc) { + this.d_first = this.d_rows * p; + var state = { + page: p, + first: this.d_first, + rows: this.d_rows, + pageCount: pc + }; + this.$emit("update:first", this.d_first); + this.$emit("update:rows", this.d_rows); + this.$emit("page", state); + } + }, "changePage"), + changePageToFirst: /* @__PURE__ */ __name(function changePageToFirst(event2) { + if (!this.isFirstPage) { + this.changePage(0); + } + event2.preventDefault(); + }, "changePageToFirst"), + changePageToPrev: /* @__PURE__ */ __name(function changePageToPrev(event2) { + this.changePage(this.page - 1); + event2.preventDefault(); + }, "changePageToPrev"), + changePageLink: /* @__PURE__ */ __name(function changePageLink(event2) { + this.changePage(event2.value - 1); + event2.originalEvent.preventDefault(); + }, "changePageLink"), + changePageToNext: /* @__PURE__ */ __name(function changePageToNext(event2) { + this.changePage(this.page + 1); + event2.preventDefault(); + }, "changePageToNext"), + changePageToLast: /* @__PURE__ */ __name(function changePageToLast(event2) { + if (!this.isLastPage) { + this.changePage(this.pageCount - 1); + } + event2.preventDefault(); + }, "changePageToLast"), + onRowChange: /* @__PURE__ */ __name(function onRowChange(value) { + this.d_rows = value; + this.changePage(this.page); + }, "onRowChange"), + createStyle: /* @__PURE__ */ __name(function createStyle() { + var _this = this; + if (this.hasBreakpoints() && !this.isUnstyled) { + var _this$$primevue; + this.styleElement = document.createElement("style"); + this.styleElement.type = "text/css"; + setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce); + document.body.appendChild(this.styleElement); + var innerHTML = ""; + var keys = Object.keys(this.template); + var sortedBreakpoints = {}; + keys.sort(function(a, b) { + return parseInt(a) - parseInt(b); + }).forEach(function(key2) { + sortedBreakpoints[key2] = _this.template[key2]; + }); + for (var _i = 0, _Object$entries = Object.entries(Object.entries(sortedBreakpoints)); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _slicedToArray$1(_Object$entries[_i], 2), index = _Object$entries$_i[0], _Object$entries$_i$ = _slicedToArray$1(_Object$entries$_i[1], 1), key = _Object$entries$_i$[0]; + var minValue = void 0, calculatedMinValue = void 0; + if (key !== "default" && typeof Object.keys(sortedBreakpoints)[index - 1] === "string") { + calculatedMinValue = Number(Object.keys(sortedBreakpoints)[index - 1].slice(0, -2)) + 1 + "px"; + } else { + calculatedMinValue = Object.keys(sortedBreakpoints)[index - 1]; + } + minValue = Object.entries(sortedBreakpoints)[index - 1] ? "and (min-width:".concat(calculatedMinValue, ")") : ""; + if (key === "default") { + innerHTML += "\n @media screen ".concat(minValue, " {\n .p-paginator[").concat(this.$attrSelector, "],\n display: flex;\n }\n }\n "); + } else { + innerHTML += "\n.p-paginator-".concat(key, " {\n display: none;\n}\n@media screen ").concat(minValue, " and (max-width: ").concat(key, ") {\n .p-paginator-").concat(key, " {\n display: flex;\n }\n\n .p-paginator-default{\n display: none;\n }\n}\n "); + } + } + this.styleElement.innerHTML = innerHTML; + } + }, "createStyle"), + hasBreakpoints: /* @__PURE__ */ __name(function hasBreakpoints() { + return _typeof$b(this.template) === "object"; + }, "hasBreakpoints"), + getAriaLabel: /* @__PURE__ */ __name(function getAriaLabel(labelType) { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria[labelType] : void 0; + }, "getAriaLabel") + }, + computed: { + templateItems: /* @__PURE__ */ __name(function templateItems() { + var keys = {}; + if (this.hasBreakpoints()) { + keys = this.template; + if (!keys["default"]) { + keys["default"] = "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"; + } + for (var item in keys) { + keys[item] = this.template[item].split(" ").map(function(value) { + return value.trim(); + }); + } + return keys; + } + keys["default"] = this.template.split(" ").map(function(value) { + return value.trim(); + }); + return keys; + }, "templateItems"), + page: /* @__PURE__ */ __name(function page3() { + return Math.floor(this.d_first / this.d_rows); + }, "page"), + pageCount: /* @__PURE__ */ __name(function pageCount() { + return Math.ceil(this.totalRecords / this.d_rows); + }, "pageCount"), + isFirstPage: /* @__PURE__ */ __name(function isFirstPage() { + return this.page === 0; + }, "isFirstPage"), + isLastPage: /* @__PURE__ */ __name(function isLastPage() { + return this.page === this.pageCount - 1; + }, "isLastPage"), + calculatePageLinkBoundaries: /* @__PURE__ */ __name(function calculatePageLinkBoundaries() { + var numberOfPages = this.pageCount; + var visiblePages = Math.min(this.pageLinkSize, numberOfPages); + var start = Math.max(0, Math.ceil(this.page - visiblePages / 2)); + var end = Math.min(numberOfPages - 1, start + visiblePages - 1); + var delta = this.pageLinkSize - (end - start + 1); + start = Math.max(0, start - delta); + return [start, end]; + }, "calculatePageLinkBoundaries"), + pageLinks: /* @__PURE__ */ __name(function pageLinks() { + var pageLinks2 = []; + var boundaries = this.calculatePageLinkBoundaries; + var start = boundaries[0]; + var end = boundaries[1]; + for (var i = start; i <= end; i++) { + pageLinks2.push(i + 1); + } + return pageLinks2; + }, "pageLinks"), + currentState: /* @__PURE__ */ __name(function currentState() { + return { + page: this.page, + first: this.d_first, + rows: this.d_rows + }; + }, "currentState"), + empty: /* @__PURE__ */ __name(function empty() { + return this.pageCount === 0; + }, "empty"), + currentPage: /* @__PURE__ */ __name(function currentPage() { + return this.pageCount > 0 ? this.page + 1 : 0; + }, "currentPage"), + last: /* @__PURE__ */ __name(function last2() { + return Math.min(this.d_first + this.rows, this.totalRecords); + }, "last") + }, + components: { + CurrentPageReport: script$9$1, + FirstPageLink: script$8$1, + LastPageLink: script$5$1, + NextPageLink: script$4$1, + PageLinks: script$3$1, + PrevPageLink: script$2$1, + RowsPerPageDropdown: script$1$2, + JumpToPageDropdown: script$7$1, + JumpToPageInput: script$6$1 + } +}; +function render$k(_ctx, _cache, $props, $setup, $data, $options) { + var _component_FirstPageLink = resolveComponent("FirstPageLink"); + var _component_PrevPageLink = resolveComponent("PrevPageLink"); + var _component_NextPageLink = resolveComponent("NextPageLink"); + var _component_LastPageLink = resolveComponent("LastPageLink"); + var _component_PageLinks = resolveComponent("PageLinks"); + var _component_CurrentPageReport = resolveComponent("CurrentPageReport"); + var _component_RowsPerPageDropdown = resolveComponent("RowsPerPageDropdown"); + var _component_JumpToPageDropdown = resolveComponent("JumpToPageDropdown"); + var _component_JumpToPageInput = resolveComponent("JumpToPageInput"); + return (_ctx.alwaysShow ? true : $options.pageLinks && $options.pageLinks.length > 1) ? (openBlock(), createElementBlock("nav", normalizeProps(mergeProps({ + key: 0 + }, _ctx.ptmi("paginatorContainer"))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.templateItems, function(value, key) { + return openBlock(), createElementBlock("div", mergeProps({ + key, + ref_for: true, + ref: "paginator", + "class": _ctx.cx("paginator", { + key + }) + }, _ctx.ptm("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", { + key: 0, + first: $data.d_first + 1, + last: $options.last, + rows: $data.d_rows, + page: $options.page, + pageCount: $options.pageCount, + totalRecords: _ctx.totalRecords, + firstPageCallback: $options.changePageToFirst, + lastPageCallback: $options.changePageToLast, + prevPageCallback: $options.changePageToPrev, + nextPageCallback: $options.changePageToNext, + rowChangeCallback: $options.onRowChange + }) : (openBlock(), createElementBlock(Fragment, { + key: 1 + }, [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("contentStart"), + ref_for: true + }, _ctx.ptm("contentStart")), [renderSlot(_ctx.$slots, "start", { + state: $options.currentState + })], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("content"), + ref_for: true + }, _ctx.ptm("content")), [(openBlock(true), createElementBlock(Fragment, null, renderList(value, function(item) { + return openBlock(), createElementBlock(Fragment, { + key: item + }, [item === "FirstPageLink" ? (openBlock(), createBlock(_component_FirstPageLink, { + key: 0, + "aria-label": $options.getAriaLabel("firstPageLabel"), + template: _ctx.$slots.firsticon || _ctx.$slots.firstpagelinkicon, + onClick: _cache[0] || (_cache[0] = function($event) { + return $options.changePageToFirst($event); + }), + disabled: $options.isFirstPage || $options.empty, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "PrevPageLink" ? (openBlock(), createBlock(_component_PrevPageLink, { + key: 1, + "aria-label": $options.getAriaLabel("prevPageLabel"), + template: _ctx.$slots.previcon || _ctx.$slots.prevpagelinkicon, + onClick: _cache[1] || (_cache[1] = function($event) { + return $options.changePageToPrev($event); + }), + disabled: $options.isFirstPage || $options.empty, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "NextPageLink" ? (openBlock(), createBlock(_component_NextPageLink, { + key: 2, + "aria-label": $options.getAriaLabel("nextPageLabel"), + template: _ctx.$slots.nexticon || _ctx.$slots.nextpagelinkicon, + onClick: _cache[2] || (_cache[2] = function($event) { + return $options.changePageToNext($event); + }), + disabled: $options.isLastPage || $options.empty, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "LastPageLink" ? (openBlock(), createBlock(_component_LastPageLink, { + key: 3, + "aria-label": $options.getAriaLabel("lastPageLabel"), + template: _ctx.$slots.lasticon || _ctx.$slots.lastpagelinkicon, + onClick: _cache[3] || (_cache[3] = function($event) { + return $options.changePageToLast($event); + }), + disabled: $options.isLastPage || $options.empty, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "PageLinks" ? (openBlock(), createBlock(_component_PageLinks, { + key: 4, + "aria-label": $options.getAriaLabel("pageLabel"), + value: $options.pageLinks, + page: $options.page, + onClick: _cache[4] || (_cache[4] = function($event) { + return $options.changePageLink($event); + }), + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["aria-label", "value", "page", "unstyled", "pt"])) : item === "CurrentPageReport" ? (openBlock(), createBlock(_component_CurrentPageReport, { + key: 5, + "aria-live": "polite", + template: _ctx.currentPageReportTemplate, + currentPage: $options.currentPage, + page: $options.page, + pageCount: $options.pageCount, + first: $data.d_first, + rows: $data.d_rows, + totalRecords: _ctx.totalRecords, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["template", "currentPage", "page", "pageCount", "first", "rows", "totalRecords", "unstyled", "pt"])) : item === "RowsPerPageDropdown" && _ctx.rowsPerPageOptions ? (openBlock(), createBlock(_component_RowsPerPageDropdown, { + key: 6, + "aria-label": $options.getAriaLabel("rowsPerPageLabel"), + rows: $data.d_rows, + options: _ctx.rowsPerPageOptions, + onRowsChange: _cache[5] || (_cache[5] = function($event) { + return $options.onRowChange($event); + }), + disabled: $options.empty, + templates: _ctx.$slots, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["aria-label", "rows", "options", "disabled", "templates", "unstyled", "pt"])) : item === "JumpToPageDropdown" ? (openBlock(), createBlock(_component_JumpToPageDropdown, { + key: 7, + "aria-label": $options.getAriaLabel("jumpToPageDropdownLabel"), + page: $options.page, + pageCount: $options.pageCount, + onPageChange: _cache[6] || (_cache[6] = function($event) { + return $options.changePage($event); + }), + disabled: $options.empty, + templates: _ctx.$slots, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["aria-label", "page", "pageCount", "disabled", "templates", "unstyled", "pt"])) : item === "JumpToPageInput" ? (openBlock(), createBlock(_component_JumpToPageInput, { + key: 8, + page: $options.currentPage, + onPageChange: _cache[7] || (_cache[7] = function($event) { + return $options.changePage($event); + }), + disabled: $options.empty, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["page", "disabled", "unstyled", "pt"])) : createCommentVNode("", true)], 64); + }), 128))], 16), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({ + key: 1, + "class": _ctx.cx("contentEnd"), + ref_for: true + }, _ctx.ptm("contentEnd")), [renderSlot(_ctx.$slots, "end", { + state: $options.currentState + })], 16)) : createCommentVNode("", true)], 64))], 16); + }), 128))], 16)) : createCommentVNode("", true); +} +__name(render$k, "render$k"); +script$l.render = render$k; +var theme$1 = /* @__PURE__ */ __name(function theme2(_ref) { + var dt = _ref.dt; + return "\n.p-datatable {\n position: relative;\n}\n\n.p-datatable-table {\n border-spacing: 0;\n width: 100%;\n}\n\n.p-datatable-scrollable > .p-datatable-table-container {\n position: relative;\n}\n\n.p-datatable-scrollable-table > .p-datatable-thead {\n inset-block-start: 0;\n z-index: 1;\n}\n\n.p-datatable-scrollable-table > .p-datatable-frozen-tbody {\n position: sticky;\n z-index: 1;\n}\n\n.p-datatable-scrollable-table > .p-datatable-tfoot {\n inset-block-end: 0;\n z-index: 1;\n}\n\n.p-datatable-scrollable .p-datatable-frozen-column {\n position: sticky;\n background: ".concat(dt("datatable.header.cell.background"), ";\n}\n\n.p-datatable-scrollable th.p-datatable-frozen-column {\n z-index: 1;\n}\n\n.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-thead,\n.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-thead {\n background: ").concat(dt("datatable.header.cell.background"), ";\n}\n\n.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-tfoot,\n.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-tfoot {\n background: ").concat(dt("datatable.footer.cell.background"), ";\n}\n\n.p-datatable-flex-scrollable {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.p-datatable-flex-scrollable > .p-datatable-table-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n height: 100%;\n}\n\n.p-datatable-scrollable-table > .p-datatable-tbody > .p-datatable-row-group-header {\n position: sticky;\n z-index: 1;\n}\n\n.p-datatable-resizable-table > .p-datatable-thead > tr > th,\n.p-datatable-resizable-table > .p-datatable-tfoot > tr > td,\n.p-datatable-resizable-table > .p-datatable-tbody > tr > td {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.p-datatable-resizable-table > .p-datatable-thead > tr > th.p-datatable-resizable-column:not(.p-datatable-frozen-column) {\n background-clip: padding-box;\n position: relative;\n}\n\n.p-datatable-resizable-table-fit > .p-datatable-thead > tr > th.p-datatable-resizable-column:last-child .p-datatable-column-resizer {\n display: none;\n}\n\n.p-datatable-column-resizer {\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n margin: 0;\n width: ").concat(dt("datatable.column.resizer.width"), ";\n height: 100%;\n padding: 0;\n cursor: col-resize;\n border: 1px solid transparent;\n}\n\n.p-datatable-column-header-content {\n display: flex;\n align-items: center;\n gap: ").concat(dt("datatable.header.cell.gap"), ";\n}\n\n.p-datatable-column-resize-indicator {\n width: ").concat(dt("datatable.resize.indicator.width"), ";\n position: absolute;\n z-index: 10;\n display: none;\n background: ").concat(dt("datatable.resize.indicator.color"), ";\n}\n\n.p-datatable-row-reorder-indicator-up,\n.p-datatable-row-reorder-indicator-down {\n position: absolute;\n display: none;\n}\n\n.p-datatable-reorderable-column,\n.p-datatable-reorderable-row-handle {\n cursor: move;\n}\n\n.p-datatable-mask {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 2;\n}\n\n.p-datatable-inline-filter {\n display: flex;\n align-items: center;\n width: 100%;\n gap: ").concat(dt("datatable.filter.inline.gap"), ";\n}\n\n.p-datatable-inline-filter .p-datatable-filter-element-container {\n flex: 1 1 auto;\n width: 1%;\n}\n\n.p-datatable-filter-overlay {\n background: ").concat(dt("datatable.filter.overlay.select.background"), ";\n color: ").concat(dt("datatable.filter.overlay.select.color"), ";\n border: 1px solid ").concat(dt("datatable.filter.overlay.select.border.color"), ";\n border-radius: ").concat(dt("datatable.filter.overlay.select.border.radius"), ";\n box-shadow: ").concat(dt("datatable.filter.overlay.select.shadow"), ";\n min-width: 12.5rem;\n}\n\n.p-datatable-filter-constraint-list {\n margin: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n padding: ").concat(dt("datatable.filter.constraint.list.padding"), ";\n gap: ").concat(dt("datatable.filter.constraint.list.gap"), ";\n}\n\n.p-datatable-filter-constraint {\n padding: ").concat(dt("datatable.filter.constraint.padding"), ";\n color: ").concat(dt("datatable.filter.constraint.color"), ";\n border-radius: ").concat(dt("datatable.filter.constraint.border.radius"), ";\n cursor: pointer;\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n box-shadow ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-filter-constraint-selected {\n background: ").concat(dt("datatable.filter.constraint.selected.background"), ";\n color: ").concat(dt("datatable.filter.constraint.selected.color"), ";\n}\n\n.p-datatable-filter-constraint:not(.p-datatable-filter-constraint-selected):not(.p-disabled):hover {\n background: ").concat(dt("datatable.filter.constraint.focus.background"), ";\n color: ").concat(dt("datatable.filter.constraint.focus.color"), ";\n}\n\n.p-datatable-filter-constraint:focus-visible {\n outline: 0 none;\n background: ").concat(dt("datatable.filter.constraint.focus.background"), ";\n color: ").concat(dt("datatable.filter.constraint.focus.color"), ";\n}\n\n.p-datatable-filter-constraint-selected:focus-visible {\n outline: 0 none;\n background: ").concat(dt("datatable.filter.constraint.selected.focus.background"), ";\n color: ").concat(dt("datatable.filter.constraint.selected.focus.color"), ";\n}\n\n.p-datatable-filter-constraint-separator {\n border-block-start: 1px solid ").concat(dt("datatable.filter.constraint.separator.border.color"), ";\n}\n\n.p-datatable-popover-filter {\n display: inline-flex;\n margin-inline-start: auto;\n}\n\n.p-datatable-filter-overlay-popover {\n background: ").concat(dt("datatable.filter.overlay.popover.background"), ";\n color: ").concat(dt("datatable.filter.overlay.popover.color"), ";\n border: 1px solid ").concat(dt("datatable.filter.overlay.popover.border.color"), ";\n border-radius: ").concat(dt("datatable.filter.overlay.popover.border.radius"), ";\n box-shadow: ").concat(dt("datatable.filter.overlay.popover.shadow"), ";\n min-width: 12.5rem;\n padding: ").concat(dt("datatable.filter.overlay.popover.padding"), ";\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("datatable.filter.overlay.popover.gap"), ";\n}\n\n.p-datatable-filter-operator-dropdown {\n width: 100%;\n}\n\n.p-datatable-filter-rule-list,\n.p-datatable-filter-rule {\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("datatable.filter.overlay.popover.gap"), ";\n}\n\n.p-datatable-filter-rule {\n border-block-end: 1px solid ").concat(dt("datatable.filter.rule.border.color"), ";\n padding-bottom: ").concat(dt("datatable.filter.overlay.popover.gap"), ";\n}\n\n.p-datatable-filter-rule:last-child {\n border-block-end: 0 none;\n padding-bottom: 0;\n}\n\n.p-datatable-filter-add-rule-button {\n width: 100%;\n}\n\n.p-datatable-filter-remove-rule-button {\n width: 100%;\n}\n\n.p-datatable-filter-buttonbar {\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.p-datatable-virtualscroller-spacer {\n display: flex;\n}\n\n.p-datatable .p-virtualscroller .p-virtualscroller-loading {\n transform: none !important;\n min-height: 0;\n position: sticky;\n inset-block-start: 0;\n inset-inline-start: 0;\n}\n\n.p-datatable-paginator-top {\n border-color: ").concat(dt("datatable.paginator.top.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.paginator.top.border.width"), ";\n}\n\n.p-datatable-paginator-bottom {\n border-color: ").concat(dt("datatable.paginator.bottom.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.paginator.bottom.border.width"), ";\n}\n\n.p-datatable-header {\n background: ").concat(dt("datatable.header.background"), ";\n color: ").concat(dt("datatable.header.color"), ";\n border-color: ").concat(dt("datatable.header.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.header.border.width"), ";\n padding: ").concat(dt("datatable.header.padding"), ";\n}\n\n.p-datatable-footer {\n background: ").concat(dt("datatable.footer.background"), ";\n color: ").concat(dt("datatable.footer.color"), ";\n border-color: ").concat(dt("datatable.footer.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.footer.border.width"), ";\n padding: ").concat(dt("datatable.footer.padding"), ";\n}\n\n.p-datatable-header-cell {\n padding: ").concat(dt("datatable.header.cell.padding"), ";\n background: ").concat(dt("datatable.header.cell.background"), ";\n border-color: ").concat(dt("datatable.header.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n color: ").concat(dt("datatable.header.cell.color"), ";\n font-weight: normal;\n text-align: start;\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n outline-color ").concat(dt("datatable.transition.duration"), ", box-shadow ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-column-title {\n font-weight: ").concat(dt("datatable.column.title.font.weight"), ";\n}\n\n.p-datatable-tbody > tr {\n outline-color: transparent;\n background: ").concat(dt("datatable.row.background"), ";\n color: ").concat(dt("datatable.row.color"), ";\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n outline-color ").concat(dt("datatable.transition.duration"), ", box-shadow ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-tbody > tr > td {\n text-align: start;\n border-color: ").concat(dt("datatable.body.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n padding: ").concat(dt("datatable.body.cell.padding"), ";\n}\n\n.p-datatable-hoverable .p-datatable-tbody > tr:not(.p-datatable-row-selected):hover {\n background: ").concat(dt("datatable.row.hover.background"), ";\n color: ").concat(dt("datatable.row.hover.color"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-row-selected {\n background: ").concat(dt("datatable.row.selected.background"), ";\n color: ").concat(dt("datatable.row.selected.color"), ";\n}\n\n.p-datatable-tbody > tr:has(+ .p-datatable-row-selected) > td {\n border-block-end-color: ").concat(dt("datatable.body.cell.selected.border.color"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-row-selected > td {\n border-block-end-color: ").concat(dt("datatable.body.cell.selected.border.color"), ";\n}\n\n.p-datatable-tbody > tr:focus-visible,\n.p-datatable-tbody > tr.p-datatable-contextmenu-row-selected {\n box-shadow: ").concat(dt("datatable.row.focus.ring.shadow"), ";\n outline: ").concat(dt("datatable.row.focus.ring.width"), " ").concat(dt("datatable.row.focus.ring.style"), " ").concat(dt("datatable.row.focus.ring.color"), ";\n outline-offset: ").concat(dt("datatable.row.focus.ring.offset"), ";\n}\n\n.p-datatable-tfoot > tr > td {\n text-align: start;\n padding: ").concat(dt("datatable.footer.cell.padding"), ";\n border-color: ").concat(dt("datatable.footer.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n color: ").concat(dt("datatable.footer.cell.color"), ";\n background: ").concat(dt("datatable.footer.cell.background"), ";\n}\n\n.p-datatable-column-footer {\n font-weight: ").concat(dt("datatable.column.footer.font.weight"), ";\n}\n\n.p-datatable-sortable-column {\n cursor: pointer;\n user-select: none;\n outline-color: transparent;\n}\n\n.p-datatable-column-title,\n.p-datatable-sort-icon,\n.p-datatable-sort-badge {\n vertical-align: middle;\n}\n\n.p-datatable-sort-icon {\n color: ").concat(dt("datatable.sort.icon.color"), ";\n font-size: ").concat(dt("datatable.sort.icon.size"), ";\n width: ").concat(dt("datatable.sort.icon.size"), ";\n height: ").concat(dt("datatable.sort.icon.size"), ";\n transition: color ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover {\n background: ").concat(dt("datatable.header.cell.hover.background"), ";\n color: ").concat(dt("datatable.header.cell.hover.color"), ";\n}\n\n.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover .p-datatable-sort-icon {\n color: ").concat(dt("datatable.sort.icon.hover.color"), ";\n}\n\n.p-datatable-column-sorted {\n background: ").concat(dt("datatable.header.cell.selected.background"), ";\n color: ").concat(dt("datatable.header.cell.selected.color"), ";\n}\n\n.p-datatable-column-sorted .p-datatable-sort-icon {\n color: ").concat(dt("datatable.header.cell.selected.color"), ";\n}\n\n.p-datatable-sortable-column:focus-visible {\n box-shadow: ").concat(dt("datatable.header.cell.focus.ring.shadow"), ";\n outline: ").concat(dt("datatable.header.cell.focus.ring.width"), " ").concat(dt("datatable.header.cell.focus.ring.style"), " ").concat(dt("datatable.header.cell.focus.ring.color"), ";\n outline-offset: ").concat(dt("datatable.header.cell.focus.ring.offset"), ";\n}\n\n.p-datatable-hoverable .p-datatable-selectable-row {\n cursor: pointer;\n}\n\n.p-datatable-tbody > tr.p-datatable-dragpoint-top > td {\n box-shadow: inset 0 2px 0 0 ").concat(dt("datatable.drop.point.color"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-dragpoint-bottom > td {\n box-shadow: inset 0 -2px 0 0 ").concat(dt("datatable.drop.point.color"), ";\n}\n\n.p-datatable-loading-icon {\n font-size: ").concat(dt("datatable.loading.icon.size"), ";\n width: ").concat(dt("datatable.loading.icon.size"), ";\n height: ").concat(dt("datatable.loading.icon.size"), ";\n}\n\n.p-datatable-gridlines .p-datatable-header {\n border-width: 1px 1px 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-footer {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-paginator-top {\n border-width: 1px 1px 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-paginator-bottom {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-thead > tr > th {\n border-width: 1px 0 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-thead > tr > th:last-child {\n border-width: 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr > td {\n border-width: 1px 0 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr > td:last-child {\n border-width: 1px 1px 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr:last-child > td {\n border-width: 1px 0 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr:last-child > td:last-child {\n border-width: 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tfoot > tr > td {\n border-width: 1px 0 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tfoot > tr > td:last-child {\n border-width: 1px 1px 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines .p-datatable-thead + .p-datatable-tfoot > tr > td {\n border-width: 0 0 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines .p-datatable-thead + .p-datatable-tfoot > tr > td:last-child {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td {\n border-width: 0 0 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td:last-child {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td {\n border-width: 0 0 0 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td:last-child {\n border-width: 0 1px 0 1px;\n}\n\n.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd {\n background: ").concat(dt("datatable.row.striped.background"), ";\n}\n\n.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd.p-datatable-row-selected {\n background: ").concat(dt("datatable.row.selected.background"), ";\n color: ").concat(dt("datatable.row.selected.color"), ";\n}\n\n.p-datatable.p-datatable-sm .p-datatable-header {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-thead > tr > th {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-tbody > tr > td {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-tfoot > tr > td {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-footer {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-header {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-thead > tr > th {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-tbody > tr > td {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-tfoot > tr > td {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-footer {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable-row-toggle-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n width: ").concat(dt("datatable.row.toggle.button.size"), ";\n height: ").concat(dt("datatable.row.toggle.button.size"), ";\n color: ").concat(dt("datatable.row.toggle.button.color"), ";\n border: 0 none;\n background: transparent;\n cursor: pointer;\n border-radius: ").concat(dt("datatable.row.toggle.button.border.radius"), ";\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n outline-color ").concat(dt("datatable.transition.duration"), ", box-shadow ").concat(dt("datatable.transition.duration"), ";\n outline-color: transparent;\n user-select: none;\n}\n\n.p-datatable-row-toggle-button:enabled:hover {\n color: ").concat(dt("datatable.row.toggle.button.hover.color"), ";\n background: ").concat(dt("datatable.row.toggle.button.hover.background"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-row-selected .p-datatable-row-toggle-button:hover {\n background: ").concat(dt("datatable.row.toggle.button.selected.hover.background"), ";\n color: ").concat(dt("datatable.row.toggle.button.selected.hover.color"), ";\n}\n\n.p-datatable-row-toggle-button:focus-visible {\n box-shadow: ").concat(dt("datatable.row.toggle.button.focus.ring.shadow"), ";\n outline: ").concat(dt("datatable.row.toggle.button.focus.ring.width"), " ").concat(dt("datatable.row.toggle.button.focus.ring.style"), " ").concat(dt("datatable.row.toggle.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("datatable.row.toggle.button.focus.ring.offset"), ";\n}\n\n.p-datatable-row-toggle-icon:dir(rtl) {\n transform: rotate(180deg);\n}\n"); +}, "theme"); +var classes$1 = { + root: /* @__PURE__ */ __name(function root(_ref2) { + var props = _ref2.props; + return ["p-datatable p-component", { + "p-datatable-hoverable": props.rowHover || props.selectionMode, + "p-datatable-resizable": props.resizableColumns, + "p-datatable-resizable-fit": props.resizableColumns && props.columnResizeMode === "fit", + "p-datatable-scrollable": props.scrollable, + "p-datatable-flex-scrollable": props.scrollable && props.scrollHeight === "flex", + "p-datatable-striped": props.stripedRows, + "p-datatable-gridlines": props.showGridlines, + "p-datatable-sm": props.size === "small", + "p-datatable-lg": props.size === "large" + }]; + }, "root"), + mask: "p-datatable-mask p-overlay-mask", + loadingIcon: "p-datatable-loading-icon", + header: "p-datatable-header", + pcPaginator: /* @__PURE__ */ __name(function pcPaginator(_ref3) { + var position = _ref3.position; + return "p-datatable-paginator-" + position; + }, "pcPaginator"), + tableContainer: "p-datatable-table-container", + table: /* @__PURE__ */ __name(function table(_ref4) { + var props = _ref4.props; + return ["p-datatable-table", { + "p-datatable-scrollable-table": props.scrollable, + "p-datatable-resizable-table": props.resizableColumns, + "p-datatable-resizable-table-fit": props.resizableColumns && props.columnResizeMode === "fit" + }]; + }, "table"), + thead: "p-datatable-thead", + headerCell: /* @__PURE__ */ __name(function headerCell(_ref5) { + var instance = _ref5.instance, props = _ref5.props, column = _ref5.column; + return column && !instance.columnProp(column, "hidden") && (props.rowGroupMode !== "subheader" || props.groupRowsBy !== instance.columnProp(column, "field")) ? ["p-datatable-header-cell", { + "p-datatable-frozen-column": instance.columnProp(column, "frozen") + }] : ["p-datatable-header-cell", { + "p-datatable-sortable-column": instance.columnProp("sortable"), + "p-datatable-resizable-column": instance.resizableColumns, + "p-datatable-column-sorted": instance.isColumnSorted(), + "p-datatable-frozen-column": instance.columnProp("frozen"), + "p-datatable-reorderable-column": props.reorderableColumns + }]; + }, "headerCell"), + columnResizer: "p-datatable-column-resizer", + columnHeaderContent: "p-datatable-column-header-content", + columnTitle: "p-datatable-column-title", + columnFooter: "p-datatable-column-footer", + sortIcon: "p-datatable-sort-icon", + pcSortBadge: "p-datatable-sort-badge", + filter: /* @__PURE__ */ __name(function filter(_ref6) { + var props = _ref6.props; + return ["p-datatable-filter", { + "p-datatable-inline-filter": props.display === "row", + "p-datatable-popover-filter": props.display === "menu" + }]; + }, "filter"), + filterElementContainer: "p-datatable-filter-element-container", + pcColumnFilterButton: "p-datatable-column-filter-button", + pcColumnFilterClearButton: "p-datatable-column-filter-clear-button", + filterOverlay: /* @__PURE__ */ __name(function filterOverlay(_ref7) { + _ref7.instance; + var props = _ref7.props; + return ["p-datatable-filter-overlay p-component", { + "p-datatable-filter-overlay-popover": props.display === "menu" + }]; + }, "filterOverlay"), + filterConstraintList: "p-datatable-filter-constraint-list", + filterConstraint: /* @__PURE__ */ __name(function filterConstraint(_ref8) { + var instance = _ref8.instance, matchMode = _ref8.matchMode; + return ["p-datatable-filter-constraint", { + "p-datatable-filter-constraint-selected": matchMode && instance.isRowMatchModeSelected(matchMode.value) + }]; + }, "filterConstraint"), + filterConstraintSeparator: "p-datatable-filter-constraint-separator", + filterOperator: "p-datatable-filter-operator", + pcFilterOperatorDropdown: "p-datatable-filter-operator-dropdown", + filterRuleList: "p-datatable-filter-rule-list", + filterRule: "p-datatable-filter-rule", + pcFilterConstraintDropdown: "p-datatable-filter-constraint-dropdown", + pcFilterRemoveRuleButton: "p-datatable-filter-remove-rule-button", + pcFilterAddRuleButton: "p-datatable-filter-add-rule-button", + filterButtonbar: "p-datatable-filter-buttonbar", + pcFilterClearButton: "p-datatable-filter-clear-button", + pcFilterApplyButton: "p-datatable-filter-apply-button", + tbody: /* @__PURE__ */ __name(function tbody(_ref9) { + var props = _ref9.props; + return props.frozenRow ? "p-datatable-tbody p-datatable-frozen-tbody" : "p-datatable-tbody"; + }, "tbody"), + rowGroupHeader: "p-datatable-row-group-header", + rowToggleButton: "p-datatable-row-toggle-button", + rowToggleIcon: "p-datatable-row-toggle-icon", + row: /* @__PURE__ */ __name(function row(_ref10) { + var instance = _ref10.instance, props = _ref10.props, index = _ref10.index, columnSelectionMode = _ref10.columnSelectionMode; + var rowStyleClass = []; + if (props.selectionMode) { + rowStyleClass.push("p-datatable-selectable-row"); + } + if (props.selection) { + rowStyleClass.push({ + "p-datatable-row-selected": columnSelectionMode ? instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect : instance.isSelected + }); + } + if (props.contextMenuSelection) { + rowStyleClass.push({ + "p-datatable-contextmenu-row-selected": instance.isSelectedWithContextMenu + }); + } + rowStyleClass.push(index % 2 === 0 ? "p-row-even" : "p-row-odd"); + return rowStyleClass; + }, "row"), + rowExpansion: "p-datatable-row-expansion", + rowGroupFooter: "p-datatable-row-group-footer", + emptyMessage: "p-datatable-empty-message", + bodyCell: /* @__PURE__ */ __name(function bodyCell(_ref11) { + var instance = _ref11.instance; + return [{ + "p-datatable-frozen-column": instance.columnProp("frozen") + }]; + }, "bodyCell"), + reorderableRowHandle: "p-datatable-reorderable-row-handle", + pcRowEditorInit: "p-datatable-row-editor-init", + pcRowEditorSave: "p-datatable-row-editor-save", + pcRowEditorCancel: "p-datatable-row-editor-cancel", + tfoot: "p-datatable-tfoot", + footerCell: /* @__PURE__ */ __name(function footerCell(_ref12) { + var instance = _ref12.instance; + return [{ + "p-datatable-frozen-column": instance.columnProp("frozen") + }]; + }, "footerCell"), + virtualScrollerSpacer: "p-datatable-virtualscroller-spacer", + footer: "p-datatable-footer", + columnResizeIndicator: "p-datatable-column-resize-indicator", + rowReorderIndicatorUp: "p-datatable-row-reorder-indicator-up", + rowReorderIndicatorDown: "p-datatable-row-reorder-indicator-down" +}; +var inlineStyles = { + tableContainer: { + overflow: "auto" + }, + thead: { + position: "sticky" + }, + tfoot: { + position: "sticky" + } +}; +var DataTableStyle = BaseStyle.extend({ + name: "datatable", + theme: theme$1, + classes: classes$1, + inlineStyles +}); +var script$k = { + name: "PencilIcon", + "extends": script$t +}; +function render$j(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + d: "M0.609628 13.959C0.530658 13.9599 0.452305 13.9451 0.379077 13.9156C0.305849 13.8861 0.239191 13.8424 0.18294 13.787C0.118447 13.7234 0.0688234 13.6464 0.0376166 13.5614C0.00640987 13.4765 -0.00560954 13.3857 0.00241768 13.2956L0.25679 10.1501C0.267698 10.0041 0.331934 9.86709 0.437312 9.76516L9.51265 0.705715C10.0183 0.233014 10.6911 -0.0203041 11.3835 0.00127367C12.0714 0.00660201 12.7315 0.27311 13.2298 0.746671C13.7076 1.23651 13.9824 1.88848 13.9992 2.57201C14.0159 3.25554 13.7733 3.92015 13.32 4.4327L4.23648 13.5331C4.13482 13.6342 4.0017 13.6978 3.85903 13.7133L0.667067 14L0.609628 13.959ZM1.43018 10.4696L1.25787 12.714L3.50619 12.5092L12.4502 3.56444C12.6246 3.35841 12.7361 3.10674 12.7714 2.83933C12.8067 2.57193 12.7644 2.30002 12.6495 2.05591C12.5346 1.8118 12.3519 1.60575 12.1231 1.46224C11.8943 1.31873 11.6291 1.2438 11.3589 1.24633C11.1813 1.23508 11.0033 1.25975 10.8355 1.31887C10.6677 1.37798 10.5136 1.47033 10.3824 1.59036L1.43018 10.4696Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$j, "render$j"); +script$k.render = render$j; +var theme3 = /* @__PURE__ */ __name(function theme4(_ref) { + var dt = _ref.dt; + return "\n.p-radiobutton {\n position: relative;\n display: inline-flex;\n user-select: none;\n vertical-align: bottom;\n width: ".concat(dt("radiobutton.width"), ";\n height: ").concat(dt("radiobutton.height"), ";\n}\n\n.p-radiobutton-input {\n cursor: pointer;\n appearance: none;\n position: absolute;\n top: 0;\n inset-inline-start: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: 1;\n outline: 0 none;\n border: 1px solid transparent;\n border-radius: 50%;\n}\n\n.p-radiobutton-box {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 1px solid ").concat(dt("radiobutton.border.color"), ";\n background: ").concat(dt("radiobutton.background"), ";\n width: ").concat(dt("radiobutton.width"), ";\n height: ").concat(dt("radiobutton.height"), ";\n transition: background ").concat(dt("radiobutton.transition.duration"), ", color ").concat(dt("radiobutton.transition.duration"), ", border-color ").concat(dt("radiobutton.transition.duration"), ", box-shadow ").concat(dt("radiobutton.transition.duration"), ", outline-color ").concat(dt("radiobutton.transition.duration"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("radiobutton.shadow"), ";\n}\n\n.p-radiobutton-icon {\n transition-duration: ").concat(dt("radiobutton.transition.duration"), ";\n background: transparent;\n font-size: ").concat(dt("radiobutton.icon.size"), ";\n width: ").concat(dt("radiobutton.icon.size"), ";\n height: ").concat(dt("radiobutton.icon.size"), ";\n border-radius: 50%;\n backface-visibility: hidden;\n transform: translateZ(0) scale(0.1);\n}\n\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:hover) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.hover.border.color"), ";\n}\n\n.p-radiobutton-checked .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.checked.border.color"), ";\n background: ").concat(dt("radiobutton.checked.background"), ";\n}\n\n.p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon {\n background: ").concat(dt("radiobutton.icon.checked.color"), ";\n transform: translateZ(0) scale(1, 1);\n visibility: visible;\n}\n\n.p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:hover) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.checked.hover.border.color"), ";\n background: ").concat(dt("radiobutton.checked.hover.background"), ";\n}\n\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:hover).p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon {\n background: ").concat(dt("radiobutton.icon.checked.hover.color"), ";\n}\n\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.focus.border.color"), ";\n box-shadow: ").concat(dt("radiobutton.focus.ring.shadow"), ";\n outline: ").concat(dt("radiobutton.focus.ring.width"), " ").concat(dt("radiobutton.focus.ring.style"), " ").concat(dt("radiobutton.focus.ring.color"), ";\n outline-offset: ").concat(dt("radiobutton.focus.ring.offset"), ";\n}\n\n.p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.checked.focus.border.color"), ";\n}\n\n.p-radiobutton.p-invalid > .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.invalid.border.color"), ";\n}\n\n.p-radiobutton.p-variant-filled .p-radiobutton-box {\n background: ").concat(dt("radiobutton.filled.background"), ";\n}\n\n.p-radiobutton.p-variant-filled.p-radiobutton-checked .p-radiobutton-box {\n background: ").concat(dt("radiobutton.checked.background"), ";\n}\n\n.p-radiobutton.p-variant-filled:not(.p-disabled):has(.p-radiobutton-input:hover).p-radiobutton-checked .p-radiobutton-box {\n background: ").concat(dt("radiobutton.checked.hover.background"), ";\n}\n\n.p-radiobutton.p-disabled {\n opacity: 1;\n}\n\n.p-radiobutton.p-disabled .p-radiobutton-box {\n background: ").concat(dt("radiobutton.disabled.background"), ";\n border-color: ").concat(dt("radiobutton.checked.disabled.border.color"), ";\n}\n\n.p-radiobutton-checked.p-disabled .p-radiobutton-box .p-radiobutton-icon {\n background: ").concat(dt("radiobutton.icon.disabled.color"), ";\n}\n\n.p-radiobutton-sm,\n.p-radiobutton-sm .p-radiobutton-box {\n width: ").concat(dt("radiobutton.sm.width"), ";\n height: ").concat(dt("radiobutton.sm.height"), ";\n}\n\n.p-radiobutton-sm .p-radiobutton-icon {\n font-size: ").concat(dt("radiobutton.icon.sm.size"), ";\n width: ").concat(dt("radiobutton.icon.sm.size"), ";\n height: ").concat(dt("radiobutton.icon.sm.size"), ";\n}\n\n.p-radiobutton-lg,\n.p-radiobutton-lg .p-radiobutton-box {\n width: ").concat(dt("radiobutton.lg.width"), ";\n height: ").concat(dt("radiobutton.lg.height"), ";\n}\n\n.p-radiobutton-lg .p-radiobutton-icon {\n font-size: ").concat(dt("radiobutton.icon.lg.size"), ";\n width: ").concat(dt("radiobutton.icon.lg.size"), ";\n height: ").concat(dt("radiobutton.icon.lg.size"), ";\n}\n"); +}, "theme"); +var classes = { + root: /* @__PURE__ */ __name(function root2(_ref2) { + var instance = _ref2.instance, props = _ref2.props; + return ["p-radiobutton p-component", { + "p-radiobutton-checked": instance.checked, + "p-disabled": props.disabled, + "p-invalid": instance.$pcRadioButtonGroup ? instance.$pcRadioButtonGroup.$invalid : instance.$invalid, + "p-variant-filled": instance.$variant === "filled", + "p-radiobutton-sm p-inputfield-sm": props.size === "small", + "p-radiobutton-lg p-inputfield-lg": props.size === "large" + }]; + }, "root"), + box: "p-radiobutton-box", + input: "p-radiobutton-input", + icon: "p-radiobutton-icon" +}; +var RadioButtonStyle = BaseStyle.extend({ + name: "radiobutton", + theme: theme3, + classes +}); +var script$1$1 = { + name: "BaseRadioButton", +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js + "extends": script$x, +======== + "extends": script$s, +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js + props: { + value: null, + binary: Boolean, + readonly: { + type: Boolean, + "default": false + }, + tabindex: { + type: Number, + "default": null + }, + inputId: { + type: String, + "default": null + }, + inputClass: { + type: [String, Object], + "default": null + }, + inputStyle: { + type: Object, + "default": null + }, + ariaLabelledby: { + type: String, + "default": null + }, + ariaLabel: { + type: String, + "default": null + } + }, + style: RadioButtonStyle, + provide: /* @__PURE__ */ __name(function provide3() { + return { + $pcRadioButton: this, + $parentInstance: this + }; + }, "provide") +}; +var script$j = { + name: "RadioButton", + "extends": script$1$1, + inheritAttrs: false, + emits: ["change", "focus", "blur"], + inject: { + $pcRadioButtonGroup: { + "default": void 0 + } + }, + methods: { + getPTOptions: /* @__PURE__ */ __name(function getPTOptions6(key) { + var _ptm = key === "root" ? this.ptmi : this.ptm; + return _ptm(key, { + context: { + checked: this.checked, + disabled: this.disabled + } + }); + }, "getPTOptions"), + onChange: /* @__PURE__ */ __name(function onChange4(event2) { + if (!this.disabled && !this.readonly) { + var newModelValue = this.binary ? !this.checked : this.value; + this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.writeValue(newModelValue, event2) : this.writeValue(newModelValue, event2); + this.$emit("change", event2); + } + }, "onChange"), + onFocus: /* @__PURE__ */ __name(function onFocus(event2) { + this.$emit("focus", event2); + }, "onFocus"), + onBlur: /* @__PURE__ */ __name(function onBlur(event2) { + var _this$formField$onBlu, _this$formField; + this.$emit("blur", event2); + (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event2); + }, "onBlur") + }, + computed: { + groupName: /* @__PURE__ */ __name(function groupName() { + return this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.groupName : this.$formName; + }, "groupName"), + checked: /* @__PURE__ */ __name(function checked() { + var value = this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.d_value : this.d_value; + return value != null && (this.binary ? !!value : equals(value, this.value)); + }, "checked") + } +}; +var _hoisted_1$5 = ["data-p-checked", "data-p-disabled"]; +var _hoisted_2$3 = ["id", "value", "name", "checked", "tabindex", "disabled", "readonly", "aria-labelledby", "aria-label", "aria-invalid"]; +function render$i(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root") + }, $options.getPTOptions("root"), { + "data-p-checked": $options.checked, + "data-p-disabled": _ctx.disabled + }), [createBaseVNode("input", mergeProps({ + id: _ctx.inputId, + type: "radio", + "class": [_ctx.cx("input"), _ctx.inputClass], + style: _ctx.inputStyle, + value: _ctx.value, + name: $options.groupName, + checked: $options.checked, + tabindex: _ctx.tabindex, + disabled: _ctx.disabled, + readonly: _ctx.readonly, + "aria-labelledby": _ctx.ariaLabelledby, + "aria-label": _ctx.ariaLabel, + "aria-invalid": _ctx.invalid || void 0, + onFocus: _cache[0] || (_cache[0] = function() { + return $options.onFocus && $options.onFocus.apply($options, arguments); + }), + onBlur: _cache[1] || (_cache[1] = function() { + return $options.onBlur && $options.onBlur.apply($options, arguments); + }), + onChange: _cache[2] || (_cache[2] = function() { + return $options.onChange && $options.onChange.apply($options, arguments); + }) + }, $options.getPTOptions("input")), null, 16, _hoisted_2$3), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("box") + }, $options.getPTOptions("box")), [createBaseVNode("div", mergeProps({ + "class": _ctx.cx("icon") + }, $options.getPTOptions("icon")), null, 16)], 16)], 16, _hoisted_1$5); +} +__name(render$i, "render$i"); +script$j.render = render$i; +var script$i = { + name: "FilterIcon", + "extends": script$t +}; +function render$h(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + d: "M8.64708 14H5.35296C5.18981 13.9979 5.03395 13.9321 4.91858 13.8167C4.8032 13.7014 4.73745 13.5455 4.73531 13.3824V7L0.329431 0.98C0.259794 0.889466 0.217389 0.780968 0.20718 0.667208C0.19697 0.553448 0.219379 0.439133 0.271783 0.337647C0.324282 0.236453 0.403423 0.151519 0.500663 0.0920138C0.597903 0.0325088 0.709548 0.000692754 0.823548 0H13.1765C13.2905 0.000692754 13.4021 0.0325088 13.4994 0.0920138C13.5966 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7826 0.780968 13.7402 0.889466 13.6706 0.98L9.26472 7V13.3824C9.26259 13.5455 9.19683 13.7014 9.08146 13.8167C8.96609 13.9321 8.81022 13.9979 8.64708 14ZM5.97061 12.7647H8.02943V6.79412C8.02878 6.66289 8.07229 6.53527 8.15296 6.43177L11.9412 1.23529H2.05884L5.86355 6.43177C5.94422 6.53527 5.98773 6.66289 5.98708 6.79412L5.97061 12.7647Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$h, "render$h"); +script$i.render = render$h; +var script$h = { + name: "FilterSlashIcon", + "extends": script$t +}; +function render$g(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M13.4994 0.0920138C13.5967 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7827 0.780968 13.7403 0.889466 13.6707 0.98L11.406 4.06823C11.3099 4.19928 11.1656 4.28679 11.005 4.3115C10.8444 4.33621 10.6805 4.2961 10.5495 4.2C10.4184 4.1039 10.3309 3.95967 10.3062 3.79905C10.2815 3.63843 10.3216 3.47458 10.4177 3.34353L11.9412 1.23529H7.41184C7.24803 1.23529 7.09093 1.17022 6.97509 1.05439C6.85926 0.938558 6.79419 0.781457 6.79419 0.617647C6.79419 0.453837 6.85926 0.296736 6.97509 0.180905C7.09093 0.0650733 7.24803 0 7.41184 0H13.1765C13.2905 0.000692754 13.4022 0.0325088 13.4994 0.0920138ZM4.20008 0.181168H4.24126L13.2013 9.03411C13.3169 9.14992 13.3819 9.3069 13.3819 9.47058C13.3819 9.63426 13.3169 9.79124 13.2013 9.90705C13.1445 9.96517 13.0766 10.0112 13.0016 10.0423C12.9266 10.0735 12.846 10.0891 12.7648 10.0882C12.6836 10.0886 12.6032 10.0728 12.5283 10.0417C12.4533 10.0106 12.3853 9.96479 12.3283 9.90705L9.3142 6.92587L9.26479 6.99999V13.3823C9.26265 13.5455 9.19689 13.7014 9.08152 13.8167C8.96615 13.9321 8.81029 13.9979 8.64714 14H5.35302C5.18987 13.9979 5.03401 13.9321 4.91864 13.8167C4.80327 13.7014 4.73751 13.5455 4.73537 13.3823V6.99999L0.329492 1.02117C0.259855 0.930634 0.21745 0.822137 0.207241 0.708376C0.197031 0.594616 0.21944 0.480301 0.271844 0.378815C0.324343 0.277621 0.403484 0.192687 0.500724 0.133182C0.597964 0.073677 0.709609 0.041861 0.823609 0.0411682H3.86243C3.92448 0.0461551 3.9855 0.060022 4.04361 0.0823446C4.10037 0.10735 4.15311 0.140655 4.20008 0.181168ZM8.02949 6.79411C8.02884 6.66289 8.07235 6.53526 8.15302 6.43176L8.42478 6.05293L3.55773 1.23529H2.0589L5.84714 6.43176C5.92781 6.53526 5.97132 6.66289 5.97067 6.79411V12.7647H8.02949V6.79411Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$g, "render$g"); +script$h.render = render$g; +var script$g = { + name: "TrashIcon", + "extends": script$t +}; +function render$f(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + d: "M3.44802 13.9955H10.552C10.8056 14.0129 11.06 13.9797 11.3006 13.898C11.5412 13.8163 11.7632 13.6877 11.9537 13.5196C12.1442 13.3515 12.2995 13.1473 12.4104 12.9188C12.5213 12.6903 12.5858 12.442 12.6 12.1884V4.36041H13.4C13.5591 4.36041 13.7117 4.29722 13.8243 4.18476C13.9368 4.07229 14 3.91976 14 3.76071C14 3.60166 13.9368 3.44912 13.8243 3.33666C13.7117 3.22419 13.5591 3.16101 13.4 3.16101H12.0537C12.0203 3.1557 11.9863 3.15299 11.952 3.15299C11.9178 3.15299 11.8838 3.1557 11.8503 3.16101H11.2285C11.2421 3.10893 11.2487 3.05513 11.248 3.00106V1.80966C11.2171 1.30262 10.9871 0.828306 10.608 0.48989C10.229 0.151475 9.73159 -0.0236625 9.22402 0.00257442H4.77602C4.27251 -0.0171866 3.78126 0.160868 3.40746 0.498617C3.03365 0.836366 2.807 1.30697 2.77602 1.80966V3.00106C2.77602 3.0556 2.78346 3.10936 2.79776 3.16101H0.6C0.521207 3.16101 0.443185 3.17652 0.37039 3.20666C0.297595 3.2368 0.231451 3.28097 0.175736 3.33666C0.120021 3.39235 0.0758251 3.45846 0.0456722 3.53121C0.0155194 3.60397 0 3.68196 0 3.76071C0 3.83946 0.0155194 3.91744 0.0456722 3.9902C0.0758251 4.06296 0.120021 4.12907 0.175736 4.18476C0.231451 4.24045 0.297595 4.28462 0.37039 4.31476C0.443185 4.3449 0.521207 4.36041 0.6 4.36041H1.40002V12.1884C1.41426 12.442 1.47871 12.6903 1.58965 12.9188C1.7006 13.1473 1.85582 13.3515 2.04633 13.5196C2.23683 13.6877 2.45882 13.8163 2.69944 13.898C2.94005 13.9797 3.1945 14.0129 3.44802 13.9955ZM2.60002 4.36041H11.304V12.1884C11.304 12.5163 10.952 12.7961 10.504 12.7961H3.40002C2.97602 12.7961 2.60002 12.5163 2.60002 12.1884V4.36041ZM3.95429 3.16101C3.96859 3.10936 3.97602 3.0556 3.97602 3.00106V1.80966C3.97602 1.48183 4.33602 1.20197 4.77602 1.20197H9.24802C9.66403 1.20197 10.048 1.48183 10.048 1.80966V3.00106C10.0473 3.05515 10.054 3.10896 10.0678 3.16101H3.95429ZM5.57571 10.997C5.41731 10.995 5.26597 10.9311 5.15395 10.8191C5.04193 10.7071 4.97808 10.5558 4.97601 10.3973V6.77517C4.97601 6.61612 5.0392 6.46359 5.15166 6.35112C5.26413 6.23866 5.41666 6.17548 5.57571 6.17548C5.73476 6.17548 5.8873 6.23866 5.99976 6.35112C6.11223 6.46359 6.17541 6.61612 6.17541 6.77517V10.3894C6.17647 10.4688 6.16174 10.5476 6.13208 10.6213C6.10241 10.695 6.05841 10.762 6.00261 10.8186C5.94682 10.8751 5.88035 10.92 5.80707 10.9506C5.73378 10.9813 5.65514 10.9971 5.57571 10.997ZM7.99968 10.8214C8.11215 10.9339 8.26468 10.997 8.42373 10.997C8.58351 10.9949 8.73604 10.93 8.84828 10.8163C8.96052 10.7025 9.02345 10.5491 9.02343 10.3894V6.77517C9.02343 6.61612 8.96025 6.46359 8.84778 6.35112C8.73532 6.23866 8.58278 6.17548 8.42373 6.17548C8.26468 6.17548 8.11215 6.23866 7.99968 6.35112C7.88722 6.46359 7.82404 6.61612 7.82404 6.77517V10.3973C7.82404 10.5564 7.88722 10.7089 7.99968 10.8214Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$f, "render$f"); +script$g.render = render$f; +var script$f = { + name: "SortAltIcon", + "extends": script$t +}; +function render$e(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + d: "M5.64515 3.61291C5.47353 3.61291 5.30192 3.54968 5.16644 3.4142L3.38708 1.63484L1.60773 3.4142C1.34579 3.67613 0.912244 3.67613 0.650309 3.4142C0.388374 3.15226 0.388374 2.71871 0.650309 2.45678L2.90837 0.198712C3.17031 -0.0632236 3.60386 -0.0632236 3.86579 0.198712L6.12386 2.45678C6.38579 2.71871 6.38579 3.15226 6.12386 3.4142C5.98837 3.54968 5.81676 3.61291 5.64515 3.61291Z", + fill: "currentColor" + }, null, -1), createBaseVNode("path", { + d: "M3.38714 14C3.01681 14 2.70972 13.6929 2.70972 13.3226V0.677419C2.70972 0.307097 3.01681 0 3.38714 0C3.75746 0 4.06456 0.307097 4.06456 0.677419V13.3226C4.06456 13.6929 3.75746 14 3.38714 14Z", + fill: "currentColor" + }, null, -1), createBaseVNode("path", { + d: "M10.6129 14C10.4413 14 10.2697 13.9368 10.1342 13.8013L7.87611 11.5432C7.61418 11.2813 7.61418 10.8477 7.87611 10.5858C8.13805 10.3239 8.5716 10.3239 8.83353 10.5858L10.6129 12.3652L12.3922 10.5858C12.6542 10.3239 13.0877 10.3239 13.3497 10.5858C13.6116 10.8477 13.6116 11.2813 13.3497 11.5432L11.0916 13.8013C10.9561 13.9368 10.7845 14 10.6129 14Z", + fill: "currentColor" + }, null, -1), createBaseVNode("path", { + d: "M10.6129 14C10.2426 14 9.93552 13.6929 9.93552 13.3226V0.677419C9.93552 0.307097 10.2426 0 10.6129 0C10.9833 0 11.2904 0.307097 11.2904 0.677419V13.3226C11.2904 13.6929 10.9832 14 10.6129 14Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$e, "render$e"); +script$f.render = render$e; +var script$e = { + name: "SortAmountDownIcon", + "extends": script$t +}; +function render$d(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + d: "M4.93953 10.5858L3.83759 11.6877V0.677419C3.83759 0.307097 3.53049 0 3.16017 0C2.78985 0 2.48275 0.307097 2.48275 0.677419V11.6877L1.38082 10.5858C1.11888 10.3239 0.685331 10.3239 0.423396 10.5858C0.16146 10.8477 0.16146 11.2813 0.423396 11.5432L2.68146 13.8013C2.74469 13.8645 2.81694 13.9097 2.89823 13.9458C2.97952 13.9819 3.06985 14 3.16017 14C3.25049 14 3.33178 13.9819 3.42211 13.9458C3.5034 13.9097 3.57565 13.8645 3.63888 13.8013L5.89694 11.5432C6.15888 11.2813 6.15888 10.8477 5.89694 10.5858C5.63501 10.3239 5.20146 10.3239 4.93953 10.5858ZM13.0957 0H7.22468C6.85436 0 6.54726 0.307097 6.54726 0.677419C6.54726 1.04774 6.85436 1.35484 7.22468 1.35484H13.0957C13.466 1.35484 13.7731 1.04774 13.7731 0.677419C13.7731 0.307097 13.466 0 13.0957 0ZM7.22468 5.41935H9.48275C9.85307 5.41935 10.1602 5.72645 10.1602 6.09677C10.1602 6.4671 9.85307 6.77419 9.48275 6.77419H7.22468C6.85436 6.77419 6.54726 6.4671 6.54726 6.09677C6.54726 5.72645 6.85436 5.41935 7.22468 5.41935ZM7.6763 8.12903H7.22468C6.85436 8.12903 6.54726 8.43613 6.54726 8.80645C6.54726 9.17677 6.85436 9.48387 7.22468 9.48387H7.6763C8.04662 9.48387 8.35372 9.17677 8.35372 8.80645C8.35372 8.43613 8.04662 8.12903 7.6763 8.12903ZM7.22468 2.70968H11.2892C11.6595 2.70968 11.9666 3.01677 11.9666 3.3871C11.9666 3.75742 11.6595 4.06452 11.2892 4.06452H7.22468C6.85436 4.06452 6.54726 3.75742 6.54726 3.3871C6.54726 3.01677 6.85436 2.70968 7.22468 2.70968Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$d, "render$d"); +script$e.render = render$d; +var script$d = { + name: "SortAmountUpAltIcon", + "extends": script$t +}; +function render$c(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("svg", mergeProps({ + width: "14", + height: "14", + viewBox: "0 0 14 14", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { + d: "M3.63435 0.19871C3.57113 0.135484 3.49887 0.0903226 3.41758 0.0541935C3.255 -0.0180645 3.06532 -0.0180645 2.90274 0.0541935C2.82145 0.0903226 2.74919 0.135484 2.68597 0.19871L0.427901 2.45677C0.165965 2.71871 0.165965 3.15226 0.427901 3.41419C0.689836 3.67613 1.12338 3.67613 1.38532 3.41419L2.48726 2.31226V13.3226C2.48726 13.6929 2.79435 14 3.16467 14C3.535 14 3.84209 13.6929 3.84209 13.3226V2.31226L4.94403 3.41419C5.07951 3.54968 5.25113 3.6129 5.42274 3.6129C5.59435 3.6129 5.76597 3.54968 5.90145 3.41419C6.16338 3.15226 6.16338 2.71871 5.90145 2.45677L3.64338 0.19871H3.63435ZM13.7685 13.3226C13.7685 12.9523 13.4615 12.6452 13.0911 12.6452H7.22016C6.84984 12.6452 6.54274 12.9523 6.54274 13.3226C6.54274 13.6929 6.84984 14 7.22016 14H13.0911C13.4615 14 13.7685 13.6929 13.7685 13.3226ZM7.22016 8.58064C6.84984 8.58064 6.54274 8.27355 6.54274 7.90323C6.54274 7.5329 6.84984 7.22581 7.22016 7.22581H9.47823C9.84855 7.22581 10.1556 7.5329 10.1556 7.90323C10.1556 8.27355 9.84855 8.58064 9.47823 8.58064H7.22016ZM7.22016 5.87097H7.67177C8.0421 5.87097 8.34919 5.56387 8.34919 5.19355C8.34919 4.82323 8.0421 4.51613 7.67177 4.51613H7.22016C6.84984 4.51613 6.54274 4.82323 6.54274 5.19355C6.54274 5.56387 6.84984 5.87097 7.22016 5.87097ZM11.2847 11.2903H7.22016C6.84984 11.2903 6.54274 10.9832 6.54274 10.6129C6.54274 10.2426 6.84984 9.93548 7.22016 9.93548H11.2847C11.655 9.93548 11.9621 10.2426 11.9621 10.6129C11.9621 10.9832 11.655 11.2903 11.2847 11.2903Z", + fill: "currentColor" + }, null, -1)]), 16); +} +__name(render$c, "render$c"); +script$d.render = render$c; +var script$c = { + name: "BaseDataTable", + "extends": script$s, + props: { + value: { + type: Array, + "default": null + }, + dataKey: { + type: [String, Function], + "default": null + }, + rows: { + type: Number, + "default": 0 + }, + first: { + type: Number, + "default": 0 + }, + totalRecords: { + type: Number, + "default": 0 + }, + paginator: { + type: Boolean, + "default": false + }, + paginatorPosition: { + type: String, + "default": "bottom" + }, + alwaysShowPaginator: { + type: Boolean, + "default": true + }, + paginatorTemplate: { + type: [Object, String], + "default": "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown" + }, + pageLinkSize: { + type: Number, + "default": 5 + }, + rowsPerPageOptions: { + type: Array, + "default": null + }, + currentPageReportTemplate: { + type: String, + "default": "({currentPage} of {totalPages})" + }, + lazy: { + type: Boolean, + "default": false + }, + loading: { + type: Boolean, + "default": false + }, + loadingIcon: { + type: String, + "default": void 0 + }, + sortField: { + type: [String, Function], + "default": null + }, + sortOrder: { + type: Number, + "default": null + }, + defaultSortOrder: { + type: Number, + "default": 1 + }, + nullSortOrder: { + type: Number, + "default": 1 + }, + multiSortMeta: { + type: Array, + "default": null + }, + sortMode: { + type: String, + "default": "single" + }, + removableSort: { + type: Boolean, + "default": false + }, + filters: { + type: Object, + "default": null + }, + filterDisplay: { + type: String, + "default": null + }, + globalFilterFields: { + type: Array, + "default": null + }, + filterLocale: { + type: String, + "default": void 0 + }, + selection: { + type: [Array, Object], + "default": null + }, + selectionMode: { + type: String, + "default": null + }, + compareSelectionBy: { + type: String, + "default": "deepEquals" + }, + metaKeySelection: { + type: Boolean, + "default": false + }, + contextMenu: { + type: Boolean, + "default": false + }, + contextMenuSelection: { + type: Object, + "default": null + }, + selectAll: { + type: Boolean, + "default": null + }, + rowHover: { + type: Boolean, + "default": false + }, + csvSeparator: { + type: String, + "default": "," + }, + exportFilename: { + type: String, + "default": "download" + }, + exportFunction: { + type: Function, + "default": null + }, + resizableColumns: { + type: Boolean, + "default": false + }, + columnResizeMode: { + type: String, + "default": "fit" + }, + reorderableColumns: { + type: Boolean, + "default": false + }, + expandedRows: { + type: [Array, Object], + "default": null + }, + expandedRowIcon: { + type: String, + "default": void 0 + }, + collapsedRowIcon: { + type: String, + "default": void 0 + }, + rowGroupMode: { + type: String, + "default": null + }, + groupRowsBy: { + type: [Array, String, Function], + "default": null + }, + expandableRowGroups: { + type: Boolean, + "default": false + }, + expandedRowGroups: { + type: Array, + "default": null + }, + stateStorage: { + type: String, + "default": "session" + }, + stateKey: { + type: String, + "default": null + }, + editMode: { + type: String, + "default": null + }, + editingRows: { + type: Array, + "default": null + }, + rowClass: { + type: Function, + "default": null + }, + rowStyle: { + type: Function, + "default": null + }, + scrollable: { + type: Boolean, + "default": false + }, + virtualScrollerOptions: { + type: Object, + "default": null + }, + scrollHeight: { + type: String, + "default": null + }, + frozenValue: { + type: Array, + "default": null + }, + breakpoint: { + type: String, + "default": "960px" + }, + showHeaders: { + type: Boolean, + "default": true + }, + showGridlines: { + type: Boolean, + "default": false + }, + stripedRows: { + type: Boolean, + "default": false + }, + highlightOnSelect: { + type: Boolean, + "default": false + }, + size: { + type: String, + "default": null + }, + tableStyle: { + type: null, + "default": null + }, + tableClass: { + type: [String, Object], + "default": null + }, + tableProps: { + type: Object, + "default": null + }, + filterInputProps: { + type: null, + "default": null + }, + filterButtonProps: { + type: Object, + "default": /* @__PURE__ */ __name(function _default2() { + return { + filter: { + severity: "secondary", + text: true, + rounded: true + }, + inline: { + clear: { + severity: "secondary", + text: true, + rounded: true + } + }, + popover: { + addRule: { + severity: "info", + text: true, + size: "small" + }, + removeRule: { + severity: "danger", + text: true, + size: "small" + }, + apply: { + size: "small" + }, + clear: { + outlined: true, + size: "small" + } + } + }; + }, "_default") + }, + editButtonProps: { + type: Object, + "default": /* @__PURE__ */ __name(function _default3() { + return { + init: { + severity: "secondary", + text: true, + rounded: true + }, + save: { + severity: "secondary", + text: true, + rounded: true + }, + cancel: { + severity: "secondary", + text: true, + rounded: true + } + }; + }, "_default") + } + }, + style: DataTableStyle, + provide: /* @__PURE__ */ __name(function provide4() { + return { + $pcDataTable: this, + $parentInstance: this + }; + }, "provide") +}; +var script$b = { + name: "RowCheckbox", + hostName: "DataTable", + "extends": script$s, + emits: ["change"], + props: { + value: null, + checked: null, + column: null, + rowCheckboxIconTemplate: { + type: Function, + "default": null + }, + index: { + type: Number, + "default": null + } + }, + methods: { + getColumnPT: /* @__PURE__ */ __name(function getColumnPT(key) { + var columnMetaData = { + props: this.column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index: this.index, + checked: this.checked, + disabled: this.$attrs.disabled + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp() { + return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; + }, "getColumnProp"), + onChange: /* @__PURE__ */ __name(function onChange5(event2) { + if (!this.$attrs.disabled) { + this.$emit("change", { + originalEvent: event2, + data: this.value + }); + } + }, "onChange") + }, + computed: { + checkboxAriaLabel: /* @__PURE__ */ __name(function checkboxAriaLabel() { + return this.$primevue.config.locale.aria ? this.checked ? this.$primevue.config.locale.aria.selectRow : this.$primevue.config.locale.aria.unselectRow : void 0; + }, "checkboxAriaLabel") + }, + components: { + CheckIcon: script$y, + Checkbox: script$z + } +}; +function render$b(_ctx, _cache, $props, $setup, $data, $options) { + var _component_CheckIcon = resolveComponent("CheckIcon"); + var _component_Checkbox = resolveComponent("Checkbox"); + return openBlock(), createBlock(_component_Checkbox, { + modelValue: $props.checked, + binary: true, + disabled: _ctx.$attrs.disabled, + "aria-label": $options.checkboxAriaLabel, + onChange: $options.onChange, + unstyled: _ctx.unstyled, + pt: $options.getColumnPT("pcRowCheckbox") + }, { + icon: withCtx(function(slotProps) { + return [$props.rowCheckboxIconTemplate ? (openBlock(), createBlock(resolveDynamicComponent($props.rowCheckboxIconTemplate), { + key: 0, + checked: slotProps.checked, + "class": normalizeClass(slotProps["class"]) + }, null, 8, ["checked", "class"])) : !$props.rowCheckboxIconTemplate && slotProps.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({ + key: 1, + "class": slotProps["class"] + }, $options.getColumnPT("pcRowCheckbox")["icon"]), null, 16, ["class"])) : createCommentVNode("", true)]; + }), + _: 1 + }, 8, ["modelValue", "disabled", "aria-label", "onChange", "unstyled", "pt"]); +} +__name(render$b, "render$b"); +script$b.render = render$b; +var script$a = { + name: "RowRadioButton", + hostName: "DataTable", + "extends": script$s, + emits: ["change"], + props: { + value: null, + checked: null, + name: null, + column: null, + index: { + type: Number, + "default": null + } + }, + methods: { + getColumnPT: /* @__PURE__ */ __name(function getColumnPT2(key) { + var columnMetaData = { + props: this.column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index: this.index, + checked: this.checked, + disabled: this.$attrs.disabled + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp2() { + return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; + }, "getColumnProp"), + onChange: /* @__PURE__ */ __name(function onChange6(event2) { + if (!this.$attrs.disabled) { + this.$emit("change", { + originalEvent: event2, + data: this.value + }); + } + }, "onChange") + }, + components: { + RadioButton: script$j + } +}; +function render$a(_ctx, _cache, $props, $setup, $data, $options) { + var _component_RadioButton = resolveComponent("RadioButton"); + return openBlock(), createBlock(_component_RadioButton, { + modelValue: $props.checked, + binary: true, + disabled: _ctx.$attrs.disabled, + name: $props.name, + onChange: $options.onChange, + unstyled: _ctx.unstyled, + pt: $options.getColumnPT("pcRowRadiobutton") + }, null, 8, ["modelValue", "disabled", "name", "onChange", "unstyled", "pt"]); +} +__name(render$a, "render$a"); +script$a.render = render$a; +var script$9 = { + name: "BodyCell", + hostName: "DataTable", + "extends": script$s, + emits: ["cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "row-edit-init", "row-edit-save", "row-edit-cancel", "row-toggle", "radio-change", "checkbox-change", "editing-meta-change"], + props: { + rowData: { + type: Object, + "default": null + }, + column: { + type: Object, + "default": null + }, + frozenRow: { + type: Boolean, + "default": false + }, + rowIndex: { + type: Number, + "default": null + }, + index: { + type: Number, + "default": null + }, + isRowExpanded: { + type: Boolean, + "default": false + }, + selected: { + type: Boolean, + "default": false + }, + editing: { + type: Boolean, + "default": false + }, + editingMeta: { + type: Object, + "default": null + }, + editMode: { + type: String, + "default": null + }, + virtualScrollerContentProps: { + type: Object, + "default": null + }, + ariaControls: { + type: String, + "default": null + }, + name: { + type: String, + "default": null + }, + expandedRowIcon: { + type: String, + "default": null + }, + collapsedRowIcon: { + type: String, + "default": null + }, + editButtonProps: { + type: Object, + "default": null + } + }, + documentEditListener: null, + selfClick: false, + overlayEventListener: null, + data: /* @__PURE__ */ __name(function data3() { + return { + d_editing: this.editing, + styleObject: {} + }; + }, "data"), + watch: { + editing: /* @__PURE__ */ __name(function editing(newValue) { + this.d_editing = newValue; + }, "editing"), + "$data.d_editing": /* @__PURE__ */ __name(function $dataD_editing(newValue) { + this.$emit("editing-meta-change", { + data: this.rowData, + field: this.field || "field_".concat(this.index), + index: this.rowIndex, + editing: newValue + }); + }, "$dataD_editing") + }, + mounted: /* @__PURE__ */ __name(function mounted3() { + if (this.columnProp("frozen")) { + this.updateStickyPosition(); + } + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated() { + var _this = this; + if (this.columnProp("frozen")) { + this.updateStickyPosition(); + } + if (this.d_editing && (this.editMode === "cell" || this.editMode === "row" && this.columnProp("rowEditor"))) { + setTimeout(function() { + var focusableEl = getFirstFocusableElement(_this.$el); + focusableEl && focusableEl.focus(); + }, 1); + } + }, "updated"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() { + if (this.overlayEventListener) { + OverlayEventBus.off("overlay-click", this.overlayEventListener); + this.overlayEventListener = null; + } + }, "beforeUnmount"), + methods: { + columnProp: /* @__PURE__ */ __name(function columnProp(prop) { + return getVNodeProp(this.column, prop); + }, "columnProp"), + getColumnPT: /* @__PURE__ */ __name(function getColumnPT3(key) { + var _this$$parentInstance, _this$$parentInstance2; + var columnMetaData = { + props: this.column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index: this.index, + size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size, + showGridlines: (_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp3() { + return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; + }, "getColumnProp"), + resolveFieldData: /* @__PURE__ */ __name(function resolveFieldData$1() { + return resolveFieldData(this.rowData, this.field); + }, "resolveFieldData$1"), + toggleRow: /* @__PURE__ */ __name(function toggleRow(event2) { + this.$emit("row-toggle", { + originalEvent: event2, + data: this.rowData + }); + }, "toggleRow"), + toggleRowWithRadio: /* @__PURE__ */ __name(function toggleRowWithRadio(event2, index) { + this.$emit("radio-change", { + originalEvent: event2.originalEvent, + index, + data: event2.data + }); + }, "toggleRowWithRadio"), + toggleRowWithCheckbox: /* @__PURE__ */ __name(function toggleRowWithCheckbox(event2, index) { + this.$emit("checkbox-change", { + originalEvent: event2.originalEvent, + index, + data: event2.data + }); + }, "toggleRowWithCheckbox"), + isEditable: /* @__PURE__ */ __name(function isEditable() { + return this.column.children && this.column.children.editor != null; + }, "isEditable"), + bindDocumentEditListener: /* @__PURE__ */ __name(function bindDocumentEditListener() { + var _this2 = this; + if (!this.documentEditListener) { + this.documentEditListener = function(event2) { + if (!_this2.selfClick) { + _this2.completeEdit(event2, "outside"); + } + _this2.selfClick = false; + }; + document.addEventListener("click", this.documentEditListener); + } + }, "bindDocumentEditListener"), + unbindDocumentEditListener: /* @__PURE__ */ __name(function unbindDocumentEditListener() { + if (this.documentEditListener) { + document.removeEventListener("click", this.documentEditListener); + this.documentEditListener = null; + this.selfClick = false; + } + }, "unbindDocumentEditListener"), + switchCellToViewMode: /* @__PURE__ */ __name(function switchCellToViewMode() { + this.d_editing = false; + this.unbindDocumentEditListener(); + OverlayEventBus.off("overlay-click", this.overlayEventListener); + this.overlayEventListener = null; + }, "switchCellToViewMode"), + onClick: /* @__PURE__ */ __name(function onClick(event2) { + var _this3 = this; + if (this.editMode === "cell" && this.isEditable()) { + this.selfClick = true; + if (!this.d_editing) { + this.d_editing = true; + this.bindDocumentEditListener(); + this.$emit("cell-edit-init", { + originalEvent: event2, + data: this.rowData, + field: this.field, + index: this.rowIndex + }); + this.overlayEventListener = function(e) { + if (_this3.$el && _this3.$el.contains(e.target)) { + _this3.selfClick = true; + } + }; + OverlayEventBus.on("overlay-click", this.overlayEventListener); + } + } + }, "onClick"), + completeEdit: /* @__PURE__ */ __name(function completeEdit(event2, type) { + var completeEvent = { + originalEvent: event2, + data: this.rowData, + newData: this.editingRowData, + value: this.rowData[this.field], + newValue: this.editingRowData[this.field], + field: this.field, + index: this.rowIndex, + type, + defaultPrevented: false, + preventDefault: /* @__PURE__ */ __name(function preventDefault() { + this.defaultPrevented = true; + }, "preventDefault") + }; + this.$emit("cell-edit-complete", completeEvent); + if (!completeEvent.defaultPrevented) { + this.switchCellToViewMode(); + } + }, "completeEdit"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown(event2) { + if (this.editMode === "cell") { + switch (event2.code) { + case "Enter": + case "NumpadEnter": + this.completeEdit(event2, "enter"); + break; + case "Escape": + this.switchCellToViewMode(); + this.$emit("cell-edit-cancel", { + originalEvent: event2, + data: this.rowData, + field: this.field, + index: this.rowIndex + }); + break; + case "Tab": + this.completeEdit(event2, "tab"); + if (event2.shiftKey) this.moveToPreviousCell(event2); + else this.moveToNextCell(event2); + break; + } + } + }, "onKeyDown"), + moveToPreviousCell: /* @__PURE__ */ __name(function moveToPreviousCell(event2) { + var currentCell = this.findCell(event2.target); + var targetCell = this.findPreviousEditableColumn(currentCell); + if (targetCell) { + invokeElementMethod(targetCell, "click"); + event2.preventDefault(); + } + }, "moveToPreviousCell"), + moveToNextCell: /* @__PURE__ */ __name(function moveToNextCell(event2) { + var currentCell = this.findCell(event2.target); + var targetCell = this.findNextEditableColumn(currentCell); + if (targetCell) { + invokeElementMethod(targetCell, "click"); + event2.preventDefault(); + } + }, "moveToNextCell"), + findCell: /* @__PURE__ */ __name(function findCell(element) { + if (element) { + var cell = element; + while (cell && !getAttribute(cell, "data-p-cell-editing")) { + cell = cell.parentElement; + } + return cell; + } else { + return null; + } + }, "findCell"), + findPreviousEditableColumn: /* @__PURE__ */ __name(function findPreviousEditableColumn(cell) { + var prevCell = cell.previousElementSibling; + if (!prevCell) { + var previousRow = cell.parentElement.previousElementSibling; + if (previousRow) { + prevCell = previousRow.lastElementChild; + } + } + if (prevCell) { + if (getAttribute(prevCell, "data-p-editable-column")) return prevCell; + else return this.findPreviousEditableColumn(prevCell); + } else { + return null; + } + }, "findPreviousEditableColumn"), + findNextEditableColumn: /* @__PURE__ */ __name(function findNextEditableColumn(cell) { + var nextCell = cell.nextElementSibling; + if (!nextCell) { + var nextRow = cell.parentElement.nextElementSibling; + if (nextRow) { + nextCell = nextRow.firstElementChild; + } + } + if (nextCell) { + if (getAttribute(nextCell, "data-p-editable-column")) return nextCell; + else return this.findNextEditableColumn(nextCell); + } else { + return null; + } + }, "findNextEditableColumn"), + onRowEditInit: /* @__PURE__ */ __name(function onRowEditInit(event2) { + this.$emit("row-edit-init", { + originalEvent: event2, + data: this.rowData, + newData: this.editingRowData, + field: this.field, + index: this.rowIndex + }); + }, "onRowEditInit"), + onRowEditSave: /* @__PURE__ */ __name(function onRowEditSave(event2) { + this.$emit("row-edit-save", { + originalEvent: event2, + data: this.rowData, + newData: this.editingRowData, + field: this.field, + index: this.rowIndex + }); + }, "onRowEditSave"), + onRowEditCancel: /* @__PURE__ */ __name(function onRowEditCancel(event2) { + this.$emit("row-edit-cancel", { + originalEvent: event2, + data: this.rowData, + newData: this.editingRowData, + field: this.field, + index: this.rowIndex + }); + }, "onRowEditCancel"), + editorInitCallback: /* @__PURE__ */ __name(function editorInitCallback(event2) { + this.$emit("row-edit-init", { + originalEvent: event2, + data: this.rowData, + newData: this.editingRowData, + field: this.field, + index: this.rowIndex + }); + }, "editorInitCallback"), + editorSaveCallback: /* @__PURE__ */ __name(function editorSaveCallback(event2) { + if (this.editMode === "row") { + this.$emit("row-edit-save", { + originalEvent: event2, + data: this.rowData, + newData: this.editingRowData, + field: this.field, + index: this.rowIndex + }); + } else { + this.completeEdit(event2, "enter"); + } + }, "editorSaveCallback"), + editorCancelCallback: /* @__PURE__ */ __name(function editorCancelCallback(event2) { + if (this.editMode === "row") { + this.$emit("row-edit-cancel", { + originalEvent: event2, + data: this.rowData, + newData: this.editingRowData, + field: this.field, + index: this.rowIndex + }); + } else { + this.switchCellToViewMode(); + this.$emit("cell-edit-cancel", { + originalEvent: event2, + data: this.rowData, + field: this.field, + index: this.rowIndex + }); + } + }, "editorCancelCallback"), + updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition() { + if (this.columnProp("frozen")) { + var align = this.columnProp("alignFrozen"); + var isRTL = this.$parentInstance.$parentInstance.isRTL; + if (align === "right") { + var pos = 0; + var next2 = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]'); + if (next2) { + pos = getOuterWidth(next2) + parseFloat(next2.style.right || 0); + } + if (isRTL) { + this.styleObject.left = pos + "px"; + } else { + this.styleObject.right = pos + "px"; + } + } else { + var _pos = 0; + var prev2 = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]'); + if (prev2) { + _pos = getOuterWidth(prev2) + parseFloat(prev2.style.left || 0); + } + if (isRTL) { + this.styleObject.right = _pos + "px"; + } else { + this.styleObject.left = _pos + "px"; + } + } + } + }, "updateStickyPosition"), + getVirtualScrollerProp: /* @__PURE__ */ __name(function getVirtualScrollerProp(option) { + return this.virtualScrollerContentProps ? this.virtualScrollerContentProps[option] : null; + }, "getVirtualScrollerProp") + }, + computed: { + editingRowData: /* @__PURE__ */ __name(function editingRowData() { + return this.editingMeta[this.rowIndex] ? this.editingMeta[this.rowIndex].data : this.rowData; + }, "editingRowData"), + field: /* @__PURE__ */ __name(function field() { + return this.columnProp("field"); + }, "field"), + containerClass: /* @__PURE__ */ __name(function containerClass() { + return [this.columnProp("bodyClass"), this.columnProp("class"), this.cx("bodyCell")]; + }, "containerClass"), + containerStyle: /* @__PURE__ */ __name(function containerStyle() { + var bodyStyle = this.columnProp("bodyStyle"); + var columnStyle = this.columnProp("style"); + return this.columnProp("frozen") ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle]; + }, "containerStyle"), + loading: /* @__PURE__ */ __name(function loading() { + return this.getVirtualScrollerProp("loading"); + }, "loading"), + loadingOptions: /* @__PURE__ */ __name(function loadingOptions() { + var getLoaderOptions = this.getVirtualScrollerProp("getLoaderOptions"); + return getLoaderOptions && getLoaderOptions(this.rowIndex, { + cellIndex: this.index, + cellFirst: this.index === 0, + cellLast: this.index === this.getVirtualScrollerProp("columns").length - 1, + cellEven: this.index % 2 === 0, + cellOdd: this.index % 2 !== 0, + column: this.column, + field: this.field + }); + }, "loadingOptions"), + expandButtonAriaLabel: /* @__PURE__ */ __name(function expandButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.isRowExpanded ? this.$primevue.config.locale.aria.expandRow : this.$primevue.config.locale.aria.collapseRow : void 0; + }, "expandButtonAriaLabel"), + initButtonAriaLabel: /* @__PURE__ */ __name(function initButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.editRow : void 0; + }, "initButtonAriaLabel"), + saveButtonAriaLabel: /* @__PURE__ */ __name(function saveButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.saveEdit : void 0; + }, "saveButtonAriaLabel"), + cancelButtonAriaLabel: /* @__PURE__ */ __name(function cancelButtonAriaLabel() { + return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.cancelEdit : void 0; + }, "cancelButtonAriaLabel") + }, + components: { + DTRadioButton: script$a, + DTCheckbox: script$b, +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js + Button: script$A, + ChevronDownIcon: script$B, + ChevronRightIcon: script$C, + BarsIcon: script$D, + PencilIcon: script$l, + CheckIcon: script$y, + TimesIcon: script$E +======== + Button: script$z, + ChevronDownIcon: script$A, + ChevronRightIcon: script$B, + BarsIcon: script$C, + PencilIcon: script$k, + CheckIcon: script$x, + TimesIcon: script$D +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js + }, + directives: { + ripple: Ripple + } +}; +function _typeof$a(o) { + "@babel/helpers - typeof"; + return _typeof$a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$a(o); +} +__name(_typeof$a, "_typeof$a"); +function ownKeys$a(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$a, "ownKeys$a"); +function _objectSpread$a(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$a(Object(t), true).forEach(function(r2) { + _defineProperty$a(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$a, "_objectSpread$a"); +function _defineProperty$a(e, r, t) { + return (r = _toPropertyKey$a(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$a, "_defineProperty$a"); +function _toPropertyKey$a(t) { + var i = _toPrimitive$a(t, "string"); + return "symbol" == _typeof$a(i) ? i : i + ""; +} +__name(_toPropertyKey$a, "_toPropertyKey$a"); +function _toPrimitive$a(t, r) { + if ("object" != _typeof$a(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$a(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$a, "_toPrimitive$a"); +var _hoisted_1$4 = ["colspan", "rowspan", "data-p-selection-column", "data-p-editable-column", "data-p-cell-editing", "data-p-frozen-column"]; +var _hoisted_2$2 = ["aria-expanded", "aria-controls", "aria-label"]; +function render$9(_ctx, _cache, $props, $setup, $data, $options) { + var _component_DTRadioButton = resolveComponent("DTRadioButton"); + var _component_DTCheckbox = resolveComponent("DTCheckbox"); + var _component_BarsIcon = resolveComponent("BarsIcon"); + var _component_ChevronDownIcon = resolveComponent("ChevronDownIcon"); + var _component_ChevronRightIcon = resolveComponent("ChevronRightIcon"); + var _component_Button = resolveComponent("Button"); + var _directive_ripple = resolveDirective("ripple"); + return $options.loading ? (openBlock(), createElementBlock("td", mergeProps({ + key: 0, + style: $options.containerStyle, + "class": $options.containerClass, + role: "cell" + }, _objectSpread$a(_objectSpread$a({}, $options.getColumnPT("root")), $options.getColumnPT("bodyCell"))), [(openBlock(), createBlock(resolveDynamicComponent($props.column.children.loading), { + data: $props.rowData, + column: $props.column, + field: $options.field, + index: $props.rowIndex, + frozenRow: $props.frozenRow, + loadingOptions: $options.loadingOptions + }, null, 8, ["data", "column", "field", "index", "frozenRow", "loadingOptions"]))], 16)) : (openBlock(), createElementBlock("td", mergeProps({ + key: 1, + style: $options.containerStyle, + "class": $options.containerClass, + colspan: $options.columnProp("colspan"), + rowspan: $options.columnProp("rowspan"), + onClick: _cache[3] || (_cache[3] = function() { + return $options.onClick && $options.onClick.apply($options, arguments); + }), + onKeydown: _cache[4] || (_cache[4] = function() { + return $options.onKeyDown && $options.onKeyDown.apply($options, arguments); + }), + role: "cell" + }, _objectSpread$a(_objectSpread$a({}, $options.getColumnPT("root")), $options.getColumnPT("bodyCell")), { + "data-p-selection-column": $options.columnProp("selectionMode") != null, + "data-p-editable-column": $options.isEditable(), + "data-p-cell-editing": $data.d_editing, + "data-p-frozen-column": $options.columnProp("frozen") + }), [$props.column.children && $props.column.children.body && !$data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.body), { + key: 0, + data: $props.rowData, + column: $props.column, + field: $options.field, + index: $props.rowIndex, + frozenRow: $props.frozenRow, + editorInitCallback: $options.editorInitCallback, + rowTogglerCallback: $options.toggleRow + }, null, 8, ["data", "column", "field", "index", "frozenRow", "editorInitCallback", "rowTogglerCallback"])) : $props.column.children && $props.column.children.editor && $data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.editor), { + key: 1, + data: $options.editingRowData, + column: $props.column, + field: $options.field, + index: $props.rowIndex, + frozenRow: $props.frozenRow, + editorSaveCallback: $options.editorSaveCallback, + editorCancelCallback: $options.editorCancelCallback + }, null, 8, ["data", "column", "field", "index", "frozenRow", "editorSaveCallback", "editorCancelCallback"])) : $props.column.children && $props.column.children.body && !$props.column.children.editor && $data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.body), { + key: 2, + data: $options.editingRowData, + column: $props.column, + field: $options.field, + index: $props.rowIndex, + frozenRow: $props.frozenRow + }, null, 8, ["data", "column", "field", "index", "frozenRow"])) : $options.columnProp("selectionMode") ? (openBlock(), createElementBlock(Fragment, { + key: 3 + }, [$options.columnProp("selectionMode") === "single" ? (openBlock(), createBlock(_component_DTRadioButton, { + key: 0, + value: $props.rowData, + name: $props.name, + checked: $props.selected, + onChange: _cache[0] || (_cache[0] = function($event) { + return $options.toggleRowWithRadio($event, $props.rowIndex); + }), + column: $props.column, + index: $props.index, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["value", "name", "checked", "column", "index", "unstyled", "pt"])) : $options.columnProp("selectionMode") === "multiple" ? (openBlock(), createBlock(_component_DTCheckbox, { + key: 1, + value: $props.rowData, + checked: $props.selected, + rowCheckboxIconTemplate: $props.column.children && $props.column.children.rowcheckboxicon, + "aria-selected": $props.selected ? true : void 0, + onChange: _cache[1] || (_cache[1] = function($event) { + return $options.toggleRowWithCheckbox($event, $props.rowIndex); + }), + column: $props.column, + index: $props.index, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["value", "checked", "rowCheckboxIconTemplate", "aria-selected", "column", "index", "unstyled", "pt"])) : createCommentVNode("", true)], 64)) : $options.columnProp("rowReorder") ? (openBlock(), createElementBlock(Fragment, { + key: 4 + }, [$props.column.children && $props.column.children.rowreordericon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowreordericon), { + key: 0, + "class": normalizeClass(_ctx.cx("reorderableRowHandle")) + }, null, 8, ["class"])) : $options.columnProp("rowReorderIcon") ? (openBlock(), createElementBlock("i", mergeProps({ + key: 1, + "class": [_ctx.cx("reorderableRowHandle"), $options.columnProp("rowReorderIcon")] + }, $options.getColumnPT("reorderableRowHandle")), null, 16)) : (openBlock(), createBlock(_component_BarsIcon, mergeProps({ + key: 2, + "class": _ctx.cx("reorderableRowHandle") + }, $options.getColumnPT("reorderableRowHandle")), null, 16, ["class"]))], 64)) : $options.columnProp("expander") ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ + key: 5, + "class": _ctx.cx("rowToggleButton"), + type: "button", + "aria-expanded": $props.isRowExpanded, + "aria-controls": $props.ariaControls, + "aria-label": $options.expandButtonAriaLabel, + onClick: _cache[2] || (_cache[2] = function() { + return $options.toggleRow && $options.toggleRow.apply($options, arguments); + }) + }, $options.getColumnPT("rowToggleButton"), { + "data-pc-group-section": "rowactionbutton" + }), [$props.column.children && $props.column.children.rowtogglericon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowtogglericon), { + key: 0, + "class": normalizeClass(_ctx.cx("rowToggleIcon")), + rowExpanded: $props.isRowExpanded + }, null, 8, ["class", "rowExpanded"])) : (openBlock(), createElementBlock(Fragment, { + key: 1 + }, [$props.isRowExpanded && $props.expandedRowIcon ? (openBlock(), createElementBlock("span", { + key: 0, + "class": normalizeClass([_ctx.cx("rowToggleIcon"), $props.expandedRowIcon]) + }, null, 2)) : $props.isRowExpanded && !$props.expandedRowIcon ? (openBlock(), createBlock(_component_ChevronDownIcon, mergeProps({ + key: 1, + "class": _ctx.cx("rowToggleIcon") + }, $options.getColumnPT("rowToggleIcon")), null, 16, ["class"])) : !$props.isRowExpanded && $props.collapsedRowIcon ? (openBlock(), createElementBlock("span", { + key: 2, + "class": normalizeClass([_ctx.cx("rowToggleIcon"), $props.collapsedRowIcon]) + }, null, 2)) : !$props.isRowExpanded && !$props.collapsedRowIcon ? (openBlock(), createBlock(_component_ChevronRightIcon, mergeProps({ + key: 3, + "class": _ctx.cx("rowToggleIcon") + }, $options.getColumnPT("rowToggleIcon")), null, 16, ["class"])) : createCommentVNode("", true)], 64))], 16, _hoisted_2$2)), [[_directive_ripple]]) : $props.editMode === "row" && $options.columnProp("rowEditor") ? (openBlock(), createElementBlock(Fragment, { + key: 6 + }, [!$data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 0, + "class": _ctx.cx("pcRowEditorInit"), + "aria-label": $options.initButtonAriaLabel, + unstyled: _ctx.unstyled, + onClick: $options.onRowEditInit + }, $props.editButtonProps.init, { + pt: $options.getColumnPT("pcRowEditorInit"), + "data-pc-group-section": "rowactionbutton" + }), { + icon: withCtx(function(slotProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditoriniticon || "PencilIcon"), mergeProps({ + "class": slotProps["class"] + }, $options.getColumnPT("pcRowEditorInit")["icon"]), null, 16, ["class"]))]; + }), + _: 1 + }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true), $data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 1, + "class": _ctx.cx("pcRowEditorSave"), + "aria-label": $options.saveButtonAriaLabel, + unstyled: _ctx.unstyled, + onClick: $options.onRowEditSave + }, $props.editButtonProps.save, { + pt: $options.getColumnPT("pcRowEditorSave"), + "data-pc-group-section": "rowactionbutton" + }), { + icon: withCtx(function(slotProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditorsaveicon || "CheckIcon"), mergeProps({ + "class": slotProps["class"] + }, $options.getColumnPT("pcRowEditorSave")["icon"]), null, 16, ["class"]))]; + }), + _: 1 + }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true), $data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 2, + "class": _ctx.cx("pcRowEditorCancel"), + "aria-label": $options.cancelButtonAriaLabel, + unstyled: _ctx.unstyled, + onClick: $options.onRowEditCancel + }, $props.editButtonProps.cancel, { + pt: $options.getColumnPT("pcRowEditorCancel"), + "data-pc-group-section": "rowactionbutton" + }), { + icon: withCtx(function(slotProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditorcancelicon || "TimesIcon"), mergeProps({ + "class": slotProps["class"] + }, $options.getColumnPT("pcRowEditorCancel")["icon"]), null, 16, ["class"]))]; + }), + _: 1 + }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock(Fragment, { + key: 7 + }, [createTextVNode(toDisplayString($options.resolveFieldData()), 1)], 64))], 16, _hoisted_1$4)); +} +__name(render$9, "render$9"); +script$9.render = render$9; +function _typeof$9(o) { + "@babel/helpers - typeof"; + return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$9(o); +} +__name(_typeof$9, "_typeof$9"); +function _createForOfIteratorHelper$2(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e) { + t && (r = t); + var _n = 0, F = /* @__PURE__ */ __name(function F2() { + }, "F"); + return { s: F, n: /* @__PURE__ */ __name(function n() { + return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; + }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { + throw r2; + }, "e"), f: F }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var o, a = true, u = false; + return { s: /* @__PURE__ */ __name(function s() { + t = t.call(r); + }, "s"), n: /* @__PURE__ */ __name(function n() { + var r2 = t.next(); + return a = r2.done, r2; + }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { + u = true, o = r2; + }, "e"), f: /* @__PURE__ */ __name(function f() { + try { + a || null == t["return"] || t["return"](); + } finally { + if (u) throw o; + } + }, "f") }; +} +__name(_createForOfIteratorHelper$2, "_createForOfIteratorHelper$2"); +function _unsupportedIterableToArray$2(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray$2(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; + } +} +__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray$2"); +function _arrayLikeToArray$2(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +__name(_arrayLikeToArray$2, "_arrayLikeToArray$2"); +function ownKeys$9(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$9, "ownKeys$9"); +function _objectSpread$9(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$9(Object(t), true).forEach(function(r2) { + _defineProperty$9(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$9, "_objectSpread$9"); +function _defineProperty$9(e, r, t) { + return (r = _toPropertyKey$9(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$9, "_defineProperty$9"); +function _toPropertyKey$9(t) { + var i = _toPrimitive$9(t, "string"); + return "symbol" == _typeof$9(i) ? i : i + ""; +} +__name(_toPropertyKey$9, "_toPropertyKey$9"); +function _toPrimitive$9(t, r) { + if ("object" != _typeof$9(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$9(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$9, "_toPrimitive$9"); +var script$8 = { + name: "BodyRow", + hostName: "DataTable", + "extends": script$s, + emits: ["rowgroup-toggle", "row-click", "row-dblclick", "row-rightclick", "row-touchend", "row-keydown", "row-mousedown", "row-dragstart", "row-dragover", "row-dragleave", "row-dragend", "row-drop", "row-toggle", "radio-change", "checkbox-change", "cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "row-edit-init", "row-edit-save", "row-edit-cancel", "editing-meta-change"], + props: { + rowData: { + type: Object, + "default": null + }, + index: { + type: Number, + "default": 0 + }, + value: { + type: Array, + "default": null + }, + columns: { + type: null, + "default": null + }, + frozenRow: { + type: Boolean, + "default": false + }, + empty: { + type: Boolean, + "default": false + }, + rowGroupMode: { + type: String, + "default": null + }, + groupRowsBy: { + type: [Array, String, Function], + "default": null + }, + expandableRowGroups: { + type: Boolean, + "default": false + }, + expandedRowGroups: { + type: Array, + "default": null + }, + first: { + type: Number, + "default": 0 + }, + dataKey: { + type: [String, Function], + "default": null + }, + expandedRowIcon: { + type: String, + "default": null + }, + collapsedRowIcon: { + type: String, + "default": null + }, + expandedRows: { + type: [Array, Object], + "default": null + }, + selection: { + type: [Array, Object], + "default": null + }, + selectionKeys: { + type: null, + "default": null + }, + selectionMode: { + type: String, + "default": null + }, + contextMenu: { + type: Boolean, + "default": false + }, + contextMenuSelection: { + type: Object, + "default": null + }, + rowClass: { + type: null, + "default": null + }, + rowStyle: { + type: null, + "default": null + }, + rowGroupHeaderStyle: { + type: null, + "default": null + }, + editMode: { + type: String, + "default": null + }, + compareSelectionBy: { + type: String, + "default": "deepEquals" + }, + editingRows: { + type: Array, + "default": null + }, + editingRowKeys: { + type: null, + "default": null + }, + editingMeta: { + type: Object, + "default": null + }, + templates: { + type: null, + "default": null + }, + scrollable: { + type: Boolean, + "default": false + }, + editButtonProps: { + type: Object, + "default": null + }, + virtualScrollerContentProps: { + type: Object, + "default": null + }, + isVirtualScrollerDisabled: { + type: Boolean, + "default": false + }, + expandedRowId: { + type: String, + "default": null + }, + nameAttributeSelector: { + type: String, + "default": null + } + }, + data: /* @__PURE__ */ __name(function data4() { + return { + d_rowExpanded: false + }; + }, "data"), + watch: { + expandedRows: { + deep: true, + immediate: true, + handler: /* @__PURE__ */ __name(function handler(newValue) { + var _this = this; + this.d_rowExpanded = this.dataKey ? (newValue === null || newValue === void 0 ? void 0 : newValue[resolveFieldData(this.rowData, this.dataKey)]) !== void 0 : newValue === null || newValue === void 0 ? void 0 : newValue.some(function(d) { + return _this.equals(_this.rowData, d); + }); + }, "handler") + } + }, + methods: { + columnProp: /* @__PURE__ */ __name(function columnProp2(col, prop) { + return getVNodeProp(col, prop); + }, "columnProp"), + //@todo - update this method + getColumnPT: /* @__PURE__ */ __name(function getColumnPT4(key) { + var columnMetaData = { + parent: { + instance: this, + props: this.$props, + state: this.$data + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.columnProp({}, "pt"), key, columnMetaData)); + }, "getColumnPT"), + //@todo - update this method + getBodyRowPTOptions: /* @__PURE__ */ __name(function getBodyRowPTOptions(key) { + var _this$$parentInstance; + var datatable = (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.$parentInstance; + return this.ptm(key, { + context: { + index: this.rowIndex, + selectable: (datatable === null || datatable === void 0 ? void 0 : datatable.rowHover) || (datatable === null || datatable === void 0 ? void 0 : datatable.selectionMode), + selected: this.isSelected, + stripedRows: (datatable === null || datatable === void 0 ? void 0 : datatable.stripedRows) || false + } + }); + }, "getBodyRowPTOptions"), + shouldRenderBodyCell: /* @__PURE__ */ __name(function shouldRenderBodyCell(column) { + var isHidden = this.columnProp(column, "hidden"); + if (this.rowGroupMode && !isHidden) { + var field2 = this.columnProp(column, "field"); + if (this.rowGroupMode === "subheader") { + return this.groupRowsBy !== field2; + } else if (this.rowGroupMode === "rowspan") { + if (this.isGrouped(column)) { + var prevRowData = this.value[this.rowIndex - 1]; + if (prevRowData) { + var currentRowFieldData = resolveFieldData(this.value[this.rowIndex], field2); + var previousRowFieldData = resolveFieldData(prevRowData, field2); + return currentRowFieldData !== previousRowFieldData; + } else { + return true; + } + } else { + return true; + } + } + } else { + return !isHidden; + } + }, "shouldRenderBodyCell"), + calculateRowGroupSize: /* @__PURE__ */ __name(function calculateRowGroupSize(column) { + if (this.isGrouped(column)) { + var index = this.rowIndex; + var field2 = this.columnProp(column, "field"); + var currentRowFieldData = resolveFieldData(this.value[index], field2); + var nextRowFieldData = currentRowFieldData; + var groupRowSpan = 0; + while (currentRowFieldData === nextRowFieldData) { + groupRowSpan++; + var nextRowData = this.value[++index]; + if (nextRowData) { + nextRowFieldData = resolveFieldData(nextRowData, field2); + } else { + break; + } + } + return groupRowSpan === 1 ? null : groupRowSpan; + } else { + return null; + } + }, "calculateRowGroupSize"), + isGrouped: /* @__PURE__ */ __name(function isGrouped(column) { + var field2 = this.columnProp(column, "field"); + if (this.groupRowsBy && field2) { + if (Array.isArray(this.groupRowsBy)) return this.groupRowsBy.indexOf(field2) > -1; + else return this.groupRowsBy === field2; + } else { + return false; + } + }, "isGrouped"), + findIndexInSelection: /* @__PURE__ */ __name(function findIndexInSelection(data12) { + return this.findIndex(data12, this.selection); + }, "findIndexInSelection"), + findIndex: /* @__PURE__ */ __name(function findIndex(data12, collection) { + var index = -1; + if (collection && collection.length) { + for (var i = 0; i < collection.length; i++) { + if (this.equals(data12, collection[i])) { + index = i; + break; + } + } + } + return index; + }, "findIndex"), + equals: /* @__PURE__ */ __name(function equals$1(data1, data22) { + return this.compareSelectionBy === "equals" ? data1 === data22 : equals(data1, data22, this.dataKey); + }, "equals$1"), + onRowGroupToggle: /* @__PURE__ */ __name(function onRowGroupToggle(event2) { + this.$emit("rowgroup-toggle", { + originalEvent: event2, + data: this.rowData + }); + }, "onRowGroupToggle"), + onRowClick: /* @__PURE__ */ __name(function onRowClick(event2) { + this.$emit("row-click", { + originalEvent: event2, + data: this.rowData, + index: this.rowIndex + }); + }, "onRowClick"), + onRowDblClick: /* @__PURE__ */ __name(function onRowDblClick(event2) { + this.$emit("row-dblclick", { + originalEvent: event2, + data: this.rowData, + index: this.rowIndex + }); + }, "onRowDblClick"), + onRowRightClick: /* @__PURE__ */ __name(function onRowRightClick(event2) { + this.$emit("row-rightclick", { + originalEvent: event2, + data: this.rowData, + index: this.rowIndex + }); + }, "onRowRightClick"), + onRowTouchEnd: /* @__PURE__ */ __name(function onRowTouchEnd(event2) { + this.$emit("row-touchend", event2); + }, "onRowTouchEnd"), + onRowKeyDown: /* @__PURE__ */ __name(function onRowKeyDown(event2) { + this.$emit("row-keydown", { + originalEvent: event2, + data: this.rowData, + index: this.rowIndex + }); + }, "onRowKeyDown"), + onRowMouseDown: /* @__PURE__ */ __name(function onRowMouseDown(event2) { + this.$emit("row-mousedown", event2); + }, "onRowMouseDown"), + onRowDragStart: /* @__PURE__ */ __name(function onRowDragStart(event2) { + this.$emit("row-dragstart", { + originalEvent: event2, + index: this.rowIndex + }); + }, "onRowDragStart"), + onRowDragOver: /* @__PURE__ */ __name(function onRowDragOver(event2) { + this.$emit("row-dragover", { + originalEvent: event2, + index: this.rowIndex + }); + }, "onRowDragOver"), + onRowDragLeave: /* @__PURE__ */ __name(function onRowDragLeave(event2) { + this.$emit("row-dragleave", event2); + }, "onRowDragLeave"), + onRowDragEnd: /* @__PURE__ */ __name(function onRowDragEnd(event2) { + this.$emit("row-dragend", event2); + }, "onRowDragEnd"), + onRowDrop: /* @__PURE__ */ __name(function onRowDrop(event2) { + this.$emit("row-drop", event2); + }, "onRowDrop"), + onRowToggle: /* @__PURE__ */ __name(function onRowToggle(event2) { + this.d_rowExpanded = !this.d_rowExpanded; + this.$emit("row-toggle", _objectSpread$9(_objectSpread$9({}, event2), {}, { + expanded: this.d_rowExpanded + })); + }, "onRowToggle"), + onRadioChange: /* @__PURE__ */ __name(function onRadioChange(event2) { + this.$emit("radio-change", event2); + }, "onRadioChange"), + onCheckboxChange: /* @__PURE__ */ __name(function onCheckboxChange(event2) { + this.$emit("checkbox-change", event2); + }, "onCheckboxChange"), + onCellEditInit: /* @__PURE__ */ __name(function onCellEditInit(event2) { + this.$emit("cell-edit-init", event2); + }, "onCellEditInit"), + onCellEditComplete: /* @__PURE__ */ __name(function onCellEditComplete(event2) { + this.$emit("cell-edit-complete", event2); + }, "onCellEditComplete"), + onCellEditCancel: /* @__PURE__ */ __name(function onCellEditCancel(event2) { + this.$emit("cell-edit-cancel", event2); + }, "onCellEditCancel"), + onRowEditInit: /* @__PURE__ */ __name(function onRowEditInit2(event2) { + this.$emit("row-edit-init", event2); + }, "onRowEditInit"), + onRowEditSave: /* @__PURE__ */ __name(function onRowEditSave2(event2) { + this.$emit("row-edit-save", event2); + }, "onRowEditSave"), + onRowEditCancel: /* @__PURE__ */ __name(function onRowEditCancel2(event2) { + this.$emit("row-edit-cancel", event2); + }, "onRowEditCancel"), + onEditingMetaChange: /* @__PURE__ */ __name(function onEditingMetaChange(event2) { + this.$emit("editing-meta-change", event2); + }, "onEditingMetaChange"), + getVirtualScrollerProp: /* @__PURE__ */ __name(function getVirtualScrollerProp2(option, options) { + options = options || this.virtualScrollerContentProps; + return options ? options[option] : null; + }, "getVirtualScrollerProp") + }, + computed: { + rowIndex: /* @__PURE__ */ __name(function rowIndex() { + var getItemOptions = this.getVirtualScrollerProp("getItemOptions"); + return getItemOptions ? getItemOptions(this.index).index : this.index; + }, "rowIndex"), + rowStyles: /* @__PURE__ */ __name(function rowStyles() { + var _this$rowStyle; + return (_this$rowStyle = this.rowStyle) === null || _this$rowStyle === void 0 ? void 0 : _this$rowStyle.call(this, this.rowData); + }, "rowStyles"), + rowClasses: /* @__PURE__ */ __name(function rowClasses() { + var rowStyleClass = []; + var columnSelectionMode = null; + if (this.rowClass) { + var rowClassValue = this.rowClass(this.rowData); + if (rowClassValue) { + rowStyleClass.push(rowClassValue); + } + } + if (this.columns) { + var _iterator = _createForOfIteratorHelper$2(this.columns), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var col = _step.value; + var _selectionMode = this.columnProp(col, "selectionMode"); + if (isNotEmpty(_selectionMode)) { + columnSelectionMode = _selectionMode; + break; + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + return [this.cx("row", { + rowData: this.rowData, + index: this.rowIndex, + columnSelectionMode + }), rowStyleClass]; + }, "rowClasses"), + rowTabindex: /* @__PURE__ */ __name(function rowTabindex() { + if (this.selection === null && (this.selectionMode === "single" || this.selectionMode === "multiple")) { + return this.rowIndex === 0 ? 0 : -1; + } + return -1; + }, "rowTabindex"), + isRowEditing: /* @__PURE__ */ __name(function isRowEditing() { + if (this.rowData && this.editingRows) { + if (this.dataKey) return this.editingRowKeys ? this.editingRowKeys[resolveFieldData(this.rowData, this.dataKey)] !== void 0 : false; + else return this.findIndex(this.rowData, this.editingRows) > -1; + } + return false; + }, "isRowEditing"), + isRowGroupExpanded: /* @__PURE__ */ __name(function isRowGroupExpanded() { + if (this.expandableRowGroups && this.expandedRowGroups) { + var groupFieldValue = resolveFieldData(this.rowData, this.groupRowsBy); + return this.expandedRowGroups.indexOf(groupFieldValue) > -1; + } + return false; + }, "isRowGroupExpanded"), + isSelected: /* @__PURE__ */ __name(function isSelected() { + if (this.rowData && this.selection) { + if (this.dataKey) { + return this.selectionKeys ? this.selectionKeys[resolveFieldData(this.rowData, this.dataKey)] !== void 0 : false; + } else { + if (this.selection instanceof Array) return this.findIndexInSelection(this.rowData) > -1; + else return this.equals(this.rowData, this.selection); + } + } + return false; + }, "isSelected"), + isSelectedWithContextMenu: /* @__PURE__ */ __name(function isSelectedWithContextMenu() { + if (this.rowData && this.contextMenuSelection) { + return this.equals(this.rowData, this.contextMenuSelection, this.dataKey); + } + return false; + }, "isSelectedWithContextMenu"), + shouldRenderRowGroupHeader: /* @__PURE__ */ __name(function shouldRenderRowGroupHeader() { + var currentRowFieldData = resolveFieldData(this.rowData, this.groupRowsBy); + var prevRowData = this.value[this.rowIndex - 1]; + if (prevRowData) { + var previousRowFieldData = resolveFieldData(prevRowData, this.groupRowsBy); + return currentRowFieldData !== previousRowFieldData; + } else { + return true; + } + }, "shouldRenderRowGroupHeader"), + shouldRenderRowGroupFooter: /* @__PURE__ */ __name(function shouldRenderRowGroupFooter() { + if (this.expandableRowGroups && !this.isRowGroupExpanded) { + return false; + } else { + var currentRowFieldData = resolveFieldData(this.rowData, this.groupRowsBy); + var nextRowData = this.value[this.rowIndex + 1]; + if (nextRowData) { + var nextRowFieldData = resolveFieldData(nextRowData, this.groupRowsBy); + return currentRowFieldData !== nextRowFieldData; + } else { + return true; + } + } + }, "shouldRenderRowGroupFooter"), + columnsLength: /* @__PURE__ */ __name(function columnsLength() { + var _this2 = this; + if (this.columns) { + var hiddenColLength = 0; + this.columns.forEach(function(column) { + if (_this2.columnProp(column, "selectionMode") === "single") hiddenColLength--; + if (_this2.columnProp(column, "hidden")) hiddenColLength++; + }); + return this.columns.length - hiddenColLength; + } + return 0; + }, "columnsLength") + }, + components: { + DTBodyCell: script$9, + ChevronDownIcon: script$B, + ChevronRightIcon: script$C + } +}; +function _typeof$8(o) { + "@babel/helpers - typeof"; + return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$8(o); +} +__name(_typeof$8, "_typeof$8"); +function ownKeys$8(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$8, "ownKeys$8"); +function _objectSpread$8(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$8(Object(t), true).forEach(function(r2) { + _defineProperty$8(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$8, "_objectSpread$8"); +function _defineProperty$8(e, r, t) { + return (r = _toPropertyKey$8(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$8, "_defineProperty$8"); +function _toPropertyKey$8(t) { + var i = _toPrimitive$8(t, "string"); + return "symbol" == _typeof$8(i) ? i : i + ""; +} +__name(_toPropertyKey$8, "_toPropertyKey$8"); +function _toPrimitive$8(t, r) { + if ("object" != _typeof$8(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$8(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$8, "_toPrimitive$8"); +var _hoisted_1$3 = ["colspan"]; +var _hoisted_2$1 = ["tabindex", "aria-selected", "data-p-index", "data-p-selectable-row", "data-p-selected", "data-p-selected-contextmenu"]; +var _hoisted_3 = ["id"]; +var _hoisted_4 = ["colspan"]; +var _hoisted_5 = ["colspan"]; +var _hoisted_6 = ["colspan"]; +function render$8(_ctx, _cache, $props, $setup, $data, $options) { + var _component_ChevronDownIcon = resolveComponent("ChevronDownIcon"); + var _component_ChevronRightIcon = resolveComponent("ChevronRightIcon"); + var _component_DTBodyCell = resolveComponent("DTBodyCell"); + return !$props.empty ? (openBlock(), createElementBlock(Fragment, { + key: 0 + }, [$props.templates["groupheader"] && $props.rowGroupMode === "subheader" && $options.shouldRenderRowGroupHeader ? (openBlock(), createElementBlock("tr", mergeProps({ + key: 0, + "class": _ctx.cx("rowGroupHeader"), + style: $props.rowGroupHeaderStyle, + role: "row" + }, _ctx.ptm("rowGroupHeader")), [createBaseVNode("td", mergeProps({ + colspan: $options.columnsLength - 1 + }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("rowGroupHeaderCell"))), [$props.expandableRowGroups ? (openBlock(), createElementBlock("button", mergeProps({ + key: 0, + "class": _ctx.cx("rowToggleButton"), + onClick: _cache[0] || (_cache[0] = function() { + return $options.onRowGroupToggle && $options.onRowGroupToggle.apply($options, arguments); + }), + type: "button" + }, _ctx.ptm("rowToggleButton")), [$props.templates["rowtoggleicon"] || $props.templates["rowgrouptogglericon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["rowtoggleicon"] || $props.templates["rowgrouptogglericon"]), { + key: 0, + expanded: $options.isRowGroupExpanded + }, null, 8, ["expanded"])) : (openBlock(), createElementBlock(Fragment, { + key: 1 + }, [$options.isRowGroupExpanded && $props.expandedRowIcon ? (openBlock(), createElementBlock("span", mergeProps({ + key: 0, + "class": [_ctx.cx("rowToggleIcon"), $props.expandedRowIcon] + }, _ctx.ptm("rowToggleIcon")), null, 16)) : $options.isRowGroupExpanded && !$props.expandedRowIcon ? (openBlock(), createBlock(_component_ChevronDownIcon, mergeProps({ + key: 1, + "class": _ctx.cx("rowToggleIcon") + }, _ctx.ptm("rowToggleIcon")), null, 16, ["class"])) : !$options.isRowGroupExpanded && $props.collapsedRowIcon ? (openBlock(), createElementBlock("span", mergeProps({ + key: 2, + "class": [_ctx.cx("rowToggleIcon"), $props.collapsedRowIcon] + }, _ctx.ptm("rowToggleIcon")), null, 16)) : !$options.isRowGroupExpanded && !$props.collapsedRowIcon ? (openBlock(), createBlock(_component_ChevronRightIcon, mergeProps({ + key: 3, + "class": _ctx.cx("rowToggleIcon") + }, _ctx.ptm("rowToggleIcon")), null, 16, ["class"])) : createCommentVNode("", true)], 64))], 16)) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent($props.templates["groupheader"]), { + data: $props.rowData, + index: $options.rowIndex + }, null, 8, ["data", "index"]))], 16, _hoisted_1$3)], 16)) : createCommentVNode("", true), ($props.expandableRowGroups ? $options.isRowGroupExpanded : true) ? (openBlock(), createElementBlock("tr", mergeProps({ + key: 1, + "class": $options.rowClasses, + style: $options.rowStyles, + tabindex: $options.rowTabindex, + role: "row", + "aria-selected": $props.selectionMode ? $options.isSelected : null, + onClick: _cache[1] || (_cache[1] = function() { + return $options.onRowClick && $options.onRowClick.apply($options, arguments); + }), + onDblclick: _cache[2] || (_cache[2] = function() { + return $options.onRowDblClick && $options.onRowDblClick.apply($options, arguments); + }), + onContextmenu: _cache[3] || (_cache[3] = function() { + return $options.onRowRightClick && $options.onRowRightClick.apply($options, arguments); + }), + onTouchend: _cache[4] || (_cache[4] = function() { + return $options.onRowTouchEnd && $options.onRowTouchEnd.apply($options, arguments); + }), + onKeydown: _cache[5] || (_cache[5] = withModifiers(function() { + return $options.onRowKeyDown && $options.onRowKeyDown.apply($options, arguments); + }, ["self"])), + onMousedown: _cache[6] || (_cache[6] = function() { + return $options.onRowMouseDown && $options.onRowMouseDown.apply($options, arguments); + }), + onDragstart: _cache[7] || (_cache[7] = function() { + return $options.onRowDragStart && $options.onRowDragStart.apply($options, arguments); + }), + onDragover: _cache[8] || (_cache[8] = function() { + return $options.onRowDragOver && $options.onRowDragOver.apply($options, arguments); + }), + onDragleave: _cache[9] || (_cache[9] = function() { + return $options.onRowDragLeave && $options.onRowDragLeave.apply($options, arguments); + }), + onDragend: _cache[10] || (_cache[10] = function() { + return $options.onRowDragEnd && $options.onRowDragEnd.apply($options, arguments); + }), + onDrop: _cache[11] || (_cache[11] = function() { + return $options.onRowDrop && $options.onRowDrop.apply($options, arguments); + }) + }, $options.getBodyRowPTOptions("bodyRow"), { + "data-p-index": $options.rowIndex, + "data-p-selectable-row": $props.selectionMode ? true : false, + "data-p-selected": $props.selection && $options.isSelected, + "data-p-selected-contextmenu": $props.contextMenuSelection && $options.isSelectedWithContextMenu + }), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { + return openBlock(), createElementBlock(Fragment, null, [$options.shouldRenderBodyCell(col) ? (openBlock(), createBlock(_component_DTBodyCell, { + key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i, + rowData: $props.rowData, + column: col, + rowIndex: $options.rowIndex, + index: i, + selected: $options.isSelected, + frozenRow: $props.frozenRow, + rowspan: $props.rowGroupMode === "rowspan" ? $options.calculateRowGroupSize(col) : null, + editMode: $props.editMode, + editing: $props.editMode === "row" && $options.isRowEditing, + editingMeta: $props.editingMeta, + virtualScrollerContentProps: $props.virtualScrollerContentProps, + ariaControls: $props.expandedRowId + "_" + $options.rowIndex + "_expansion", + name: $props.nameAttributeSelector, + isRowExpanded: $data.d_rowExpanded, + expandedRowIcon: $props.expandedRowIcon, + collapsedRowIcon: $props.collapsedRowIcon, + editButtonProps: $props.editButtonProps, + onRadioChange: $options.onRadioChange, + onCheckboxChange: $options.onCheckboxChange, + onRowToggle: $options.onRowToggle, + onCellEditInit: $options.onCellEditInit, + onCellEditComplete: $options.onCellEditComplete, + onCellEditCancel: $options.onCellEditCancel, + onRowEditInit: $options.onRowEditInit, + onRowEditSave: $options.onRowEditSave, + onRowEditCancel: $options.onRowEditCancel, + onEditingMetaChange: $options.onEditingMetaChange, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["rowData", "column", "rowIndex", "index", "selected", "frozenRow", "rowspan", "editMode", "editing", "editingMeta", "virtualScrollerContentProps", "ariaControls", "name", "isRowExpanded", "expandedRowIcon", "collapsedRowIcon", "editButtonProps", "onRadioChange", "onCheckboxChange", "onRowToggle", "onCellEditInit", "onCellEditComplete", "onCellEditCancel", "onRowEditInit", "onRowEditSave", "onRowEditCancel", "onEditingMetaChange", "unstyled", "pt"])) : createCommentVNode("", true)], 64); + }), 256))], 16, _hoisted_2$1)) : createCommentVNode("", true), $props.templates["expansion"] && $props.expandedRows && $data.d_rowExpanded ? (openBlock(), createElementBlock("tr", mergeProps({ + key: 2, + id: $props.expandedRowId + "_" + $options.rowIndex + "_expansion", + "class": _ctx.cx("rowExpansion"), + role: "row" + }, _ctx.ptm("rowExpansion")), [createBaseVNode("td", mergeProps({ + colspan: $options.columnsLength + }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("rowExpansionCell"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates["expansion"]), { + data: $props.rowData, + index: $options.rowIndex + }, null, 8, ["data", "index"]))], 16, _hoisted_4)], 16, _hoisted_3)) : createCommentVNode("", true), $props.templates["groupfooter"] && $props.rowGroupMode === "subheader" && $options.shouldRenderRowGroupFooter ? (openBlock(), createElementBlock("tr", mergeProps({ + key: 3, + "class": _ctx.cx("rowGroupFooter"), + role: "row" + }, _ctx.ptm("rowGroupFooter")), [createBaseVNode("td", mergeProps({ + colspan: $options.columnsLength - 1 + }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("rowGroupFooterCell"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates["groupfooter"]), { + data: $props.rowData, + index: $options.rowIndex + }, null, 8, ["data", "index"]))], 16, _hoisted_5)], 16)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("tr", mergeProps({ + key: 1, + "class": _ctx.cx("emptyMessage"), + role: "row" + }, _ctx.ptm("emptyMessage")), [createBaseVNode("td", mergeProps({ + colspan: $options.columnsLength + }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("emptyMessageCell"))), [$props.templates.empty ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.empty), { + key: 0 + })) : createCommentVNode("", true)], 16, _hoisted_6)], 16)); +} +__name(render$8, "render$8"); +script$8.render = render$8; +var script$7 = { + name: "TableBody", + hostName: "DataTable", + "extends": script$s, + emits: ["rowgroup-toggle", "row-click", "row-dblclick", "row-rightclick", "row-touchend", "row-keydown", "row-mousedown", "row-dragstart", "row-dragover", "row-dragleave", "row-dragend", "row-drop", "row-toggle", "radio-change", "checkbox-change", "cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "row-edit-init", "row-edit-save", "row-edit-cancel", "editing-meta-change"], + props: { + value: { + type: Array, + "default": null + }, + columns: { + type: null, + "default": null + }, + frozenRow: { + type: Boolean, + "default": false + }, + empty: { + type: Boolean, + "default": false + }, + rowGroupMode: { + type: String, + "default": null + }, + groupRowsBy: { + type: [Array, String, Function], + "default": null + }, + expandableRowGroups: { + type: Boolean, + "default": false + }, + expandedRowGroups: { + type: Array, + "default": null + }, + first: { + type: Number, + "default": 0 + }, + dataKey: { + type: [String, Function], + "default": null + }, + expandedRowIcon: { + type: String, + "default": null + }, + collapsedRowIcon: { + type: String, + "default": null + }, + expandedRows: { + type: [Array, Object], + "default": null + }, + selection: { + type: [Array, Object], + "default": null + }, + selectionKeys: { + type: null, + "default": null + }, + selectionMode: { + type: String, + "default": null + }, + contextMenu: { + type: Boolean, + "default": false + }, + contextMenuSelection: { + type: Object, + "default": null + }, + rowClass: { + type: null, + "default": null + }, + rowStyle: { + type: null, + "default": null + }, + editMode: { + type: String, + "default": null + }, + compareSelectionBy: { + type: String, + "default": "deepEquals" + }, + editingRows: { + type: Array, + "default": null + }, + editingRowKeys: { + type: null, + "default": null + }, + editingMeta: { + type: Object, + "default": null + }, + templates: { + type: null, + "default": null + }, + scrollable: { + type: Boolean, + "default": false + }, + editButtonProps: { + type: Object, + "default": null + }, + virtualScrollerContentProps: { + type: Object, + "default": null + }, + isVirtualScrollerDisabled: { + type: Boolean, + "default": false + } + }, + data: /* @__PURE__ */ __name(function data5() { + return { + rowGroupHeaderStyleObject: {} + }; + }, "data"), + mounted: /* @__PURE__ */ __name(function mounted4() { + if (this.frozenRow) { + this.updateFrozenRowStickyPosition(); + } + if (this.scrollable && this.rowGroupMode === "subheader") { + this.updateFrozenRowGroupHeaderStickyPosition(); + } + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated2() { + if (this.frozenRow) { + this.updateFrozenRowStickyPosition(); + } + if (this.scrollable && this.rowGroupMode === "subheader") { + this.updateFrozenRowGroupHeaderStickyPosition(); + } + }, "updated"), + methods: { + getRowKey: /* @__PURE__ */ __name(function getRowKey(rowData, rowIndex2) { + return this.dataKey ? resolveFieldData(rowData, this.dataKey) : rowIndex2; + }, "getRowKey"), + updateFrozenRowStickyPosition: /* @__PURE__ */ __name(function updateFrozenRowStickyPosition() { + this.$el.style.top = getOuterHeight(this.$el.previousElementSibling) + "px"; + }, "updateFrozenRowStickyPosition"), + updateFrozenRowGroupHeaderStickyPosition: /* @__PURE__ */ __name(function updateFrozenRowGroupHeaderStickyPosition() { + var tableHeaderHeight = getOuterHeight(this.$el.previousElementSibling); + this.rowGroupHeaderStyleObject.top = tableHeaderHeight + "px"; + }, "updateFrozenRowGroupHeaderStickyPosition"), + getVirtualScrollerProp: /* @__PURE__ */ __name(function getVirtualScrollerProp3(option, options) { + options = options || this.virtualScrollerContentProps; + return options ? options[option] : null; + }, "getVirtualScrollerProp"), + bodyRef: /* @__PURE__ */ __name(function bodyRef(el) { + var contentRef = this.getVirtualScrollerProp("contentRef"); + contentRef && contentRef(el); + }, "bodyRef") + }, + computed: { + rowGroupHeaderStyle: /* @__PURE__ */ __name(function rowGroupHeaderStyle() { + if (this.scrollable) { + return { + top: this.rowGroupHeaderStyleObject.top + }; + } + return null; + }, "rowGroupHeaderStyle"), + bodyContentStyle: /* @__PURE__ */ __name(function bodyContentStyle() { + return this.getVirtualScrollerProp("contentStyle"); + }, "bodyContentStyle"), + ptmTBodyOptions: /* @__PURE__ */ __name(function ptmTBodyOptions() { + var _this$$parentInstance; + return { + context: { + scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable + } + }; + }, "ptmTBodyOptions"), + expandedRowId: /* @__PURE__ */ __name(function expandedRowId() { + return UniqueComponentId(); + }, "expandedRowId"), + nameAttributeSelector: /* @__PURE__ */ __name(function nameAttributeSelector() { + return UniqueComponentId(); + }, "nameAttributeSelector") + }, + components: { + DTBodyRow: script$8 + } +}; +function render$7(_ctx, _cache, $props, $setup, $data, $options) { + var _component_DTBodyRow = resolveComponent("DTBodyRow"); + return openBlock(), createElementBlock("tbody", mergeProps({ + ref: $options.bodyRef, + "class": _ctx.cx("tbody"), + role: "rowgroup", + style: $options.bodyContentStyle + }, _ctx.ptm("tbody", $options.ptmTBodyOptions)), [!$props.empty ? (openBlock(true), createElementBlock(Fragment, { + key: 0 + }, renderList($props.value, function(rowData, rowIndex2) { + return openBlock(), createBlock(_component_DTBodyRow, { + key: $options.getRowKey(rowData, rowIndex2), + rowData, + index: rowIndex2, + value: $props.value, + columns: $props.columns, + frozenRow: $props.frozenRow, + empty: $props.empty, + first: $props.first, + dataKey: $props.dataKey, + selection: $props.selection, + selectionKeys: $props.selectionKeys, + selectionMode: $props.selectionMode, + contextMenu: $props.contextMenu, + contextMenuSelection: $props.contextMenuSelection, + rowGroupMode: $props.rowGroupMode, + groupRowsBy: $props.groupRowsBy, + expandableRowGroups: $props.expandableRowGroups, + rowClass: $props.rowClass, + rowStyle: $props.rowStyle, + editMode: $props.editMode, + compareSelectionBy: $props.compareSelectionBy, + scrollable: $props.scrollable, + expandedRowIcon: $props.expandedRowIcon, + collapsedRowIcon: $props.collapsedRowIcon, + expandedRows: $props.expandedRows, + expandedRowGroups: $props.expandedRowGroups, + editingRows: $props.editingRows, + editingRowKeys: $props.editingRowKeys, + templates: $props.templates, + editButtonProps: $props.editButtonProps, + virtualScrollerContentProps: $props.virtualScrollerContentProps, + isVirtualScrollerDisabled: $props.isVirtualScrollerDisabled, + editingMeta: $props.editingMeta, + rowGroupHeaderStyle: $options.rowGroupHeaderStyle, + expandedRowId: $options.expandedRowId, + nameAttributeSelector: $options.nameAttributeSelector, + onRowgroupToggle: _cache[0] || (_cache[0] = function($event) { + return _ctx.$emit("rowgroup-toggle", $event); + }), + onRowClick: _cache[1] || (_cache[1] = function($event) { + return _ctx.$emit("row-click", $event); + }), + onRowDblclick: _cache[2] || (_cache[2] = function($event) { + return _ctx.$emit("row-dblclick", $event); + }), + onRowRightclick: _cache[3] || (_cache[3] = function($event) { + return _ctx.$emit("row-rightclick", $event); + }), + onRowTouchend: _cache[4] || (_cache[4] = function($event) { + return _ctx.$emit("row-touchend", $event); + }), + onRowKeydown: _cache[5] || (_cache[5] = function($event) { + return _ctx.$emit("row-keydown", $event); + }), + onRowMousedown: _cache[6] || (_cache[6] = function($event) { + return _ctx.$emit("row-mousedown", $event); + }), + onRowDragstart: _cache[7] || (_cache[7] = function($event) { + return _ctx.$emit("row-dragstart", $event); + }), + onRowDragover: _cache[8] || (_cache[8] = function($event) { + return _ctx.$emit("row-dragover", $event); + }), + onRowDragleave: _cache[9] || (_cache[9] = function($event) { + return _ctx.$emit("row-dragleave", $event); + }), + onRowDragend: _cache[10] || (_cache[10] = function($event) { + return _ctx.$emit("row-dragend", $event); + }), + onRowDrop: _cache[11] || (_cache[11] = function($event) { + return _ctx.$emit("row-drop", $event); + }), + onRowToggle: _cache[12] || (_cache[12] = function($event) { + return _ctx.$emit("row-toggle", $event); + }), + onRadioChange: _cache[13] || (_cache[13] = function($event) { + return _ctx.$emit("radio-change", $event); + }), + onCheckboxChange: _cache[14] || (_cache[14] = function($event) { + return _ctx.$emit("checkbox-change", $event); + }), + onCellEditInit: _cache[15] || (_cache[15] = function($event) { + return _ctx.$emit("cell-edit-init", $event); + }), + onCellEditComplete: _cache[16] || (_cache[16] = function($event) { + return _ctx.$emit("cell-edit-complete", $event); + }), + onCellEditCancel: _cache[17] || (_cache[17] = function($event) { + return _ctx.$emit("cell-edit-cancel", $event); + }), + onRowEditInit: _cache[18] || (_cache[18] = function($event) { + return _ctx.$emit("row-edit-init", $event); + }), + onRowEditSave: _cache[19] || (_cache[19] = function($event) { + return _ctx.$emit("row-edit-save", $event); + }), + onRowEditCancel: _cache[20] || (_cache[20] = function($event) { + return _ctx.$emit("row-edit-cancel", $event); + }), + onEditingMetaChange: _cache[21] || (_cache[21] = function($event) { + return _ctx.$emit("editing-meta-change", $event); + }), + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["rowData", "index", "value", "columns", "frozenRow", "empty", "first", "dataKey", "selection", "selectionKeys", "selectionMode", "contextMenu", "contextMenuSelection", "rowGroupMode", "groupRowsBy", "expandableRowGroups", "rowClass", "rowStyle", "editMode", "compareSelectionBy", "scrollable", "expandedRowIcon", "collapsedRowIcon", "expandedRows", "expandedRowGroups", "editingRows", "editingRowKeys", "templates", "editButtonProps", "virtualScrollerContentProps", "isVirtualScrollerDisabled", "editingMeta", "rowGroupHeaderStyle", "expandedRowId", "nameAttributeSelector", "unstyled", "pt"]); + }), 128)) : (openBlock(), createBlock(_component_DTBodyRow, { + key: 1, + empty: $props.empty, + columns: $props.columns, + templates: $props.templates, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["empty", "columns", "templates", "unstyled", "pt"]))], 16); +} +__name(render$7, "render$7"); +script$7.render = render$7; +var script$6 = { + name: "FooterCell", + hostName: "DataTable", + "extends": script$s, + props: { + column: { + type: Object, + "default": null + }, + index: { + type: Number, + "default": null + } + }, + data: /* @__PURE__ */ __name(function data6() { + return { + styleObject: {} + }; + }, "data"), + mounted: /* @__PURE__ */ __name(function mounted5() { + if (this.columnProp("frozen")) { + this.updateStickyPosition(); + } + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated3() { + if (this.columnProp("frozen")) { + this.updateStickyPosition(); + } + }, "updated"), + methods: { + columnProp: /* @__PURE__ */ __name(function columnProp3(prop) { + return getVNodeProp(this.column, prop); + }, "columnProp"), + getColumnPT: /* @__PURE__ */ __name(function getColumnPT5(key) { + var _this$$parentInstance, _this$$parentInstance2; + var columnMetaData = { + props: this.column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index: this.index, + size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size, + showGridlines: ((_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines) || false + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp4() { + return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; + }, "getColumnProp"), + updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition2() { + if (this.columnProp("frozen")) { + var align = this.columnProp("alignFrozen"); + var isRTL = this.$parentInstance.$parentInstance.isRTL; + if (align === "right") { + var pos = 0; + var next2 = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]'); + if (next2) { + pos = getOuterWidth(next2) + parseFloat(next2.style.right || 0); + } + if (isRTL) { + this.styleObject.left = pos + "px"; + } else { + this.styleObject.right = pos + "px"; + } + } else { + var _pos = 0; + var prev2 = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]'); + if (prev2) { + _pos = getOuterWidth(prev2) + parseFloat(prev2.style.left || 0); + } + if (isRTL) { + this.styleObject.right = _pos + "px"; + } else { + this.styleObject.left = _pos + "px"; + } + } + } + }, "updateStickyPosition") + }, + computed: { + containerClass: /* @__PURE__ */ __name(function containerClass2() { + return [this.columnProp("footerClass"), this.columnProp("class"), this.cx("footerCell")]; + }, "containerClass"), + containerStyle: /* @__PURE__ */ __name(function containerStyle2() { + var bodyStyle = this.columnProp("footerStyle"); + var columnStyle = this.columnProp("style"); + return this.columnProp("frozen") ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle]; + }, "containerStyle") + } +}; +function _typeof$7(o) { + "@babel/helpers - typeof"; + return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$7(o); +} +__name(_typeof$7, "_typeof$7"); +function ownKeys$7(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$7, "ownKeys$7"); +function _objectSpread$7(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$7(Object(t), true).forEach(function(r2) { + _defineProperty$7(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$7, "_objectSpread$7"); +function _defineProperty$7(e, r, t) { + return (r = _toPropertyKey$7(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$7, "_defineProperty$7"); +function _toPropertyKey$7(t) { + var i = _toPrimitive$7(t, "string"); + return "symbol" == _typeof$7(i) ? i : i + ""; +} +__name(_toPropertyKey$7, "_toPropertyKey$7"); +function _toPrimitive$7(t, r) { + if ("object" != _typeof$7(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$7(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$7, "_toPrimitive$7"); +var _hoisted_1$2 = ["colspan", "rowspan", "data-p-frozen-column"]; +function render$6(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock("td", mergeProps({ + style: $options.containerStyle, + "class": $options.containerClass, + role: "cell", + colspan: $options.columnProp("colspan"), + rowspan: $options.columnProp("rowspan") + }, _objectSpread$7(_objectSpread$7({}, $options.getColumnPT("root")), $options.getColumnPT("footerCell")), { + "data-p-frozen-column": $options.columnProp("frozen") + }), [$props.column.children && $props.column.children.footer ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.footer), { + key: 0, + column: $props.column + }, null, 8, ["column"])) : createCommentVNode("", true), $options.columnProp("footer") ? (openBlock(), createElementBlock("span", mergeProps({ + key: 1, + "class": _ctx.cx("columnFooter") + }, $options.getColumnPT("columnFooter")), toDisplayString($options.columnProp("footer")), 17)) : createCommentVNode("", true)], 16, _hoisted_1$2); +} +__name(render$6, "render$6"); +script$6.render = render$6; +function _createForOfIteratorHelper$1(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) { + t && (r = t); + var _n = 0, F = /* @__PURE__ */ __name(function F2() { + }, "F"); + return { s: F, n: /* @__PURE__ */ __name(function n() { + return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; + }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { + throw r2; + }, "e"), f: F }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var o, a = true, u = false; + return { s: /* @__PURE__ */ __name(function s() { + t = t.call(r); + }, "s"), n: /* @__PURE__ */ __name(function n() { + var r2 = t.next(); + return a = r2.done, r2; + }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { + u = true, o = r2; + }, "e"), f: /* @__PURE__ */ __name(function f() { + try { + a || null == t["return"] || t["return"](); + } finally { + if (u) throw o; + } + }, "f") }; +} +__name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper$1"); +function _unsupportedIterableToArray$1(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray$1(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; + } +} +__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1"); +function _arrayLikeToArray$1(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +__name(_arrayLikeToArray$1, "_arrayLikeToArray$1"); +var script$5 = { + name: "TableFooter", + hostName: "DataTable", + "extends": script$s, + props: { + columnGroup: { + type: null, + "default": null + }, + columns: { + type: Object, + "default": null + } + }, + provide: /* @__PURE__ */ __name(function provide5() { + return { + $rows: this.d_footerRows, + $columns: this.d_footerColumns + }; + }, "provide"), + data: /* @__PURE__ */ __name(function data7() { + return { + d_footerRows: new _default({ + type: "Row" + }), + d_footerColumns: new _default({ + type: "Column" + }) + }; + }, "data"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() { + this.d_footerRows.clear(); + this.d_footerColumns.clear(); + }, "beforeUnmount"), + methods: { + columnProp: /* @__PURE__ */ __name(function columnProp4(col, prop) { + return getVNodeProp(col, prop); + }, "columnProp"), + getColumnGroupPT: /* @__PURE__ */ __name(function getColumnGroupPT(key) { + var columnGroupMetaData = { + props: this.getColumnGroupProps(), + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + type: "footer", + scrollable: this.ptmTFootOptions.context.scrollable + } + }; + return mergeProps(this.ptm("columnGroup.".concat(key), { + columnGroup: columnGroupMetaData + }), this.ptm("columnGroup.".concat(key), columnGroupMetaData), this.ptmo(this.getColumnGroupProps(), key, columnGroupMetaData)); + }, "getColumnGroupPT"), + getColumnGroupProps: /* @__PURE__ */ __name(function getColumnGroupProps() { + return this.columnGroup && this.columnGroup.props && this.columnGroup.props.pt ? this.columnGroup.props.pt : void 0; + }, "getColumnGroupProps"), + getRowPT: /* @__PURE__ */ __name(function getRowPT(row2, key, index) { + var rowMetaData = { + props: row2.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index + } + }; + return mergeProps(this.ptm("row.".concat(key), { + row: rowMetaData + }), this.ptm("row.".concat(key), rowMetaData), this.ptmo(this.getRowProp(row2), key, rowMetaData)); + }, "getRowPT"), + getRowProp: /* @__PURE__ */ __name(function getRowProp(row2) { + return row2.props && row2.props.pt ? row2.props.pt : void 0; + }, "getRowProp"), + getFooterRows: /* @__PURE__ */ __name(function getFooterRows() { + var _this$d_footerRows; + return (_this$d_footerRows = this.d_footerRows) === null || _this$d_footerRows === void 0 ? void 0 : _this$d_footerRows.get(this.columnGroup, this.columnGroup.children); + }, "getFooterRows"), + getFooterColumns: /* @__PURE__ */ __name(function getFooterColumns(row2) { + var _this$d_footerColumns; + return (_this$d_footerColumns = this.d_footerColumns) === null || _this$d_footerColumns === void 0 ? void 0 : _this$d_footerColumns.get(row2, row2.children); + }, "getFooterColumns") + }, + computed: { + hasFooter: /* @__PURE__ */ __name(function hasFooter() { + var hasFooter2 = false; + if (this.columnGroup) { + hasFooter2 = true; + } else if (this.columns) { + var _iterator = _createForOfIteratorHelper$1(this.columns), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var col = _step.value; + if (this.columnProp(col, "footer") || col.children && col.children.footer) { + hasFooter2 = true; + break; + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + return hasFooter2; + }, "hasFooter"), + ptmTFootOptions: /* @__PURE__ */ __name(function ptmTFootOptions() { + var _this$$parentInstance; + return { + context: { + scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable + } + }; + }, "ptmTFootOptions") + }, + components: { + DTFooterCell: script$6 + } +}; +function _typeof$6(o) { + "@babel/helpers - typeof"; + return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$6(o); +} +__name(_typeof$6, "_typeof$6"); +function ownKeys$6(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$6, "ownKeys$6"); +function _objectSpread$6(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$6(Object(t), true).forEach(function(r2) { + _defineProperty$6(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$6, "_objectSpread$6"); +function _defineProperty$6(e, r, t) { + return (r = _toPropertyKey$6(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$6, "_defineProperty$6"); +function _toPropertyKey$6(t) { + var i = _toPrimitive$6(t, "string"); + return "symbol" == _typeof$6(i) ? i : i + ""; +} +__name(_toPropertyKey$6, "_toPropertyKey$6"); +function _toPrimitive$6(t, r) { + if ("object" != _typeof$6(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$6(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$6, "_toPrimitive$6"); +function render$5(_ctx, _cache, $props, $setup, $data, $options) { + var _component_DTFooterCell = resolveComponent("DTFooterCell"); + return $options.hasFooter ? (openBlock(), createElementBlock("tfoot", mergeProps({ + key: 0, + "class": _ctx.cx("tfoot"), + style: _ctx.sx("tfoot"), + role: "rowgroup" + }, $props.columnGroup ? _objectSpread$6(_objectSpread$6({}, _ctx.ptm("tfoot", $options.ptmTFootOptions)), $options.getColumnGroupPT("root")) : _ctx.ptm("tfoot", $options.ptmTFootOptions), { + "data-pc-section": "tfoot" + }), [!$props.columnGroup ? (openBlock(), createElementBlock("tr", mergeProps({ + key: 0, + role: "row" + }, _ctx.ptm("footerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { + return openBlock(), createElementBlock(Fragment, { + key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i + }, [!$options.columnProp(col, "hidden") ? (openBlock(), createBlock(_component_DTFooterCell, { + key: 0, + column: col, + pt: _ctx.pt + }, null, 8, ["column", "pt"])) : createCommentVNode("", true)], 64); + }), 128))], 16)) : (openBlock(true), createElementBlock(Fragment, { + key: 1 + }, renderList($options.getFooterRows(), function(row2, i) { + return openBlock(), createElementBlock("tr", mergeProps({ + key: i, + role: "row", + ref_for: true + }, _objectSpread$6(_objectSpread$6({}, _ctx.ptm("footerRow")), $options.getRowPT(row2, "root", i))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getFooterColumns(row2), function(col, j) { + return openBlock(), createElementBlock(Fragment, { + key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || j + }, [!$options.columnProp(col, "hidden") ? (openBlock(), createBlock(_component_DTFooterCell, { + key: 0, + column: col, + index: i, + pt: _ctx.pt + }, null, 8, ["column", "index", "pt"])) : createCommentVNode("", true)], 64); + }), 128))], 16); + }), 128))], 16)) : createCommentVNode("", true); +} +__name(render$5, "render$5"); +script$5.render = render$5; +function _typeof$5(o) { + "@babel/helpers - typeof"; + return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$5(o); +} +__name(_typeof$5, "_typeof$5"); +function ownKeys$5(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$5, "ownKeys$5"); +function _objectSpread$5(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$5(Object(t), true).forEach(function(r2) { + _defineProperty$5(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$5, "_objectSpread$5"); +function _defineProperty$5(e, r, t) { + return (r = _toPropertyKey$5(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$5, "_defineProperty$5"); +function _toPropertyKey$5(t) { + var i = _toPrimitive$5(t, "string"); + return "symbol" == _typeof$5(i) ? i : i + ""; +} +__name(_toPropertyKey$5, "_toPropertyKey$5"); +function _toPrimitive$5(t, r) { + if ("object" != _typeof$5(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$5(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$5, "_toPrimitive$5"); +var script$4 = { + name: "ColumnFilter", + hostName: "DataTable", + "extends": script$s, + emits: ["filter-change", "filter-apply", "operator-change", "matchmode-change", "constraint-add", "constraint-remove", "filter-clear", "apply-click"], + props: { + field: { + type: String, + "default": null + }, + type: { + type: String, + "default": "text" + }, + display: { + type: String, + "default": null + }, + showMenu: { + type: Boolean, + "default": true + }, + matchMode: { + type: String, + "default": null + }, + showOperator: { + type: Boolean, + "default": true + }, + showClearButton: { + type: Boolean, + "default": true + }, + showApplyButton: { + type: Boolean, + "default": true + }, + showMatchModes: { + type: Boolean, + "default": true + }, + showAddButton: { + type: Boolean, + "default": true + }, + matchModeOptions: { + type: Array, + "default": null + }, + maxConstraints: { + type: Number, + "default": 2 + }, + filterElement: { + type: Function, + "default": null + }, + filterHeaderTemplate: { + type: Function, + "default": null + }, + filterFooterTemplate: { + type: Function, + "default": null + }, + filterClearTemplate: { + type: Function, + "default": null + }, + filterApplyTemplate: { + type: Function, + "default": null + }, + filterIconTemplate: { + type: Function, + "default": null + }, + filterAddIconTemplate: { + type: Function, + "default": null + }, + filterRemoveIconTemplate: { + type: Function, + "default": null + }, + filterClearIconTemplate: { + type: Function, + "default": null + }, + filters: { + type: Object, + "default": null + }, + filtersStore: { + type: Object, + "default": null + }, + filterMenuClass: { + type: String, + "default": null + }, + filterMenuStyle: { + type: null, + "default": null + }, + filterInputProps: { + type: null, + "default": null + }, + filterButtonProps: { + type: null, + "default": null + }, + column: null + }, + data: /* @__PURE__ */ __name(function data8() { + return { + id: this.$attrs.id, + overlayVisible: false, + defaultMatchMode: null, + defaultOperator: null + }; + }, "data"), + watch: { + "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) { + this.id = newValue || UniqueComponentId(); + }, "$attrsId") + }, + overlay: null, + selfClick: false, + overlayEventListener: null, + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount3() { + if (this.overlayEventListener) { + OverlayEventBus.off("overlay-click", this.overlayEventListener); + this.overlayEventListener = null; + } + if (this.overlay) { + ZIndex.clear(this.overlay); + this.onOverlayHide(); + } + }, "beforeUnmount"), + mounted: /* @__PURE__ */ __name(function mounted6() { + this.id = this.id || UniqueComponentId(); + if (this.filters && this.filters[this.field]) { + var fieldFilters = this.filters[this.field]; + if (fieldFilters.operator) { + this.defaultMatchMode = fieldFilters.constraints[0].matchMode; + this.defaultOperator = fieldFilters.operator; + } else { + this.defaultMatchMode = this.filters[this.field].matchMode; + } + } + }, "mounted"), + methods: { + getColumnPT: /* @__PURE__ */ __name(function getColumnPT6(key, params) { + var columnMetaData = _objectSpread$5({ + props: this.column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + } + }, params); + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp5() { + return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; + }, "getColumnProp"), + ptmFilterConstraintOptions: /* @__PURE__ */ __name(function ptmFilterConstraintOptions(matchMode) { + return { + context: { + highlighted: matchMode && this.isRowMatchModeSelected(matchMode.value) + } + }; + }, "ptmFilterConstraintOptions"), + clearFilter: /* @__PURE__ */ __name(function clearFilter() { + var _filters = _objectSpread$5({}, this.filters); + if (_filters[this.field].operator) { + _filters[this.field].constraints.splice(1); + _filters[this.field].operator = this.defaultOperator; + _filters[this.field].constraints[0] = { + value: null, + matchMode: this.defaultMatchMode + }; + } else { + _filters[this.field].value = null; + _filters[this.field].matchMode = this.defaultMatchMode; + } + this.$emit("filter-clear"); + this.$emit("filter-change", _filters); + this.$emit("filter-apply"); + this.hide(); + }, "clearFilter"), + applyFilter: /* @__PURE__ */ __name(function applyFilter() { + this.$emit("apply-click", { + field: this.field, + constraints: this.filters[this.field] + }); + this.$emit("filter-apply"); + this.hide(); + }, "applyFilter"), + hasFilter: /* @__PURE__ */ __name(function hasFilter() { + if (this.filtersStore) { + var fieldFilter = this.filtersStore[this.field]; + if (fieldFilter) { + if (fieldFilter.operator) return !this.isFilterBlank(fieldFilter.constraints[0].value); + else return !this.isFilterBlank(fieldFilter.value); + } + } + return false; + }, "hasFilter"), + hasRowFilter: /* @__PURE__ */ __name(function hasRowFilter() { + return this.filters[this.field] && !this.isFilterBlank(this.filters[this.field].value); + }, "hasRowFilter"), + isFilterBlank: /* @__PURE__ */ __name(function isFilterBlank(filter3) { + if (filter3 !== null && filter3 !== void 0) { + if (typeof filter3 === "string" && filter3.trim().length == 0 || filter3 instanceof Array && filter3.length == 0) return true; + else return false; + } + return true; + }, "isFilterBlank"), + toggleMenu: /* @__PURE__ */ __name(function toggleMenu(event2) { + this.overlayVisible = !this.overlayVisible; + event2.preventDefault(); + }, "toggleMenu"), + onToggleButtonKeyDown: /* @__PURE__ */ __name(function onToggleButtonKeyDown(event2) { + switch (event2.code) { + case "Enter": + case "NumpadEnter": + case "Space": + this.toggleMenu(event2); + break; + case "Escape": + this.overlayVisible = false; + break; + } + }, "onToggleButtonKeyDown"), + onRowMatchModeChange: /* @__PURE__ */ __name(function onRowMatchModeChange(matchMode) { + var _filters = _objectSpread$5({}, this.filters); + _filters[this.field].matchMode = matchMode; + this.$emit("matchmode-change", { + field: this.field, + matchMode + }); + this.$emit("filter-change", _filters); + this.$emit("filter-apply"); + this.hide(); + }, "onRowMatchModeChange"), + onRowMatchModeKeyDown: /* @__PURE__ */ __name(function onRowMatchModeKeyDown(event2) { + var item = event2.target; + switch (event2.code) { + case "ArrowDown": + var nextItem = this.findNextItem(item); + if (nextItem) { + item.removeAttribute("tabindex"); + nextItem.tabIndex = "0"; + nextItem.focus(); + } + event2.preventDefault(); + break; + case "ArrowUp": + var prevItem = this.findPrevItem(item); + if (prevItem) { + item.removeAttribute("tabindex"); + prevItem.tabIndex = "0"; + prevItem.focus(); + } + event2.preventDefault(); + break; + } + }, "onRowMatchModeKeyDown"), + isRowMatchModeSelected: /* @__PURE__ */ __name(function isRowMatchModeSelected(matchMode) { + return this.filters[this.field].matchMode === matchMode; + }, "isRowMatchModeSelected"), + onOperatorChange: /* @__PURE__ */ __name(function onOperatorChange(value) { + var _filters = _objectSpread$5({}, this.filters); + _filters[this.field].operator = value; + this.$emit("filter-change", _filters); + this.$emit("operator-change", { + field: this.field, + operator: value + }); + if (!this.showApplyButton) { + this.$emit("filter-apply"); + } + }, "onOperatorChange"), + onMenuMatchModeChange: /* @__PURE__ */ __name(function onMenuMatchModeChange(value, index) { + var _filters = _objectSpread$5({}, this.filters); + _filters[this.field].constraints[index].matchMode = value; + this.$emit("matchmode-change", { + field: this.field, + matchMode: value, + index + }); + if (!this.showApplyButton) { + this.$emit("filter-apply"); + } + }, "onMenuMatchModeChange"), + addConstraint: /* @__PURE__ */ __name(function addConstraint() { + var _filters = _objectSpread$5({}, this.filters); + var newConstraint = { + value: null, + matchMode: this.defaultMatchMode + }; + _filters[this.field].constraints.push(newConstraint); + this.$emit("constraint-add", { + field: this.field, + constraing: newConstraint + }); + this.$emit("filter-change", _filters); + if (!this.showApplyButton) { + this.$emit("filter-apply"); + } + }, "addConstraint"), + removeConstraint: /* @__PURE__ */ __name(function removeConstraint(index) { + var _filters = _objectSpread$5({}, this.filters); + var removedConstraint = _filters[this.field].constraints.splice(index, 1); + this.$emit("constraint-remove", { + field: this.field, + constraing: removedConstraint + }); + this.$emit("filter-change", _filters); + if (!this.showApplyButton) { + this.$emit("filter-apply"); + } + }, "removeConstraint"), + filterCallback: /* @__PURE__ */ __name(function filterCallback() { + this.$emit("filter-apply"); + }, "filterCallback"), + findNextItem: /* @__PURE__ */ __name(function findNextItem(item) { + var nextItem = item.nextElementSibling; + if (nextItem) return getAttribute(nextItem, "data-pc-section") === "filterconstraintseparator" ? this.findNextItem(nextItem) : nextItem; + else return item.parentElement.firstElementChild; + }, "findNextItem"), + findPrevItem: /* @__PURE__ */ __name(function findPrevItem(item) { + var prevItem = item.previousElementSibling; + if (prevItem) return getAttribute(prevItem, "data-pc-section") === "filterconstraintseparator" ? this.findPrevItem(prevItem) : prevItem; + else return item.parentElement.lastElementChild; + }, "findPrevItem"), + hide: /* @__PURE__ */ __name(function hide() { + this.overlayVisible = false; + this.showMenuButton && focus(this.$refs.icon.$el); + }, "hide"), + onContentClick: /* @__PURE__ */ __name(function onContentClick(event2) { + this.selfClick = true; + OverlayEventBus.emit("overlay-click", { + originalEvent: event2, + target: this.overlay + }); + }, "onContentClick"), + onContentMouseDown: /* @__PURE__ */ __name(function onContentMouseDown() { + this.selfClick = true; + }, "onContentMouseDown"), + onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter(el) { + var _this = this; + if (this.filterMenuStyle) { + addStyle(this.overlay, this.filterMenuStyle); + } + ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay); + addStyle(el, { + position: "absolute", + top: "0", + left: "0" + }); + absolutePosition(this.overlay, this.$refs.icon.$el); + this.bindOutsideClickListener(); + this.bindScrollListener(); + this.bindResizeListener(); + this.overlayEventListener = function(e) { + if (!_this.isOutsideClicked(e.target)) { + _this.selfClick = true; + } + }; + OverlayEventBus.on("overlay-click", this.overlayEventListener); + }, "onOverlayEnter"), + onOverlayAfterEnter: /* @__PURE__ */ __name(function onOverlayAfterEnter() { + var _this$overlay; + (_this$overlay = this.overlay) === null || _this$overlay === void 0 || (_this$overlay = _this$overlay.$focustrap) === null || _this$overlay === void 0 || _this$overlay.autoFocus(); + }, "onOverlayAfterEnter"), + onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave() { + this.onOverlayHide(); + }, "onOverlayLeave"), + onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave(el) { + ZIndex.clear(el); + }, "onOverlayAfterLeave"), + onOverlayHide: /* @__PURE__ */ __name(function onOverlayHide() { + this.unbindOutsideClickListener(); + this.unbindResizeListener(); + this.unbindScrollListener(); + this.overlay = null; + OverlayEventBus.off("overlay-click", this.overlayEventListener); + this.overlayEventListener = null; + }, "onOverlayHide"), + overlayRef: /* @__PURE__ */ __name(function overlayRef(el) { + this.overlay = el; + }, "overlayRef"), + isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked(target) { + return !this.isTargetClicked(target) && this.overlay && !(this.overlay.isSameNode(target) || this.overlay.contains(target)); + }, "isOutsideClicked"), + isTargetClicked: /* @__PURE__ */ __name(function isTargetClicked(target) { + return this.$refs.icon && (this.$refs.icon.$el.isSameNode(target) || this.$refs.icon.$el.contains(target)); + }, "isTargetClicked"), + bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener() { + var _this2 = this; + if (!this.outsideClickListener) { + this.outsideClickListener = function(event2) { + if (_this2.overlayVisible && !_this2.selfClick && _this2.isOutsideClicked(event2.target)) { + _this2.overlayVisible = false; + } + _this2.selfClick = false; + }; + document.addEventListener("click", this.outsideClickListener); + } + }, "bindOutsideClickListener"), + unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener() { + if (this.outsideClickListener) { + document.removeEventListener("click", this.outsideClickListener); + this.outsideClickListener = null; + this.selfClick = false; + } + }, "unbindOutsideClickListener"), + bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener() { + var _this3 = this; + if (!this.scrollHandler) { + this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.icon.$el, function() { + if (_this3.overlayVisible) { + _this3.hide(); + } + }); + } + this.scrollHandler.bindScrollListener(); + }, "bindScrollListener"), + unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener() { + if (this.scrollHandler) { + this.scrollHandler.unbindScrollListener(); + } + }, "unbindScrollListener"), + bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener() { + var _this4 = this; + if (!this.resizeListener) { + this.resizeListener = function() { + if (_this4.overlayVisible && !isTouchDevice()) { + _this4.hide(); + } + }; + window.addEventListener("resize", this.resizeListener); + } + }, "bindResizeListener"), + unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener() { + if (this.resizeListener) { + window.removeEventListener("resize", this.resizeListener); + this.resizeListener = null; + } + }, "unbindResizeListener") + }, + computed: { + showMenuButton: /* @__PURE__ */ __name(function showMenuButton() { + return this.showMenu && (this.display === "row" ? this.type !== "boolean" : true); + }, "showMenuButton"), + overlayId: /* @__PURE__ */ __name(function overlayId() { + return this.id + "_overlay"; + }, "overlayId"), + matchModes: /* @__PURE__ */ __name(function matchModes() { + var _this5 = this; + return this.matchModeOptions || this.$primevue.config.filterMatchModeOptions[this.type].map(function(key) { + return { + label: _this5.$primevue.config.locale[key], + value: key + }; + }); + }, "matchModes"), + isShowMatchModes: /* @__PURE__ */ __name(function isShowMatchModes() { + return this.type !== "boolean" && this.showMatchModes && this.matchModes; + }, "isShowMatchModes"), + operatorOptions: /* @__PURE__ */ __name(function operatorOptions() { + return [{ + label: this.$primevue.config.locale.matchAll, + value: FilterOperator.AND + }, { + label: this.$primevue.config.locale.matchAny, + value: FilterOperator.OR + }]; + }, "operatorOptions"), + noFilterLabel: /* @__PURE__ */ __name(function noFilterLabel() { + return this.$primevue.config.locale ? this.$primevue.config.locale.noFilter : void 0; + }, "noFilterLabel"), + isShowOperator: /* @__PURE__ */ __name(function isShowOperator() { + return this.showOperator && this.filters[this.field].operator; + }, "isShowOperator"), + operator: /* @__PURE__ */ __name(function operator() { + return this.filters[this.field].operator; + }, "operator"), + fieldConstraints: /* @__PURE__ */ __name(function fieldConstraints() { + return this.filters[this.field].constraints || [this.filters[this.field]]; + }, "fieldConstraints"), + showRemoveIcon: /* @__PURE__ */ __name(function showRemoveIcon() { + return this.fieldConstraints.length > 1; + }, "showRemoveIcon"), + removeRuleButtonLabel: /* @__PURE__ */ __name(function removeRuleButtonLabel() { + return this.$primevue.config.locale ? this.$primevue.config.locale.removeRule : void 0; + }, "removeRuleButtonLabel"), + addRuleButtonLabel: /* @__PURE__ */ __name(function addRuleButtonLabel() { + return this.$primevue.config.locale ? this.$primevue.config.locale.addRule : void 0; + }, "addRuleButtonLabel"), + isShowAddConstraint: /* @__PURE__ */ __name(function isShowAddConstraint() { + return this.showAddButton && this.filters[this.field].operator && this.fieldConstraints && this.fieldConstraints.length < this.maxConstraints; + }, "isShowAddConstraint"), + clearButtonLabel: /* @__PURE__ */ __name(function clearButtonLabel() { + return this.$primevue.config.locale ? this.$primevue.config.locale.clear : void 0; + }, "clearButtonLabel"), + applyButtonLabel: /* @__PURE__ */ __name(function applyButtonLabel() { + return this.$primevue.config.locale ? this.$primevue.config.locale.apply : void 0; + }, "applyButtonLabel"), + columnFilterButtonAriaLabel: /* @__PURE__ */ __name(function columnFilterButtonAriaLabel() { + return this.$primevue.config.locale ? this.overlayVisible ? this.$primevue.config.locale.showFilterMenu : this.$primevue.config.locale.hideFilterMenu : void 0; + }, "columnFilterButtonAriaLabel"), + filterOperatorAriaLabel: /* @__PURE__ */ __name(function filterOperatorAriaLabel() { + return this.$primevue.config.locale ? this.$primevue.config.locale.filterOperator : void 0; + }, "filterOperatorAriaLabel"), + filterRuleAriaLabel: /* @__PURE__ */ __name(function filterRuleAriaLabel() { + return this.$primevue.config.locale ? this.$primevue.config.locale.filterConstraint : void 0; + }, "filterRuleAriaLabel"), + ptmHeaderFilterClearParams: /* @__PURE__ */ __name(function ptmHeaderFilterClearParams() { + return { + context: { + hidden: this.hasRowFilter() + } + }; + }, "ptmHeaderFilterClearParams"), + ptmFilterMenuParams: /* @__PURE__ */ __name(function ptmFilterMenuParams() { + return { + context: { + overlayVisible: this.overlayVisible, + active: this.hasFilter() + } + }; + }, "ptmFilterMenuParams") + }, + components: { + Select: script$u, +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js + Button: script$A, + Portal: script$F, + FilterSlashIcon: script$i, + FilterIcon: script$j, + TrashIcon: script$h, + PlusIcon: script$G +======== + Button: script$z, + Portal: script$E, + FilterSlashIcon: script$h, + FilterIcon: script$i, + TrashIcon: script$g, + PlusIcon: script$F +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js + }, + directives: { + focustrap: FocusTrap + } +}; +function _typeof$4(o) { + "@babel/helpers - typeof"; + return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$4(o); +} +__name(_typeof$4, "_typeof$4"); +function ownKeys$4(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$4, "ownKeys$4"); +function _objectSpread$4(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$4(Object(t), true).forEach(function(r2) { + _defineProperty$4(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$4, "_objectSpread$4"); +function _defineProperty$4(e, r, t) { + return (r = _toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$4, "_defineProperty$4"); +function _toPropertyKey$4(t) { + var i = _toPrimitive$4(t, "string"); + return "symbol" == _typeof$4(i) ? i : i + ""; +} +__name(_toPropertyKey$4, "_toPropertyKey$4"); +function _toPrimitive$4(t, r) { + if ("object" != _typeof$4(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$4(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$4, "_toPrimitive$4"); +var _hoisted_1$1 = ["id", "aria-modal"]; +var _hoisted_2 = ["onClick", "onKeydown", "tabindex"]; +function render$4(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Button = resolveComponent("Button"); + var _component_Select = resolveComponent("Select"); + var _component_Portal = resolveComponent("Portal"); + var _directive_focustrap = resolveDirective("focustrap"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("filter") + }, $options.getColumnPT("filter")), [$props.display === "row" ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("filterElementContainer") + }, _objectSpread$4(_objectSpread$4({}, $props.filterInputProps), $options.getColumnPT("filterElementContainer"))), [(openBlock(), createBlock(resolveDynamicComponent($props.filterElement), { + field: $props.field, + filterModel: $props.filters[$props.field], + filterCallback: $options.filterCallback + }, null, 8, ["field", "filterModel", "filterCallback"]))], 16)) : createCommentVNode("", true), $options.showMenuButton ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 1, + ref: "icon", + "aria-label": $options.columnFilterButtonAriaLabel, + "aria-haspopup": "true", + "aria-expanded": $data.overlayVisible, + "aria-controls": $options.overlayId, + "class": _ctx.cx("pcColumnFilterButton"), + unstyled: _ctx.unstyled, + onClick: _cache[0] || (_cache[0] = function($event) { + return $options.toggleMenu($event); + }), + onKeydown: _cache[1] || (_cache[1] = function($event) { + return $options.onToggleButtonKeyDown($event); + }) + }, _objectSpread$4(_objectSpread$4({}, $options.getColumnPT("pcColumnFilterButton", $options.ptmFilterMenuParams)), $props.filterButtonProps.filter)), { + icon: withCtx(function(slotProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.filterIconTemplate || "FilterIcon"), mergeProps({ + "class": slotProps["class"] + }, $options.getColumnPT("filterMenuIcon")), null, 16, ["class"]))]; + }), + _: 1 + }, 16, ["aria-label", "aria-expanded", "aria-controls", "class", "unstyled"])) : createCommentVNode("", true), $props.showClearButton && $props.display === "row" && $options.hasRowFilter() ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 2, + "class": _ctx.cx("pcColumnFilterClearButton"), + unstyled: _ctx.unstyled, + onClick: _cache[2] || (_cache[2] = function($event) { + return $options.clearFilter(); + }) + }, _objectSpread$4(_objectSpread$4({}, $options.getColumnPT("pcColumnFilterClearButton", $options.ptmHeaderFilterClearParams)), $props.filterButtonProps.inline.clear)), { + icon: withCtx(function(slotProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.filterClearIconTemplate || "FilterSlashIcon"), mergeProps({ + "class": slotProps["class"] + }, $options.getColumnPT("filterClearIcon")), null, 16, ["class"]))]; + }), + _: 1 + }, 16, ["class", "unstyled"])) : createCommentVNode("", true), createVNode(_component_Portal, null, { + "default": withCtx(function() { + return [createVNode(Transition, mergeProps({ + name: "p-connected-overlay", + onEnter: $options.onOverlayEnter, + onAfterEnter: $options.onOverlayAfterEnter, + onLeave: $options.onOverlayLeave, + onAfterLeave: $options.onOverlayAfterLeave + }, $options.getColumnPT("transition")), { + "default": withCtx(function() { + return [$data.overlayVisible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({ + key: 0, + ref: $options.overlayRef, + id: $options.overlayId, + "aria-modal": $data.overlayVisible, + role: "dialog", + "class": [_ctx.cx("filterOverlay"), $props.filterMenuClass], + onKeydown: _cache[10] || (_cache[10] = withKeys(function() { + return $options.hide && $options.hide.apply($options, arguments); + }, ["escape"])), + onClick: _cache[11] || (_cache[11] = function() { + return $options.onContentClick && $options.onContentClick.apply($options, arguments); + }), + onMousedown: _cache[12] || (_cache[12] = function() { + return $options.onContentMouseDown && $options.onContentMouseDown.apply($options, arguments); + }) + }, $options.getColumnPT("filterOverlay")), [(openBlock(), createBlock(resolveDynamicComponent($props.filterHeaderTemplate), { + field: $props.field, + filterModel: $props.filters[$props.field], + filterCallback: $options.filterCallback + }, null, 8, ["field", "filterModel", "filterCallback"])), $props.display === "row" ? (openBlock(), createElementBlock("ul", mergeProps({ + key: 0, + "class": _ctx.cx("filterConstraintList") + }, $options.getColumnPT("filterConstraintList")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.matchModes, function(matchMode, i) { + return openBlock(), createElementBlock("li", mergeProps({ + key: matchMode.label, + "class": _ctx.cx("filterConstraint", { + matchMode + }), + onClick: /* @__PURE__ */ __name(function onClick3($event) { + return $options.onRowMatchModeChange(matchMode.value); + }, "onClick"), + onKeydown: [_cache[3] || (_cache[3] = function($event) { + return $options.onRowMatchModeKeyDown($event); + }), withKeys(withModifiers(function($event) { + return $options.onRowMatchModeChange(matchMode.value); + }, ["prevent"]), ["enter"])], + tabindex: i === 0 ? "0" : null, + ref_for: true + }, $options.getColumnPT("filterConstraint", $options.ptmFilterConstraintOptions(matchMode))), toDisplayString(matchMode.label), 17, _hoisted_2); + }), 128)), createBaseVNode("li", mergeProps({ + "class": _ctx.cx("filterConstraintSeparator") + }, $options.getColumnPT("filterConstraintSeparator")), null, 16), createBaseVNode("li", mergeProps({ + "class": _ctx.cx("filterConstraint"), + onClick: _cache[4] || (_cache[4] = function($event) { + return $options.clearFilter(); + }), + onKeydown: [_cache[5] || (_cache[5] = function($event) { + return $options.onRowMatchModeKeyDown($event); + }), _cache[6] || (_cache[6] = withKeys(function($event) { + return _ctx.onRowClearItemClick(); + }, ["enter"]))] + }, $options.getColumnPT("filterConstraint")), toDisplayString($options.noFilterLabel), 17)], 16)) : (openBlock(), createElementBlock(Fragment, { + key: 1 + }, [$options.isShowOperator ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("filterOperator") + }, $options.getColumnPT("filterOperator")), [createVNode(_component_Select, { + options: $options.operatorOptions, + modelValue: $options.operator, + "aria-label": $options.filterOperatorAriaLabel, + "class": normalizeClass(_ctx.cx("pcFilterOperatorDropdown")), + optionLabel: "label", + optionValue: "value", + "onUpdate:modelValue": _cache[7] || (_cache[7] = function($event) { + return $options.onOperatorChange($event); + }), + unstyled: _ctx.unstyled, + pt: $options.getColumnPT("pcFilterOperatorDropdown") + }, null, 8, ["options", "modelValue", "aria-label", "class", "unstyled", "pt"])], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("filterRuleList") + }, $options.getColumnPT("filterRuleList")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldConstraints, function(fieldConstraint, i) { + return openBlock(), createElementBlock("div", mergeProps({ + key: i, + "class": _ctx.cx("filterRule"), + ref_for: true + }, $options.getColumnPT("filterRule")), [$options.isShowMatchModes ? (openBlock(), createBlock(_component_Select, { + key: 0, + options: $options.matchModes, + modelValue: fieldConstraint.matchMode, + "class": normalizeClass(_ctx.cx("pcFilterConstraintDropdown")), + optionLabel: "label", + optionValue: "value", + "aria-label": $options.filterRuleAriaLabel, + "onUpdate:modelValue": /* @__PURE__ */ __name(function onUpdateModelValue($event) { + return $options.onMenuMatchModeChange($event, i); + }, "onUpdateModelValue"), + unstyled: _ctx.unstyled, + pt: $options.getColumnPT("pcFilterConstraintDropdown") + }, null, 8, ["options", "modelValue", "class", "aria-label", "onUpdate:modelValue", "unstyled", "pt"])) : createCommentVNode("", true), $props.display === "menu" ? (openBlock(), createBlock(resolveDynamicComponent($props.filterElement), { + key: 1, + field: $props.field, + filterModel: fieldConstraint, + filterCallback: $options.filterCallback, + applyFilter: $options.applyFilter + }, null, 8, ["field", "filterModel", "filterCallback", "applyFilter"])) : createCommentVNode("", true), $options.showRemoveIcon ? (openBlock(), createElementBlock("div", mergeProps({ + key: 2, + ref_for: true + }, $options.getColumnPT("filterRemove")), [createVNode(_component_Button, mergeProps({ + type: "button", + "class": _ctx.cx("pcFilterRemoveRuleButton"), + onClick: /* @__PURE__ */ __name(function onClick3($event) { + return $options.removeConstraint(i); + }, "onClick"), + label: $options.removeRuleButtonLabel, + unstyled: _ctx.unstyled, + ref_for: true + }, $props.filterButtonProps.popover.removeRule, { + pt: $options.getColumnPT("pcFilterRemoveRuleButton") + }), { + icon: withCtx(function(iconProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.filterRemoveIconTemplate || "TrashIcon"), mergeProps({ + "class": iconProps["class"], + ref_for: true + }, $options.getColumnPT("pcFilterRemoveRuleButton")["icon"]), null, 16, ["class"]))]; + }), + _: 2 + }, 1040, ["class", "onClick", "label", "unstyled", "pt"])], 16)) : createCommentVNode("", true)], 16); + }), 128))], 16), $options.isShowAddConstraint ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ + key: 1 + }, $options.getColumnPT("filterAddButtonContainer"))), [createVNode(_component_Button, mergeProps({ + type: "button", + label: $options.addRuleButtonLabel, + iconPos: "left", + "class": _ctx.cx("pcFilterAddRuleButton"), + onClick: _cache[8] || (_cache[8] = function($event) { + return $options.addConstraint(); + }), + unstyled: _ctx.unstyled + }, $props.filterButtonProps.popover.addRule, { + pt: $options.getColumnPT("pcFilterAddRuleButton") + }), { + icon: withCtx(function(iconProps) { + return [(openBlock(), createBlock(resolveDynamicComponent($props.filterAddIconTemplate || "PlusIcon"), mergeProps({ + "class": iconProps["class"] + }, $options.getColumnPT("pcFilterAddRuleButton")["icon"]), null, 16, ["class"]))]; + }), + _: 1 + }, 16, ["label", "class", "unstyled", "pt"])], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("filterButtonbar") + }, $options.getColumnPT("filterButtonbar")), [!$props.filterClearTemplate && $props.showClearButton ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 0, + type: "button", + "class": _ctx.cx("pcFilterClearButton"), + label: $options.clearButtonLabel, + onClick: $options.clearFilter, + unstyled: _ctx.unstyled + }, $props.filterButtonProps.popover.clear, { + pt: $options.getColumnPT("pcFilterClearButton") + }), null, 16, ["class", "label", "onClick", "unstyled", "pt"])) : (openBlock(), createBlock(resolveDynamicComponent($props.filterClearTemplate), { + key: 1, + field: $props.field, + filterModel: $props.filters[$props.field], + filterCallback: $options.clearFilter + }, null, 8, ["field", "filterModel", "filterCallback"])), $props.showApplyButton ? (openBlock(), createElementBlock(Fragment, { + key: 2 + }, [!$props.filterApplyTemplate ? (openBlock(), createBlock(_component_Button, mergeProps({ + key: 0, + type: "button", + "class": _ctx.cx("pcFilterApplyButton"), + label: $options.applyButtonLabel, + onClick: _cache[9] || (_cache[9] = function($event) { + return $options.applyFilter(); + }), + unstyled: _ctx.unstyled + }, $props.filterButtonProps.popover.apply, { + pt: $options.getColumnPT("pcFilterApplyButton") + }), null, 16, ["class", "label", "unstyled", "pt"])) : (openBlock(), createBlock(resolveDynamicComponent($props.filterApplyTemplate), { + key: 1, + field: $props.field, + filterModel: $props.filters[$props.field], + filterCallback: $options.applyFilter + }, null, 8, ["field", "filterModel", "filterCallback"]))], 64)) : createCommentVNode("", true)], 16)], 64)), (openBlock(), createBlock(resolveDynamicComponent($props.filterFooterTemplate), { + field: $props.field, + filterModel: $props.filters[$props.field], + filterCallback: $options.filterCallback + }, null, 8, ["field", "filterModel", "filterCallback"]))], 16, _hoisted_1$1)), [[_directive_focustrap]]) : createCommentVNode("", true)]; + }), + _: 1 + }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])]; + }), + _: 1 + })], 16); +} +__name(render$4, "render$4"); +script$4.render = render$4; +var script$3 = { + name: "HeaderCheckbox", + hostName: "DataTable", + "extends": script$s, + emits: ["change"], + props: { + checked: null, + disabled: null, + column: null, + headerCheckboxIconTemplate: { + type: Function, + "default": null + } + }, + methods: { + getColumnPT: /* @__PURE__ */ __name(function getColumnPT7(key) { + var columnMetaData = { + props: this.column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + checked: this.checked, + disabled: this.disabled + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp6() { + return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; + }, "getColumnProp"), + onChange: /* @__PURE__ */ __name(function onChange7(event2) { + this.$emit("change", { + originalEvent: event2, + checked: !this.checked + }); + }, "onChange") + }, + computed: { + headerCheckboxAriaLabel: /* @__PURE__ */ __name(function headerCheckboxAriaLabel() { + return this.$primevue.config.locale.aria ? this.checked ? this.$primevue.config.locale.aria.selectAll : this.$primevue.config.locale.aria.unselectAll : void 0; + }, "headerCheckboxAriaLabel") + }, + components: { + CheckIcon: script$y, + Checkbox: script$z + } +}; +function render$3(_ctx, _cache, $props, $setup, $data, $options) { + var _component_CheckIcon = resolveComponent("CheckIcon"); + var _component_Checkbox = resolveComponent("Checkbox"); + return openBlock(), createBlock(_component_Checkbox, { + modelValue: $props.checked, + binary: true, + disabled: $props.disabled, + "aria-label": $options.headerCheckboxAriaLabel, + onChange: $options.onChange, + unstyled: _ctx.unstyled, + pt: $options.getColumnPT("pcHeaderCheckbox") + }, { + icon: withCtx(function(slotProps) { + return [$props.headerCheckboxIconTemplate ? (openBlock(), createBlock(resolveDynamicComponent($props.headerCheckboxIconTemplate), { + key: 0, + checked: slotProps.checked, + "class": normalizeClass(slotProps["class"]) + }, null, 8, ["checked", "class"])) : !$props.headerCheckboxIconTemplate && slotProps.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({ + key: 1, + "class": slotProps["class"] + }, $options.getColumnPT("pcHeaderCheckbox")["icon"]), null, 16, ["class"])) : createCommentVNode("", true)]; + }), + _: 1 + }, 8, ["modelValue", "disabled", "aria-label", "onChange", "unstyled", "pt"]); +} +__name(render$3, "render$3"); +script$3.render = render$3; +var script$2 = { + name: "HeaderCell", + hostName: "DataTable", + "extends": script$s, + emits: ["column-click", "column-mousedown", "column-dragstart", "column-dragover", "column-dragleave", "column-drop", "column-resizestart", "checkbox-change", "filter-change", "filter-apply", "operator-change", "matchmode-change", "constraint-add", "constraint-remove", "filter-clear", "apply-click"], + props: { + column: { + type: Object, + "default": null + }, + index: { + type: Number, + "default": null + }, + resizableColumns: { + type: Boolean, + "default": false + }, + groupRowsBy: { + type: [Array, String, Function], + "default": null + }, + sortMode: { + type: String, + "default": "single" + }, + groupRowSortField: { + type: [String, Function], + "default": null + }, + sortField: { + type: [String, Function], + "default": null + }, + sortOrder: { + type: Number, + "default": null + }, + multiSortMeta: { + type: Array, + "default": null + }, + allRowsSelected: { + type: Boolean, + "default": false + }, + empty: { + type: Boolean, + "default": false + }, + filterDisplay: { + type: String, + "default": null + }, + filters: { + type: Object, + "default": null + }, + filtersStore: { + type: Object, + "default": null + }, + filterColumn: { + type: Boolean, + "default": false + }, + reorderableColumns: { + type: Boolean, + "default": false + }, + filterInputProps: { + type: null, + "default": null + }, + filterButtonProps: { + type: null, + "default": null + } + }, + data: /* @__PURE__ */ __name(function data9() { + return { + styleObject: {} + }; + }, "data"), + mounted: /* @__PURE__ */ __name(function mounted7() { + if (this.columnProp("frozen")) { + this.updateStickyPosition(); + } + }, "mounted"), + updated: /* @__PURE__ */ __name(function updated4() { + if (this.columnProp("frozen")) { + this.updateStickyPosition(); + } + }, "updated"), + methods: { + columnProp: /* @__PURE__ */ __name(function columnProp5(prop) { + return getVNodeProp(this.column, prop); + }, "columnProp"), + getColumnPT: /* @__PURE__ */ __name(function getColumnPT8(key) { + var _this$$parentInstance, _this$$parentInstance2; + var columnMetaData = { + props: this.column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index: this.index, + sortable: this.columnProp("sortable") === "" || this.columnProp("sortable"), + sorted: this.isColumnSorted(), + resizable: this.resizableColumns, + size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size, + showGridlines: ((_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines) || false + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp7() { + return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; + }, "getColumnProp"), + onClick: /* @__PURE__ */ __name(function onClick2(event2) { + this.$emit("column-click", { + originalEvent: event2, + column: this.column + }); + }, "onClick"), + onKeyDown: /* @__PURE__ */ __name(function onKeyDown2(event2) { + if ((event2.code === "Enter" || event2.code === "NumpadEnter" || event2.code === "Space") && event2.currentTarget.nodeName === "TH" && getAttribute(event2.currentTarget, "data-p-sortable-column")) { + this.$emit("column-click", { + originalEvent: event2, + column: this.column + }); + event2.preventDefault(); + } + }, "onKeyDown"), + onMouseDown: /* @__PURE__ */ __name(function onMouseDown(event2) { + this.$emit("column-mousedown", { + originalEvent: event2, + column: this.column + }); + }, "onMouseDown"), + onDragStart: /* @__PURE__ */ __name(function onDragStart(event2) { + this.$emit("column-dragstart", { + originalEvent: event2, + column: this.column + }); + }, "onDragStart"), + onDragOver: /* @__PURE__ */ __name(function onDragOver(event2) { + this.$emit("column-dragover", { + originalEvent: event2, + column: this.column + }); + }, "onDragOver"), + onDragLeave: /* @__PURE__ */ __name(function onDragLeave(event2) { + this.$emit("column-dragleave", { + originalEvent: event2, + column: this.column + }); + }, "onDragLeave"), + onDrop: /* @__PURE__ */ __name(function onDrop(event2) { + this.$emit("column-drop", { + originalEvent: event2, + column: this.column + }); + }, "onDrop"), + onResizeStart: /* @__PURE__ */ __name(function onResizeStart(event2) { + this.$emit("column-resizestart", event2); + }, "onResizeStart"), + getMultiSortMetaIndex: /* @__PURE__ */ __name(function getMultiSortMetaIndex() { + var _this = this; + return this.multiSortMeta.findIndex(function(meta) { + return meta.field === _this.columnProp("field") || meta.field === _this.columnProp("sortField"); + }); + }, "getMultiSortMetaIndex"), + getBadgeValue: /* @__PURE__ */ __name(function getBadgeValue() { + var index = this.getMultiSortMetaIndex(); + return this.groupRowsBy && this.groupRowsBy === this.groupRowSortField && index > -1 ? index : index + 1; + }, "getBadgeValue"), + isMultiSorted: /* @__PURE__ */ __name(function isMultiSorted() { + return this.sortMode === "multiple" && this.columnProp("sortable") && this.getMultiSortMetaIndex() > -1; + }, "isMultiSorted"), + isColumnSorted: /* @__PURE__ */ __name(function isColumnSorted() { + return this.sortMode === "single" ? this.sortField && (this.sortField === this.columnProp("field") || this.sortField === this.columnProp("sortField")) : this.isMultiSorted(); + }, "isColumnSorted"), + updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition3() { + if (this.columnProp("frozen")) { + var align = this.columnProp("alignFrozen"); + var isRTL = this.$parentInstance.$parentInstance.isRTL; + if (align === "right") { + var pos = 0; + var next2 = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]'); + if (next2) { + pos = getOuterWidth(next2) + parseFloat(next2.style.right || 0); + } + if (isRTL) { + this.styleObject.left = pos + "px"; + } else { + this.styleObject.right = pos + "px"; + } + } else { + var _pos = 0; + var prev2 = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]'); + if (prev2) { + _pos = getOuterWidth(prev2) + parseFloat(prev2.style.left || 0); + } + if (isRTL) { + this.styleObject.right = _pos + "px"; + } else { + this.styleObject.left = _pos + "px"; + } + } + var filterRow = this.$el.parentElement.nextElementSibling; + if (filterRow) { + var index = getIndex(this.$el); + if (filterRow.children[index]) { + filterRow.children[index].style.left = this.styleObject.left; + filterRow.children[index].style.right = this.styleObject.right; + } + } + } + }, "updateStickyPosition"), + onHeaderCheckboxChange: /* @__PURE__ */ __name(function onHeaderCheckboxChange(event2) { + this.$emit("checkbox-change", event2); + }, "onHeaderCheckboxChange") + }, + computed: { + containerClass: /* @__PURE__ */ __name(function containerClass3() { + return [this.cx("headerCell"), this.filterColumn ? this.columnProp("filterHeaderClass") : this.columnProp("headerClass"), this.columnProp("class")]; + }, "containerClass"), + containerStyle: /* @__PURE__ */ __name(function containerStyle3() { + var headerStyle = this.filterColumn ? this.columnProp("filterHeaderStyle") : this.columnProp("headerStyle"); + var columnStyle = this.columnProp("style"); + return this.columnProp("frozen") ? [columnStyle, headerStyle, this.styleObject] : [columnStyle, headerStyle]; + }, "containerStyle"), + sortState: /* @__PURE__ */ __name(function sortState() { + var sorted2 = false; + var sortOrder2 = null; + if (this.sortMode === "single") { + sorted2 = this.sortField && (this.sortField === this.columnProp("field") || this.sortField === this.columnProp("sortField")); + sortOrder2 = sorted2 ? this.sortOrder : 0; + } else if (this.sortMode === "multiple") { + var metaIndex = this.getMultiSortMetaIndex(); + if (metaIndex > -1) { + sorted2 = true; + sortOrder2 = this.multiSortMeta[metaIndex].order; + } + } + return { + sorted: sorted2, + sortOrder: sortOrder2 + }; + }, "sortState"), + sortableColumnIcon: /* @__PURE__ */ __name(function sortableColumnIcon() { + var _this$sortState = this.sortState, sorted2 = _this$sortState.sorted, sortOrder2 = _this$sortState.sortOrder; + if (!sorted2) return script$f; + else if (sorted2 && sortOrder2 > 0) return script$d; + else if (sorted2 && sortOrder2 < 0) return script$e; + return null; + }, "sortableColumnIcon"), + ariaSort: /* @__PURE__ */ __name(function ariaSort() { + if (this.columnProp("sortable")) { + var _this$sortState2 = this.sortState, sorted2 = _this$sortState2.sorted, sortOrder2 = _this$sortState2.sortOrder; + if (sorted2 && sortOrder2 < 0) return "descending"; + else if (sorted2 && sortOrder2 > 0) return "ascending"; + else return "none"; + } else { + return null; + } + }, "ariaSort") + }, + components: { + Badge: script$H, + DTHeaderCheckbox: script$3, + DTColumnFilter: script$4, + SortAltIcon: script$f, + SortAmountUpAltIcon: script$d, + SortAmountDownIcon: script$e + } +}; +function _typeof$3(o) { + "@babel/helpers - typeof"; + return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$3(o); +} +__name(_typeof$3, "_typeof$3"); +function ownKeys$3(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$3, "ownKeys$3"); +function _objectSpread$3(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$3(Object(t), true).forEach(function(r2) { + _defineProperty$3(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$3, "_objectSpread$3"); +function _defineProperty$3(e, r, t) { + return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$3, "_defineProperty$3"); +function _toPropertyKey$3(t) { + var i = _toPrimitive$3(t, "string"); + return "symbol" == _typeof$3(i) ? i : i + ""; +} +__name(_toPropertyKey$3, "_toPropertyKey$3"); +function _toPrimitive$3(t, r) { + if ("object" != _typeof$3(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$3(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$3, "_toPrimitive$3"); +var _hoisted_1 = ["tabindex", "colspan", "rowspan", "aria-sort", "data-p-sortable-column", "data-p-resizable-column", "data-p-sorted", "data-p-filter-column", "data-p-frozen-column", "data-p-reorderable-column"]; +function render$2(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Badge = resolveComponent("Badge"); + var _component_DTHeaderCheckbox = resolveComponent("DTHeaderCheckbox"); + var _component_DTColumnFilter = resolveComponent("DTColumnFilter"); + return openBlock(), createElementBlock("th", mergeProps({ + style: $options.containerStyle, + "class": $options.containerClass, + tabindex: $options.columnProp("sortable") ? "0" : null, + role: "columnheader", + colspan: $options.columnProp("colspan"), + rowspan: $options.columnProp("rowspan"), + "aria-sort": $options.ariaSort, + onClick: _cache[8] || (_cache[8] = function() { + return $options.onClick && $options.onClick.apply($options, arguments); + }), + onKeydown: _cache[9] || (_cache[9] = function() { + return $options.onKeyDown && $options.onKeyDown.apply($options, arguments); + }), + onMousedown: _cache[10] || (_cache[10] = function() { + return $options.onMouseDown && $options.onMouseDown.apply($options, arguments); + }), + onDragstart: _cache[11] || (_cache[11] = function() { + return $options.onDragStart && $options.onDragStart.apply($options, arguments); + }), + onDragover: _cache[12] || (_cache[12] = function() { + return $options.onDragOver && $options.onDragOver.apply($options, arguments); + }), + onDragleave: _cache[13] || (_cache[13] = function() { + return $options.onDragLeave && $options.onDragLeave.apply($options, arguments); + }), + onDrop: _cache[14] || (_cache[14] = function() { + return $options.onDrop && $options.onDrop.apply($options, arguments); + }) + }, _objectSpread$3(_objectSpread$3({}, $options.getColumnPT("root")), $options.getColumnPT("headerCell")), { + "data-p-sortable-column": $options.columnProp("sortable"), + "data-p-resizable-column": $props.resizableColumns, + "data-p-sorted": $options.isColumnSorted(), + "data-p-filter-column": $props.filterColumn, + "data-p-frozen-column": $options.columnProp("frozen"), + "data-p-reorderable-column": $props.reorderableColumns + }), [$props.resizableColumns && !$options.columnProp("frozen") ? (openBlock(), createElementBlock("span", mergeProps({ + key: 0, + "class": _ctx.cx("columnResizer"), + onMousedown: _cache[0] || (_cache[0] = function() { + return $options.onResizeStart && $options.onResizeStart.apply($options, arguments); + }) + }, $options.getColumnPT("columnResizer")), null, 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("columnHeaderContent") + }, $options.getColumnPT("columnHeaderContent")), [$props.column.children && $props.column.children.header ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.header), { + key: 0, + column: $props.column + }, null, 8, ["column"])) : createCommentVNode("", true), $options.columnProp("header") ? (openBlock(), createElementBlock("span", mergeProps({ + key: 1, + "class": _ctx.cx("columnTitle") + }, $options.getColumnPT("columnTitle")), toDisplayString($options.columnProp("header")), 17)) : createCommentVNode("", true), $options.columnProp("sortable") ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ + key: 2 + }, $options.getColumnPT("sort"))), [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.sorticon || $options.sortableColumnIcon), mergeProps({ + sorted: $options.sortState.sorted, + sortOrder: $options.sortState.sortOrder, + "class": _ctx.cx("sortIcon") + }, $options.getColumnPT("sorticon")), null, 16, ["sorted", "sortOrder", "class"]))], 16)) : createCommentVNode("", true), $options.isMultiSorted() ? (openBlock(), createBlock(_component_Badge, { + key: 3, + "class": normalizeClass(_ctx.cx("pcSortBadge")), + pt: $options.getColumnPT("pcSortBadge"), + value: $options.getBadgeValue(), + size: "small" + }, null, 8, ["class", "pt", "value"])) : createCommentVNode("", true), $options.columnProp("selectionMode") === "multiple" && $props.filterDisplay !== "row" ? (openBlock(), createBlock(_component_DTHeaderCheckbox, { + key: 4, + checked: $props.allRowsSelected, + onChange: $options.onHeaderCheckboxChange, + disabled: $props.empty, + headerCheckboxIconTemplate: $props.column.children && $props.column.children.headercheckboxicon, + column: $props.column, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["checked", "onChange", "disabled", "headerCheckboxIconTemplate", "column", "unstyled", "pt"])) : createCommentVNode("", true), $props.filterDisplay === "menu" && $props.column.children && $props.column.children.filter ? (openBlock(), createBlock(_component_DTColumnFilter, { + key: 5, + field: $options.columnProp("filterField") || $options.columnProp("field"), + type: $options.columnProp("dataType"), + display: "menu", + showMenu: $options.columnProp("showFilterMenu"), + filterElement: $props.column.children && $props.column.children.filter, + filterHeaderTemplate: $props.column.children && $props.column.children.filterheader, + filterFooterTemplate: $props.column.children && $props.column.children.filterfooter, + filterClearTemplate: $props.column.children && $props.column.children.filterclear, + filterApplyTemplate: $props.column.children && $props.column.children.filterapply, + filterIconTemplate: $props.column.children && $props.column.children.filtericon, + filterAddIconTemplate: $props.column.children && $props.column.children.filteraddicon, + filterRemoveIconTemplate: $props.column.children && $props.column.children.filterremoveicon, + filterClearIconTemplate: $props.column.children && $props.column.children.filterclearicon, + filters: $props.filters, + filtersStore: $props.filtersStore, + filterInputProps: $props.filterInputProps, + filterButtonProps: $props.filterButtonProps, + onFilterChange: _cache[1] || (_cache[1] = function($event) { + return _ctx.$emit("filter-change", $event); + }), + onFilterApply: _cache[2] || (_cache[2] = function($event) { + return _ctx.$emit("filter-apply"); + }), + filterMenuStyle: $options.columnProp("filterMenuStyle"), + filterMenuClass: $options.columnProp("filterMenuClass"), + showOperator: $options.columnProp("showFilterOperator"), + showClearButton: $options.columnProp("showClearButton"), + showApplyButton: $options.columnProp("showApplyButton"), + showMatchModes: $options.columnProp("showFilterMatchModes"), + showAddButton: $options.columnProp("showAddButton"), + matchModeOptions: $options.columnProp("filterMatchModeOptions"), + maxConstraints: $options.columnProp("maxConstraints"), + onOperatorChange: _cache[3] || (_cache[3] = function($event) { + return _ctx.$emit("operator-change", $event); + }), + onMatchmodeChange: _cache[4] || (_cache[4] = function($event) { + return _ctx.$emit("matchmode-change", $event); + }), + onConstraintAdd: _cache[5] || (_cache[5] = function($event) { + return _ctx.$emit("constraint-add", $event); + }), + onConstraintRemove: _cache[6] || (_cache[6] = function($event) { + return _ctx.$emit("constraint-remove", $event); + }), + onApplyClick: _cache[7] || (_cache[7] = function($event) { + return _ctx.$emit("apply-click", $event); + }), + column: $props.column, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["field", "type", "showMenu", "filterElement", "filterHeaderTemplate", "filterFooterTemplate", "filterClearTemplate", "filterApplyTemplate", "filterIconTemplate", "filterAddIconTemplate", "filterRemoveIconTemplate", "filterClearIconTemplate", "filters", "filtersStore", "filterInputProps", "filterButtonProps", "filterMenuStyle", "filterMenuClass", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "matchModeOptions", "maxConstraints", "column", "unstyled", "pt"])) : createCommentVNode("", true)], 16)], 16, _hoisted_1); +} +__name(render$2, "render$2"); +script$2.render = render$2; +var script$1 = { + name: "TableHeader", + hostName: "DataTable", + "extends": script$s, + emits: ["column-click", "column-mousedown", "column-dragstart", "column-dragover", "column-dragleave", "column-drop", "column-resizestart", "checkbox-change", "filter-change", "filter-apply", "operator-change", "matchmode-change", "constraint-add", "constraint-remove", "filter-clear", "apply-click"], + props: { + columnGroup: { + type: null, + "default": null + }, + columns: { + type: null, + "default": null + }, + rowGroupMode: { + type: String, + "default": null + }, + groupRowsBy: { + type: [Array, String, Function], + "default": null + }, + resizableColumns: { + type: Boolean, + "default": false + }, + allRowsSelected: { + type: Boolean, + "default": false + }, + empty: { + type: Boolean, + "default": false + }, + sortMode: { + type: String, + "default": "single" + }, + groupRowSortField: { + type: [String, Function], + "default": null + }, + sortField: { + type: [String, Function], + "default": null + }, + sortOrder: { + type: Number, + "default": null + }, + multiSortMeta: { + type: Array, + "default": null + }, + filterDisplay: { + type: String, + "default": null + }, + filters: { + type: Object, + "default": null + }, + filtersStore: { + type: Object, + "default": null + }, + reorderableColumns: { + type: Boolean, + "default": false + }, + first: { + type: Number, + "default": 0 + }, + filterInputProps: { + type: null, + "default": null + }, + filterButtonProps: { + type: null, + "default": null + } + }, + provide: /* @__PURE__ */ __name(function provide6() { + return { + $rows: this.d_headerRows, + $columns: this.d_headerColumns + }; + }, "provide"), + data: /* @__PURE__ */ __name(function data10() { + return { + d_headerRows: new _default({ + type: "Row" + }), + d_headerColumns: new _default({ + type: "Column" + }) + }; + }, "data"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount4() { + this.d_headerRows.clear(); + this.d_headerColumns.clear(); + }, "beforeUnmount"), + methods: { + columnProp: /* @__PURE__ */ __name(function columnProp6(col, prop) { + return getVNodeProp(col, prop); + }, "columnProp"), + getColumnGroupPT: /* @__PURE__ */ __name(function getColumnGroupPT2(key) { + var _this$$parentInstance; + var columnGroupMetaData = { + props: this.getColumnGroupProps(), + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + type: "header", + scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable + } + }; + return mergeProps(this.ptm("columnGroup.".concat(key), { + columnGroup: columnGroupMetaData + }), this.ptm("columnGroup.".concat(key), columnGroupMetaData), this.ptmo(this.getColumnGroupProps(), key, columnGroupMetaData)); + }, "getColumnGroupPT"), + getColumnGroupProps: /* @__PURE__ */ __name(function getColumnGroupProps2() { + return this.columnGroup && this.columnGroup.props && this.columnGroup.props.pt ? this.columnGroup.props.pt : void 0; + }, "getColumnGroupProps"), + getRowPT: /* @__PURE__ */ __name(function getRowPT2(row2, key, index) { + var rowMetaData = { + props: row2.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index + } + }; + return mergeProps(this.ptm("row.".concat(key), { + row: rowMetaData + }), this.ptm("row.".concat(key), rowMetaData), this.ptmo(this.getRowProp(row2), key, rowMetaData)); + }, "getRowPT"), + getRowProp: /* @__PURE__ */ __name(function getRowProp2(row2) { + return row2.props && row2.props.pt ? row2.props.pt : void 0; + }, "getRowProp"), + getColumnPT: /* @__PURE__ */ __name(function getColumnPT9(column, key, index) { + var columnMetaData = { + props: column.props, + parent: { + instance: this, + props: this.$props, + state: this.$data + }, + context: { + index + } + }; + return mergeProps(this.ptm("column.".concat(key), { + column: columnMetaData + }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(column), key, columnMetaData)); + }, "getColumnPT"), + getColumnProp: /* @__PURE__ */ __name(function getColumnProp8(column) { + return column.props && column.props.pt ? column.props.pt : void 0; + }, "getColumnProp"), + getFilterColumnHeaderClass: /* @__PURE__ */ __name(function getFilterColumnHeaderClass(column) { + return [this.cx("headerCell", { + column + }), this.columnProp(column, "filterHeaderClass"), this.columnProp(column, "class")]; + }, "getFilterColumnHeaderClass"), + getFilterColumnHeaderStyle: /* @__PURE__ */ __name(function getFilterColumnHeaderStyle(column) { + return [this.columnProp(column, "filterHeaderStyle"), this.columnProp(column, "style")]; + }, "getFilterColumnHeaderStyle"), + getHeaderRows: /* @__PURE__ */ __name(function getHeaderRows() { + var _this$d_headerRows; + return (_this$d_headerRows = this.d_headerRows) === null || _this$d_headerRows === void 0 ? void 0 : _this$d_headerRows.get(this.columnGroup, this.columnGroup.children); + }, "getHeaderRows"), + getHeaderColumns: /* @__PURE__ */ __name(function getHeaderColumns(row2) { + var _this$d_headerColumns; + return (_this$d_headerColumns = this.d_headerColumns) === null || _this$d_headerColumns === void 0 ? void 0 : _this$d_headerColumns.get(row2, row2.children); + }, "getHeaderColumns") + }, + computed: { + ptmTHeadOptions: /* @__PURE__ */ __name(function ptmTHeadOptions() { + var _this$$parentInstance2; + return { + context: { + scrollable: (_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.scrollable + } + }; + }, "ptmTHeadOptions") + }, + components: { + DTHeaderCell: script$2, + DTHeaderCheckbox: script$3, + DTColumnFilter: script$4 + } +}; +function _typeof$2(o) { + "@babel/helpers - typeof"; + return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$2(o); +} +__name(_typeof$2, "_typeof$2"); +function ownKeys$2(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$2, "ownKeys$2"); +function _objectSpread$2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$2(Object(t), true).forEach(function(r2) { + _defineProperty$2(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$2, "_objectSpread$2"); +function _defineProperty$2(e, r, t) { + return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$2, "_defineProperty$2"); +function _toPropertyKey$2(t) { + var i = _toPrimitive$2(t, "string"); + return "symbol" == _typeof$2(i) ? i : i + ""; +} +__name(_toPropertyKey$2, "_toPropertyKey$2"); +function _toPrimitive$2(t, r) { + if ("object" != _typeof$2(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$2(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$2, "_toPrimitive$2"); +function render$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_DTHeaderCell = resolveComponent("DTHeaderCell"); + var _component_DTHeaderCheckbox = resolveComponent("DTHeaderCheckbox"); + var _component_DTColumnFilter = resolveComponent("DTColumnFilter"); + return openBlock(), createElementBlock("thead", mergeProps({ + "class": _ctx.cx("thead"), + style: _ctx.sx("thead"), + role: "rowgroup" + }, $props.columnGroup ? _objectSpread$2(_objectSpread$2({}, _ctx.ptm("thead", $options.ptmTHeadOptions)), $options.getColumnGroupPT("root")) : _ctx.ptm("thead", $options.ptmTHeadOptions), { + "data-pc-section": "thead" + }), [!$props.columnGroup ? (openBlock(), createElementBlock("tr", mergeProps({ + key: 0, + role: "row" + }, _ctx.ptm("headerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { + return openBlock(), createElementBlock(Fragment, { + key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i + }, [!$options.columnProp(col, "hidden") && ($props.rowGroupMode !== "subheader" || $props.groupRowsBy !== $options.columnProp(col, "field")) ? (openBlock(), createBlock(_component_DTHeaderCell, { + key: 0, + column: col, + index: i, + onColumnClick: _cache[0] || (_cache[0] = function($event) { + return _ctx.$emit("column-click", $event); + }), + onColumnMousedown: _cache[1] || (_cache[1] = function($event) { + return _ctx.$emit("column-mousedown", $event); + }), + onColumnDragstart: _cache[2] || (_cache[2] = function($event) { + return _ctx.$emit("column-dragstart", $event); + }), + onColumnDragover: _cache[3] || (_cache[3] = function($event) { + return _ctx.$emit("column-dragover", $event); + }), + onColumnDragleave: _cache[4] || (_cache[4] = function($event) { + return _ctx.$emit("column-dragleave", $event); + }), + onColumnDrop: _cache[5] || (_cache[5] = function($event) { + return _ctx.$emit("column-drop", $event); + }), + groupRowsBy: $props.groupRowsBy, + groupRowSortField: $props.groupRowSortField, + reorderableColumns: $props.reorderableColumns, + resizableColumns: $props.resizableColumns, + onColumnResizestart: _cache[6] || (_cache[6] = function($event) { + return _ctx.$emit("column-resizestart", $event); + }), + sortMode: $props.sortMode, + sortField: $props.sortField, + sortOrder: $props.sortOrder, + multiSortMeta: $props.multiSortMeta, + allRowsSelected: $props.allRowsSelected, + empty: $props.empty, + onCheckboxChange: _cache[7] || (_cache[7] = function($event) { + return _ctx.$emit("checkbox-change", $event); + }), + filters: $props.filters, + filterDisplay: $props.filterDisplay, + filtersStore: $props.filtersStore, + filterInputProps: $props.filterInputProps, + filterButtonProps: $props.filterButtonProps, + first: $props.first, + onFilterChange: _cache[8] || (_cache[8] = function($event) { + return _ctx.$emit("filter-change", $event); + }), + onFilterApply: _cache[9] || (_cache[9] = function($event) { + return _ctx.$emit("filter-apply"); + }), + onOperatorChange: _cache[10] || (_cache[10] = function($event) { + return _ctx.$emit("operator-change", $event); + }), + onMatchmodeChange: _cache[11] || (_cache[11] = function($event) { + return _ctx.$emit("matchmode-change", $event); + }), + onConstraintAdd: _cache[12] || (_cache[12] = function($event) { + return _ctx.$emit("constraint-add", $event); + }), + onConstraintRemove: _cache[13] || (_cache[13] = function($event) { + return _ctx.$emit("constraint-remove", $event); + }), + onApplyClick: _cache[14] || (_cache[14] = function($event) { + return _ctx.$emit("apply-click", $event); + }), + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["column", "index", "groupRowsBy", "groupRowSortField", "reorderableColumns", "resizableColumns", "sortMode", "sortField", "sortOrder", "multiSortMeta", "allRowsSelected", "empty", "filters", "filterDisplay", "filtersStore", "filterInputProps", "filterButtonProps", "first", "unstyled", "pt"])) : createCommentVNode("", true)], 64); + }), 128))], 16)) : (openBlock(true), createElementBlock(Fragment, { + key: 1 + }, renderList($options.getHeaderRows(), function(row2, i) { + return openBlock(), createElementBlock("tr", mergeProps({ + key: i, + role: "row", + ref_for: true + }, _objectSpread$2(_objectSpread$2({}, _ctx.ptm("headerRow")), $options.getRowPT(row2, "root", i))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getHeaderColumns(row2), function(col, j) { + return openBlock(), createElementBlock(Fragment, { + key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || j + }, [!$options.columnProp(col, "hidden") && ($props.rowGroupMode !== "subheader" || $props.groupRowsBy !== $options.columnProp(col, "field")) && typeof col.children !== "string" ? (openBlock(), createBlock(_component_DTHeaderCell, { + key: 0, + column: col, + onColumnClick: _cache[15] || (_cache[15] = function($event) { + return _ctx.$emit("column-click", $event); + }), + onColumnMousedown: _cache[16] || (_cache[16] = function($event) { + return _ctx.$emit("column-mousedown", $event); + }), + groupRowsBy: $props.groupRowsBy, + groupRowSortField: $props.groupRowSortField, + sortMode: $props.sortMode, + sortField: $props.sortField, + sortOrder: $props.sortOrder, + multiSortMeta: $props.multiSortMeta, + allRowsSelected: $props.allRowsSelected, + empty: $props.empty, + onCheckboxChange: _cache[17] || (_cache[17] = function($event) { + return _ctx.$emit("checkbox-change", $event); + }), + filters: $props.filters, + filterDisplay: $props.filterDisplay, + filtersStore: $props.filtersStore, + onFilterChange: _cache[18] || (_cache[18] = function($event) { + return _ctx.$emit("filter-change", $event); + }), + onFilterApply: _cache[19] || (_cache[19] = function($event) { + return _ctx.$emit("filter-apply"); + }), + onOperatorChange: _cache[20] || (_cache[20] = function($event) { + return _ctx.$emit("operator-change", $event); + }), + onMatchmodeChange: _cache[21] || (_cache[21] = function($event) { + return _ctx.$emit("matchmode-change", $event); + }), + onConstraintAdd: _cache[22] || (_cache[22] = function($event) { + return _ctx.$emit("constraint-add", $event); + }), + onConstraintRemove: _cache[23] || (_cache[23] = function($event) { + return _ctx.$emit("constraint-remove", $event); + }), + onApplyClick: _cache[24] || (_cache[24] = function($event) { + return _ctx.$emit("apply-click", $event); + }), + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["column", "groupRowsBy", "groupRowSortField", "sortMode", "sortField", "sortOrder", "multiSortMeta", "allRowsSelected", "empty", "filters", "filterDisplay", "filtersStore", "unstyled", "pt"])) : createCommentVNode("", true)], 64); + }), 128))], 16); + }), 128)), $props.filterDisplay === "row" ? (openBlock(), createElementBlock("tr", mergeProps({ + key: 2, + role: "row" + }, _ctx.ptm("headerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { + return openBlock(), createElementBlock(Fragment, { + key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i + }, [!$options.columnProp(col, "hidden") && ($props.rowGroupMode !== "subheader" || $props.groupRowsBy !== $options.columnProp(col, "field")) ? (openBlock(), createElementBlock("th", mergeProps({ + key: 0, + style: $options.getFilterColumnHeaderStyle(col), + "class": $options.getFilterColumnHeaderClass(col), + ref_for: true + }, _objectSpread$2(_objectSpread$2({}, $options.getColumnPT(col, "root", i)), $options.getColumnPT(col, "headerCell", i))), [$options.columnProp(col, "selectionMode") === "multiple" ? (openBlock(), createBlock(_component_DTHeaderCheckbox, { + key: 0, + checked: $props.allRowsSelected, + disabled: $props.empty, + onChange: _cache[25] || (_cache[25] = function($event) { + return _ctx.$emit("checkbox-change", $event); + }), + column: col, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["checked", "disabled", "column", "unstyled", "pt"])) : createCommentVNode("", true), col.children && col.children.filter ? (openBlock(), createBlock(_component_DTColumnFilter, { + key: 1, + field: $options.columnProp(col, "filterField") || $options.columnProp(col, "field"), + type: $options.columnProp(col, "dataType"), + display: "row", + showMenu: $options.columnProp(col, "showFilterMenu"), + filterElement: col.children && col.children.filter, + filterHeaderTemplate: col.children && col.children.filterheader, + filterFooterTemplate: col.children && col.children.filterfooter, + filterClearTemplate: col.children && col.children.filterclear, + filterApplyTemplate: col.children && col.children.filterapply, + filterIconTemplate: col.children && col.children.filtericon, + filterAddIconTemplate: col.children && col.children.filteraddicon, + filterRemoveIconTemplate: col.children && col.children.filterremoveicon, + filterClearIconTemplate: col.children && col.children.filterclearicon, + filters: $props.filters, + filtersStore: $props.filtersStore, + filterInputProps: $props.filterInputProps, + filterButtonProps: $props.filterButtonProps, + onFilterChange: _cache[26] || (_cache[26] = function($event) { + return _ctx.$emit("filter-change", $event); + }), + onFilterApply: _cache[27] || (_cache[27] = function($event) { + return _ctx.$emit("filter-apply"); + }), + filterMenuStyle: $options.columnProp(col, "filterMenuStyle"), + filterMenuClass: $options.columnProp(col, "filterMenuClass"), + showOperator: $options.columnProp(col, "showFilterOperator"), + showClearButton: $options.columnProp(col, "showClearButton"), + showApplyButton: $options.columnProp(col, "showApplyButton"), + showMatchModes: $options.columnProp(col, "showFilterMatchModes"), + showAddButton: $options.columnProp(col, "showAddButton"), + matchModeOptions: $options.columnProp(col, "filterMatchModeOptions"), + maxConstraints: $options.columnProp(col, "maxConstraints"), + onOperatorChange: _cache[28] || (_cache[28] = function($event) { + return _ctx.$emit("operator-change", $event); + }), + onMatchmodeChange: _cache[29] || (_cache[29] = function($event) { + return _ctx.$emit("matchmode-change", $event); + }), + onConstraintAdd: _cache[30] || (_cache[30] = function($event) { + return _ctx.$emit("constraint-add", $event); + }), + onConstraintRemove: _cache[31] || (_cache[31] = function($event) { + return _ctx.$emit("constraint-remove", $event); + }), + onApplyClick: _cache[32] || (_cache[32] = function($event) { + return _ctx.$emit("apply-click", $event); + }), + column: col, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["field", "type", "showMenu", "filterElement", "filterHeaderTemplate", "filterFooterTemplate", "filterClearTemplate", "filterApplyTemplate", "filterIconTemplate", "filterAddIconTemplate", "filterRemoveIconTemplate", "filterClearIconTemplate", "filters", "filtersStore", "filterInputProps", "filterButtonProps", "filterMenuStyle", "filterMenuClass", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "matchModeOptions", "maxConstraints", "column", "unstyled", "pt"])) : createCommentVNode("", true)], 16)) : createCommentVNode("", true)], 64); + }), 128))], 16)) : createCommentVNode("", true)], 16); +} +__name(render$1, "render$1"); +script$1.render = render$1; +function _typeof$1(o) { + "@babel/helpers - typeof"; + return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof$1(o); +} +__name(_typeof$1, "_typeof$1"); +var _excluded = ["expanded"]; +function _objectWithoutProperties(e, t) { + if (null == e) return {}; + var o, r, i = _objectWithoutPropertiesLoose(e, t); + if (Object.getOwnPropertySymbols) { + var s = Object.getOwnPropertySymbols(e); + for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); + } + return i; +} +__name(_objectWithoutProperties, "_objectWithoutProperties"); +function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; +} +__name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose"); +function ownKeys$1(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys$1, "ownKeys$1"); +function _objectSpread$1(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) { + _defineProperty$1(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread$1, "_objectSpread$1"); +function _defineProperty$1(e, r, t) { + return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty$1, "_defineProperty$1"); +function _toPropertyKey$1(t) { + var i = _toPrimitive$1(t, "string"); + return "symbol" == _typeof$1(i) ? i : i + ""; +} +__name(_toPropertyKey$1, "_toPropertyKey$1"); +function _toPrimitive$1(t, r) { + if ("object" != _typeof$1(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof$1(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive$1, "_toPrimitive$1"); +function _slicedToArray(r, e) { + return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); +} +__name(_slicedToArray, "_slicedToArray"); +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +__name(_nonIterableRest, "_nonIterableRest"); +function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, n, i, u, a = [], f = true, o = false; + try { + if (i = (t = t.call(r)).next, 0 === l) ; + else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ; + } catch (r2) { + o = true, n = r2; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } +} +__name(_iterableToArrayLimit, "_iterableToArrayLimit"); +function _arrayWithHoles(r) { + if (Array.isArray(r)) return r; +} +__name(_arrayWithHoles, "_arrayWithHoles"); +function _createForOfIteratorHelper(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { + t && (r = t); + var _n = 0, F = /* @__PURE__ */ __name(function F2() { + }, "F"); + return { s: F, n: /* @__PURE__ */ __name(function n() { + return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; + }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { + throw r2; + }, "e"), f: F }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var o, a = true, u = false; + return { s: /* @__PURE__ */ __name(function s() { + t = t.call(r); + }, "s"), n: /* @__PURE__ */ __name(function n() { + var r2 = t.next(); + return a = r2.done, r2; + }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { + u = true, o = r2; + }, "e"), f: /* @__PURE__ */ __name(function f() { + try { + a || null == t["return"] || t["return"](); + } finally { + if (u) throw o; + } + }, "f") }; +} +__name(_createForOfIteratorHelper, "_createForOfIteratorHelper"); +function _toConsumableArray(r) { + return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); +} +__name(_toConsumableArray, "_toConsumableArray"); +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +__name(_nonIterableSpread, "_nonIterableSpread"); +function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; + } +} +__name(_unsupportedIterableToArray, "_unsupportedIterableToArray"); +function _iterableToArray(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +__name(_iterableToArray, "_iterableToArray"); +function _arrayWithoutHoles(r) { + if (Array.isArray(r)) return _arrayLikeToArray(r); +} +__name(_arrayWithoutHoles, "_arrayWithoutHoles"); +function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +__name(_arrayLikeToArray, "_arrayLikeToArray"); +var script = { + name: "DataTable", + "extends": script$c, + inheritAttrs: false, + emits: ["value-change", "update:first", "update:rows", "page", "update:sortField", "update:sortOrder", "update:multiSortMeta", "sort", "filter", "row-click", "row-dblclick", "update:selection", "row-select", "row-unselect", "update:contextMenuSelection", "row-contextmenu", "row-unselect-all", "row-select-all", "select-all-change", "column-resize-end", "column-reorder", "row-reorder", "update:expandedRows", "row-collapse", "row-expand", "update:expandedRowGroups", "rowgroup-collapse", "rowgroup-expand", "update:filters", "state-restore", "state-save", "cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "update:editingRows", "row-edit-init", "row-edit-save", "row-edit-cancel"], + provide: /* @__PURE__ */ __name(function provide7() { + return { + $columns: this.d_columns, + $columnGroups: this.d_columnGroups + }; + }, "provide"), + data: /* @__PURE__ */ __name(function data11() { + return { + d_first: this.first, + d_rows: this.rows, + d_sortField: this.sortField, + d_sortOrder: this.sortOrder, + d_nullSortOrder: this.nullSortOrder, + d_multiSortMeta: this.multiSortMeta ? _toConsumableArray(this.multiSortMeta) : [], + d_groupRowsSortMeta: null, + d_selectionKeys: null, + d_columnOrder: null, + d_editingRowKeys: null, + d_editingMeta: {}, + d_filters: this.cloneFilters(this.filters), + d_columns: new _default({ + type: "Column" + }), + d_columnGroups: new _default({ + type: "ColumnGroup" + }), + isRTL: false + }; + }, "data"), + rowTouched: false, + anchorRowIndex: null, + rangeRowIndex: null, + documentColumnResizeListener: null, + documentColumnResizeEndListener: null, + lastResizeHelperX: null, + resizeColumnElement: null, + columnResizing: false, + colReorderIconWidth: null, + colReorderIconHeight: null, + draggedColumn: null, + draggedColumnElement: null, + draggedRowIndex: null, + droppedRowIndex: null, + rowDragging: null, + columnWidthsState: null, + tableWidthState: null, + columnWidthsRestored: false, + mutationObserver: null, + watch: { + first: /* @__PURE__ */ __name(function first3(newValue) { + this.d_first = newValue; + }, "first"), + rows: /* @__PURE__ */ __name(function rows2(newValue) { + this.d_rows = newValue; + }, "rows"), + sortField: /* @__PURE__ */ __name(function sortField(newValue) { + this.d_sortField = newValue; + }, "sortField"), + sortOrder: /* @__PURE__ */ __name(function sortOrder(newValue) { + this.d_sortOrder = newValue; + }, "sortOrder"), + nullSortOrder: /* @__PURE__ */ __name(function nullSortOrder(newValue) { + this.d_nullSortOrder = newValue; + }, "nullSortOrder"), + multiSortMeta: /* @__PURE__ */ __name(function multiSortMeta(newValue) { + this.d_multiSortMeta = newValue; + }, "multiSortMeta"), + selection: { + immediate: true, + handler: /* @__PURE__ */ __name(function handler2(newValue) { + if (this.dataKey) { + this.updateSelectionKeys(newValue); + } + }, "handler") + }, + editingRows: { + immediate: true, + handler: /* @__PURE__ */ __name(function handler3(newValue) { + if (this.dataKey) { + this.updateEditingRowKeys(newValue); + } + }, "handler") + }, + filters: { + deep: true, + handler: /* @__PURE__ */ __name(function handler4(newValue) { + this.d_filters = this.cloneFilters(newValue); + }, "handler") + } + }, +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js + mounted: /* @__PURE__ */ __name(function mounted7() { +======== + mounted: /* @__PURE__ */ __name(function mounted8() { + this.$el.setAttribute(this.attributeSelector, ""); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js + if (this.isStateful()) { + this.restoreState(); + this.resizableColumns && this.restoreColumnWidths(); + } + if (this.editMode === "row" && this.dataKey && !this.d_editingRowKeys) { + this.updateEditingRowKeys(this.editingRows); + } + this.updateDirection(); + this.observeDirectionChanges(); + }, "mounted"), + beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount5() { + this.unbindColumnResizeEvents(); + this.destroyStyleElement(); + this.d_columns.clear(); + this.d_columnGroups.clear(); + if (this.mutationObserver) { + this.mutationObserver.disconnect(); + } + }, "beforeUnmount"), + updated: /* @__PURE__ */ __name(function updated5() { + if (this.isStateful()) { + this.saveState(); + } + if (this.editMode === "row" && this.dataKey && !this.d_editingRowKeys) { + this.updateEditingRowKeys(this.editingRows); + } + }, "updated"), + methods: { + updateDirection: /* @__PURE__ */ __name(function updateDirection() { + this.isRTL = !!this.$el.closest('[dir="rtl"]'); + }, "updateDirection"), + observeDirectionChanges: /* @__PURE__ */ __name(function observeDirectionChanges() { + var _this = this; + var targetNode = document.documentElement; + var config = { + attributes: true, + attributeFilter: ["dir"] + }; + this.mutationObserver = new MutationObserver(function() { + _this.updateDirection(); + }); + this.mutationObserver.observe(targetNode, config); + }, "observeDirectionChanges"), + columnProp: /* @__PURE__ */ __name(function columnProp7(col, prop) { + return getVNodeProp(col, prop); + }, "columnProp"), + onPage: /* @__PURE__ */ __name(function onPage(event2) { + var _this2 = this; + this.clearEditingMetaData(); + this.d_first = event2.first; + this.d_rows = event2.rows; + var pageEvent = this.createLazyLoadEvent(event2); + pageEvent.pageCount = event2.pageCount; + pageEvent.page = event2.page; + this.$emit("update:first", this.d_first); + this.$emit("update:rows", this.d_rows); + this.$emit("page", pageEvent); + this.$nextTick(function() { + _this2.$emit("value-change", _this2.processedData); + }); + }, "onPage"), + onColumnHeaderClick: /* @__PURE__ */ __name(function onColumnHeaderClick(e) { + var _this3 = this; + var event2 = e.originalEvent; + var column = e.column; + if (this.columnProp(column, "sortable")) { + var targetNode = event2.target; + var columnField = this.columnProp(column, "sortField") || this.columnProp(column, "field"); + if (getAttribute(targetNode, "data-p-sortable-column") === true || getAttribute(targetNode, "data-pc-section") === "columntitle" || getAttribute(targetNode, "data-pc-section") === "columnheadercontent" || getAttribute(targetNode, "data-pc-section") === "sorticon" || getAttribute(targetNode.parentElement, "data-pc-section") === "sorticon" || getAttribute(targetNode.parentElement.parentElement, "data-pc-section") === "sorticon" || targetNode.closest('[data-p-sortable-column="true"]') && !targetNode.closest('[data-pc-section="columnfilterbutton"]') && !isClickable(event2.target)) { + clearSelection(); + if (this.sortMode === "single") { + if (this.d_sortField === columnField) { + if (this.removableSort && this.d_sortOrder * -1 === this.defaultSortOrder) { + this.d_sortOrder = null; + this.d_sortField = null; + } else { + this.d_sortOrder = this.d_sortOrder * -1; + } + } else { + this.d_sortOrder = this.defaultSortOrder; + this.d_sortField = columnField; + } + this.$emit("update:sortField", this.d_sortField); + this.$emit("update:sortOrder", this.d_sortOrder); + this.resetPage(); + } else if (this.sortMode === "multiple") { + var metaKey = event2.metaKey || event2.ctrlKey; + if (!metaKey) { + this.d_multiSortMeta = this.d_multiSortMeta.filter(function(meta) { + return meta.field === columnField; + }); + } + this.addMultiSortField(columnField); + this.$emit("update:multiSortMeta", this.d_multiSortMeta); + } + this.$emit("sort", this.createLazyLoadEvent(event2)); + this.$nextTick(function() { + _this3.$emit("value-change", _this3.processedData); + }); + } + } + }, "onColumnHeaderClick"), + sortSingle: /* @__PURE__ */ __name(function sortSingle(value) { + var _this4 = this; + this.clearEditingMetaData(); + if (this.groupRowsBy && this.groupRowsBy === this.sortField) { + this.d_multiSortMeta = [{ + field: this.sortField, + order: this.sortOrder || this.defaultSortOrder + }, { + field: this.d_sortField, + order: this.d_sortOrder + }]; + return this.sortMultiple(value); + } + var data12 = _toConsumableArray(value); + var resolvedFieldData = /* @__PURE__ */ new Map(); + var _iterator = _createForOfIteratorHelper(data12), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var item = _step.value; + resolvedFieldData.set(item, resolveFieldData(item, this.d_sortField)); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + var comparer = localeComparator(); + data12.sort(function(data1, data22) { + var value1 = resolvedFieldData.get(data1); + var value2 = resolvedFieldData.get(data22); + return sort(value1, value2, _this4.d_sortOrder, comparer, _this4.d_nullSortOrder); + }); + return data12; + }, "sortSingle"), + sortMultiple: /* @__PURE__ */ __name(function sortMultiple(value) { + var _this5 = this; + this.clearEditingMetaData(); + if (this.groupRowsBy && (this.d_groupRowsSortMeta || this.d_multiSortMeta.length && this.groupRowsBy === this.d_multiSortMeta[0].field)) { + var firstSortMeta = this.d_multiSortMeta[0]; + !this.d_groupRowsSortMeta && (this.d_groupRowsSortMeta = firstSortMeta); + if (firstSortMeta.field !== this.d_groupRowsSortMeta.field) { + this.d_multiSortMeta = [this.d_groupRowsSortMeta].concat(_toConsumableArray(this.d_multiSortMeta)); + } + } + var data12 = _toConsumableArray(value); + data12.sort(function(data1, data22) { + return _this5.multisortField(data1, data22, 0); + }); + return data12; + }, "sortMultiple"), + multisortField: /* @__PURE__ */ __name(function multisortField(data1, data22, index) { + var value1 = resolveFieldData(data1, this.d_multiSortMeta[index].field); + var value2 = resolveFieldData(data22, this.d_multiSortMeta[index].field); + var comparer = localeComparator(); + if (value1 === value2) { + return this.d_multiSortMeta.length - 1 > index ? this.multisortField(data1, data22, index + 1) : 0; + } + return sort(value1, value2, this.d_multiSortMeta[index].order, comparer, this.d_nullSortOrder); + }, "multisortField"), + addMultiSortField: /* @__PURE__ */ __name(function addMultiSortField(field2) { + var index = this.d_multiSortMeta.findIndex(function(meta) { + return meta.field === field2; + }); + if (index >= 0) { + if (this.removableSort && this.d_multiSortMeta[index].order * -1 === this.defaultSortOrder) this.d_multiSortMeta.splice(index, 1); + else this.d_multiSortMeta[index] = { + field: field2, + order: this.d_multiSortMeta[index].order * -1 + }; + } else { + this.d_multiSortMeta.push({ + field: field2, + order: this.defaultSortOrder + }); + } + this.d_multiSortMeta = _toConsumableArray(this.d_multiSortMeta); + }, "addMultiSortField"), + getActiveFilters: /* @__PURE__ */ __name(function getActiveFilters(filters) { + var removeEmptyFilters = /* @__PURE__ */ __name(function removeEmptyFilters2(_ref) { + var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; + if (value.constraints) { + var filteredConstraints = value.constraints.filter(function(constraint) { + return constraint.value !== null; + }); + if (filteredConstraints.length > 0) { + return [key, _objectSpread$1(_objectSpread$1({}, value), {}, { + constraints: filteredConstraints + })]; + } + } else if (value.value !== null) { + return [key, value]; + } + return void 0; + }, "removeEmptyFilters"); + var filterValidEntries = /* @__PURE__ */ __name(function filterValidEntries2(entry) { + return entry !== void 0; + }, "filterValidEntries"); + var entries = Object.entries(filters).map(removeEmptyFilters).filter(filterValidEntries); + return Object.fromEntries(entries); + }, "getActiveFilters"), + filter: /* @__PURE__ */ __name(function filter2(data12) { + var _this6 = this; + if (!data12) { + return; + } + this.clearEditingMetaData(); + var activeFilters = this.getActiveFilters(this.filters); + var globalFilterFieldsArray; + if (activeFilters["global"]) { + globalFilterFieldsArray = this.globalFilterFields || this.columns.map(function(col) { + return _this6.columnProp(col, "filterField") || _this6.columnProp(col, "field"); + }); + } + var filteredValue = []; + for (var i = 0; i < data12.length; i++) { + var localMatch = true; + var globalMatch = false; + var localFiltered = false; + for (var prop in activeFilters) { + if (Object.prototype.hasOwnProperty.call(activeFilters, prop) && prop !== "global") { + localFiltered = true; + var filterField = prop; + var filterMeta = activeFilters[filterField]; + if (filterMeta.operator) { + var _iterator2 = _createForOfIteratorHelper(filterMeta.constraints), _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) { + var filterConstraint2 = _step2.value; + localMatch = this.executeLocalFilter(filterField, data12[i], filterConstraint2); + if (filterMeta.operator === FilterOperator.OR && localMatch || filterMeta.operator === FilterOperator.AND && !localMatch) { + break; + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + } else { + localMatch = this.executeLocalFilter(filterField, data12[i], filterMeta); + } + if (!localMatch) { + break; + } + } + } + if (localMatch && activeFilters["global"] && !globalMatch && globalFilterFieldsArray) { + for (var j = 0; j < globalFilterFieldsArray.length; j++) { + var globalFilterField = globalFilterFieldsArray[j]; + globalMatch = FilterService.filters[activeFilters["global"].matchMode || FilterMatchMode.CONTAINS](resolveFieldData(data12[i], globalFilterField), activeFilters["global"].value, this.filterLocale); + if (globalMatch) { + break; + } + } + } + var matches = void 0; + if (activeFilters["global"]) { + matches = localFiltered ? localFiltered && localMatch && globalMatch : globalMatch; + } else { + matches = localFiltered && localMatch; + } + if (matches) { + filteredValue.push(data12[i]); + } + } + if (filteredValue.length === this.value.length || Object.keys(activeFilters).length == 0) { + filteredValue = data12; + } + var filterEvent = this.createLazyLoadEvent(); + filterEvent.filteredValue = filteredValue; + this.$emit("filter", filterEvent); + this.$nextTick(function() { + _this6.$emit("value-change", _this6.processedData); + }); + return filteredValue; + }, "filter"), + executeLocalFilter: /* @__PURE__ */ __name(function executeLocalFilter(field2, rowData, filterMeta) { + var filterValue = filterMeta.value; + var filterMatchMode = filterMeta.matchMode || FilterMatchMode.STARTS_WITH; + var dataFieldValue = resolveFieldData(rowData, field2); + var filterConstraint2 = FilterService.filters[filterMatchMode]; + return filterConstraint2(dataFieldValue, filterValue, this.filterLocale); + }, "executeLocalFilter"), + onRowClick: /* @__PURE__ */ __name(function onRowClick2(e) { + var event2 = e.originalEvent; + var body = this.$refs.bodyRef && this.$refs.bodyRef.$el; + var focusedItem = findSingle(body, 'tr[data-p-selectable-row="true"][tabindex="0"]'); + if (isClickable(event2.target)) { + return; + } + this.$emit("row-click", e); + if (this.selectionMode) { + var rowData = e.data; + var rowIndex2 = this.d_first + e.index; + if (this.isMultipleSelectionMode() && event2.shiftKey && this.anchorRowIndex != null) { + clearSelection(); + this.rangeRowIndex = rowIndex2; + this.selectRange(event2); + } else { + var selected = this.isSelected(rowData); + var metaSelection = this.rowTouched ? false : this.metaKeySelection; + this.anchorRowIndex = rowIndex2; + this.rangeRowIndex = rowIndex2; + if (metaSelection) { + var metaKey = event2.metaKey || event2.ctrlKey; + if (selected && metaKey) { + if (this.isSingleSelectionMode()) { + this.$emit("update:selection", null); + } else { + var selectionIndex = this.findIndexInSelection(rowData); + var _selection = this.selection.filter(function(val, i) { + return i != selectionIndex; + }); + this.$emit("update:selection", _selection); + } + this.$emit("row-unselect", { + originalEvent: event2, + data: rowData, + index: rowIndex2, + type: "row" + }); + } else { + if (this.isSingleSelectionMode()) { + this.$emit("update:selection", rowData); + } else if (this.isMultipleSelectionMode()) { + var _selection2 = metaKey ? this.selection || [] : []; + _selection2 = [].concat(_toConsumableArray(_selection2), [rowData]); + this.$emit("update:selection", _selection2); + } + this.$emit("row-select", { + originalEvent: event2, + data: rowData, + index: rowIndex2, + type: "row" + }); + } + } else { + if (this.selectionMode === "single") { + if (selected) { + this.$emit("update:selection", null); + this.$emit("row-unselect", { + originalEvent: event2, + data: rowData, + index: rowIndex2, + type: "row" + }); + } else { + this.$emit("update:selection", rowData); + this.$emit("row-select", { + originalEvent: event2, + data: rowData, + index: rowIndex2, + type: "row" + }); + } + } else if (this.selectionMode === "multiple") { + if (selected) { + var _selectionIndex = this.findIndexInSelection(rowData); + var _selection3 = this.selection.filter(function(val, i) { + return i != _selectionIndex; + }); + this.$emit("update:selection", _selection3); + this.$emit("row-unselect", { + originalEvent: event2, + data: rowData, + index: rowIndex2, + type: "row" + }); + } else { + var _selection4 = this.selection ? [].concat(_toConsumableArray(this.selection), [rowData]) : [rowData]; + this.$emit("update:selection", _selection4); + this.$emit("row-select", { + originalEvent: event2, + data: rowData, + index: rowIndex2, + type: "row" + }); + } + } + } + } + } + this.rowTouched = false; + if (focusedItem) { + var _event$target, _event$currentTarget; + if (((_event$target = event2.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute("data-pc-section")) === "rowtoggleicon") return; + var targetRow = (_event$currentTarget = event2.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.closest('tr[data-p-selectable-row="true"]'); + focusedItem.tabIndex = "-1"; + targetRow.tabIndex = "0"; + } + }, "onRowClick"), + onRowDblClick: /* @__PURE__ */ __name(function onRowDblClick2(e) { + var event2 = e.originalEvent; + if (isClickable(event2.target)) { + return; + } + this.$emit("row-dblclick", e); + }, "onRowDblClick"), + onRowRightClick: /* @__PURE__ */ __name(function onRowRightClick2(event2) { + if (this.contextMenu) { + clearSelection(); + event2.originalEvent.target.focus(); + } + this.$emit("update:contextMenuSelection", event2.data); + this.$emit("row-contextmenu", event2); + }, "onRowRightClick"), + onRowTouchEnd: /* @__PURE__ */ __name(function onRowTouchEnd2() { + this.rowTouched = true; + }, "onRowTouchEnd"), + onRowKeyDown: /* @__PURE__ */ __name(function onRowKeyDown2(e, slotProps) { + var event2 = e.originalEvent; + var rowData = e.data; + var rowIndex2 = e.index; + var metaKey = event2.metaKey || event2.ctrlKey; + if (this.selectionMode) { + var row2 = event2.target; + switch (event2.code) { + case "ArrowDown": + this.onArrowDownKey(event2, row2, rowIndex2, slotProps); + break; + case "ArrowUp": + this.onArrowUpKey(event2, row2, rowIndex2, slotProps); + break; + case "Home": + this.onHomeKey(event2, row2, rowIndex2, slotProps); + break; + case "End": + this.onEndKey(event2, row2, rowIndex2, slotProps); + break; + case "Enter": + case "NumpadEnter": + this.onEnterKey(event2, rowData, rowIndex2); + break; + case "Space": + this.onSpaceKey(event2, rowData, rowIndex2, slotProps); + break; + case "Tab": + this.onTabKey(event2, rowIndex2); + break; + default: + if (event2.code === "KeyA" && metaKey && this.isMultipleSelectionMode()) { + var data12 = this.dataToRender(slotProps.rows); + this.$emit("update:selection", data12); + } + event2.preventDefault(); + break; + } + } + }, "onRowKeyDown"), + onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey(event2, row2, rowIndex2, slotProps) { + var nextRow = this.findNextSelectableRow(row2); + nextRow && this.focusRowChange(row2, nextRow); + if (event2.shiftKey) { + var data12 = this.dataToRender(slotProps.rows); + var nextRowIndex = rowIndex2 + 1 >= data12.length ? data12.length - 1 : rowIndex2 + 1; + this.onRowClick({ + originalEvent: event2, + data: data12[nextRowIndex], + index: nextRowIndex + }); + } + event2.preventDefault(); + }, "onArrowDownKey"), + onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey(event2, row2, rowIndex2, slotProps) { + var prevRow = this.findPrevSelectableRow(row2); + prevRow && this.focusRowChange(row2, prevRow); + if (event2.shiftKey) { + var data12 = this.dataToRender(slotProps.rows); + var prevRowIndex = rowIndex2 - 1 <= 0 ? 0 : rowIndex2 - 1; + this.onRowClick({ + originalEvent: event2, + data: data12[prevRowIndex], + index: prevRowIndex + }); + } + event2.preventDefault(); + }, "onArrowUpKey"), + onHomeKey: /* @__PURE__ */ __name(function onHomeKey(event2, row2, rowIndex2, slotProps) { + var firstRow = this.findFirstSelectableRow(); + firstRow && this.focusRowChange(row2, firstRow); + if (event2.ctrlKey && event2.shiftKey) { + var data12 = this.dataToRender(slotProps.rows); + this.$emit("update:selection", data12.slice(0, rowIndex2 + 1)); + } + event2.preventDefault(); + }, "onHomeKey"), + onEndKey: /* @__PURE__ */ __name(function onEndKey(event2, row2, rowIndex2, slotProps) { + var lastRow = this.findLastSelectableRow(); + lastRow && this.focusRowChange(row2, lastRow); + if (event2.ctrlKey && event2.shiftKey) { + var data12 = this.dataToRender(slotProps.rows); + this.$emit("update:selection", data12.slice(rowIndex2, data12.length)); + } + event2.preventDefault(); + }, "onEndKey"), + onEnterKey: /* @__PURE__ */ __name(function onEnterKey(event2, rowData, rowIndex2) { + this.onRowClick({ + originalEvent: event2, + data: rowData, + index: rowIndex2 + }); + event2.preventDefault(); + }, "onEnterKey"), + onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey(event2, rowData, rowIndex2, slotProps) { + this.onEnterKey(event2, rowData, rowIndex2); + if (event2.shiftKey && this.selection !== null) { + var data12 = this.dataToRender(slotProps.rows); + var index; + if (this.selection.length > 0) { + var firstSelectedRowIndex, lastSelectedRowIndex; + firstSelectedRowIndex = findIndexInList(this.selection[0], data12); + lastSelectedRowIndex = findIndexInList(this.selection[this.selection.length - 1], data12); + index = rowIndex2 <= firstSelectedRowIndex ? lastSelectedRowIndex : firstSelectedRowIndex; + } else { + index = findIndexInList(this.selection, data12); + } + var _selection = index !== rowIndex2 ? data12.slice(Math.min(index, rowIndex2), Math.max(index, rowIndex2) + 1) : rowData; + this.$emit("update:selection", _selection); + } + }, "onSpaceKey"), + onTabKey: /* @__PURE__ */ __name(function onTabKey(event2, rowIndex2) { + var body = this.$refs.bodyRef && this.$refs.bodyRef.$el; + var rows3 = find(body, 'tr[data-p-selectable-row="true"]'); + if (event2.code === "Tab" && rows3 && rows3.length > 0) { + var firstSelectedRow = findSingle(body, 'tr[data-p-selected="true"]'); + var focusedItem = findSingle(body, 'tr[data-p-selectable-row="true"][tabindex="0"]'); + if (firstSelectedRow) { + firstSelectedRow.tabIndex = "0"; + focusedItem && focusedItem !== firstSelectedRow && (focusedItem.tabIndex = "-1"); + } else { + rows3[0].tabIndex = "0"; + focusedItem !== rows3[0] && (rows3[rowIndex2].tabIndex = "-1"); + } + } + }, "onTabKey"), + findNextSelectableRow: /* @__PURE__ */ __name(function findNextSelectableRow(row2) { + var nextRow = row2.nextElementSibling; + if (nextRow) { + if (getAttribute(nextRow, "data-p-selectable-row") === true) return nextRow; + else return this.findNextSelectableRow(nextRow); + } else { + return null; + } + }, "findNextSelectableRow"), + findPrevSelectableRow: /* @__PURE__ */ __name(function findPrevSelectableRow(row2) { + var prevRow = row2.previousElementSibling; + if (prevRow) { + if (getAttribute(prevRow, "data-p-selectable-row") === true) return prevRow; + else return this.findPrevSelectableRow(prevRow); + } else { + return null; + } + }, "findPrevSelectableRow"), + findFirstSelectableRow: /* @__PURE__ */ __name(function findFirstSelectableRow() { + var firstRow = findSingle(this.$refs.table, 'tr[data-p-selectable-row="true"]'); + return firstRow; + }, "findFirstSelectableRow"), + findLastSelectableRow: /* @__PURE__ */ __name(function findLastSelectableRow() { + var rows3 = find(this.$refs.table, 'tr[data-p-selectable-row="true"]'); + return rows3 ? rows3[rows3.length - 1] : null; + }, "findLastSelectableRow"), + focusRowChange: /* @__PURE__ */ __name(function focusRowChange(firstFocusableRow, currentFocusedRow) { + firstFocusableRow.tabIndex = "-1"; + currentFocusedRow.tabIndex = "0"; + focus(currentFocusedRow); + }, "focusRowChange"), + toggleRowWithRadio: /* @__PURE__ */ __name(function toggleRowWithRadio2(event2) { + var rowData = event2.data; + if (this.isSelected(rowData)) { + this.$emit("update:selection", null); + this.$emit("row-unselect", { + originalEvent: event2.originalEvent, + data: rowData, + index: event2.index, + type: "radiobutton" + }); + } else { + this.$emit("update:selection", rowData); + this.$emit("row-select", { + originalEvent: event2.originalEvent, + data: rowData, + index: event2.index, + type: "radiobutton" + }); + } + }, "toggleRowWithRadio"), + toggleRowWithCheckbox: /* @__PURE__ */ __name(function toggleRowWithCheckbox2(event2) { + var rowData = event2.data; + if (this.isSelected(rowData)) { + var selectionIndex = this.findIndexInSelection(rowData); + var _selection = this.selection.filter(function(val, i) { + return i != selectionIndex; + }); + this.$emit("update:selection", _selection); + this.$emit("row-unselect", { + originalEvent: event2.originalEvent, + data: rowData, + index: event2.index, + type: "checkbox" + }); + } else { + var _selection5 = this.selection ? _toConsumableArray(this.selection) : []; + _selection5 = [].concat(_toConsumableArray(_selection5), [rowData]); + this.$emit("update:selection", _selection5); + this.$emit("row-select", { + originalEvent: event2.originalEvent, + data: rowData, + index: event2.index, + type: "checkbox" + }); + } + }, "toggleRowWithCheckbox"), + toggleRowsWithCheckbox: /* @__PURE__ */ __name(function toggleRowsWithCheckbox(event2) { + if (this.selectAll !== null) { + this.$emit("select-all-change", event2); + } else { + var originalEvent = event2.originalEvent, checked2 = event2.checked; + var _selection = []; + if (checked2) { + _selection = this.frozenValue ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(this.processedData)) : this.processedData; + this.$emit("row-select-all", { + originalEvent, + data: _selection + }); + } else { + this.$emit("row-unselect-all", { + originalEvent + }); + } + this.$emit("update:selection", _selection); + } + }, "toggleRowsWithCheckbox"), + isSingleSelectionMode: /* @__PURE__ */ __name(function isSingleSelectionMode() { + return this.selectionMode === "single"; + }, "isSingleSelectionMode"), + isMultipleSelectionMode: /* @__PURE__ */ __name(function isMultipleSelectionMode() { + return this.selectionMode === "multiple"; + }, "isMultipleSelectionMode"), + isSelected: /* @__PURE__ */ __name(function isSelected2(rowData) { + if (rowData && this.selection) { + if (this.dataKey) { + return this.d_selectionKeys ? this.d_selectionKeys[resolveFieldData(rowData, this.dataKey)] !== void 0 : false; + } else { + if (this.selection instanceof Array) return this.findIndexInSelection(rowData) > -1; + else return this.equals(rowData, this.selection); + } + } + return false; + }, "isSelected"), + findIndexInSelection: /* @__PURE__ */ __name(function findIndexInSelection2(rowData) { + return this.findIndex(rowData, this.selection); + }, "findIndexInSelection"), + findIndex: /* @__PURE__ */ __name(function findIndex2(rowData, collection) { + var index = -1; + if (collection && collection.length) { + for (var i = 0; i < collection.length; i++) { + if (this.equals(rowData, collection[i])) { + index = i; + break; + } + } + } + return index; + }, "findIndex"), + updateSelectionKeys: /* @__PURE__ */ __name(function updateSelectionKeys(selection) { + this.d_selectionKeys = {}; + if (Array.isArray(selection)) { + var _iterator3 = _createForOfIteratorHelper(selection), _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) { + var data12 = _step3.value; + this.d_selectionKeys[String(resolveFieldData(data12, this.dataKey))] = 1; + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + } else { + this.d_selectionKeys[String(resolveFieldData(selection, this.dataKey))] = 1; + } + }, "updateSelectionKeys"), + updateEditingRowKeys: /* @__PURE__ */ __name(function updateEditingRowKeys(editingRows) { + if (editingRows && editingRows.length) { + this.d_editingRowKeys = {}; + var _iterator4 = _createForOfIteratorHelper(editingRows), _step4; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) { + var data12 = _step4.value; + this.d_editingRowKeys[String(resolveFieldData(data12, this.dataKey))] = 1; + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + } else { + this.d_editingRowKeys = null; + } + }, "updateEditingRowKeys"), + equals: /* @__PURE__ */ __name(function equals$12(data1, data22) { + return this.compareSelectionBy === "equals" ? data1 === data22 : equals(data1, data22, this.dataKey); + }, "equals$1"), + selectRange: /* @__PURE__ */ __name(function selectRange(event2) { + var rangeStart, rangeEnd; + if (this.rangeRowIndex > this.anchorRowIndex) { + rangeStart = this.anchorRowIndex; + rangeEnd = this.rangeRowIndex; + } else if (this.rangeRowIndex < this.anchorRowIndex) { + rangeStart = this.rangeRowIndex; + rangeEnd = this.anchorRowIndex; + } else { + rangeStart = this.rangeRowIndex; + rangeEnd = this.rangeRowIndex; + } + if (this.lazy && this.paginator) { + rangeStart -= this.first; + rangeEnd -= this.first; + } + var value = this.processedData; + var _selection = []; + for (var i = rangeStart; i <= rangeEnd; i++) { + var rangeRowData = value[i]; + _selection.push(rangeRowData); + this.$emit("row-select", { + originalEvent: event2, + data: rangeRowData, + type: "row" + }); + } + this.$emit("update:selection", _selection); + }, "selectRange"), + exportCSV: /* @__PURE__ */ __name(function exportCSV$1(options, data12) { + var _this7 = this; + var csv = "\uFEFF"; + if (!data12) { + data12 = this.processedData; + if (options && options.selectionOnly) data12 = this.selection || []; + else if (this.frozenValue) data12 = data12 ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(data12)) : this.frozenValue; + } + var headerInitiated = false; + for (var i = 0; i < this.columns.length; i++) { + var column = this.columns[i]; + if (this.columnProp(column, "exportable") !== false && this.columnProp(column, "field")) { + if (headerInitiated) csv += this.csvSeparator; + else headerInitiated = true; + csv += '"' + (this.columnProp(column, "exportHeader") || this.columnProp(column, "header") || this.columnProp(column, "field")) + '"'; + } + } + if (data12) { + data12.forEach(function(record) { + csv += "\n"; + var rowInitiated = false; + for (var _i = 0; _i < _this7.columns.length; _i++) { + var _column = _this7.columns[_i]; + if (_this7.columnProp(_column, "exportable") !== false && _this7.columnProp(_column, "field")) { + if (rowInitiated) csv += _this7.csvSeparator; + else rowInitiated = true; + var cellData = resolveFieldData(record, _this7.columnProp(_column, "field")); + if (cellData != null) { + if (_this7.exportFunction) { + cellData = _this7.exportFunction({ + data: cellData, + field: _this7.columnProp(_column, "field") + }); + } else cellData = String(cellData).replace(/"/g, '""'); + } else cellData = ""; + csv += '"' + cellData + '"'; + } + } + }); + } + var footerInitiated = false; + for (var _i2 = 0; _i2 < this.columns.length; _i2++) { + var _column2 = this.columns[_i2]; + if (_i2 === 0) csv += "\n"; + if (this.columnProp(_column2, "exportable") !== false && this.columnProp(_column2, "exportFooter")) { + if (footerInitiated) csv += this.csvSeparator; + else footerInitiated = true; + csv += '"' + (this.columnProp(_column2, "exportFooter") || this.columnProp(_column2, "footer") || this.columnProp(_column2, "field")) + '"'; + } + } + exportCSV(csv, this.exportFilename); + }, "exportCSV$1"), + resetPage: /* @__PURE__ */ __name(function resetPage() { + this.d_first = 0; + this.$emit("update:first", this.d_first); + }, "resetPage"), + onColumnResizeStart: /* @__PURE__ */ __name(function onColumnResizeStart(event2) { + var containerLeft = getOffset(this.$el).left; + this.resizeColumnElement = event2.target.parentElement; + this.columnResizing = true; + this.lastResizeHelperX = event2.pageX - containerLeft + this.$el.scrollLeft; + this.bindColumnResizeEvents(); + }, "onColumnResizeStart"), + onColumnResize: /* @__PURE__ */ __name(function onColumnResize(event2) { + var containerLeft = getOffset(this.$el).left; + this.$el.setAttribute("data-p-unselectable-text", "true"); + !this.isUnstyled && addStyle(this.$el, { + "user-select": "none" + }); + this.$refs.resizeHelper.style.height = this.$el.offsetHeight + "px"; + this.$refs.resizeHelper.style.top = "0px"; + this.$refs.resizeHelper.style.left = event2.pageX - containerLeft + this.$el.scrollLeft + "px"; + this.$refs.resizeHelper.style.display = "block"; + }, "onColumnResize"), + onColumnResizeEnd: /* @__PURE__ */ __name(function onColumnResizeEnd() { + var delta = this.isRTL ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX; + var columnWidth = this.resizeColumnElement.offsetWidth; + var newColumnWidth = columnWidth + delta; + var minWidth = this.resizeColumnElement.style.minWidth || 15; + if (columnWidth + delta > parseInt(minWidth, 10)) { + if (this.columnResizeMode === "fit") { + var nextColumn = this.resizeColumnElement.nextElementSibling; + var nextColumnWidth = nextColumn.offsetWidth - delta; + if (newColumnWidth > 15 && nextColumnWidth > 15) { + this.resizeTableCells(newColumnWidth, nextColumnWidth); + } + } else if (this.columnResizeMode === "expand") { + var tableWidth = this.$refs.table.offsetWidth + delta + "px"; + var updateTableWidth = /* @__PURE__ */ __name(function updateTableWidth2(el) { + !!el && (el.style.width = el.style.minWidth = tableWidth); + }, "updateTableWidth"); + this.resizeTableCells(newColumnWidth); + updateTableWidth(this.$refs.table); + if (!this.virtualScrollerDisabled) { + var body = this.$refs.bodyRef && this.$refs.bodyRef.$el; + var frozenBody = this.$refs.frozenBodyRef && this.$refs.frozenBodyRef.$el; + updateTableWidth(body); + updateTableWidth(frozenBody); + } + } + this.$emit("column-resize-end", { + element: this.resizeColumnElement, + delta + }); + } + this.$refs.resizeHelper.style.display = "none"; + this.resizeColumn = null; + this.$el.removeAttribute("data-p-unselectable-text"); + !this.isUnstyled && (this.$el.style["user-select"] = ""); + this.unbindColumnResizeEvents(); + if (this.isStateful()) { + this.saveState(); + } + }, "onColumnResizeEnd"), + resizeTableCells: /* @__PURE__ */ __name(function resizeTableCells(newColumnWidth, nextColumnWidth) { + var colIndex = getIndex(this.resizeColumnElement); + var widths = []; + var headers = find(this.$refs.table, 'thead[data-pc-section="thead"] > tr > th'); + headers.forEach(function(header) { + return widths.push(getOuterWidth(header)); + }); + this.destroyStyleElement(); + this.createStyleElement(); + var innerHTML = ""; + var selector = '[data-pc-name="datatable"]['.concat(this.$attrSelector, '] > [data-pc-section="tablecontainer"] ').concat(this.virtualScrollerDisabled ? "" : '> [data-pc-name="virtualscroller"]', ' > table[data-pc-section="table"]'); + widths.forEach(function(width, index) { + var colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width; + var style = "width: ".concat(colWidth, "px !important; max-width: ").concat(colWidth, "px !important"); + innerHTML += "\n ".concat(selector, ' > thead[data-pc-section="thead"] > tr > th:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tbody[data-pc-section="tbody"] > tr > td:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tfoot[data-pc-section="tfoot"] > tr > td:nth-child(').concat(index + 1, ") {\n ").concat(style, "\n }\n "); + }); + this.styleElement.innerHTML = innerHTML; + }, "resizeTableCells"), + bindColumnResizeEvents: /* @__PURE__ */ __name(function bindColumnResizeEvents() { + var _this8 = this; + if (!this.documentColumnResizeListener) { + this.documentColumnResizeListener = document.addEventListener("mousemove", function() { + if (_this8.columnResizing) { + _this8.onColumnResize(event); + } + }); + } + if (!this.documentColumnResizeEndListener) { + this.documentColumnResizeEndListener = document.addEventListener("mouseup", function() { + if (_this8.columnResizing) { + _this8.columnResizing = false; + _this8.onColumnResizeEnd(); + } + }); + } + }, "bindColumnResizeEvents"), + unbindColumnResizeEvents: /* @__PURE__ */ __name(function unbindColumnResizeEvents() { + if (this.documentColumnResizeListener) { + document.removeEventListener("document", this.documentColumnResizeListener); + this.documentColumnResizeListener = null; + } + if (this.documentColumnResizeEndListener) { + document.removeEventListener("document", this.documentColumnResizeEndListener); + this.documentColumnResizeEndListener = null; + } + }, "unbindColumnResizeEvents"), + onColumnHeaderMouseDown: /* @__PURE__ */ __name(function onColumnHeaderMouseDown(e) { + var event2 = e.originalEvent; + var column = e.column; + if (this.reorderableColumns && this.columnProp(column, "reorderableColumn") !== false) { + if (event2.target.nodeName === "INPUT" || event2.target.nodeName === "TEXTAREA" || getAttribute(event2.target, '[data-pc-section="columnresizer"]')) event2.currentTarget.draggable = false; + else event2.currentTarget.draggable = true; + } + }, "onColumnHeaderMouseDown"), + onColumnHeaderDragStart: /* @__PURE__ */ __name(function onColumnHeaderDragStart(e) { + var event2 = e.originalEvent, column = e.column; + if (this.columnResizing) { + event2.preventDefault(); + return; + } + this.colReorderIconWidth = getHiddenElementOuterWidth(this.$refs.reorderIndicatorUp); + this.colReorderIconHeight = getHiddenElementOuterHeight(this.$refs.reorderIndicatorUp); + this.draggedColumn = column; + this.draggedColumnElement = this.findParentHeader(event2.target); + event2.dataTransfer.setData("text", "b"); + }, "onColumnHeaderDragStart"), + onColumnHeaderDragOver: /* @__PURE__ */ __name(function onColumnHeaderDragOver(e) { + var event2 = e.originalEvent, column = e.column; + var dropHeader = this.findParentHeader(event2.target); + if (this.reorderableColumns && this.draggedColumnElement && dropHeader && !this.columnProp(column, "frozen")) { + event2.preventDefault(); + var containerOffset = getOffset(this.$el); + var dropHeaderOffset = getOffset(dropHeader); + if (this.draggedColumnElement !== dropHeader) { + var targetLeft = dropHeaderOffset.left - containerOffset.left; + var columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2; + this.$refs.reorderIndicatorUp.style.top = dropHeaderOffset.top - containerOffset.top - (this.colReorderIconHeight - 1) + "px"; + this.$refs.reorderIndicatorDown.style.top = dropHeaderOffset.top - containerOffset.top + dropHeader.offsetHeight + "px"; + if (event2.pageX > columnCenter) { + this.$refs.reorderIndicatorUp.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + "px"; + this.$refs.reorderIndicatorDown.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + "px"; + this.dropPosition = 1; + } else { + this.$refs.reorderIndicatorUp.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + "px"; + this.$refs.reorderIndicatorDown.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + "px"; + this.dropPosition = -1; + } + this.$refs.reorderIndicatorUp.style.display = "block"; + this.$refs.reorderIndicatorDown.style.display = "block"; + } + } + }, "onColumnHeaderDragOver"), + onColumnHeaderDragLeave: /* @__PURE__ */ __name(function onColumnHeaderDragLeave(e) { + var event2 = e.originalEvent; + if (this.reorderableColumns && this.draggedColumnElement) { + event2.preventDefault(); + this.$refs.reorderIndicatorUp.style.display = "none"; + this.$refs.reorderIndicatorDown.style.display = "none"; + } + }, "onColumnHeaderDragLeave"), + onColumnHeaderDrop: /* @__PURE__ */ __name(function onColumnHeaderDrop(e) { + var _this9 = this; + var event2 = e.originalEvent, column = e.column; + event2.preventDefault(); + if (this.draggedColumnElement) { + var dragIndex = getIndex(this.draggedColumnElement); + var dropIndex = getIndex(this.findParentHeader(event2.target)); + var allowDrop = dragIndex !== dropIndex; + if (allowDrop && (dropIndex - dragIndex === 1 && this.dropPosition === -1 || dropIndex - dragIndex === -1 && this.dropPosition === 1)) { + allowDrop = false; + } + if (allowDrop) { + var isSameColumn = /* @__PURE__ */ __name(function isSameColumn2(col1, col2) { + return _this9.columnProp(col1, "columnKey") || _this9.columnProp(col2, "columnKey") ? _this9.columnProp(col1, "columnKey") === _this9.columnProp(col2, "columnKey") : _this9.columnProp(col1, "field") === _this9.columnProp(col2, "field"); + }, "isSameColumn"); + var dragColIndex = this.columns.findIndex(function(child) { + return isSameColumn(child, _this9.draggedColumn); + }); + var dropColIndex = this.columns.findIndex(function(child) { + return isSameColumn(child, column); + }); + var widths = []; + var headers = find(this.$el, 'thead[data-pc-section="thead"] > tr > th'); + headers.forEach(function(header) { + return widths.push(getOuterWidth(header)); + }); + var movedItem = widths.find(function(_, index) { + return index === dragColIndex; + }); + var remainingItems = widths.filter(function(_, index) { + return index !== dragColIndex; + }); + var reorderedWidths = [].concat(_toConsumableArray(remainingItems.slice(0, dropColIndex)), [movedItem], _toConsumableArray(remainingItems.slice(dropColIndex))); + this.addColumnWidthStyles(reorderedWidths); + if (dropColIndex < dragColIndex && this.dropPosition === 1) { + dropColIndex++; + } + if (dropColIndex > dragColIndex && this.dropPosition === -1) { + dropColIndex--; + } + reorderArray(this.columns, dragColIndex, dropColIndex); + this.updateReorderableColumns(); + this.$emit("column-reorder", { + originalEvent: event2, + dragIndex: dragColIndex, + dropIndex: dropColIndex + }); + } + this.$refs.reorderIndicatorUp.style.display = "none"; + this.$refs.reorderIndicatorDown.style.display = "none"; + this.draggedColumnElement.draggable = false; + this.draggedColumnElement = null; + this.draggedColumn = null; + this.dropPosition = null; + } + }, "onColumnHeaderDrop"), + findParentHeader: /* @__PURE__ */ __name(function findParentHeader(element) { + if (element.nodeName === "TH") { + return element; + } else { + var parent = element.parentElement; + while (parent.nodeName !== "TH") { + parent = parent.parentElement; + if (!parent) break; + } + return parent; + } + }, "findParentHeader"), + findColumnByKey: /* @__PURE__ */ __name(function findColumnByKey(columns2, key) { + if (columns2 && columns2.length) { + for (var i = 0; i < columns2.length; i++) { + var column = columns2[i]; + if (this.columnProp(column, "columnKey") === key || this.columnProp(column, "field") === key) { + return column; + } + } + } + return null; + }, "findColumnByKey"), + onRowMouseDown: /* @__PURE__ */ __name(function onRowMouseDown2(event2) { + if (getAttribute(event2.target, "data-pc-section") === "reorderablerowhandle" || getAttribute(event2.target.parentElement, "data-pc-section") === "reorderablerowhandle") event2.currentTarget.draggable = true; + else event2.currentTarget.draggable = false; + }, "onRowMouseDown"), + onRowDragStart: /* @__PURE__ */ __name(function onRowDragStart2(e) { + var event2 = e.originalEvent; + var index = e.index; + this.rowDragging = true; + this.draggedRowIndex = index; + event2.dataTransfer.setData("text", "b"); + }, "onRowDragStart"), + onRowDragOver: /* @__PURE__ */ __name(function onRowDragOver2(e) { + var event2 = e.originalEvent; + var index = e.index; + if (this.rowDragging && this.draggedRowIndex !== index) { + var rowElement = event2.currentTarget; + var rowY = getOffset(rowElement).top; + var pageY = event2.pageY; + var rowMidY = rowY + getOuterHeight(rowElement) / 2; + var prevRowElement = rowElement.previousElementSibling; + if (pageY < rowMidY) { + rowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); + !this.isUnstyled && removeClass(rowElement, "p-datatable-dragpoint-bottom"); + this.droppedRowIndex = index; + if (prevRowElement) { + prevRowElement.setAttribute("data-p-datatable-dragpoint-bottom", "true"); + !this.isUnstyled && addClass(prevRowElement, "p-datatable-dragpoint-bottom"); + } else { + rowElement.setAttribute("data-p-datatable-dragpoint-top", "true"); + !this.isUnstyled && addClass(rowElement, "p-datatable-dragpoint-top"); + } + } else { + if (prevRowElement) { + prevRowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); + !this.isUnstyled && removeClass(prevRowElement, "p-datatable-dragpoint-bottom"); + } else { + rowElement.setAttribute("data-p-datatable-dragpoint-top", "true"); + !this.isUnstyled && addClass(rowElement, "p-datatable-dragpoint-top"); + } + this.droppedRowIndex = index + 1; + rowElement.setAttribute("data-p-datatable-dragpoint-bottom", "true"); + !this.isUnstyled && addClass(rowElement, "p-datatable-dragpoint-bottom"); + } + event2.preventDefault(); + } + }, "onRowDragOver"), + onRowDragLeave: /* @__PURE__ */ __name(function onRowDragLeave2(event2) { + var rowElement = event2.currentTarget; + var prevRowElement = rowElement.previousElementSibling; + if (prevRowElement) { + prevRowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); + !this.isUnstyled && removeClass(prevRowElement, "p-datatable-dragpoint-bottom"); + } + rowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); + !this.isUnstyled && removeClass(rowElement, "p-datatable-dragpoint-bottom"); + rowElement.setAttribute("data-p-datatable-dragpoint-top", "false"); + !this.isUnstyled && removeClass(rowElement, "p-datatable-dragpoint-top"); + }, "onRowDragLeave"), + onRowDragEnd: /* @__PURE__ */ __name(function onRowDragEnd2(event2) { + this.rowDragging = false; + this.draggedRowIndex = null; + this.droppedRowIndex = null; + event2.currentTarget.draggable = false; + }, "onRowDragEnd"), + onRowDrop: /* @__PURE__ */ __name(function onRowDrop2(event2) { + if (this.droppedRowIndex != null) { + var dropIndex = this.draggedRowIndex > this.droppedRowIndex ? this.droppedRowIndex : this.droppedRowIndex === 0 ? 0 : this.droppedRowIndex - 1; + var processedData2 = _toConsumableArray(this.processedData); + reorderArray(processedData2, this.draggedRowIndex + this.d_first, dropIndex + this.d_first); + this.$emit("row-reorder", { + originalEvent: event2, + dragIndex: this.draggedRowIndex, + dropIndex, + value: processedData2 + }); + } + this.onRowDragLeave(event2); + this.onRowDragEnd(event2); + event2.preventDefault(); + }, "onRowDrop"), + toggleRow: /* @__PURE__ */ __name(function toggleRow2(event2) { + var _this10 = this; + var expanded = event2.expanded, rest = _objectWithoutProperties(event2, _excluded); + var rowData = event2.data; + var expandedRows; + if (this.dataKey) { + var value = resolveFieldData(rowData, this.dataKey); + expandedRows = this.expandedRows ? _objectSpread$1({}, this.expandedRows) : {}; + expanded ? expandedRows[value] = true : delete expandedRows[value]; + } else { + expandedRows = this.expandedRows ? _toConsumableArray(this.expandedRows) : []; + expanded ? expandedRows.push(rowData) : expandedRows = expandedRows.filter(function(d) { + return !_this10.equals(rowData, d); + }); + } + this.$emit("update:expandedRows", expandedRows); + expanded ? this.$emit("row-expand", rest) : this.$emit("row-collapse", rest); + }, "toggleRow"), + toggleRowGroup: /* @__PURE__ */ __name(function toggleRowGroup(e) { + var event2 = e.originalEvent; + var data12 = e.data; + var groupFieldValue = resolveFieldData(data12, this.groupRowsBy); + var _expandedRowGroups = this.expandedRowGroups ? _toConsumableArray(this.expandedRowGroups) : []; + if (this.isRowGroupExpanded(data12)) { + _expandedRowGroups = _expandedRowGroups.filter(function(group) { + return group !== groupFieldValue; + }); + this.$emit("update:expandedRowGroups", _expandedRowGroups); + this.$emit("rowgroup-collapse", { + originalEvent: event2, + data: groupFieldValue + }); + } else { + _expandedRowGroups.push(groupFieldValue); + this.$emit("update:expandedRowGroups", _expandedRowGroups); + this.$emit("rowgroup-expand", { + originalEvent: event2, + data: groupFieldValue + }); + } + }, "toggleRowGroup"), + isRowGroupExpanded: /* @__PURE__ */ __name(function isRowGroupExpanded2(rowData) { + if (this.expandableRowGroups && this.expandedRowGroups) { + var groupFieldValue = resolveFieldData(rowData, this.groupRowsBy); + return this.expandedRowGroups.indexOf(groupFieldValue) > -1; + } + return false; + }, "isRowGroupExpanded"), + isStateful: /* @__PURE__ */ __name(function isStateful() { + return this.stateKey != null; + }, "isStateful"), + getStorage: /* @__PURE__ */ __name(function getStorage() { + switch (this.stateStorage) { + case "local": + return window.localStorage; + case "session": + return window.sessionStorage; + default: + throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are "local" and "session".'); + } + }, "getStorage"), + saveState: /* @__PURE__ */ __name(function saveState() { + var storage = this.getStorage(); + var state = {}; + if (this.paginator) { + state.first = this.d_first; + state.rows = this.d_rows; + } + if (this.d_sortField) { + state.sortField = this.d_sortField; + state.sortOrder = this.d_sortOrder; + } + if (this.d_multiSortMeta) { + state.multiSortMeta = this.d_multiSortMeta; + } + if (this.hasFilters) { + state.filters = this.filters; + } + if (this.resizableColumns) { + this.saveColumnWidths(state); + } + if (this.reorderableColumns) { + state.columnOrder = this.d_columnOrder; + } + if (this.expandedRows) { + state.expandedRows = this.expandedRows; + } + if (this.expandedRowGroups) { + state.expandedRowGroups = this.expandedRowGroups; + } + if (this.selection) { + state.selection = this.selection; + state.selectionKeys = this.d_selectionKeys; + } + if (Object.keys(state).length) { + storage.setItem(this.stateKey, JSON.stringify(state)); + } + this.$emit("state-save", state); + }, "saveState"), + restoreState: /* @__PURE__ */ __name(function restoreState() { + var storage = this.getStorage(); + var stateString = storage.getItem(this.stateKey); + var dateFormat = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/; + var reviver = /* @__PURE__ */ __name(function reviver2(key, value) { + if (typeof value === "string" && dateFormat.test(value)) { + return new Date(value); + } + return value; + }, "reviver"); + if (stateString) { + var restoredState = JSON.parse(stateString, reviver); + if (this.paginator) { + this.d_first = restoredState.first; + this.d_rows = restoredState.rows; + } + if (restoredState.sortField) { + this.d_sortField = restoredState.sortField; + this.d_sortOrder = restoredState.sortOrder; + } + if (restoredState.multiSortMeta) { + this.d_multiSortMeta = restoredState.multiSortMeta; + } + if (restoredState.filters) { + this.$emit("update:filters", restoredState.filters); + } + if (this.resizableColumns) { + this.columnWidthsState = restoredState.columnWidths; + this.tableWidthState = restoredState.tableWidth; + } + if (this.reorderableColumns) { + this.d_columnOrder = restoredState.columnOrder; + } + if (restoredState.expandedRows) { + this.$emit("update:expandedRows", restoredState.expandedRows); + } + if (restoredState.expandedRowGroups) { + this.$emit("update:expandedRowGroups", restoredState.expandedRowGroups); + } + if (restoredState.selection) { + this.d_selectionKeys = restoredState.d_selectionKeys; + this.$emit("update:selection", restoredState.selection); + } + this.$emit("state-restore", restoredState); + } + }, "restoreState"), + saveColumnWidths: /* @__PURE__ */ __name(function saveColumnWidths(state) { + var widths = []; + var headers = find(this.$el, 'thead[data-pc-section="thead"] > tr > th'); + headers.forEach(function(header) { + return widths.push(getOuterWidth(header)); + }); + state.columnWidths = widths.join(","); + if (this.columnResizeMode === "expand") { + state.tableWidth = getOuterWidth(this.$refs.table) + "px"; + } + }, "saveColumnWidths"), + addColumnWidthStyles: /* @__PURE__ */ __name(function addColumnWidthStyles(widths) { + this.createStyleElement(); + var innerHTML = ""; + var selector = '[data-pc-name="datatable"]['.concat(this.$attrSelector, '] > [data-pc-section="tablecontainer"] ').concat(this.virtualScrollerDisabled ? "" : '> [data-pc-name="virtualscroller"]', ' > table[data-pc-section="table"]'); + widths.forEach(function(width, index) { + var style = "width: ".concat(width, "px !important; max-width: ").concat(width, "px !important"); + innerHTML += "\n ".concat(selector, ' > thead[data-pc-section="thead"] > tr > th:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tbody[data-pc-section="tbody"] > tr > td:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tfoot[data-pc-section="tfoot"] > tr > td:nth-child(').concat(index + 1, ") {\n ").concat(style, "\n }\n "); + }); + this.styleElement.innerHTML = innerHTML; + }, "addColumnWidthStyles"), + restoreColumnWidths: /* @__PURE__ */ __name(function restoreColumnWidths() { + if (this.columnWidthsState) { + var widths = this.columnWidthsState.split(","); + if (this.columnResizeMode === "expand" && this.tableWidthState) { + this.$refs.table.style.width = this.tableWidthState; + this.$refs.table.style.minWidth = this.tableWidthState; + } + if (isNotEmpty(widths)) { + this.addColumnWidthStyles(widths); + } + } + }, "restoreColumnWidths"), + onCellEditInit: /* @__PURE__ */ __name(function onCellEditInit2(event2) { + this.$emit("cell-edit-init", event2); + }, "onCellEditInit"), + onCellEditComplete: /* @__PURE__ */ __name(function onCellEditComplete2(event2) { + this.$emit("cell-edit-complete", event2); + }, "onCellEditComplete"), + onCellEditCancel: /* @__PURE__ */ __name(function onCellEditCancel2(event2) { + this.$emit("cell-edit-cancel", event2); + }, "onCellEditCancel"), + onRowEditInit: /* @__PURE__ */ __name(function onRowEditInit3(event2) { + var _editingRows = this.editingRows ? _toConsumableArray(this.editingRows) : []; + _editingRows.push(event2.data); + this.$emit("update:editingRows", _editingRows); + this.$emit("row-edit-init", event2); + }, "onRowEditInit"), + onRowEditSave: /* @__PURE__ */ __name(function onRowEditSave3(event2) { + var _editingRows = _toConsumableArray(this.editingRows); + _editingRows.splice(this.findIndex(event2.data, _editingRows), 1); + this.$emit("update:editingRows", _editingRows); + this.$emit("row-edit-save", event2); + }, "onRowEditSave"), + onRowEditCancel: /* @__PURE__ */ __name(function onRowEditCancel3(event2) { + var _editingRows = _toConsumableArray(this.editingRows); + _editingRows.splice(this.findIndex(event2.data, _editingRows), 1); + this.$emit("update:editingRows", _editingRows); + this.$emit("row-edit-cancel", event2); + }, "onRowEditCancel"), + onEditingMetaChange: /* @__PURE__ */ __name(function onEditingMetaChange2(event2) { + var data12 = event2.data, field2 = event2.field, index = event2.index, editing2 = event2.editing; + var editingMeta = _objectSpread$1({}, this.d_editingMeta); + var meta = editingMeta[index]; + if (editing2) { + !meta && (meta = editingMeta[index] = { + data: _objectSpread$1({}, data12), + fields: [] + }); + meta["fields"].push(field2); + } else if (meta) { + var fields = meta["fields"].filter(function(f) { + return f !== field2; + }); + !fields.length ? delete editingMeta[index] : meta["fields"] = fields; + } + this.d_editingMeta = editingMeta; + }, "onEditingMetaChange"), + clearEditingMetaData: /* @__PURE__ */ __name(function clearEditingMetaData() { + if (this.editMode) { + this.d_editingMeta = {}; + } + }, "clearEditingMetaData"), + createLazyLoadEvent: /* @__PURE__ */ __name(function createLazyLoadEvent(event2) { + return { + originalEvent: event2, + first: this.d_first, + rows: this.d_rows, + sortField: this.d_sortField, + sortOrder: this.d_sortOrder, + multiSortMeta: this.d_multiSortMeta, + filters: this.d_filters + }; + }, "createLazyLoadEvent"), + hasGlobalFilter: /* @__PURE__ */ __name(function hasGlobalFilter() { + return this.filters && Object.prototype.hasOwnProperty.call(this.filters, "global"); + }, "hasGlobalFilter"), + onFilterChange: /* @__PURE__ */ __name(function onFilterChange(filters) { + this.d_filters = filters; + }, "onFilterChange"), + onFilterApply: /* @__PURE__ */ __name(function onFilterApply() { + this.d_first = 0; + this.$emit("update:first", this.d_first); + this.$emit("update:filters", this.d_filters); + if (this.lazy) { + this.$emit("filter", this.createLazyLoadEvent()); + } + }, "onFilterApply"), + cloneFilters: /* @__PURE__ */ __name(function cloneFilters() { + var cloned = {}; + if (this.filters) { + Object.entries(this.filters).forEach(function(_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), prop = _ref4[0], value = _ref4[1]; + cloned[prop] = value.operator ? { + operator: value.operator, + constraints: value.constraints.map(function(constraint) { + return _objectSpread$1({}, constraint); + }) + } : _objectSpread$1({}, value); + }); + } + return cloned; + }, "cloneFilters"), + updateReorderableColumns: /* @__PURE__ */ __name(function updateReorderableColumns() { + var _this11 = this; + var columnOrder = []; + this.columns.forEach(function(col) { + return columnOrder.push(_this11.columnProp(col, "columnKey") || _this11.columnProp(col, "field")); + }); + this.d_columnOrder = columnOrder; + }, "updateReorderableColumns"), + createStyleElement: /* @__PURE__ */ __name(function createStyleElement() { + var _this$$primevue; + this.styleElement = document.createElement("style"); + this.styleElement.type = "text/css"; + setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce); + document.head.appendChild(this.styleElement); + }, "createStyleElement"), + destroyStyleElement: /* @__PURE__ */ __name(function destroyStyleElement() { + if (this.styleElement) { + document.head.removeChild(this.styleElement); + this.styleElement = null; + } + }, "destroyStyleElement"), + dataToRender: /* @__PURE__ */ __name(function dataToRender(data12) { + var _data = data12 || this.processedData; + if (_data && this.paginator) { + var first4 = this.lazy ? 0 : this.d_first; + return _data.slice(first4, first4 + this.d_rows); + } + return _data; + }, "dataToRender"), + getVirtualScrollerRef: /* @__PURE__ */ __name(function getVirtualScrollerRef() { + return this.$refs.virtualScroller; + }, "getVirtualScrollerRef"), + hasSpacerStyle: /* @__PURE__ */ __name(function hasSpacerStyle(style) { + return isNotEmpty(style); + }, "hasSpacerStyle") + }, + computed: { + columns: /* @__PURE__ */ __name(function columns() { + var cols = this.d_columns.get(this); + if (this.reorderableColumns && this.d_columnOrder) { + var orderedColumns = []; + var _iterator5 = _createForOfIteratorHelper(this.d_columnOrder), _step5; + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) { + var columnKey = _step5.value; + var column = this.findColumnByKey(cols, columnKey); + if (column && !this.columnProp(column, "hidden")) { + orderedColumns.push(column); + } + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); + } + return [].concat(orderedColumns, _toConsumableArray(cols.filter(function(item) { + return orderedColumns.indexOf(item) < 0; + }))); + } + return cols; + }, "columns"), + columnGroups: /* @__PURE__ */ __name(function columnGroups() { + return this.d_columnGroups.get(this); + }, "columnGroups"), + headerColumnGroup: /* @__PURE__ */ __name(function headerColumnGroup() { + var _this$columnGroups, _this12 = this; + return (_this$columnGroups = this.columnGroups) === null || _this$columnGroups === void 0 ? void 0 : _this$columnGroups.find(function(group) { + return _this12.columnProp(group, "type") === "header"; + }); + }, "headerColumnGroup"), + footerColumnGroup: /* @__PURE__ */ __name(function footerColumnGroup() { + var _this$columnGroups2, _this13 = this; + return (_this$columnGroups2 = this.columnGroups) === null || _this$columnGroups2 === void 0 ? void 0 : _this$columnGroups2.find(function(group) { + return _this13.columnProp(group, "type") === "footer"; + }); + }, "footerColumnGroup"), + hasFilters: /* @__PURE__ */ __name(function hasFilters() { + return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object; + }, "hasFilters"), + processedData: /* @__PURE__ */ __name(function processedData() { + var _this$virtualScroller; + var data12 = this.value || []; + if (!this.lazy && !((_this$virtualScroller = this.virtualScrollerOptions) !== null && _this$virtualScroller !== void 0 && _this$virtualScroller.lazy)) { + if (data12 && data12.length) { + if (this.hasFilters) { + data12 = this.filter(data12); + } + if (this.sorted) { + if (this.sortMode === "single") data12 = this.sortSingle(data12); + else if (this.sortMode === "multiple") data12 = this.sortMultiple(data12); + } + } + } + return data12; + }, "processedData"), + totalRecordsLength: /* @__PURE__ */ __name(function totalRecordsLength() { + if (this.lazy) { + return this.totalRecords; + } else { + var data12 = this.processedData; + return data12 ? data12.length : 0; + } + }, "totalRecordsLength"), + empty: /* @__PURE__ */ __name(function empty2() { + var data12 = this.processedData; + return !data12 || data12.length === 0; + }, "empty"), + paginatorTop: /* @__PURE__ */ __name(function paginatorTop() { + return this.paginator && (this.paginatorPosition !== "bottom" || this.paginatorPosition === "both"); + }, "paginatorTop"), + paginatorBottom: /* @__PURE__ */ __name(function paginatorBottom() { + return this.paginator && (this.paginatorPosition !== "top" || this.paginatorPosition === "both"); + }, "paginatorBottom"), + sorted: /* @__PURE__ */ __name(function sorted() { + return this.d_sortField || this.d_multiSortMeta && this.d_multiSortMeta.length > 0; + }, "sorted"), + allRowsSelected: /* @__PURE__ */ __name(function allRowsSelected() { + var _this14 = this; + if (this.selectAll !== null) { + return this.selectAll; + } else { + var val = this.frozenValue ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(this.processedData)) : this.processedData; + return isNotEmpty(val) && this.selection && Array.isArray(this.selection) && val.every(function(v) { + return _this14.selection.some(function(s) { + return _this14.equals(s, v); + }); + }); + } + }, "allRowsSelected"), + groupRowSortField: /* @__PURE__ */ __name(function groupRowSortField() { + return this.sortMode === "single" ? this.sortField : this.d_groupRowsSortMeta ? this.d_groupRowsSortMeta.field : null; + }, "groupRowSortField"), + headerFilterButtonProps: /* @__PURE__ */ __name(function headerFilterButtonProps() { + return _objectSpread$1(_objectSpread$1({ + filter: { + severity: "secondary", + text: true, + rounded: true + } + }, this.filterButtonProps), {}, { + inline: _objectSpread$1({ + clear: { + severity: "secondary", + text: true, + rounded: true + } + }, this.filterButtonProps.inline), + popover: _objectSpread$1({ + addRule: { + severity: "info", + text: true, + size: "small" + }, + removeRule: { + severity: "danger", + text: true, + size: "small" + }, + apply: { + size: "small" + }, + clear: { + outlined: true, + size: "small" + } + }, this.filterButtonProps.popover) + }); + }, "headerFilterButtonProps"), + rowEditButtonProps: /* @__PURE__ */ __name(function rowEditButtonProps() { + return _objectSpread$1(_objectSpread$1({}, { + init: { + severity: "secondary", + text: true, + rounded: true + }, + save: { + severity: "secondary", + text: true, + rounded: true + }, + cancel: { + severity: "secondary", + text: true, + rounded: true + } + }), this.editButtonProps); + }, "rowEditButtonProps"), + virtualScrollerDisabled: /* @__PURE__ */ __name(function virtualScrollerDisabled() { + return isEmpty(this.virtualScrollerOptions) || !this.scrollable; + }, "virtualScrollerDisabled") + }, + components: { + DTPaginator: script$l, + DTTableHeader: script$1, + DTTableBody: script$7, + DTTableFooter: script$5, +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js + DTVirtualScroller: script$I, + ArrowDownIcon: script$r, + ArrowUpIcon: script$q, + SpinnerIcon: script$J +======== + DTVirtualScroller: script$H, + ArrowDownIcon: script$q, + ArrowUpIcon: script$p, + SpinnerIcon: script$I +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js + } +}; +function _typeof(o) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof(o); +} +__name(_typeof, "_typeof"); +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +__name(ownKeys, "ownKeys"); +function _objectSpread(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +__name(_objectSpread, "_objectSpread"); +function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; +} +__name(_defineProperty, "_defineProperty"); +function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : i + ""; +} +__name(_toPropertyKey, "_toPropertyKey"); +function _toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +__name(_toPrimitive, "_toPrimitive"); +function render2(_ctx, _cache, $props, $setup, $data, $options) { + var _component_SpinnerIcon = resolveComponent("SpinnerIcon"); + var _component_DTPaginator = resolveComponent("DTPaginator"); + var _component_DTTableHeader = resolveComponent("DTTableHeader"); + var _component_DTTableBody = resolveComponent("DTTableBody"); + var _component_DTTableFooter = resolveComponent("DTTableFooter"); + var _component_DTVirtualScroller = resolveComponent("DTVirtualScroller"); + return openBlock(), createElementBlock("div", mergeProps({ + "class": _ctx.cx("root"), + "data-scrollselectors": ".p-datatable-wrapper" + }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default"), _ctx.loading ? (openBlock(), createElementBlock("div", mergeProps({ + key: 0, + "class": _ctx.cx("mask") + }, _ctx.ptm("mask")), [_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { + key: 0 + }) : (openBlock(), createElementBlock(Fragment, { + key: 1 + }, [_ctx.$slots.loadingicon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.loadingicon), { + key: 0, + "class": normalizeClass(_ctx.cx("loadingIcon")) + }, null, 8, ["class"])) : _ctx.loadingIcon ? (openBlock(), createElementBlock("i", mergeProps({ + key: 1, + "class": [_ctx.cx("loadingIcon"), "pi-spin", _ctx.loadingIcon] + }, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({ + key: 2, + spin: "", + "class": _ctx.cx("loadingIcon") + }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))], 64))], 16)) : createCommentVNode("", true), _ctx.$slots.header ? (openBlock(), createElementBlock("div", mergeProps({ + key: 1, + "class": _ctx.cx("header") + }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header")], 16)) : createCommentVNode("", true), $options.paginatorTop ? (openBlock(), createBlock(_component_DTPaginator, { + key: 2, + rows: $data.d_rows, + first: $data.d_first, + totalRecords: $options.totalRecordsLength, + pageLinkSize: _ctx.pageLinkSize, + template: _ctx.paginatorTemplate, + rowsPerPageOptions: _ctx.rowsPerPageOptions, + currentPageReportTemplate: _ctx.currentPageReportTemplate, + "class": normalizeClass(_ctx.cx("pcPaginator", { + position: "top" + })), + onPage: _cache[0] || (_cache[0] = function($event) { + return $options.onPage($event); + }), + alwaysShow: _ctx.alwaysShowPaginator, + unstyled: _ctx.unstyled, + pt: _ctx.ptm("pcPaginator") + }, createSlots({ + _: 2 + }, [_ctx.$slots.paginatorcontainer ? { + name: "container", + fn: withCtx(function() { + return [renderSlot(_ctx.$slots, "paginatorcontainer", { + first: _ctx.slotProps.first, + last: _ctx.slotProps.last, + rows: _ctx.slotProps.rows, + page: _ctx.slotProps.page, + pageCount: _ctx.slotProps.pageCount, + totalRecords: _ctx.slotProps.totalRecords, + firstPageCallback: _ctx.slotProps.firstPageCallback, + lastPageCallback: _ctx.slotProps.lastPageCallback, + prevPageCallback: _ctx.slotProps.prevPageCallback, + nextPageCallback: _ctx.slotProps.nextPageCallback, + rowChangeCallback: _ctx.slotProps.rowChangeCallback + })]; + }), + key: "0" + } : void 0, _ctx.$slots.paginatorstart ? { + name: "start", + fn: withCtx(function() { + return [renderSlot(_ctx.$slots, "paginatorstart")]; + }), + key: "1" + } : void 0, _ctx.$slots.paginatorend ? { + name: "end", + fn: withCtx(function() { + return [renderSlot(_ctx.$slots, "paginatorend")]; + }), + key: "2" + } : void 0, _ctx.$slots.paginatorfirstpagelinkicon ? { + name: "firstpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorfirstpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "3" + } : void 0, _ctx.$slots.paginatorprevpagelinkicon ? { + name: "prevpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorprevpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "4" + } : void 0, _ctx.$slots.paginatornextpagelinkicon ? { + name: "nextpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatornextpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "5" + } : void 0, _ctx.$slots.paginatorlastpagelinkicon ? { + name: "lastpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorlastpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "6" + } : void 0, _ctx.$slots.paginatorjumptopagedropdownicon ? { + name: "jumptopagedropdownicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorjumptopagedropdownicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "7" + } : void 0, _ctx.$slots.paginatorrowsperpagedropdownicon ? { + name: "rowsperpagedropdownicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorrowsperpagedropdownicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "8" + } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + "class": _ctx.cx("tableContainer"), + style: [_ctx.sx("tableContainer"), { + maxHeight: $options.virtualScrollerDisabled ? _ctx.scrollHeight : "" + }] + }, _ctx.ptm("tableContainer")), [createVNode(_component_DTVirtualScroller, mergeProps({ + ref: "virtualScroller" + }, _ctx.virtualScrollerOptions, { + items: $options.processedData, + columns: $options.columns, + style: _ctx.scrollHeight !== "flex" ? { + height: _ctx.scrollHeight + } : void 0, + scrollHeight: _ctx.scrollHeight !== "flex" ? void 0 : "100%", + disabled: $options.virtualScrollerDisabled, + loaderDisabled: "", + inline: "", + autoSize: "", + showSpacer: false, + pt: _ctx.ptm("virtualScroller") + }), { + content: withCtx(function(slotProps) { + return [createBaseVNode("table", mergeProps({ + ref: "table", + role: "table", + "class": [_ctx.cx("table"), _ctx.tableClass], + style: [_ctx.tableStyle, slotProps.spacerStyle] + }, _objectSpread(_objectSpread({}, _ctx.tableProps), _ctx.ptm("table"))), [_ctx.showHeaders ? (openBlock(), createBlock(_component_DTTableHeader, { + key: 0, + columnGroup: $options.headerColumnGroup, + columns: slotProps.columns, + rowGroupMode: _ctx.rowGroupMode, + groupRowsBy: _ctx.groupRowsBy, + groupRowSortField: $options.groupRowSortField, + reorderableColumns: _ctx.reorderableColumns, + resizableColumns: _ctx.resizableColumns, + allRowsSelected: $options.allRowsSelected, + empty: $options.empty, + sortMode: _ctx.sortMode, + sortField: $data.d_sortField, + sortOrder: $data.d_sortOrder, + multiSortMeta: $data.d_multiSortMeta, + filters: $data.d_filters, + filtersStore: _ctx.filters, + filterDisplay: _ctx.filterDisplay, + filterButtonProps: $options.headerFilterButtonProps, + filterInputProps: _ctx.filterInputProps, + first: $data.d_first, + onColumnClick: _cache[1] || (_cache[1] = function($event) { + return $options.onColumnHeaderClick($event); + }), + onColumnMousedown: _cache[2] || (_cache[2] = function($event) { + return $options.onColumnHeaderMouseDown($event); + }), + onFilterChange: $options.onFilterChange, + onFilterApply: $options.onFilterApply, + onColumnDragstart: _cache[3] || (_cache[3] = function($event) { + return $options.onColumnHeaderDragStart($event); + }), + onColumnDragover: _cache[4] || (_cache[4] = function($event) { + return $options.onColumnHeaderDragOver($event); + }), + onColumnDragleave: _cache[5] || (_cache[5] = function($event) { + return $options.onColumnHeaderDragLeave($event); + }), + onColumnDrop: _cache[6] || (_cache[6] = function($event) { + return $options.onColumnHeaderDrop($event); + }), + onColumnResizestart: _cache[7] || (_cache[7] = function($event) { + return $options.onColumnResizeStart($event); + }), + onCheckboxChange: _cache[8] || (_cache[8] = function($event) { + return $options.toggleRowsWithCheckbox($event); + }), + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["columnGroup", "columns", "rowGroupMode", "groupRowsBy", "groupRowSortField", "reorderableColumns", "resizableColumns", "allRowsSelected", "empty", "sortMode", "sortField", "sortOrder", "multiSortMeta", "filters", "filtersStore", "filterDisplay", "filterButtonProps", "filterInputProps", "first", "onFilterChange", "onFilterApply", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.frozenValue ? (openBlock(), createBlock(_component_DTTableBody, { + key: 1, + ref: "frozenBodyRef", + value: _ctx.frozenValue, + frozenRow: true, + columns: slotProps.columns, + first: $data.d_first, + dataKey: _ctx.dataKey, + selection: _ctx.selection, + selectionKeys: $data.d_selectionKeys, + selectionMode: _ctx.selectionMode, + contextMenu: _ctx.contextMenu, + contextMenuSelection: _ctx.contextMenuSelection, + rowGroupMode: _ctx.rowGroupMode, + groupRowsBy: _ctx.groupRowsBy, + expandableRowGroups: _ctx.expandableRowGroups, + rowClass: _ctx.rowClass, + rowStyle: _ctx.rowStyle, + editMode: _ctx.editMode, + compareSelectionBy: _ctx.compareSelectionBy, + scrollable: _ctx.scrollable, + expandedRowIcon: _ctx.expandedRowIcon, + collapsedRowIcon: _ctx.collapsedRowIcon, + expandedRows: _ctx.expandedRows, + expandedRowGroups: _ctx.expandedRowGroups, + editingRows: _ctx.editingRows, + editingRowKeys: $data.d_editingRowKeys, + templates: _ctx.$slots, + editButtonProps: $options.rowEditButtonProps, + isVirtualScrollerDisabled: true, + onRowgroupToggle: $options.toggleRowGroup, + onRowClick: _cache[9] || (_cache[9] = function($event) { + return $options.onRowClick($event); + }), + onRowDblclick: _cache[10] || (_cache[10] = function($event) { + return $options.onRowDblClick($event); + }), + onRowRightclick: _cache[11] || (_cache[11] = function($event) { + return $options.onRowRightClick($event); + }), + onRowTouchend: $options.onRowTouchEnd, + onRowKeydown: $options.onRowKeyDown, + onRowMousedown: $options.onRowMouseDown, + onRowDragstart: _cache[12] || (_cache[12] = function($event) { + return $options.onRowDragStart($event); + }), + onRowDragover: _cache[13] || (_cache[13] = function($event) { + return $options.onRowDragOver($event); + }), + onRowDragleave: _cache[14] || (_cache[14] = function($event) { + return $options.onRowDragLeave($event); + }), + onRowDragend: _cache[15] || (_cache[15] = function($event) { + return $options.onRowDragEnd($event); + }), + onRowDrop: _cache[16] || (_cache[16] = function($event) { + return $options.onRowDrop($event); + }), + onRowToggle: _cache[17] || (_cache[17] = function($event) { + return $options.toggleRow($event); + }), + onRadioChange: _cache[18] || (_cache[18] = function($event) { + return $options.toggleRowWithRadio($event); + }), + onCheckboxChange: _cache[19] || (_cache[19] = function($event) { + return $options.toggleRowWithCheckbox($event); + }), + onCellEditInit: _cache[20] || (_cache[20] = function($event) { + return $options.onCellEditInit($event); + }), + onCellEditComplete: _cache[21] || (_cache[21] = function($event) { + return $options.onCellEditComplete($event); + }), + onCellEditCancel: _cache[22] || (_cache[22] = function($event) { + return $options.onCellEditCancel($event); + }), + onRowEditInit: _cache[23] || (_cache[23] = function($event) { + return $options.onRowEditInit($event); + }), + onRowEditSave: _cache[24] || (_cache[24] = function($event) { + return $options.onRowEditSave($event); + }), + onRowEditCancel: _cache[25] || (_cache[25] = function($event) { + return $options.onRowEditCancel($event); + }), + editingMeta: $data.d_editingMeta, + onEditingMetaChange: $options.onEditingMetaChange, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["value", "columns", "first", "dataKey", "selection", "selectionKeys", "selectionMode", "contextMenu", "contextMenuSelection", "rowGroupMode", "groupRowsBy", "expandableRowGroups", "rowClass", "rowStyle", "editMode", "compareSelectionBy", "scrollable", "expandedRowIcon", "collapsedRowIcon", "expandedRows", "expandedRowGroups", "editingRows", "editingRowKeys", "templates", "editButtonProps", "onRowgroupToggle", "onRowTouchend", "onRowKeydown", "onRowMousedown", "editingMeta", "onEditingMetaChange", "unstyled", "pt"])) : createCommentVNode("", true), createVNode(_component_DTTableBody, { + ref: "bodyRef", + value: $options.dataToRender(slotProps.rows), + "class": normalizeClass(slotProps.styleClass), + columns: slotProps.columns, + empty: $options.empty, + first: $data.d_first, + dataKey: _ctx.dataKey, + selection: _ctx.selection, + selectionKeys: $data.d_selectionKeys, + selectionMode: _ctx.selectionMode, + contextMenu: _ctx.contextMenu, + contextMenuSelection: _ctx.contextMenuSelection, + rowGroupMode: _ctx.rowGroupMode, + groupRowsBy: _ctx.groupRowsBy, + expandableRowGroups: _ctx.expandableRowGroups, + rowClass: _ctx.rowClass, + rowStyle: _ctx.rowStyle, + editMode: _ctx.editMode, + compareSelectionBy: _ctx.compareSelectionBy, + scrollable: _ctx.scrollable, + expandedRowIcon: _ctx.expandedRowIcon, + collapsedRowIcon: _ctx.collapsedRowIcon, + expandedRows: _ctx.expandedRows, + expandedRowGroups: _ctx.expandedRowGroups, + editingRows: _ctx.editingRows, + editingRowKeys: $data.d_editingRowKeys, + templates: _ctx.$slots, + editButtonProps: $options.rowEditButtonProps, + virtualScrollerContentProps: slotProps, + isVirtualScrollerDisabled: $options.virtualScrollerDisabled, + onRowgroupToggle: $options.toggleRowGroup, + onRowClick: _cache[26] || (_cache[26] = function($event) { + return $options.onRowClick($event); + }), + onRowDblclick: _cache[27] || (_cache[27] = function($event) { + return $options.onRowDblClick($event); + }), + onRowRightclick: _cache[28] || (_cache[28] = function($event) { + return $options.onRowRightClick($event); + }), + onRowTouchend: $options.onRowTouchEnd, + onRowKeydown: /* @__PURE__ */ __name(function onRowKeydown($event) { + return $options.onRowKeyDown($event, slotProps); + }, "onRowKeydown"), + onRowMousedown: $options.onRowMouseDown, + onRowDragstart: _cache[29] || (_cache[29] = function($event) { + return $options.onRowDragStart($event); + }), + onRowDragover: _cache[30] || (_cache[30] = function($event) { + return $options.onRowDragOver($event); + }), + onRowDragleave: _cache[31] || (_cache[31] = function($event) { + return $options.onRowDragLeave($event); + }), + onRowDragend: _cache[32] || (_cache[32] = function($event) { + return $options.onRowDragEnd($event); + }), + onRowDrop: _cache[33] || (_cache[33] = function($event) { + return $options.onRowDrop($event); + }), + onRowToggle: _cache[34] || (_cache[34] = function($event) { + return $options.toggleRow($event); + }), + onRadioChange: _cache[35] || (_cache[35] = function($event) { + return $options.toggleRowWithRadio($event); + }), + onCheckboxChange: _cache[36] || (_cache[36] = function($event) { + return $options.toggleRowWithCheckbox($event); + }), + onCellEditInit: _cache[37] || (_cache[37] = function($event) { + return $options.onCellEditInit($event); + }), + onCellEditComplete: _cache[38] || (_cache[38] = function($event) { + return $options.onCellEditComplete($event); + }), + onCellEditCancel: _cache[39] || (_cache[39] = function($event) { + return $options.onCellEditCancel($event); + }), + onRowEditInit: _cache[40] || (_cache[40] = function($event) { + return $options.onRowEditInit($event); + }), + onRowEditSave: _cache[41] || (_cache[41] = function($event) { + return $options.onRowEditSave($event); + }), + onRowEditCancel: _cache[42] || (_cache[42] = function($event) { + return $options.onRowEditCancel($event); + }), + editingMeta: $data.d_editingMeta, + onEditingMetaChange: $options.onEditingMetaChange, + unstyled: _ctx.unstyled, + pt: _ctx.pt + }, null, 8, ["value", "class", "columns", "empty", "first", "dataKey", "selection", "selectionKeys", "selectionMode", "contextMenu", "contextMenuSelection", "rowGroupMode", "groupRowsBy", "expandableRowGroups", "rowClass", "rowStyle", "editMode", "compareSelectionBy", "scrollable", "expandedRowIcon", "collapsedRowIcon", "expandedRows", "expandedRowGroups", "editingRows", "editingRowKeys", "templates", "editButtonProps", "virtualScrollerContentProps", "isVirtualScrollerDisabled", "onRowgroupToggle", "onRowTouchend", "onRowKeydown", "onRowMousedown", "editingMeta", "onEditingMetaChange", "unstyled", "pt"]), $options.hasSpacerStyle(slotProps.spacerStyle) ? (openBlock(), createElementBlock("tbody", mergeProps({ + key: 2, + "class": _ctx.cx("virtualScrollerSpacer"), + style: { + height: "calc(".concat(slotProps.spacerStyle.height, " - ").concat(slotProps.rows.length * slotProps.itemSize, "px)") + } + }, _ctx.ptm("virtualScrollerSpacer")), null, 16)) : createCommentVNode("", true), createVNode(_component_DTTableFooter, { + columnGroup: $options.footerColumnGroup, + columns: slotProps.columns, + pt: _ctx.pt + }, null, 8, ["columnGroup", "columns", "pt"])], 16)]; + }), + _: 1 + }, 16, ["items", "columns", "style", "scrollHeight", "disabled", "pt"])], 16), $options.paginatorBottom ? (openBlock(), createBlock(_component_DTPaginator, { + key: 3, + rows: $data.d_rows, + first: $data.d_first, + totalRecords: $options.totalRecordsLength, + pageLinkSize: _ctx.pageLinkSize, + template: _ctx.paginatorTemplate, + rowsPerPageOptions: _ctx.rowsPerPageOptions, + currentPageReportTemplate: _ctx.currentPageReportTemplate, + "class": normalizeClass(_ctx.cx("pcPaginator", { + position: "bottom" + })), + onPage: _cache[43] || (_cache[43] = function($event) { + return $options.onPage($event); + }), + alwaysShow: _ctx.alwaysShowPaginator, + unstyled: _ctx.unstyled, + pt: _ctx.ptm("pcPaginator") + }, createSlots({ + _: 2 + }, [_ctx.$slots.paginatorcontainer ? { + name: "container", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorcontainer", { + first: slotProps.first, + last: slotProps.last, + rows: slotProps.rows, + page: slotProps.page, + pageCount: slotProps.pageCount, + totalRecords: slotProps.totalRecords, + firstPageCallback: slotProps.firstPageCallback, + lastPageCallback: slotProps.lastPageCallback, + prevPageCallback: slotProps.prevPageCallback, + nextPageCallback: slotProps.nextPageCallback, + rowChangeCallback: slotProps.rowChangeCallback + })]; + }), + key: "0" + } : void 0, _ctx.$slots.paginatorstart ? { + name: "start", + fn: withCtx(function() { + return [renderSlot(_ctx.$slots, "paginatorstart")]; + }), + key: "1" + } : void 0, _ctx.$slots.paginatorend ? { + name: "end", + fn: withCtx(function() { + return [renderSlot(_ctx.$slots, "paginatorend")]; + }), + key: "2" + } : void 0, _ctx.$slots.paginatorfirstpagelinkicon ? { + name: "firstpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorfirstpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "3" + } : void 0, _ctx.$slots.paginatorprevpagelinkicon ? { + name: "prevpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorprevpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "4" + } : void 0, _ctx.$slots.paginatornextpagelinkicon ? { + name: "nextpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatornextpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "5" + } : void 0, _ctx.$slots.paginatorlastpagelinkicon ? { + name: "lastpagelinkicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorlastpagelinkicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "6" + } : void 0, _ctx.$slots.paginatorjumptopagedropdownicon ? { + name: "jumptopagedropdownicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorjumptopagedropdownicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "7" + } : void 0, _ctx.$slots.paginatorrowsperpagedropdownicon ? { + name: "rowsperpagedropdownicon", + fn: withCtx(function(slotProps) { + return [renderSlot(_ctx.$slots, "paginatorrowsperpagedropdownicon", { + "class": normalizeClass(slotProps["class"]) + })]; + }), + key: "8" + } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({ + key: 4, + "class": _ctx.cx("footer") + }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ + ref: "resizeHelper", + "class": _ctx.cx("columnResizeIndicator"), + style: { + "display": "none" + } + }, _ctx.ptm("columnResizeIndicator")), null, 16), _ctx.reorderableColumns ? (openBlock(), createElementBlock("span", mergeProps({ + key: 5, + ref: "reorderIndicatorUp", + "class": _ctx.cx("rowReorderIndicatorUp"), + style: { + "position": "absolute", + "display": "none" + } + }, _ctx.ptm("rowReorderIndicatorUp")), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.rowreorderindicatorupicon || _ctx.$slots.reorderindicatorupicon || "ArrowDownIcon")))], 16)) : createCommentVNode("", true), _ctx.reorderableColumns ? (openBlock(), createElementBlock("span", mergeProps({ + key: 6, + ref: "reorderIndicatorDown", + "class": _ctx.cx("rowReorderIndicatorDown"), + style: { + "position": "absolute", + "display": "none" + } + }, _ctx.ptm("rowReorderIndicatorDown")), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.rowreorderindicatordownicon || _ctx.$slots.reorderindicatordownicon || "ArrowUpIcon")))], 16)) : createCommentVNode("", true)], 16); +} +__name(render2, "render"); +script.render = render2; +export { + script as a, + script$r as s +}; +<<<<<<<< HEAD:comfy/web/assets/index-BwNYbo7J.js +//# sourceMappingURL=index-BwNYbo7J.js.map +======== +//# sourceMappingURL=index-B5F0uxTQ.js.map +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-B5F0uxTQ.js diff --git a/comfy/web/assets/index-BK27PIiK.js b/comfy/web/assets/index-BK27PIiK.js index 47a30f3f2..fbf061241 100644 --- a/comfy/web/assets/index-BK27PIiK.js +++ b/comfy/web/assets/index-BK27PIiK.js @@ -1,13 +1,19 @@ +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./KeybindingPanel-CCriqCI8.js","./index-BwNYbo7J.js","./index-4Y1pXkN0.js","./KeybindingPanel-peHZz96S.css","./ExtensionPanel-B4Se9sV5.js","./ServerConfigPanel-B6kqsYbT.js","./serverConfigStore-7qHooIp9.js","./index-CJHqfMZG.js","./index-A7qL4fzl.css","./GraphView-CtNN12CD.js","./GraphView-D9bTLjwH.css","./ServerStartView-B62YVgoN.js","./ServerStartView-BOMJWAdU.css","./InstallView-DiTLLUby.js","./InstallView-CwCsfDGf.css","./WelcomeView-Bxxhmp-U.js","./WelcomeView-IDMwvMd_.css","./NotSupportedView-4gTCJw6x.js","./NotSupportedView-gP2ltgpF.css"])))=>i.map(i=>d[i]); var __defProp2 = Object.defineProperty; var __name = (target2, value3) => __defProp2(target2, "name", { value: value3, configurable: true }); +======== +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphView-HVeNbkaW.js","./index-jXPKy3pP.js","./index-5HFeZax4.js","./index-B-aVupP5.js","./keybindingService-Bx7YdkXn.js","./serverConfigStore-CvyKFVuP.js","./GraphView-CIRWBKTm.css","./UserSelectView-B3jYchWu.js","./BaseViewTemplate-BNGF4K22.js","./ServerStartView-CIDTUh4x.js","./ServerStartView-CnyN4Ib6.css","./InstallView-CAcYt0HL.js","./InstallView-CwQdoH-C.css","./WelcomeView-N0ZXLjdi.js","./WelcomeView-Brz3-luE.css","./NotSupportedView-Drz3x2d-.js","./NotSupportedView-bFzHmqNj.css","./DownloadGitView-DeC7MBzG.js","./ManualConfigurationView-Bi_qHE-n.js","./ManualConfigurationView-B6ecEClB.css","./KeybindingPanel-Dc3C4lG1.js","./index-B5F0uxTQ.js","./KeybindingPanel-DvrUYZ4S.css","./ExtensionPanel-D4Phn0Zr.js","./ServerConfigPanel-Be4StJmv.js","./index-Bordpmzt.js","./index-BRhY6FpL.css"])))=>i.map(i=>d[i]); +var __defProp2 = Object.defineProperty; +var __name = (target, value4) => __defProp2(target, "name", { value: value4, configurable: true }); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js (/* @__PURE__ */ __name(function polyfill() { const relList = document.createElement("link").relList; if (relList && relList.supports && relList.supports("modulepreload")) { return; } - for (const link of document.querySelectorAll('link[rel="modulepreload"]')) { - processPreload(link); + for (const link2 of document.querySelectorAll('link[rel="modulepreload"]')) { + processPreload(link2); } new MutationObserver((mutations) => { for (const mutation of mutations) { @@ -20,26 +26,27 @@ var __name = (target2, value3) => __defProp2(target2, "name", { value: value3, c } } }).observe(document, { childList: true, subtree: true }); - function getFetchOpts(link) { + function getFetchOpts(link2) { const fetchOpts = {}; - if (link.integrity) fetchOpts.integrity = link.integrity; - if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy; - if (link.crossOrigin === "use-credentials") + if (link2.integrity) fetchOpts.integrity = link2.integrity; + if (link2.referrerPolicy) fetchOpts.referrerPolicy = link2.referrerPolicy; + if (link2.crossOrigin === "use-credentials") fetchOpts.credentials = "include"; - else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; + else if (link2.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; else fetchOpts.credentials = "same-origin"; return fetchOpts; } __name(getFetchOpts, "getFetchOpts"); - function processPreload(link) { - if (link.ep) + function processPreload(link2) { + if (link2.ep) return; - link.ep = true; - const fetchOpts = getFetchOpts(link); - fetch(link.href, fetchOpts); + link2.ep = true; + const fetchOpts = getFetchOpts(link2); + fetch(link2.href, fetchOpts); } __name(processPreload, "processPreload"); }, "polyfill"))(); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js /** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -49684,9 +49691,32 @@ function isEmpty(value3) { } __name(isEmpty, "isEmpty"); function compare$1(value1, value22, comparator, order = 1) { +======== +var __defProp$2 = Object.defineProperty; +var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols; +var __hasOwnProp$1 = Object.prototype.hasOwnProperty; +var __propIsEnum$1 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$2 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$2"); +var __spreadValues$1 = /* @__PURE__ */ __name((a, b) => { + for (var prop2 in b || (b = {})) + if (__hasOwnProp$1.call(b, prop2)) + __defNormalProp$2(a, prop2, b[prop2]); + if (__getOwnPropSymbols$1) + for (var prop2 of __getOwnPropSymbols$1(b)) { + if (__propIsEnum$1.call(b, prop2)) + __defNormalProp$2(a, prop2, b[prop2]); + } + return a; +}, "__spreadValues$1"); +function isEmpty$1(value4) { + return value4 === null || value4 === void 0 || value4 === "" || Array.isArray(value4) && value4.length === 0 || !(value4 instanceof Date) && typeof value4 === "object" && Object.keys(value4).length === 0; +} +__name(isEmpty$1, "isEmpty$1"); +function compare$1(value1, value22, comparator2, order = 1) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js let result = -1; - const emptyValue1 = isEmpty(value1); - const emptyValue2 = isEmpty(value22); + const emptyValue1 = isEmpty$1(value1); + const emptyValue2 = isEmpty$1(value22); if (emptyValue1 && emptyValue2) result = 0; else if (emptyValue1) result = order; else if (emptyValue2) result = -order; @@ -49697,6 +49727,7 @@ function compare$1(value1, value22, comparator, order = 1) { __name(compare$1, "compare$1"); function _deepEquals(obj1, obj2, visited = /* @__PURE__ */ new WeakSet()) { if (obj1 === obj2) return true; +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") return false; if (visited.has(obj1) || visited.has(obj2)) return false; visited.add(obj1).add(obj2); @@ -49705,6 +49736,31 @@ function _deepEquals(obj1, obj2, visited = /* @__PURE__ */ new WeakSet()) { length = obj1.length; if (length != obj2.length) return false; for (i = length; i-- !== 0; ) if (!_deepEquals(obj1[i], obj2[i], visited)) return false; +======== + if (obj1 && obj2 && typeof obj1 == "object" && typeof obj2 == "object") { + var arrObj1 = Array.isArray(obj1), arrObj2 = Array.isArray(obj2), i2, length, key; + if (arrObj1 && arrObj2) { + length = obj1.length; + if (length != obj2.length) return false; + for (i2 = length; i2-- !== 0; ) if (!deepEquals(obj1[i2], obj2[i2])) return false; + return true; + } + if (arrObj1 != arrObj2) return false; + var dateObj1 = obj1 instanceof Date, dateObj2 = obj2 instanceof Date; + if (dateObj1 != dateObj2) return false; + if (dateObj1 && dateObj2) return obj1.getTime() == obj2.getTime(); + var regexpObj1 = obj1 instanceof RegExp, regexpObj2 = obj2 instanceof RegExp; + if (regexpObj1 != regexpObj2) return false; + if (regexpObj1 && regexpObj2) return obj1.toString() == obj2.toString(); + var keys2 = Object.keys(obj1); + length = keys2.length; + if (length !== Object.keys(obj2).length) return false; + for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(obj2, keys2[i2])) return false; + for (i2 = length; i2-- !== 0; ) { + key = keys2[i2]; + if (!deepEquals(obj1[key], obj2[key])) return false; + } +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js return true; } if (arrObj1 != arrObj2) return false; @@ -49729,6 +49785,7 @@ function deepEquals(obj1, obj2) { return _deepEquals(obj1, obj2); } __name(deepEquals, "deepEquals"); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js function isFunction$1(value3) { return !!(value3 && value3.constructor && value3.call && value3.apply); } @@ -49756,11 +49813,40 @@ function resolveFieldData(data25, field) { let value3 = data25; for (let i = 0, len = fields.length; i < len; ++i) { if (value3 == null) { +======== +function isFunction$5(value4) { + return !!(value4 && value4.constructor && value4.call && value4.apply); +} +__name(isFunction$5, "isFunction$5"); +function isNotEmpty(value4) { + return !isEmpty$1(value4); +} +__name(isNotEmpty, "isNotEmpty"); +function resolveFieldData(data24, field) { + if (!data24 || !field) { + return null; + } + try { + const value4 = data24[field]; + if (isNotEmpty(value4)) return value4; + } catch (e2) { + } + if (Object.keys(data24).length) { + if (isFunction$5(field)) { + return field(data24); + } else if (field.indexOf(".") === -1) { + return data24[field]; + } else { + let fields = field.split("."); + let value4 = data24; + for (let i2 = 0, len = fields.length; i2 < len; ++i2) { + if (value4 == null) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js return null; } - value3 = value3[fields[i]]; + value4 = value4[fields[i2]]; } - return value3; + return value4; } } return null; @@ -49771,22 +49857,22 @@ function equals(obj1, obj2, field) { else return deepEquals(obj1, obj2); } __name(equals, "equals"); -function contains(value3, list) { - if (value3 != null && list && list.length) { - for (let val of list) { - if (equals(value3, val)) return true; +function contains(value4, list2) { + if (value4 != null && list2 && list2.length) { + for (let val of list2) { + if (equals(value4, val)) return true; } } return false; } __name(contains, "contains"); -function filter(value3, fields, filterValue) { +function filter(value4, fields, filterValue) { let filteredItems = []; - if (value3) { - for (let item2 of value3) { + if (value4) { + for (let item3 of value4) { for (let field of fields) { - if (String(resolveFieldData(item2, field)).toLowerCase().indexOf(filterValue.toLowerCase()) > -1) { - filteredItems.push(item2); + if (String(resolveFieldData(item3, field)).toLowerCase().indexOf(filterValue.toLowerCase()) > -1) { + filteredItems.push(item3); break; } } @@ -49795,12 +49881,12 @@ function filter(value3, fields, filterValue) { return filteredItems; } __name(filter, "filter"); -function findIndexInList(value3, list) { +function findIndexInList(value4, list2) { let index2 = -1; - if (list) { - for (let i = 0; i < list.length; i++) { - if (list[i] === value3) { - index2 = i; + if (list2) { + for (let i2 = 0; i2 < list2.length; i2++) { + if (list2[i2] === value4) { + index2 = i2; break; } } @@ -49809,15 +49895,15 @@ function findIndexInList(value3, list) { } __name(findIndexInList, "findIndexInList"); function findLast$1(arr, callback) { - let item2; + let item3; if (isNotEmpty(arr)) { try { - item2 = arr.findLast(callback); + item3 = arr.findLast(callback); } catch (e2) { - item2 = [...arr].reverse().find(callback); + item3 = [...arr].reverse().find(callback); } } - return item2; + return item3; } __name(findLast$1, "findLast$1"); function findLastIndex(arr, callback) { @@ -49832,54 +49918,61 @@ function findLastIndex(arr, callback) { return index2; } __name(findLastIndex, "findLastIndex"); -function isObject$2(value3, empty = true) { - return value3 instanceof Object && value3.constructor === Object && (empty || Object.keys(value3).length !== 0); +function isObject$7(value4, empty3 = true) { + return value4 instanceof Object && value4.constructor === Object && (empty3 || Object.keys(value4).length !== 0); } +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js __name(isObject$2, "isObject$2"); function resolve(obj, ...params) { return isFunction$1(obj) ? obj(...params) : obj; +======== +__name(isObject$7, "isObject$7"); +function resolve$1(obj, ...params) { + return isFunction$5(obj) ? obj(...params) : obj; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js } -__name(resolve, "resolve"); -function isString$1(value3, empty = true) { - return typeof value3 === "string" && (empty || value3 !== ""); +__name(resolve$1, "resolve$1"); +function isString$8(value4, empty3 = true) { + return typeof value4 === "string" && (empty3 || value4 !== ""); } -__name(isString$1, "isString$1"); +__name(isString$8, "isString$8"); function toFlatCase(str) { - return isString$1(str) ? str.replace(/(-|_)/g, "").toLowerCase() : str; + return isString$8(str) ? str.replace(/(-|_)/g, "").toLowerCase() : str; } __name(toFlatCase, "toFlatCase"); function getKeyValue(obj, key = "", params = {}) { const fKeys = toFlatCase(key).split("."); const fKey = fKeys.shift(); - return fKey ? isObject$2(obj) ? getKeyValue(resolve(obj[Object.keys(obj).find((k) => toFlatCase(k) === fKey) || ""], params), fKeys.join("."), params) : void 0 : resolve(obj, params); + return fKey ? isObject$7(obj) ? getKeyValue(resolve$1(obj[Object.keys(obj).find((k) => toFlatCase(k) === fKey) || ""], params), fKeys.join("."), params) : void 0 : resolve$1(obj, params); } __name(getKeyValue, "getKeyValue"); -function insertIntoOrderedArray(item2, index2, arr, sourceArr) { +function insertIntoOrderedArray(item3, index2, arr, sourceArr) { if (arr.length > 0) { let injected = false; - for (let i = 0; i < arr.length; i++) { - let currentItemIndex = findIndexInList(arr[i], sourceArr); + for (let i2 = 0; i2 < arr.length; i2++) { + let currentItemIndex = findIndexInList(arr[i2], sourceArr); if (currentItemIndex > index2) { - arr.splice(i, 0, item2); + arr.splice(i2, 0, item3); injected = true; break; } } if (!injected) { - arr.push(item2); + arr.push(item3); } } else { - arr.push(item2); + arr.push(item3); } } __name(insertIntoOrderedArray, "insertIntoOrderedArray"); -function isArray$2(value3, empty = true) { - return Array.isArray(value3) && (empty || value3.length !== 0); +function isArray$5(value4, empty3 = true) { + return Array.isArray(value4) && (empty3 || value4.length !== 0); } -__name(isArray$2, "isArray$2"); -function isDate(value3) { - return value3 instanceof Date && value3.constructor === Date; +__name(isArray$5, "isArray$5"); +function isDate$3(value4) { + return value4 instanceof Date && value4.constructor === Date; } +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js __name(isDate, "isDate"); function isLetter(char) { return /^[a-zA-Z\u00C0-\u017F]$/.test(char); @@ -49887,8 +49980,13 @@ function isLetter(char) { __name(isLetter, "isLetter"); function isNumber$1(value3) { return isNotEmpty(value3) && !isNaN(value3); +======== +__name(isDate$3, "isDate$3"); +function isNumber$5(value4) { + return isNotEmpty(value4) && !isNaN(value4); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js } -__name(isNumber$1, "isNumber$1"); +__name(isNumber$5, "isNumber$5"); function isPrintableCharacter(char = "") { return isNotEmpty(char) && char.length === 1 && !!char.match(/\S| /); } @@ -49901,11 +49999,11 @@ function localeComparator() { return new Intl.Collator(void 0, { numeric: true }).compare; } __name(localeComparator, "localeComparator"); -function matchRegex(str, regex) { - if (regex) { - const match = regex.test(str); - regex.lastIndex = 0; - return match; +function matchRegex(str, regex2) { + if (regex2) { + const match2 = regex2.test(str); + regex2.lastIndex = 0; + return match2; } return false; } @@ -49914,15 +50012,20 @@ function mergeKeys(...args) { const _mergeKeys = /* @__PURE__ */ __name((target2 = {}, source = {}) => { const mergedObj = __spreadValues$2({}, target2); Object.keys(source).forEach((key) => { +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js if (isObject$2(source[key]) && key in target2 && isObject$2(target2[key])) { mergedObj[key] = _mergeKeys(target2[key], source[key]); +======== + if (isObject$7(source[key]) && key in target && isObject$7(target[key])) { + mergedObj[key] = _mergeKeys(target[key], source[key]); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js } else { mergedObj[key] = source[key]; } }); return mergedObj; }, "_mergeKeys"); - return args.reduce((acc, obj, i) => i === 0 ? obj : _mergeKeys(acc, obj), {}); + return args.reduce((acc, obj, i2) => i2 === 0 ? obj : _mergeKeys(acc, obj), {}); } __name(mergeKeys, "mergeKeys"); function minifyCSS(css3) { @@ -49930,9 +50033,9 @@ function minifyCSS(css3) { } __name(minifyCSS, "minifyCSS"); function nestedKeys(obj = {}, parentKey = "") { - return Object.entries(obj).reduce((o, [key, value3]) => { + return Object.entries(obj).reduce((o, [key, value4]) => { const currentKey = parentKey ? `${parentKey}.${key}` : key; - isObject$2(value3) ? o = o.concat(nestedKeys(value3, currentKey)) : o.push(currentKey); + isObject$7(value4) ? o = o.concat(nestedKeys(value4, currentKey)) : o.push(currentKey); return o; }, []); } @@ -50000,28 +50103,29 @@ function removeAccents(str) { return str; } __name(removeAccents, "removeAccents"); -function reorderArray(value3, from, to) { - if (value3 && from !== to) { - if (to >= value3.length) { - to %= value3.length; - from %= value3.length; +function reorderArray(value4, from2, to) { + if (value4 && from2 !== to) { + if (to >= value4.length) { + to %= value4.length; + from2 %= value4.length; } - value3.splice(to, 0, value3.splice(from, 1)[0]); + value4.splice(to, 0, value4.splice(from2, 1)[0]); } } __name(reorderArray, "reorderArray"); function sort(value1, value22, order = 1, comparator, nullSortOrder = 1) { const result = compare$1(value1, value22, comparator, order); let finalSortOrder = order; - if (isEmpty(value1) || isEmpty(value22)) { + if (isEmpty$1(value1) || isEmpty$1(value22)) { finalSortOrder = nullSortOrder === 1 ? order : nullSortOrder; } return finalSortOrder * result; } __name(sort, "sort"); -function stringify(value3, indent = 2, currentIndent = 0) { +function stringify(value4, indent = 2, currentIndent = 0) { const currentIndentStr = " ".repeat(currentIndent); const nextIndentStr = " ".repeat(currentIndent + indent); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js if (isArray$2(value3)) { return "[" + value3.map((v2) => stringify(v2, indent, currentIndent + indent)).join(", ") + "]"; } else if (isDate(value3)) { @@ -50030,24 +50134,35 @@ function stringify(value3, indent = 2, currentIndent = 0) { return value3.toString(); } else if (isObject$2(value3)) { return "{\n" + Object.entries(value3).map(([k, v2]) => `${nextIndentStr}${k}: ${stringify(v2, indent, currentIndent + indent)}`).join(",\n") + ` +======== + if (isArray$5(value4)) { + return "[" + value4.map((v2) => stringify(v2, indent, currentIndent + indent)).join(", ") + "]"; + } else if (isDate$3(value4)) { + return value4.toISOString(); + } else if (isFunction$5(value4)) { + return value4.toString(); + } else if (isObject$7(value4)) { + return "{\n" + Object.entries(value4).map(([k, v2]) => `${nextIndentStr}${k}: ${stringify(v2, indent, currentIndent + indent)}`).join(",\n") + ` +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js ${currentIndentStr}}`; } else { - return JSON.stringify(value3); + return JSON.stringify(value4); } } __name(stringify, "stringify"); function toCapitalCase(str) { - return isString$1(str, false) ? str[0].toUpperCase() + str.slice(1) : str; + return isString$8(str, false) ? str[0].toUpperCase() + str.slice(1) : str; } __name(toCapitalCase, "toCapitalCase"); function toKebabCase(str) { - return isString$1(str) ? str.replace(/(_)/g, "-").replace(/[A-Z]/g, (c, i) => i === 0 ? c : "-" + c.toLowerCase()).toLowerCase() : str; + return isString$8(str) ? str.replace(/(_)/g, "-").replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "-" + c.toLowerCase()).toLowerCase() : str; } __name(toKebabCase, "toKebabCase"); function toTokenKey$1(str) { - return isString$1(str) ? str.replace(/[A-Z]/g, (c, i) => i === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str; + return isString$8(str) ? str.replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str; } __name(toTokenKey$1, "toTokenKey$1"); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js function toValue$2(value3) { if (value3 && typeof value3 === "object") { if (value3.hasOwnProperty("current")) { @@ -50621,6 +50736,8 @@ function classNames(...args) { return void 0; } __name(classNames, "classNames"); +======== +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js function EventBus() { const allHandlers = /* @__PURE__ */ new Map(); return { @@ -50653,6 +50770,7 @@ function EventBus() { } __name(EventBus, "EventBus"); var __defProp$1 = Object.defineProperty; +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols; var __hasOwnProp$1 = Object.prototype.hasOwnProperty; var __propIsEnum$1 = Object.prototype.propertyIsEnumerable; @@ -50984,20 +51102,22 @@ function getVNodeProp(vnode, prop2) { } __name(getVNodeProp, "getVNodeProp"); var __defProp = Object.defineProperty; +======== +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = /* @__PURE__ */ __name((obj, key, value3) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value3 }) : obj[key] = value3, "__defNormalProp"); +var __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$1"); var __spreadValues = /* @__PURE__ */ __name((a, b) => { for (var prop2 in b || (b = {})) if (__hasOwnProp.call(b, prop2)) - __defNormalProp(a, prop2, b[prop2]); + __defNormalProp$1(a, prop2, b[prop2]); if (__getOwnPropSymbols) for (var prop2 of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop2)) - __defNormalProp(a, prop2, b[prop2]); + __defNormalProp$1(a, prop2, b[prop2]); } return a; }, "__spreadValues"); @@ -51021,29 +51141,29 @@ __name(definePreset, "definePreset"); var ThemeService = EventBus(); var service_default = ThemeService; function toTokenKey(str) { - return isString$1(str) ? str.replace(/[A-Z]/g, (c, i) => i === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str; + return isString$8(str) ? str.replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str; } __name(toTokenKey, "toTokenKey"); -function merge(value1, value22) { - if (isArray$2(value1)) { +function merge$1(value1, value22) { + if (isArray$5(value1)) { value1.push(...value22 || []); - } else if (isObject$2(value1)) { + } else if (isObject$7(value1)) { Object.assign(value1, value22); } } -__name(merge, "merge"); -function toValue$1(value3) { - return isObject$2(value3) && value3.hasOwnProperty("value") && value3.hasOwnProperty("type") ? value3.value : value3; +__name(merge$1, "merge$1"); +function toValue$2(value4) { + return isObject$7(value4) && value4.hasOwnProperty("value") && value4.hasOwnProperty("type") ? value4.value : value4; } -__name(toValue$1, "toValue$1"); -function toUnit(value3, variable = "") { +__name(toValue$2, "toValue$2"); +function toUnit(value4, variable = "") { const excludedProperties = ["opacity", "z-index", "line-height", "font-weight", "flex", "flex-grow", "flex-shrink", "order"]; if (!excludedProperties.some((property) => variable.endsWith(property))) { - const val = `${value3}`.trim(); + const val = `${value4}`.trim(); const valArr = val.split(" "); - return valArr.map((v2) => isNumber$1(v2) ? `${v2}px` : v2).join(" "); + return valArr.map((v2) => isNumber$5(v2) ? `${v2}px` : v2).join(" "); } - return value3; + return value4; } __name(toUnit, "toUnit"); function toNormalizePrefix(prefix2) { @@ -51051,13 +51171,14 @@ function toNormalizePrefix(prefix2) { } __name(toNormalizePrefix, "toNormalizePrefix"); function toNormalizeVariable(prefix2 = "", variable = "") { - return toNormalizePrefix(`${isString$1(prefix2, false) && isString$1(variable, false) ? `${prefix2}-` : prefix2}${variable}`); + return toNormalizePrefix(`${isString$8(prefix2, false) && isString$8(variable, false) ? `${prefix2}-` : prefix2}${variable}`); } __name(toNormalizeVariable, "toNormalizeVariable"); function getVariableName(prefix2 = "", variable = "") { return `--${toNormalizeVariable(prefix2, variable)}`; } __name(getVariableName, "getVariableName"); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js function hasOddBraces(str = "") { const openBraces = (str.match(/{/g) || []).length; const closeBraces = (str.match(/}/g) || []).length; @@ -51072,6 +51193,14 @@ function getVariableValue(value3, variable = "", prefix2 = "", excludedKeyRegexe return void 0; } else if (matchRegex(val, regex)) { const _val = val.replaceAll(regex, (v2) => { +======== +function getVariableValue(value4, variable = "", prefix2 = "", excludedKeyRegexes = [], fallback) { + if (isString$8(value4)) { + const regex2 = /{([^}]*)}/g; + const val = value4.trim(); + if (matchRegex(val, regex2)) { + const _val = val.replaceAll(regex2, (v2) => { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js const path = v2.replace(/{|}/g, ""); const keys2 = path.split(".").filter((_v) => !excludedKeyRegexes.some((_r) => matchRegex(_v, _r))); return `var(${getVariableName(prefix2, toKebabCase(keys2.join("-")))}${isNotEmpty(fallback) ? `, ${fallback}` : ""})`; @@ -51080,27 +51209,33 @@ function getVariableValue(value3, variable = "", prefix2 = "", excludedKeyRegexe const cleanedVarRegex = /var\([^)]+\)/g; return matchRegex(_val.replace(cleanedVarRegex, "0"), calculationRegex) ? `calc(${_val})` : _val; } +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js return val; } else if (isNumber$1(value3)) { return value3; +======== + return toUnit(val, variable); + } else if (isNumber$5(value4)) { + return toUnit(value4, variable); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js } return void 0; } __name(getVariableValue, "getVariableValue"); -function getComputedValue(obj = {}, value3) { - if (isString$1(value3)) { - const regex = /{([^}]*)}/g; - const val = value3.trim(); - return matchRegex(val, regex) ? val.replaceAll(regex, (v2) => getKeyValue(obj, v2.replace(/{|}/g, ""))) : val; - } else if (isNumber$1(value3)) { - return value3; +function getComputedValue(obj = {}, value4) { + if (isString$8(value4)) { + const regex2 = /{([^}]*)}/g; + const val = value4.trim(); + return matchRegex(val, regex2) ? val.replaceAll(regex2, (v2) => getKeyValue(obj, v2.replace(/{|}/g, ""))) : val; + } else if (isNumber$5(value4)) { + return value4; } return void 0; } __name(getComputedValue, "getComputedValue"); -function setProperty(properties, key, value3) { - if (isString$1(key, false)) { - properties.push(`${key}:${value3};`); +function setProperty(properties, key, value4) { + if (isString$8(key, false)) { + properties.push(`${key}:${value4};`); } } __name(setProperty, "setProperty"); @@ -51152,23 +51287,32 @@ var palette_default = /* @__PURE__ */ __name((color2) => { const token = color2.replace(/{|}/g, ""); return scales.reduce((acc, scale) => (acc[scale] = `{${token}.${scale}}`, acc), {}); } - return typeof color2 === "string" ? scales.reduce((acc, scale, i) => (acc[scale] = i <= 5 ? tint_default(color2, (5 - i) * 19) : shade_default(color2, (i - 5) * 15), acc), {}) : color2; + return typeof color2 === "string" ? scales.reduce((acc, scale, i2) => (acc[scale] = i2 <= 5 ? tint_default(color2, (5 - i2) * 19) : shade_default(color2, (i2 - 5) * 15), acc), {}) : color2; }, "palette_default"); var $dt = /* @__PURE__ */ __name((tokenPath) => { +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var _a; const theme39 = config_default.getTheme(); const variable = dtwt(theme39, tokenPath, void 0, "variable"); const name2 = (_a = variable == null ? void 0 : variable.match(/--[\w-]+/g)) == null ? void 0 : _a[0]; const value3 = dtwt(theme39, tokenPath, void 0, "value"); +======== + var _a2; + const theme40 = config_default.getTheme(); + const variable = dtwt(theme40, tokenPath, void 0, "variable"); + const name2 = (_a2 = variable.match(/--[\w-]+/g)) == null ? void 0 : _a2[0]; + const value4 = dtwt(theme40, tokenPath, void 0, "value"); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js return { name: name2, variable, - value: value3 + value: value4 }; }, "$dt"); var dt = /* @__PURE__ */ __name((...args) => { return dtwt(config_default.getTheme(), ...args); }, "dt"); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var dtwt = /* @__PURE__ */ __name((theme39 = {}, tokenPath, fallback, type) => { if (tokenPath) { const { variable: VARIABLE, options: OPTIONS } = config_default.defaults || {}; @@ -51176,23 +51320,41 @@ var dtwt = /* @__PURE__ */ __name((theme39 = {}, tokenPath, fallback, type) => { const regex = /{([^}]*)}/g; const token = matchRegex(tokenPath, regex) ? tokenPath : `{${tokenPath}}`; const isStrictTransform = type === "value" || isEmpty(type) && transform2 === "strict"; +======== +var dtwt = /* @__PURE__ */ __name((theme40 = {}, tokenPath, fallback, type = "variable") => { + if (tokenPath) { + const { variable: VARIABLE, options: OPTIONS } = config_default.defaults || {}; + const { prefix: prefix2, transform: transform2 } = (theme40 == null ? void 0 : theme40.options) || OPTIONS || {}; + const regex2 = /{([^}]*)}/g; + const token = matchRegex(tokenPath, regex2) ? tokenPath : `{${tokenPath}}`; + const isStrictTransform = type === "value" || transform2 === "strict"; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js return isStrictTransform ? config_default.getTokenValue(tokenPath) : getVariableValue(token, void 0, prefix2, [VARIABLE.excludedKeyRegex], fallback); } return ""; }, "dtwt"); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js function css$3(style) { return resolve(style, { dt }); } __name(css$3, "css$3"); var $t = /* @__PURE__ */ __name((theme39 = {}) => { let { preset: _preset, options: _options } = theme39; +======== +function css$2(style2) { + return resolve$1(style2, { dt }); +} +__name(css$2, "css$2"); +var $t = /* @__PURE__ */ __name((theme40 = {}) => { + let { preset: _preset, options: _options } = theme40; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js return { - preset(value3) { - _preset = _preset ? mergeKeys(_preset, value3) : value3; + preset(value4) { + _preset = _preset ? mergeKeys(_preset, value4) : value4; return this; }, - options(value3) { - _options = _options ? __spreadValues(__spreadValues({}, _options), value3) : value3; + options(value4) { + _options = _options ? __spreadValues(__spreadValues({}, _options), value4) : value4; return this; }, // features @@ -51202,13 +51364,13 @@ var $t = /* @__PURE__ */ __name((theme39 = {}) => { return this; }, surfacePalette(surface) { - var _a, _b; + var _a2, _b; const { semantic } = _preset || {}; const lightSurface = (surface == null ? void 0 : surface.hasOwnProperty("light")) ? surface == null ? void 0 : surface.light : surface; const darkSurface = (surface == null ? void 0 : surface.hasOwnProperty("dark")) ? surface == null ? void 0 : surface.dark : surface; const newColorScheme = { colorScheme: { - light: __spreadValues(__spreadValues({}, (_a = semantic == null ? void 0 : semantic.colorScheme) == null ? void 0 : _a.light), !!lightSurface && { surface: lightSurface }), + light: __spreadValues(__spreadValues({}, (_a2 = semantic == null ? void 0 : semantic.colorScheme) == null ? void 0 : _a2.light), !!lightSurface && { surface: lightSurface }), dark: __spreadValues(__spreadValues({}, (_b = semantic == null ? void 0 : semantic.colorScheme) == null ? void 0 : _b.dark), !!darkSurface && { surface: darkSurface }) } }; @@ -51230,25 +51392,25 @@ var $t = /* @__PURE__ */ __name((theme39 = {}) => { config_default.setTheme(newTheme); return newTheme; }, - use(options3) { - const newTheme = this.define(options3); + use(options4) { + const newTheme = this.define(options4); config_default.setTheme(newTheme); return newTheme; } }; }, "$t"); -function toVariables_default(theme39, options3 = {}) { +function toVariables_default(theme40, options4 = {}) { const VARIABLE = config_default.defaults.variable; - const { prefix: prefix2 = VARIABLE.prefix, selector = VARIABLE.selector, excludedKeyRegex = VARIABLE.excludedKeyRegex } = options3; + const { prefix: prefix2 = VARIABLE.prefix, selector = VARIABLE.selector, excludedKeyRegex = VARIABLE.excludedKeyRegex } = options4; const _toVariables = /* @__PURE__ */ __name((_theme, _prefix = "") => { return Object.entries(_theme).reduce( - (acc, [key, value3]) => { + (acc, [key, value4]) => { const px = matchRegex(key, excludedKeyRegex) ? toNormalizeVariable(_prefix) : toNormalizeVariable(_prefix, toKebabCase(key)); - const v2 = toValue$1(value3); - if (isObject$2(v2)) { + const v2 = toValue$2(value4); + if (isObject$7(v2)) { const { variables: variables2, tokens: tokens2 } = _toVariables(v2, px); - merge(acc["tokens"], tokens2); - merge(acc["variables"], variables2); + merge$1(acc["tokens"], tokens2); + merge$1(acc["variables"], variables2); } else { acc["tokens"].push((prefix2 ? px.replace(`${prefix2}-`, "") : px).replaceAll("-", ".")); setProperty(acc["variables"], getVariableName(px), getVariableValue(v2, px, prefix2, [excludedKeyRegex])); @@ -51258,7 +51420,7 @@ function toVariables_default(theme39, options3 = {}) { { variables: [], tokens: [] } ); }, "_toVariables"); - const { variables, tokens } = _toVariables(theme39, prefix2); + const { variables, tokens } = _toVariables(theme40, prefix2); return { value: variables, tokens, @@ -51272,45 +51434,46 @@ var themeUtils_default = { rules: { class: { pattern: /^\.([a-zA-Z][\w-]*)$/, - resolve(value3) { - return { type: "class", selector: value3, matched: this.pattern.test(value3.trim()) }; + resolve(value4) { + return { type: "class", selector: value4, matched: this.pattern.test(value4.trim()) }; } }, attr: { pattern: /^\[(.*)\]$/, - resolve(value3) { - return { type: "attr", selector: `:root${value3}`, matched: this.pattern.test(value3.trim()) }; + resolve(value4) { + return { type: "attr", selector: `:root${value4}`, matched: this.pattern.test(value4.trim()) }; } }, media: { pattern: /^@media (.*)$/, - resolve(value3) { - return { type: "media", selector: `${value3}{:root{[CSS]}}`, matched: this.pattern.test(value3.trim()) }; + resolve(value4) { + return { type: "media", selector: `${value4}{:root{[CSS]}}`, matched: this.pattern.test(value4.trim()) }; } }, system: { pattern: /^system$/, - resolve(value3) { - return { type: "system", selector: "@media (prefers-color-scheme: dark){:root{[CSS]}}", matched: this.pattern.test(value3.trim()) }; + resolve(value4) { + return { type: "system", selector: "@media (prefers-color-scheme: dark){:root{[CSS]}}", matched: this.pattern.test(value4.trim()) }; } }, custom: { - resolve(value3) { - return { type: "custom", selector: value3, matched: true }; + resolve(value4) { + return { type: "custom", selector: value4, matched: true }; } } }, - resolve(value3) { + resolve(value4) { const rules = Object.keys(this.rules).filter((k) => k !== "custom").map((r) => this.rules[r]); - return [value3].flat().map((v2) => { - var _a; - return (_a = rules.map((r) => r.resolve(v2)).find((rr) => rr.matched)) != null ? _a : this.rules.custom.resolve(v2); + return [value4].flat().map((v2) => { + var _a2; + return (_a2 = rules.map((r) => r.resolve(v2)).find((rr) => rr.matched)) != null ? _a2 : this.rules.custom.resolve(v2); }); } }, - _toVariables(theme39, options3) { - return toVariables_default(theme39, { prefix: options3 == null ? void 0 : options3.prefix }); + _toVariables(theme40, options4) { + return toVariables_default(theme40, { prefix: options4 == null ? void 0 : options4.prefix }); }, +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js getCommon({ name: name2 = "", theme: theme39 = {}, params, set: set2, defaults: defaults2 }) { var _e, _f, _g, _h, _i, _j, _k; const { preset, options: options3 } = theme39; @@ -51339,6 +51502,28 @@ var themeUtils_default = { primitive_tokens = prim_tokens; const semantic_light_css = this.transformCSS(name2, `${sRest_css}${csRest_css}`, "light", "variable", options3, set2, defaults2); const semantic_dark_css = this.transformCSS(name2, `${csDark_css}`, "dark", "variable", options3, set2, defaults2); +======== + getCommon({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) { + var _c, _d, _e, _f; + const { preset, options: options4 } = theme40; + let primitive_css, primitive_tokens, semantic_css, semantic_tokens; + if (isNotEmpty(preset)) { + const { primitive, semantic } = preset; + const _a2 = semantic || {}, { colorScheme } = _a2, sRest = __objRest(_a2, ["colorScheme"]); + const _b = colorScheme || {}, { dark: dark2 } = _b, csRest = __objRest(_b, ["dark"]); + const prim_var = isNotEmpty(primitive) ? this._toVariables({ primitive }, options4) : {}; + const sRest_var = isNotEmpty(sRest) ? this._toVariables({ semantic: sRest }, options4) : {}; + const csRest_var = isNotEmpty(csRest) ? this._toVariables({ light: csRest }, options4) : {}; + const dark_var = isNotEmpty(dark2) ? this._toVariables({ dark: dark2 }, options4) : {}; + const [prim_css, prim_tokens] = [(_c = prim_var.declarations) != null ? _c : "", prim_var.tokens]; + const [sRest_css, sRest_tokens] = [(_d = sRest_var.declarations) != null ? _d : "", sRest_var.tokens || []]; + const [csRest_css, csRest_tokens] = [(_e = csRest_var.declarations) != null ? _e : "", csRest_var.tokens || []]; + const [dark_css, dark_tokens] = [(_f = dark_var.declarations) != null ? _f : "", dark_var.tokens || []]; + primitive_css = this.transformCSS(name2, prim_css, "light", "variable", options4, set3, defaults2); + primitive_tokens = prim_tokens; + const semantic_light_css = this.transformCSS(name2, `${sRest_css}${csRest_css}color-scheme:light`, "light", "variable", options4, set3, defaults2); + const semantic_dark_css = this.transformCSS(name2, `${dark_css}color-scheme:dark`, "dark", "variable", options4, set3, defaults2); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js semantic_css = `${semantic_light_css}${semantic_dark_css}`; semantic_tokens = [.../* @__PURE__ */ new Set([...sRest_tokens, ...csRest_tokens, ...csDark_tokens])]; const global_light_css = this.transformCSS(name2, `${eRest_css}${ecsRest_css}color-scheme:light`, "light", "variable", options3, set2, defaults2); @@ -51363,6 +51548,7 @@ var themeUtils_default = { style }; }, +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js getPreset({ name: name2 = "", preset = {}, options: options3, params, set: set2, defaults: defaults2, selector }) { var _e, _f, _g; let p_css, p_tokens, p_style; @@ -51384,12 +51570,29 @@ var themeUtils_default = { p_tokens = [.../* @__PURE__ */ new Set([...vRest_tokens, ...csRest_tokens, ...csDark_tokens])]; p_style = resolve(css22, { dt }); } +======== + getPreset({ name: name2 = "", preset = {}, options: options4, params, set: set3, defaults: defaults2, selector }) { + var _c, _d, _e; + const _name = name2.replace("-directive", ""); + const _a2 = preset, { colorScheme } = _a2, vRest = __objRest(_a2, ["colorScheme"]); + const _b = colorScheme || {}, { dark: dark2 } = _b, csRest = __objRest(_b, ["dark"]); + const vRest_var = isNotEmpty(vRest) ? this._toVariables({ [_name]: vRest }, options4) : {}; + const csRest_var = isNotEmpty(csRest) ? this._toVariables({ [_name]: csRest }, options4) : {}; + const dark_var = isNotEmpty(dark2) ? this._toVariables({ [_name]: dark2 }, options4) : {}; + const [vRest_css, vRest_tokens] = [(_c = vRest_var.declarations) != null ? _c : "", vRest_var.tokens || []]; + const [csRest_css, csRest_tokens] = [(_d = csRest_var.declarations) != null ? _d : "", csRest_var.tokens || []]; + const [dark_css, dark_tokens] = [(_e = dark_var.declarations) != null ? _e : "", dark_var.tokens || []]; + const tokens = [.../* @__PURE__ */ new Set([...vRest_tokens, ...csRest_tokens, ...dark_tokens])]; + const light_variable_css = this.transformCSS(_name, `${vRest_css}${csRest_css}`, "light", "variable", options4, set3, defaults2, selector); + const dark_variable_css = this.transformCSS(_name, dark_css, "dark", "variable", options4, set3, defaults2, selector); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js return { css: p_css, tokens: p_tokens, style: p_style }; }, +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js getPresetC({ name: name2 = "", theme: theme39 = {}, params, set: set2, defaults: defaults2 }) { var _a; const { preset, options: options3 } = theme39; @@ -51412,37 +51615,70 @@ var themeUtils_default = { }, getLayerOrder(name2, options3 = {}, params, defaults2) { const { cssLayer } = options3; +======== + getPresetC({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) { + var _a2; + const { preset, options: options4 } = theme40; + const cPreset = (_a2 = preset == null ? void 0 : preset.components) == null ? void 0 : _a2[name2]; + return this.getPreset({ name: name2, preset: cPreset, options: options4, params, set: set3, defaults: defaults2 }); + }, + getPresetD({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) { + var _a2; + const dName = name2.replace("-directive", ""); + const { preset, options: options4 } = theme40; + const dPreset = (_a2 = preset == null ? void 0 : preset.directives) == null ? void 0 : _a2[dName]; + return this.getPreset({ name: dName, preset: dPreset, options: options4, params, set: set3, defaults: defaults2 }); + }, + getColorSchemeOption(options4, defaults2) { + var _a2; + return this.regex.resolve((_a2 = options4.darkModeSelector) != null ? _a2 : defaults2.options.darkModeSelector); + }, + getLayerOrder(name2, options4 = {}, params, defaults2) { + const { cssLayer } = options4; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js if (cssLayer) { - const order = resolve(cssLayer.order || "primeui", params); + const order = resolve$1(cssLayer.order || "primeui", params); return `@layer ${order}`; } return ""; }, +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js getCommonStyleSheet({ name: name2 = "", theme: theme39 = {}, params, props = {}, set: set2, defaults: defaults2 }) { const common = this.getCommon({ name: name2, theme: theme39, params, set: set2, defaults: defaults2 }); +======== + getCommonStyleSheet({ name: name2 = "", theme: theme40 = {}, params, props = {}, set: set3, defaults: defaults2 }) { + const common = this.getCommon({ name: name2, theme: theme40, params, set: set3, defaults: defaults2 }); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js const _props = Object.entries(props).reduce((acc, [k, v2]) => acc.push(`${k}="${v2}"`) && acc, []).join(" "); - return Object.entries(common || {}).reduce((acc, [key, value3]) => { - if (value3 == null ? void 0 : value3.css) { - const _css = minifyCSS(value3 == null ? void 0 : value3.css); + return Object.entries(common || {}).reduce((acc, [key, value4]) => { + if (value4 == null ? void 0 : value4.css) { + const _css = minifyCSS(value4 == null ? void 0 : value4.css); const id3 = `${key}-variables`; acc.push(``); } return acc; }, []).join(""); }, +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js getStyleSheet({ name: name2 = "", theme: theme39 = {}, params, props = {}, set: set2, defaults: defaults2 }) { var _a; const options3 = { name: name2, theme: theme39, params, set: set2, defaults: defaults2 }; const preset_css = (_a = name2.includes("-directive") ? this.getPresetD(options3) : this.getPresetC(options3)) == null ? void 0 : _a.css; +======== + getStyleSheet({ name: name2 = "", theme: theme40 = {}, params, props = {}, set: set3, defaults: defaults2 }) { + var _a2; + const options4 = { name: name2, theme: theme40, params, set: set3, defaults: defaults2 }; + const preset_css = (_a2 = name2.includes("-directive") ? this.getPresetD(options4) : this.getPresetC(options4)) == null ? void 0 : _a2.css; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js const _props = Object.entries(props).reduce((acc, [k, v2]) => acc.push(`${k}="${v2}"`) && acc, []).join(" "); return preset_css ? `` : ""; }, createTokens(obj = {}, defaults2, parentKey = "", parentPath = "", tokens = {}) { - Object.entries(obj).forEach(([key, value3]) => { + Object.entries(obj).forEach(([key, value4]) => { const currentKey = matchRegex(key, defaults2.variable.excludedKeyRegex) ? parentKey : parentKey ? `${parentKey}.${toTokenKey$1(key)}` : toTokenKey$1(key); const currentPath = parentPath ? `${parentPath}.${key}` : key; - if (isObject$2(value3)) { - this.createTokens(value3, defaults2, currentKey, currentPath, tokens); + if (isObject$7(value4)) { + this.createTokens(value4, defaults2, currentKey, currentPath, tokens); } else { tokens[currentKey] || (tokens[currentKey] = { paths: [], @@ -51458,13 +51694,14 @@ var themeUtils_default = { }); tokens[currentKey].paths.push({ path: currentPath, - value: value3, + value: value4, scheme: currentPath.includes("colorScheme.light") ? "light" : currentPath.includes("colorScheme.dark") ? "dark" : "none", computed(colorScheme, tokenPathMap = {}) { - const regex = /{([^}]*)}/g; - let computedValue = value3; + const regex2 = /{([^}]*)}/g; + let computedValue = value4; tokenPathMap["name"] = this.path; tokenPathMap["binding"] || (tokenPathMap["binding"] = {}); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js if (matchRegex(value3, regex)) { const val = value3.trim(); const _val = val.replaceAll(regex, (v2) => { @@ -51472,12 +51709,20 @@ var themeUtils_default = { const path = v2.replace(/{|}/g, ""); const computed2 = (_a = tokens[path]) == null ? void 0 : _a.computed(colorScheme, tokenPathMap); return isArray$2(computed2) && computed2.length === 2 ? `light-dark(${computed2[0].value},${computed2[1].value})` : computed2 == null ? void 0 : computed2.value; +======== + if (matchRegex(value4, regex2)) { + const val = value4.trim(); + const _val = val.replaceAll(regex2, (v2) => { + var _a2, _b; + const path = v2.replace(/{|}/g, ""); + return (_b = (_a2 = tokens[path]) == null ? void 0 : _a2.computed(colorScheme, tokenPathMap)) == null ? void 0 : _b.value; +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js }); const calculationRegex = /(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g; const cleanedVarRegex = /var\([^)]+\)/g; computedValue = matchRegex(_val.replace(cleanedVarRegex, "0"), calculationRegex) ? `calc(${_val})` : _val; } - isEmpty(tokenPathMap["binding"]) && delete tokenPathMap["binding"]; + isEmpty$1(tokenPathMap["binding"]) && delete tokenPathMap["binding"]; return { colorScheme, path: this.path, @@ -51491,29 +51736,39 @@ var themeUtils_default = { return tokens; }, getTokenValue(tokens, path, defaults2) { - var _a; + var _a2; const normalizePath = /* @__PURE__ */ __name((str) => { const strArr = str.split("."); return strArr.filter((s) => !matchRegex(s.toLowerCase(), defaults2.variable.excludedKeyRegex)).join("."); }, "normalizePath"); const token = normalizePath(path); const colorScheme = path.includes("colorScheme.light") ? "light" : path.includes("colorScheme.dark") ? "dark" : void 0; - const computedValues = [(_a = tokens[token]) == null ? void 0 : _a.computed(colorScheme)].flat().filter((computed2) => computed2); + const computedValues = [(_a2 = tokens[token]) == null ? void 0 : _a2.computed(colorScheme)].flat().filter((computed2) => computed2); return computedValues.length === 1 ? computedValues[0].value : computedValues.reduce((acc = {}, computed2) => { - const _a2 = computed2, { colorScheme: cs } = _a2, rest = __objRest(_a2, ["colorScheme"]); + const _a22 = computed2, { colorScheme: cs } = _a22, rest = __objRest(_a22, ["colorScheme"]); acc[cs] = rest; return acc; }, void 0); }, +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js getSelectorRule(selector1, selector2, type, css22) { return type === "class" || type === "attr" ? getRule(isNotEmpty(selector2) ? `${selector1}${selector2},${selector1} ${selector2}` : selector1, css22) : getRule(selector1, isNotEmpty(selector2) ? getRule(selector2, css22) : css22); }, transformCSS(name2, css22, mode2, type, options3 = {}, set2, defaults2, selector) { +======== + transformCSS(name2, css22, mode2, type, options4 = {}, set3, defaults2, selector) { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js if (isNotEmpty(css22)) { - const { cssLayer } = options3; + const { cssLayer } = options4; if (type !== "style") { +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js const colorSchemeOption = this.getColorSchemeOption(options3, defaults2); css22 = mode2 === "dark" ? colorSchemeOption.reduce((acc, { type: type2, selector: _selector }) => { +======== + const colorSchemeOption = this.getColorSchemeOption(options4, defaults2); + const _css = selector ? getRule(selector, css22) : css22; + css22 = mode2 === "dark" ? colorSchemeOption.reduce((acc, { selector: _selector }) => { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js if (isNotEmpty(_selector)) { acc += _selector.includes("[CSS]") ? _selector.replace("[CSS]", css22) : this.getSelectorRule(_selector, selector, type2, css22); } @@ -51525,10 +51780,14 @@ var themeUtils_default = { name: "primeui", order: "primeui" }; +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js isObject$2(cssLayer) && (layerOptions.name = resolve(cssLayer.name, { name: name2, type })); +======== + isObject$7(cssLayer) && (layerOptions.name = resolve$1(cssLayer.name, { name: name2, type })); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js if (isNotEmpty(layerOptions.name)) { css22 = getRule(`@layer ${layerOptions.name}`, css22); - set2 == null ? void 0 : set2.layerNames(layerOptions.name); + set3 == null ? void 0 : set3.layerNames(layerOptions.name); } } return css22; @@ -51555,10 +51814,10 @@ var config_default = { _loadingStyles: /* @__PURE__ */ new Set(), _tokens: {}, update(newValues = {}) { - const { theme: theme39 } = newValues; - if (theme39) { - this._theme = __spreadProps(__spreadValues({}, theme39), { - options: __spreadValues(__spreadValues({}, this.defaults.options), theme39.options) + const { theme: theme40 } = newValues; + if (theme40) { + this._theme = __spreadProps(__spreadValues({}, theme40), { + options: __spreadValues(__spreadValues({}, this.defaults.options), theme40.options) }); this._tokens = themeUtils_default.createTokens(this.preset, this.defaults); this.clearLoadedStyleNames(); @@ -51568,12 +51827,12 @@ var config_default = { return this._theme; }, get preset() { - var _a; - return ((_a = this.theme) == null ? void 0 : _a.preset) || {}; + var _a2; + return ((_a2 = this.theme) == null ? void 0 : _a2.preset) || {}; }, get options() { - var _a; - return ((_a = this.theme) == null ? void 0 : _a.options) || {}; + var _a2; + return ((_a2 = this.theme) == null ? void 0 : _a2.options) || {}; }, get tokens() { return this._tokens; @@ -51632,6 +51891,7 @@ var config_default = { return themeUtils_default.getCommon({ name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); }, getComponent(name2 = "", params) { +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js const options3 = { name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return themeUtils_default.getPresetC(options3); }, @@ -51642,6 +51902,18 @@ var config_default = { getCustomPreset(name2 = "", preset, selector, params) { const options3 = { name: name2, preset, options: this.options, selector, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; return themeUtils_default.getPreset(options3); +======== + const options4 = { name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; + return themeUtils_default.getPresetC(options4); + }, + getDirective(name2 = "", params) { + const options4 = { name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; + return themeUtils_default.getPresetD(options4); + }, + getCustomPreset(name2 = "", preset, selector, params) { + const options4 = { name: name2, preset, options: this.options, selector, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; + return themeUtils_default.getPreset(options4); +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js }, getLayerOrderCSS(name2 = "") { return themeUtils_default.getLayerOrder(name2, this.options, { names: this.getLayerNames() }, this.defaults); @@ -51689,10 +51961,11 @@ function usePreset(...presets) { return newPreset; } __name(usePreset, "usePreset"); -function useTheme(theme39) { - return $t(theme39).update({ mergePresets: false }); +function useTheme(theme40) { + return $t(theme40).update({ mergePresets: false }); } __name(useTheme, "useTheme"); +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var Base = { _loadedStyleNames: /* @__PURE__ */ new Set(), getLoadedStyleNames: /* @__PURE__ */ __name(function getLoadedStyleNames() { @@ -142522,6 +142795,9 @@ const router = createRouter({ } }); var index$1p = { +======== +var index$1n = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js root: { transitionDuration: "{transition.duration}" }, @@ -142572,7 +142848,11 @@ var index$1p = { padding: "0 1.125rem 1.125rem 1.125rem" } }; +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var index$1o = { +======== +var index$1m = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js root: { background: "{form.field.background}", disabledBackground: "{form.field.disabled.background}", @@ -142685,7 +142965,11 @@ var index$1o = { } } }; +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var index$1n = { +======== +var index$1l = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js root: { width: "2rem", height: "2rem", @@ -142724,7 +143008,11 @@ var index$1n = { } } }; +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var index$1m = { +======== +var index$1k = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js root: { borderRadius: "{border.radius.md}", padding: "0 0.5rem", @@ -142814,7 +143102,3937 @@ var index$1m = { } } }; +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js var index$1l = { +======== +var index$1j = { + root: { + borderRadius: "{content.border.radius}" + } +}; +var index$1i = { + root: { + padding: "1rem", + background: "{content.background}", + gap: "0.5rem", + transitionDuration: "{transition.duration}" + }, + item: { + color: "{text.muted.color}", + hoverColor: "{text.color}", + borderRadius: "{content.border.radius}", + gap: "{navigation.item.gap}", + icon: { + color: "{navigation.item.icon.color}", + hoverColor: "{navigation.item.icon.focus.color}" + }, + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + separator: { + color: "{navigation.item.icon.color}" + } +}; +var index$1h = { + root: { + borderRadius: "{form.field.border.radius}", + roundedBorderRadius: "2rem", + gap: "0.5rem", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + iconOnlyWidth: "2.5rem", + sm: { + fontSize: "0.875rem", + paddingX: "0.625rem", + paddingY: "0.375rem" + }, + lg: { + fontSize: "1.125rem", + paddingX: "0.875rem", + paddingY: "0.625rem" + }, + label: { + fontWeight: "500" + }, + raisedShadow: "0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + offset: "{focus.ring.offset}" + }, + badgeSize: "1rem", + transitionDuration: "{form.field.transition.duration}" + }, + colorScheme: { + light: { + root: { + primary: { + background: "{primary.color}", + hoverBackground: "{primary.hover.color}", + activeBackground: "{primary.active.color}", + borderColor: "{primary.color}", + hoverBorderColor: "{primary.hover.color}", + activeBorderColor: "{primary.active.color}", + color: "{primary.contrast.color}", + hoverColor: "{primary.contrast.color}", + activeColor: "{primary.contrast.color}", + focusRing: { + color: "{primary.color}", + shadow: "none" + } + }, + secondary: { + background: "{surface.100}", + hoverBackground: "{surface.200}", + activeBackground: "{surface.300}", + borderColor: "{surface.100}", + hoverBorderColor: "{surface.200}", + activeBorderColor: "{surface.300}", + color: "{surface.600}", + hoverColor: "{surface.700}", + activeColor: "{surface.800}", + focusRing: { + color: "{surface.600}", + shadow: "none" + } + }, + info: { + background: "{sky.500}", + hoverBackground: "{sky.600}", + activeBackground: "{sky.700}", + borderColor: "{sky.500}", + hoverBorderColor: "{sky.600}", + activeBorderColor: "{sky.700}", + color: "#ffffff", + hoverColor: "#ffffff", + activeColor: "#ffffff", + focusRing: { + color: "{sky.500}", + shadow: "none" + } + }, + success: { + background: "{green.500}", + hoverBackground: "{green.600}", + activeBackground: "{green.700}", + borderColor: "{green.500}", + hoverBorderColor: "{green.600}", + activeBorderColor: "{green.700}", + color: "#ffffff", + hoverColor: "#ffffff", + activeColor: "#ffffff", + focusRing: { + color: "{green.500}", + shadow: "none" + } + }, + warn: { + background: "{orange.500}", + hoverBackground: "{orange.600}", + activeBackground: "{orange.700}", + borderColor: "{orange.500}", + hoverBorderColor: "{orange.600}", + activeBorderColor: "{orange.700}", + color: "#ffffff", + hoverColor: "#ffffff", + activeColor: "#ffffff", + focusRing: { + color: "{orange.500}", + shadow: "none" + } + }, + help: { + background: "{purple.500}", + hoverBackground: "{purple.600}", + activeBackground: "{purple.700}", + borderColor: "{purple.500}", + hoverBorderColor: "{purple.600}", + activeBorderColor: "{purple.700}", + color: "#ffffff", + hoverColor: "#ffffff", + activeColor: "#ffffff", + focusRing: { + color: "{purple.500}", + shadow: "none" + } + }, + danger: { + background: "{red.500}", + hoverBackground: "{red.600}", + activeBackground: "{red.700}", + borderColor: "{red.500}", + hoverBorderColor: "{red.600}", + activeBorderColor: "{red.700}", + color: "#ffffff", + hoverColor: "#ffffff", + activeColor: "#ffffff", + focusRing: { + color: "{red.500}", + shadow: "none" + } + }, + contrast: { + background: "{surface.950}", + hoverBackground: "{surface.900}", + activeBackground: "{surface.800}", + borderColor: "{surface.950}", + hoverBorderColor: "{surface.900}", + activeBorderColor: "{surface.800}", + color: "{surface.0}", + hoverColor: "{surface.0}", + activeColor: "{surface.0}", + focusRing: { + color: "{surface.950}", + shadow: "none" + } + } + }, + outlined: { + primary: { + hoverBackground: "{primary.50}", + activeBackground: "{primary.100}", + borderColor: "{primary.200}", + color: "{primary.color}" + }, + secondary: { + hoverBackground: "{surface.50}", + activeBackground: "{surface.100}", + borderColor: "{surface.200}", + color: "{surface.500}" + }, + success: { + hoverBackground: "{green.50}", + activeBackground: "{green.100}", + borderColor: "{green.200}", + color: "{green.500}" + }, + info: { + hoverBackground: "{sky.50}", + activeBackground: "{sky.100}", + borderColor: "{sky.200}", + color: "{sky.500}" + }, + warn: { + hoverBackground: "{orange.50}", + activeBackground: "{orange.100}", + borderColor: "{orange.200}", + color: "{orange.500}" + }, + help: { + hoverBackground: "{purple.50}", + activeBackground: "{purple.100}", + borderColor: "{purple.200}", + color: "{purple.500}" + }, + danger: { + hoverBackground: "{red.50}", + activeBackground: "{red.100}", + borderColor: "{red.200}", + color: "{red.500}" + }, + contrast: { + hoverBackground: "{surface.50}", + activeBackground: "{surface.100}", + borderColor: "{surface.700}", + color: "{surface.950}" + }, + plain: { + hoverBackground: "{surface.50}", + activeBackground: "{surface.100}", + borderColor: "{surface.200}", + color: "{surface.700}" + } + }, + text: { + primary: { + hoverBackground: "{primary.50}", + activeBackground: "{primary.100}", + color: "{primary.color}" + }, + secondary: { + hoverBackground: "{surface.50}", + activeBackground: "{surface.100}", + color: "{surface.500}" + }, + success: { + hoverBackground: "{green.50}", + activeBackground: "{green.100}", + color: "{green.500}" + }, + info: { + hoverBackground: "{sky.50}", + activeBackground: "{sky.100}", + color: "{sky.500}" + }, + warn: { + hoverBackground: "{orange.50}", + activeBackground: "{orange.100}", + color: "{orange.500}" + }, + help: { + hoverBackground: "{purple.50}", + activeBackground: "{purple.100}", + color: "{purple.500}" + }, + danger: { + hoverBackground: "{red.50}", + activeBackground: "{red.100}", + color: "{red.500}" + }, + plain: { + hoverBackground: "{surface.50}", + activeBackground: "{surface.100}", + color: "{surface.700}" + } + }, + link: { + color: "{primary.color}", + hoverColor: "{primary.color}", + activeColor: "{primary.color}" + } + }, + dark: { + root: { + primary: { + background: "{primary.color}", + hoverBackground: "{primary.hover.color}", + activeBackground: "{primary.active.color}", + borderColor: "{primary.color}", + hoverBorderColor: "{primary.hover.color}", + activeBorderColor: "{primary.active.color}", + color: "{primary.contrast.color}", + hoverColor: "{primary.contrast.color}", + activeColor: "{primary.contrast.color}", + focusRing: { + color: "{primary.color}", + shadow: "none" + } + }, + secondary: { + background: "{surface.800}", + hoverBackground: "{surface.700}", + activeBackground: "{surface.600}", + borderColor: "{surface.800}", + hoverBorderColor: "{surface.700}", + activeBorderColor: "{surface.600}", + color: "{surface.300}", + hoverColor: "{surface.200}", + activeColor: "{surface.100}", + focusRing: { + color: "{surface.300}", + shadow: "none" + } + }, + info: { + background: "{sky.400}", + hoverBackground: "{sky.300}", + activeBackground: "{sky.200}", + borderColor: "{sky.400}", + hoverBorderColor: "{sky.300}", + activeBorderColor: "{sky.200}", + color: "{sky.950}", + hoverColor: "{sky.950}", + activeColor: "{sky.950}", + focusRing: { + color: "{sky.400}", + shadow: "none" + } + }, + success: { + background: "{green.400}", + hoverBackground: "{green.300}", + activeBackground: "{green.200}", + borderColor: "{green.400}", + hoverBorderColor: "{green.300}", + activeBorderColor: "{green.200}", + color: "{green.950}", + hoverColor: "{green.950}", + activeColor: "{green.950}", + focusRing: { + color: "{green.400}", + shadow: "none" + } + }, + warn: { + background: "{orange.400}", + hoverBackground: "{orange.300}", + activeBackground: "{orange.200}", + borderColor: "{orange.400}", + hoverBorderColor: "{orange.300}", + activeBorderColor: "{orange.200}", + color: "{orange.950}", + hoverColor: "{orange.950}", + activeColor: "{orange.950}", + focusRing: { + color: "{orange.400}", + shadow: "none" + } + }, + help: { + background: "{purple.400}", + hoverBackground: "{purple.300}", + activeBackground: "{purple.200}", + borderColor: "{purple.400}", + hoverBorderColor: "{purple.300}", + activeBorderColor: "{purple.200}", + color: "{purple.950}", + hoverColor: "{purple.950}", + activeColor: "{purple.950}", + focusRing: { + color: "{purple.400}", + shadow: "none" + } + }, + danger: { + background: "{red.400}", + hoverBackground: "{red.300}", + activeBackground: "{red.200}", + borderColor: "{red.400}", + hoverBorderColor: "{red.300}", + activeBorderColor: "{red.200}", + color: "{red.950}", + hoverColor: "{red.950}", + activeColor: "{red.950}", + focusRing: { + color: "{red.400}", + shadow: "none" + } + }, + contrast: { + background: "{surface.0}", + hoverBackground: "{surface.100}", + activeBackground: "{surface.200}", + borderColor: "{surface.0}", + hoverBorderColor: "{surface.100}", + activeBorderColor: "{surface.200}", + color: "{surface.950}", + hoverColor: "{surface.950}", + activeColor: "{surface.950}", + focusRing: { + color: "{surface.0}", + shadow: "none" + } + } + }, + outlined: { + primary: { + hoverBackground: "color-mix(in srgb, {primary.color}, transparent 96%)", + activeBackground: "color-mix(in srgb, {primary.color}, transparent 84%)", + borderColor: "{primary.700}", + color: "{primary.color}" + }, + secondary: { + hoverBackground: "rgba(255,255,255,0.04)", + activeBackground: "rgba(255,255,255,0.16)", + borderColor: "{surface.700}", + color: "{surface.400}" + }, + success: { + hoverBackground: "color-mix(in srgb, {green.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {green.400}, transparent 84%)", + borderColor: "{green.700}", + color: "{green.400}" + }, + info: { + hoverBackground: "color-mix(in srgb, {sky.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {sky.400}, transparent 84%)", + borderColor: "{sky.700}", + color: "{sky.400}" + }, + warn: { + hoverBackground: "color-mix(in srgb, {orange.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {orange.400}, transparent 84%)", + borderColor: "{orange.700}", + color: "{orange.400}" + }, + help: { + hoverBackground: "color-mix(in srgb, {purple.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {purple.400}, transparent 84%)", + borderColor: "{purple.700}", + color: "{purple.400}" + }, + danger: { + hoverBackground: "color-mix(in srgb, {red.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {red.400}, transparent 84%)", + borderColor: "{red.700}", + color: "{red.400}" + }, + contrast: { + hoverBackground: "{surface.800}", + activeBackground: "{surface.700}", + borderColor: "{surface.500}", + color: "{surface.0}" + }, + plain: { + hoverBackground: "{surface.800}", + activeBackground: "{surface.700}", + borderColor: "{surface.600}", + color: "{surface.0}" + } + }, + text: { + primary: { + hoverBackground: "color-mix(in srgb, {primary.color}, transparent 96%)", + activeBackground: "color-mix(in srgb, {primary.color}, transparent 84%)", + color: "{primary.color}" + }, + secondary: { + hoverBackground: "{surface.800}", + activeBackground: "{surface.700}", + color: "{surface.400}" + }, + success: { + hoverBackground: "color-mix(in srgb, {green.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {green.400}, transparent 84%)", + color: "{green.400}" + }, + info: { + hoverBackground: "color-mix(in srgb, {sky.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {sky.400}, transparent 84%)", + color: "{sky.400}" + }, + warn: { + hoverBackground: "color-mix(in srgb, {orange.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {orange.400}, transparent 84%)", + color: "{orange.400}" + }, + help: { + hoverBackground: "color-mix(in srgb, {purple.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {purple.400}, transparent 84%)", + color: "{purple.400}" + }, + danger: { + hoverBackground: "color-mix(in srgb, {red.400}, transparent 96%)", + activeBackground: "color-mix(in srgb, {red.400}, transparent 84%)", + color: "{red.400}" + }, + plain: { + hoverBackground: "{surface.800}", + activeBackground: "{surface.700}", + color: "{surface.0}" + } + }, + link: { + color: "{primary.color}", + hoverColor: "{primary.color}", + activeColor: "{primary.color}" + } + } + } +}; +var index$1g = { + root: { + background: "{content.background}", + borderRadius: "{border.radius.xl}", + color: "{content.color}", + shadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)" + }, + body: { + padding: "1.25rem", + gap: "0.5rem" + }, + caption: { + gap: "0.5rem" + }, + title: { + fontSize: "1.25rem", + fontWeight: "500" + }, + subtitle: { + color: "{text.muted.color}" + } +}; +var index$1f = { + root: { + transitionDuration: "{transition.duration}" + }, + content: { + gap: "0.25rem" + }, + indicatorList: { + padding: "1rem", + gap: "0.5rem" + }, + indicator: { + width: "2rem", + height: "0.5rem", + borderRadius: "{content.border.radius}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + colorScheme: { + light: { + indicator: { + background: "{surface.200}", + hoverBackground: "{surface.300}", + activeBackground: "{primary.color}" + } + }, + dark: { + indicator: { + background: "{surface.700}", + hoverBackground: "{surface.600}", + activeBackground: "{primary.color}" + } + } + } +}; +var index$1e = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + filledFocusBackground: "{form.field.filled.focus.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + placeholderColor: "{form.field.placeholder.color}", + shadow: "{form.field.shadow}", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + dropdown: { + width: "2.5rem", + color: "{form.field.icon.color}" + }, + overlay: { + background: "{overlay.select.background}", + borderColor: "{overlay.select.border.color}", + borderRadius: "{overlay.select.border.radius}", + color: "{overlay.select.color}", + shadow: "{overlay.select.shadow}" + }, + list: { + padding: "{list.padding}", + gap: "{list.gap}" + }, + option: { + focusBackground: "{list.option.focus.background}", + selectedBackground: "{list.option.selected.background}", + selectedFocusBackground: "{list.option.selected.focus.background}", + color: "{list.option.color}", + focusColor: "{list.option.focus.color}", + selectedColor: "{list.option.selected.color}", + selectedFocusColor: "{list.option.selected.focus.color}", + padding: "{list.option.padding}", + borderRadius: "{list.option.border.radius}", + icon: { + color: "{list.option.icon.color}", + focusColor: "{list.option.icon.focus.color}", + size: "0.875rem" + } + } +}; +var index$1d = { + root: { + borderRadius: "{border.radius.sm}", + width: "1.25rem", + height: "1.25rem", + background: "{form.field.background}", + checkedBackground: "{primary.color}", + checkedHoverBackground: "{primary.hover.color}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.border.color}", + checkedBorderColor: "{primary.color}", + checkedHoverBorderColor: "{primary.hover.color}", + checkedFocusBorderColor: "{primary.color}", + checkedDisabledBorderColor: "{form.field.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + shadow: "{form.field.shadow}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + icon: { + size: "0.875rem", + color: "{form.field.color}", + checkedColor: "{primary.contrast.color}", + checkedHoverColor: "{primary.contrast.color}", + disabledColor: "{form.field.disabled.color}" + } +}; +var index$1c = { + root: { + borderRadius: "16px", + paddingX: "0.75rem", + paddingY: "0.5rem", + gap: "0.5rem", + transitionDuration: "{transition.duration}" + }, + image: { + width: "2rem", + height: "2rem" + }, + icon: { + size: "1rem" + }, + removeIcon: { + size: "1rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + } + }, + colorScheme: { + light: { + root: { + background: "{surface.100}", + color: "{surface.800}" + }, + icon: { + color: "{surface.800}" + }, + removeIcon: { + color: "{surface.800}" + } + }, + dark: { + root: { + background: "{surface.800}", + color: "{surface.0}" + }, + icon: { + color: "{surface.0}" + }, + removeIcon: { + color: "{surface.0}" + } + } + } +}; +var index$1b = { + root: { + transitionDuration: "{transition.duration}" + }, + preview: { + width: "1.5rem", + height: "1.5rem", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + panel: { + shadow: "{overlay.popover.shadow}", + borderRadius: "{overlay.popover.borderRadius}" + }, + colorScheme: { + light: { + panel: { + background: "{surface.800}", + borderColor: "{surface.900}" + }, + handle: { + color: "{surface.0}" + } + }, + dark: { + panel: { + background: "{surface.900}", + borderColor: "{surface.700}" + }, + handle: { + color: "{surface.0}" + } + } + } +}; +var index$1a = { + icon: { + size: "2rem", + color: "{overlay.modal.color}" + }, + content: { + gap: "1rem" + } +}; +var index$19 = { + root: { + background: "{overlay.popover.background}", + borderColor: "{overlay.popover.border.color}", + color: "{overlay.popover.color}", + borderRadius: "{overlay.popover.border.radius}", + shadow: "{overlay.popover.shadow}", + gutter: "10px", + arrowOffset: "1.25rem" + }, + content: { + padding: "{overlay.popover.padding}", + gap: "1rem" + }, + icon: { + size: "1.5rem", + color: "{overlay.popover.color}" + }, + footer: { + gap: "0.5rem", + padding: "0 {overlay.popover.padding} {overlay.popover.padding} {overlay.popover.padding}" + } +}; +var index$18 = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + borderRadius: "{content.border.radius}", + shadow: "{overlay.navigation.shadow}", + transitionDuration: "{transition.duration}" + }, + list: { + padding: "{navigation.list.padding}", + gap: "{navigation.list.gap}" + }, + item: { + focusBackground: "{navigation.item.focus.background}", + activeBackground: "{navigation.item.active.background}", + color: "{navigation.item.color}", + focusColor: "{navigation.item.focus.color}", + activeColor: "{navigation.item.active.color}", + padding: "{navigation.item.padding}", + borderRadius: "{navigation.item.border.radius}", + gap: "{navigation.item.gap}", + icon: { + color: "{navigation.item.icon.color}", + focusColor: "{navigation.item.icon.focus.color}", + activeColor: "{navigation.item.icon.active.color}" + } + }, + submenuIcon: { + size: "{navigation.submenu.icon.size}", + color: "{navigation.submenu.icon.color}", + focusColor: "{navigation.submenu.icon.focus.color}", + activeColor: "{navigation.submenu.icon.active.color}" + }, + separator: { + borderColor: "{content.border.color}" + } +}; +var index$17 = { + root: { + transitionDuration: "{transition.duration}" + }, + header: { + background: "{content.background}", + borderColor: "{datatable.border.color}", + color: "{content.color}", + borderWidth: "0 0 1px 0", + padding: "0.75rem 1rem" + }, + headerCell: { + background: "{content.background}", + hoverBackground: "{content.hover.background}", + selectedBackground: "{highlight.background}", + borderColor: "{datatable.border.color}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + selectedColor: "{highlight.color}", + gap: "0.5rem", + padding: "0.75rem 1rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "-1px", + shadow: "{focus.ring.shadow}" + } + }, + columnTitle: { + fontWeight: "600" + }, + row: { + background: "{content.background}", + hoverBackground: "{content.hover.background}", + selectedBackground: "{highlight.background}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + selectedColor: "{highlight.color}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "-1px", + shadow: "{focus.ring.shadow}" + } + }, + bodyCell: { + borderColor: "{datatable.border.color}", + padding: "0.75rem 1rem" + }, + footerCell: { + background: "{content.background}", + borderColor: "{datatable.border.color}", + color: "{content.color}", + padding: "0.75rem 1rem" + }, + columnFooter: { + fontWeight: "600" + }, + footer: { + background: "{content.background}", + borderColor: "{datatable.border.color}", + color: "{content.color}", + borderWidth: "0 0 1px 0", + padding: "0.75rem 1rem" + }, + dropPointColor: "{primary.color}", + columnResizerWidth: "0.5rem", + resizeIndicator: { + width: "1px", + color: "{primary.color}" + }, + sortIcon: { + color: "{text.muted.color}", + hoverColor: "{text.hover.muted.color}" + }, + loadingIcon: { + size: "2rem" + }, + rowToggleButton: { + hoverBackground: "{content.hover.background}", + selectedHoverBackground: "{content.background}", + color: "{text.muted.color}", + hoverColor: "{text.color}", + selectedHoverColor: "{primary.color}", + size: "1.75rem", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + filter: { + inlineGap: "0.5rem", + overlaySelect: { + background: "{overlay.select.background}", + borderColor: "{overlay.select.border.color}", + borderRadius: "{overlay.select.border.radius}", + color: "{overlay.select.color}", + shadow: "{overlay.select.shadow}" + }, + overlayPopover: { + background: "{overlay.popover.background}", + borderColor: "{overlay.popover.border.color}", + borderRadius: "{overlay.popover.border.radius}", + color: "{overlay.popover.color}", + shadow: "{overlay.popover.shadow}", + padding: "{overlay.popover.padding}", + gap: "0.5rem" + }, + rule: { + borderColor: "{content.border.color}" + }, + constraintList: { + padding: "{list.padding}", + gap: "{list.gap}" + }, + constraint: { + focusBackground: "{list.option.focus.background}", + selectedBackground: "{list.option.selected.background}", + selectedFocusBackground: "{list.option.selected.focus.background}", + color: "{list.option.color}", + focusColor: "{list.option.focus.color}", + selectedColor: "{list.option.selected.color}", + selectedFocusColor: "{list.option.selected.focus.color}", + separator: { + borderColor: "{content.border.color}" + }, + padding: "{list.option.padding}", + borderRadius: "{list.option.border.radius}" + } + }, + paginatorTop: { + borderColor: "{datatable.border.color}", + borderWidth: "0 0 1px 0" + }, + paginatorBottom: { + borderColor: "{datatable.border.color}", + borderWidth: "0 0 1px 0" + }, + colorScheme: { + light: { + root: { + borderColor: "{content.border.color}" + }, + row: { + stripedBackground: "{surface.50}" + }, + bodyCell: { + selectedBorderColor: "{primary.100}" + } + }, + dark: { + root: { + borderColor: "{surface.800}" + }, + row: { + stripedBackground: "{surface.950}" + }, + bodyCell: { + selectedBorderColor: "{primary.900}" + } + } + } +}; +var index$16 = { + root: { + borderColor: "transparent", + borderWidth: "0", + borderRadius: "0", + padding: "0" + }, + header: { + background: "{content.background}", + color: "{content.color}", + borderColor: "{content.border.color}", + borderWidth: "0 0 1px 0", + padding: "0.75rem 1rem", + borderRadius: "0" + }, + content: { + background: "{content.background}", + color: "{content.color}", + borderColor: "transparent", + borderWidth: "0", + padding: "0", + borderRadius: "0" + }, + footer: { + background: "{content.background}", + color: "{content.color}", + borderColor: "{content.border.color}", + borderWidth: "1px 0 0 0", + padding: "0.75rem 1rem", + borderRadius: "0" + }, + paginatorTop: { + borderColor: "{content.border.color}", + borderWidth: "0 0 1px 0" + }, + paginatorBottom: { + borderColor: "{content.border.color}", + borderWidth: "1px 0 0 0" + } +}; +var index$15 = { + root: { + transitionDuration: "{transition.duration}" + }, + panel: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + borderRadius: "{content.border.radius}", + shadow: "{overlay.popover.shadow}", + padding: "{overlay.popover.padding}" + }, + header: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + padding: "0 0 0.5rem 0", + fontWeight: "500", + gap: "0.5rem" + }, + title: { + gap: "0.5rem", + fontWeight: "500" + }, + dropdown: { + width: "2.5rem", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.border.color}", + activeBorderColor: "{form.field.border.color}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + inputIcon: { + color: "{form.field.icon.color}" + }, + selectMonth: { + hoverBackground: "{content.hover.background}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + padding: "0.25rem 0.5rem", + borderRadius: "{content.border.radius}" + }, + selectYear: { + hoverBackground: "{content.hover.background}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + padding: "0.25rem 0.5rem", + borderRadius: "{content.border.radius}" + }, + group: { + borderColor: "{content.border.color}", + gap: "{overlay.popover.padding}" + }, + dayView: { + margin: "0.5rem 0 0 0" + }, + weekDay: { + padding: "0.25rem", + fontWeight: "500", + color: "{content.color}" + }, + date: { + hoverBackground: "{content.hover.background}", + selectedBackground: "{primary.color}", + rangeSelectedBackground: "{highlight.background}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + selectedColor: "{primary.contrast.color}", + rangeSelectedColor: "{highlight.color}", + width: "2rem", + height: "2rem", + borderRadius: "50%", + padding: "0.25rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + monthView: { + margin: "0.5rem 0 0 0" + }, + month: { + borderRadius: "{content.border.radius}" + }, + yearView: { + margin: "0.5rem 0 0 0" + }, + year: { + borderRadius: "{content.border.radius}" + }, + buttonbar: { + padding: "0.5rem 0 0 0", + borderColor: "{content.border.color}" + }, + timePicker: { + padding: "0.5rem 0 0 0", + borderColor: "{content.border.color}", + gap: "0.5rem", + buttonGap: "0.25rem" + }, + colorScheme: { + light: { + dropdown: { + background: "{surface.100}", + hoverBackground: "{surface.200}", + activeBackground: "{surface.300}", + color: "{surface.600}", + hoverColor: "{surface.700}", + activeColor: "{surface.800}" + }, + today: { + background: "{surface.200}", + color: "{surface.900}" + } + }, + dark: { + dropdown: { + background: "{surface.800}", + hoverBackground: "{surface.700}", + activeBackground: "{surface.600}", + color: "{surface.300}", + hoverColor: "{surface.200}", + activeColor: "{surface.100}" + }, + today: { + background: "{surface.700}", + color: "{surface.0}" + } + } + } +}; +var index$14 = { + root: { + background: "{overlay.modal.background}", + borderColor: "{overlay.modal.border.color}", + color: "{overlay.modal.color}", + borderRadius: "{overlay.modal.border.radius}", + shadow: "{overlay.modal.shadow}" + }, + header: { + padding: "{overlay.modal.padding}", + gap: "0.5rem" + }, + title: { + fontSize: "1.25rem", + fontWeight: "600" + }, + content: { + padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}" + }, + footer: { + padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}", + gap: "0.5rem" + } +}; +var index$13 = { + root: { + borderColor: "{content.border.color}" + }, + content: { + background: "{content.background}", + color: "{text.color}" + }, + horizontal: { + margin: "1rem 0", + padding: "0 1rem", + content: { + padding: "0 0.5rem" + } + }, + vertical: { + margin: "0 1rem", + padding: "0.5rem 0", + content: { + padding: "0.5rem 0" + } + } +}; +var index$12 = { + root: { + background: "rgba(255, 255, 255, 0.1)", + borderColor: "rgba(255, 255, 255, 0.2)", + padding: "0.5rem", + borderRadius: "{border.radius.xl}" + }, + item: { + borderRadius: "{content.border.radius}", + padding: "0.5rem", + size: "3rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + } +}; +var index$11 = { + root: { + background: "{overlay.modal.background}", + borderColor: "{overlay.modal.border.color}", + color: "{overlay.modal.color}", + borderRadius: "{overlay.modal.border.radius}", + shadow: "{overlay.modal.shadow}" + }, + header: { + padding: "{overlay.modal.padding}" + }, + title: { + fontSize: "1.5rem", + fontWeight: "600" + }, + content: { + padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}" + } +}; +var index$10 = { + toolbar: { + background: "{content.background}", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}" + }, + toolbarItem: { + color: "{text.muted.color}", + hoverColor: "{text.color}", + activeColor: "{primary.color}" + }, + overlay: { + background: "{overlay.select.background}", + borderColor: "{overlay.select.border.color}", + borderRadius: "{overlay.select.border.radius}", + color: "{overlay.select.color}", + shadow: "{overlay.select.shadow}", + padding: "{list.padding}" + }, + overlayOption: { + focusBackground: "{list.option.focus.background}", + color: "{list.option.color}", + focusColor: "{list.option.focus.color}", + padding: "{list.option.padding}", + borderRadius: "{list.option.border.radius}" + }, + content: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + borderRadius: "{content.border.radius}" + } +}; +var index$$ = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}", + color: "{content.color}", + padding: "0 1.125rem 1.125rem 1.125rem", + transitionDuration: "{transition.duration}" + }, + legend: { + background: "{content.background}", + hoverBackground: "{content.hover.background}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + borderRadius: "{content.border.radius}", + borderWidth: "1px", + borderColor: "transparent", + padding: "0.5rem 0.75rem", + gap: "0.5rem", + fontWeight: "600", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + toggleIcon: { + color: "{text.muted.color}", + hoverColor: "{text.hover.muted.color}" + }, + content: { + padding: "0" + } +}; +var index$_ = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + borderRadius: "{content.border.radius}", + transitionDuration: "{transition.duration}" + }, + header: { + background: "transparent", + color: "{text.color}", + padding: "1.125rem", + borderWidth: "0", + borderRadius: "0", + gap: "0.5rem" + }, + content: { + highlightBorderColor: "{primary.color}", + padding: "0 1.125rem 1.125rem 1.125rem" + }, + file: { + padding: "1rem", + gap: "1rem", + borderColor: "{content.border.color}", + info: { + gap: "0.5rem" + } + }, + progressbar: { + height: "0.25rem" + }, + basic: { + gap: "0.5rem" + } +}; +var index$Z = { + root: { + color: "{form.field.float.label.color}", + focusColor: "{form.field.float.label.focus.color}", + invalidColor: "{form.field.float.label.invalid.color}", + transitionDuration: "0.2s" + } +}; +var index$Y = { + root: { + borderWidth: "1px", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}", + transitionDuration: "{transition.duration}" + }, + navButton: { + background: "rgba(255, 255, 255, 0.1)", + hoverBackground: "rgba(255, 255, 255, 0.2)", + color: "{surface.100}", + hoverColor: "{surface.0}", + size: "3rem", + gutter: "0.5rem", + prev: { + borderRadius: "50%" + }, + next: { + borderRadius: "50%" + }, + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + navIcon: { + size: "1.5rem" + }, + thumbnailsContent: { + background: "{content.background}", + padding: "1rem 0.25rem" + }, + thumbnailNavButton: { + size: "2rem", + borderRadius: "{content.border.radius}", + gutter: "0.5rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + thumbnailNavButtonIcon: { + size: "1rem" + }, + caption: { + background: "rgba(0, 0, 0, 0.5)", + color: "{surface.100}", + padding: "1rem" + }, + indicatorList: { + gap: "0.5rem", + padding: "1rem" + }, + indicatorButton: { + width: "1rem", + height: "1rem", + activeBackground: "{primary.color}", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + insetIndicatorList: { + background: "rgba(0, 0, 0, 0.5)" + }, + insetIndicatorButton: { + background: "rgba(255, 255, 255, 0.4)", + hoverBackground: "rgba(255, 255, 255, 0.6)", + activeBackground: "rgba(255, 255, 255, 0.9)" + }, + mask: { + background: "{mask.background}", + color: "{mask.color}" + }, + closeButton: { + size: "3rem", + gutter: "0.5rem", + background: "rgba(255, 255, 255, 0.1)", + hoverBackground: "rgba(255, 255, 255, 0.2)", + color: "{surface.50}", + hoverColor: "{surface.0}", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + closeButtonIcon: { + size: "1.5rem" + }, + colorScheme: { + light: { + thumbnailNavButton: { + hoverBackground: "{surface.100}", + color: "{surface.600}", + hoverColor: "{surface.700}" + }, + indicatorButton: { + background: "{surface.200}", + hoverBackground: "{surface.300}" + } + }, + dark: { + thumbnailNavButton: { + hoverBackground: "{surface.700}", + color: "{surface.400}", + hoverColor: "{surface.0}" + }, + indicatorButton: { + background: "{surface.700}", + hoverBackground: "{surface.600}" + } + } + } +}; +var index$X = { + icon: { + color: "{form.field.icon.color}" + } +}; +var index$W = { + root: { + transitionDuration: "{transition.duration}" + }, + preview: { + icon: { + size: "1.5rem" + }, + mask: { + background: "{mask.background}", + color: "{mask.color}" + } + }, + toolbar: { + position: { + left: "auto", + right: "1rem", + top: "1rem", + bottom: "auto" + }, + blur: "8px", + background: "rgba(255,255,255,0.1)", + borderColor: "rgba(255,255,255,0.2)", + borderWidth: "1px", + borderRadius: "30px", + padding: ".5rem", + gap: "0.5rem" + }, + action: { + hoverBackground: "rgba(255,255,255,0.1)", + color: "{surface.50}", + hoverColor: "{surface.0}", + size: "3rem", + iconSize: "1.5rem", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + } +}; +var index$V = { + root: { + padding: "{form.field.padding.y} {form.field.padding.x}", + borderRadius: "{content.border.radius}", + gap: "0.5rem" + }, + text: { + fontWeight: "500" + }, + icon: { + size: "1rem" + }, + colorScheme: { + light: { + info: { + background: "color-mix(in srgb, {blue.50}, transparent 5%)", + borderColor: "{blue.200}", + color: "{blue.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)" + }, + success: { + background: "color-mix(in srgb, {green.50}, transparent 5%)", + borderColor: "{green.200}", + color: "{green.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)" + }, + warn: { + background: "color-mix(in srgb,{yellow.50}, transparent 5%)", + borderColor: "{yellow.200}", + color: "{yellow.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)" + }, + error: { + background: "color-mix(in srgb, {red.50}, transparent 5%)", + borderColor: "{red.200}", + color: "{red.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)" + }, + secondary: { + background: "{surface.100}", + borderColor: "{surface.200}", + color: "{surface.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)" + }, + contrast: { + background: "{surface.900}", + borderColor: "{surface.950}", + color: "{surface.50}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)" + } + }, + dark: { + info: { + background: "color-mix(in srgb, {blue.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)", + color: "{blue.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)" + }, + success: { + background: "color-mix(in srgb, {green.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {green.700}, transparent 64%)", + color: "{green.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)" + }, + warn: { + background: "color-mix(in srgb, {yellow.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)", + color: "{yellow.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)" + }, + error: { + background: "color-mix(in srgb, {red.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {red.700}, transparent 64%)", + color: "{red.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)" + }, + secondary: { + background: "{surface.800}", + borderColor: "{surface.700}", + color: "{surface.300}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)" + }, + contrast: { + background: "{surface.0}", + borderColor: "{surface.100}", + color: "{surface.950}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)" + } + } + } +}; +var index$U = { + root: { + padding: "{form.field.padding.y} {form.field.padding.x}", + borderRadius: "{content.border.radius}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + }, + transitionDuration: "{transition.duration}" + }, + display: { + hoverBackground: "{content.hover.background}", + hoverColor: "{content.hover.color}" + } +}; +var index$T = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + filledFocusBackground: "{form.field.filled.focus.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + placeholderColor: "{form.field.placeholder.color}", + shadow: "{form.field.shadow}", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + chip: { + borderRadius: "{border.radius.sm}" + }, + colorScheme: { + light: { + chip: { + focusBackground: "{surface.200}", + color: "{surface.800}" + } + }, + dark: { + chip: { + focusBackground: "{surface.700}", + color: "{surface.0}" + } + } + } +}; +var index$S = { + addon: { + background: "{form.field.background}", + borderColor: "{form.field.border.color}", + color: "{form.field.icon.color}", + borderRadius: "{form.field.border.radius}" + } +}; +var index$R = { + root: { + transitionDuration: "{transition.duration}" + }, + button: { + width: "2.5rem", + borderRadius: "{form.field.border.radius}", + verticalPadding: "{form.field.padding.y}" + }, + colorScheme: { + light: { + button: { + background: "transparent", + hoverBackground: "{surface.100}", + activeBackground: "{surface.200}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.border.color}", + activeBorderColor: "{form.field.border.color}", + color: "{surface.400}", + hoverColor: "{surface.500}", + activeColor: "{surface.600}" + } + }, + dark: { + button: { + background: "transparent", + hoverBackground: "{surface.800}", + activeBackground: "{surface.700}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.border.color}", + activeBorderColor: "{form.field.border.color}", + color: "{surface.400}", + hoverColor: "{surface.300}", + activeColor: "{surface.200}" + } + } + } +}; +var index$Q = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + filledFocusBackground: "{form.field.filled.focus.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + placeholderColor: "{form.field.placeholder.color}", + shadow: "{form.field.shadow}", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}", + sm: { + fontSize: "0.875rem", + paddingX: "0.625rem", + paddingY: "0.375rem" + }, + lg: { + fontSize: "1.125rem", + paddingX: "0.875rem", + paddingY: "0.625rem" + } + } +}; +var index$P = { + root: { + transitionDuration: "{transition.duration}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + value: { + background: "{primary.color}" + }, + range: { + background: "{content.border.color}" + }, + text: { + color: "{text.muted.color}" + } +}; +var index$O = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + shadow: "{form.field.shadow}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + list: { + padding: "{list.padding}", + gap: "{list.gap}", + header: { + padding: "{list.header.padding}" + } + }, + option: { + focusBackground: "{list.option.focus.background}", + selectedBackground: "{list.option.selected.background}", + selectedFocusBackground: "{list.option.selected.focus.background}", + color: "{list.option.color}", + focusColor: "{list.option.focus.color}", + selectedColor: "{list.option.selected.color}", + selectedFocusColor: "{list.option.selected.focus.color}", + padding: "{list.option.padding}", + borderRadius: "{list.option.border.radius}" + }, + optionGroup: { + background: "{list.option.group.background}", + color: "{list.option.group.color}", + fontWeight: "{list.option.group.font.weight}", + padding: "{list.option.group.padding}" + }, + checkmark: { + color: "{list.option.color}", + gutterStart: "-0.375rem", + gutterEnd: "0.375rem" + }, + emptyMessage: { + padding: "{list.option.padding}" + }, + colorScheme: { + light: { + option: { + stripedBackground: "{surface.50}" + } + }, + dark: { + option: { + stripedBackground: "{surface.900}" + } + } + } +}; +var index$N = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}", + color: "{content.color}", + gap: "0.5rem", + verticalOrientation: { + padding: "{navigation.list.padding}", + gap: "0" + }, + horizontalOrientation: { + padding: "0.5rem 0.75rem" + }, + transitionDuration: "{transition.duration}" + }, + baseItem: { + borderRadius: "{content.border.radius}", + padding: "{navigation.item.padding}" + }, + item: { + focusBackground: "{navigation.item.focus.background}", + activeBackground: "{navigation.item.active.background}", + color: "{navigation.item.color}", + focusColor: "{navigation.item.focus.color}", + activeColor: "{navigation.item.active.color}", + padding: "{navigation.item.padding}", + borderRadius: "{navigation.item.border.radius}", + gap: "{navigation.item.gap}", + icon: { + color: "{navigation.item.icon.color}", + focusColor: "{navigation.item.icon.focus.color}", + activeColor: "{navigation.item.icon.active.color}" + } + }, + overlay: { + padding: "0", + background: "{content.background}", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}", + color: "{content.color}", + shadow: "{overlay.navigation.shadow}", + gap: "0.5rem" + }, + submenu: { + padding: "{navigation.list.padding}", + gap: "{navigation.list.gap}" + }, + submenuLabel: { + padding: "{navigation.submenu.label.padding}", + fontWeight: "{navigation.submenu.label.font.weight}", + background: "{navigation.submenu.label.background.}", + color: "{navigation.submenu.label.color}" + }, + submenuIcon: { + size: "{navigation.submenu.icon.size}", + color: "{navigation.submenu.icon.color}", + focusColor: "{navigation.submenu.icon.focus.color}", + activeColor: "{navigation.submenu.icon.active.color}" + }, + separator: { + borderColor: "{content.border.color}" + }, + mobileButton: { + borderRadius: "50%", + size: "1.75rem", + color: "{text.muted.color}", + hoverColor: "{text.muted.hover.color}", + hoverBackground: "{content.hover.background}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + } +}; +var index$M = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + borderRadius: "{content.border.radius}", + shadow: "{overlay.navigation.shadow}", + transitionDuration: "{transition.duration}" + }, + list: { + padding: "{navigation.list.padding}", + gap: "{navigation.list.gap}" + }, + item: { + focusBackground: "{navigation.item.focus.background}", + color: "{navigation.item.color}", + focusColor: "{navigation.item.focus.color}", + padding: "{navigation.item.padding}", + borderRadius: "{navigation.item.border.radius}", + gap: "{navigation.item.gap}", + icon: { + color: "{navigation.item.icon.color}", + focusColor: "{navigation.item.icon.focus.color}" + } + }, + submenuLabel: { + padding: "{navigation.submenu.label.padding}", + fontWeight: "{navigation.submenu.label.font.weight}", + background: "{navigation.submenu.label.background}", + color: "{navigation.submenu.label.color}" + }, + separator: { + borderColor: "{content.border.color}" + } +}; +var index$L = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}", + color: "{content.color}", + gap: "0.5rem", + padding: "0.5rem 0.75rem", + transitionDuration: "{transition.duration}" + }, + baseItem: { + borderRadius: "{content.border.radius}", + padding: "{navigation.item.padding}" + }, + item: { + focusBackground: "{navigation.item.focus.background}", + activeBackground: "{navigation.item.active.background}", + color: "{navigation.item.color}", + focusColor: "{navigation.item.focus.color}", + activeColor: "{navigation.item.active.color}", + padding: "{navigation.item.padding}", + borderRadius: "{navigation.item.border.radius}", + gap: "{navigation.item.gap}", + icon: { + color: "{navigation.item.icon.color}", + focusColor: "{navigation.item.icon.focus.color}", + activeColor: "{navigation.item.icon.active.color}" + } + }, + submenu: { + padding: "{navigation.list.padding}", + gap: "{navigation.list.gap}", + background: "{content.background}", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}", + shadow: "{overlay.navigation.shadow}", + mobileIndent: "1rem" + }, + submenuIcon: { + size: "{navigation.submenu.icon.size}", + color: "{navigation.submenu.icon.color}", + focusColor: "{navigation.submenu.icon.focus.color}", + activeColor: "{navigation.submenu.icon.active.color}" + }, + separator: { + borderColor: "{content.border.color}" + }, + mobileButton: { + borderRadius: "50%", + size: "1.75rem", + color: "{text.muted.color}", + hoverColor: "{text.muted.hover.color}", + hoverBackground: "{content.hover.background}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + } +}; +var index$K = { + root: { + borderRadius: "{content.border.radius}", + borderWidth: "1px", + transitionDuration: "{transition.duration}" + }, + content: { + padding: "0.5rem 0.75rem", + gap: "0.5rem" + }, + text: { + fontSize: "1rem", + fontWeight: "500" + }, + icon: { + size: "1.125rem" + }, + closeButton: { + width: "1.75rem", + height: "1.75rem", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + offset: "{focus.ring.offset}" + } + }, + closeIcon: { + size: "1rem" + }, + colorScheme: { + light: { + info: { + background: "color-mix(in srgb, {blue.50}, transparent 5%)", + borderColor: "{blue.200}", + color: "{blue.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", + closeButton: { + hoverBackground: "{blue.100}", + focusRing: { + color: "{blue.600}", + shadow: "none" + } + } + }, + success: { + background: "color-mix(in srgb, {green.50}, transparent 5%)", + borderColor: "{green.200}", + color: "{green.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", + closeButton: { + hoverBackground: "{green.100}", + focusRing: { + color: "{green.600}", + shadow: "none" + } + } + }, + warn: { + background: "color-mix(in srgb,{yellow.50}, transparent 5%)", + borderColor: "{yellow.200}", + color: "{yellow.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", + closeButton: { + hoverBackground: "{yellow.100}", + focusRing: { + color: "{yellow.600}", + shadow: "none" + } + } + }, + error: { + background: "color-mix(in srgb, {red.50}, transparent 5%)", + borderColor: "{red.200}", + color: "{red.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", + closeButton: { + hoverBackground: "{red.100}", + focusRing: { + color: "{red.600}", + shadow: "none" + } + } + }, + secondary: { + background: "{surface.100}", + borderColor: "{surface.200}", + color: "{surface.600}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.200}", + focusRing: { + color: "{surface.600}", + shadow: "none" + } + } + }, + contrast: { + background: "{surface.900}", + borderColor: "{surface.950}", + color: "{surface.50}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.800}", + focusRing: { + color: "{surface.50}", + shadow: "none" + } + } + } + }, + dark: { + info: { + background: "color-mix(in srgb, {blue.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)", + color: "{blue.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{blue.500}", + shadow: "none" + } + } + }, + success: { + background: "color-mix(in srgb, {green.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {green.700}, transparent 64%)", + color: "{green.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{green.500}", + shadow: "none" + } + } + }, + warn: { + background: "color-mix(in srgb, {yellow.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)", + color: "{yellow.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{yellow.500}", + shadow: "none" + } + } + }, + error: { + background: "color-mix(in srgb, {red.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {red.700}, transparent 64%)", + color: "{red.500}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{red.500}", + shadow: "none" + } + } + }, + secondary: { + background: "{surface.800}", + borderColor: "{surface.700}", + color: "{surface.300}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.700}", + focusRing: { + color: "{surface.300}", + shadow: "none" + } + } + }, + contrast: { + background: "{surface.0}", + borderColor: "{surface.100}", + color: "{surface.950}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.100}", + focusRing: { + color: "{surface.950}", + shadow: "none" + } + } + } + } + } +}; +var index$J = { + root: { + borderRadius: "{content.border.radius}", + gap: "1rem" + }, + meters: { + background: "{content.border.color}", + size: "0.5rem" + }, + label: { + gap: "0.5rem" + }, + labelMarker: { + size: "0.5rem" + }, + labelIcon: { + size: "1rem" + }, + labelList: { + verticalGap: "0.5rem", + horizontalGap: "1rem" + } +}; +var index$I = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + filledFocusBackground: "{form.field.filled.focus.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + placeholderColor: "{form.field.placeholder.color}", + shadow: "{form.field.shadow}", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + dropdown: { + width: "2.5rem", + color: "{form.field.icon.color}" + }, + overlay: { + background: "{overlay.select.background}", + borderColor: "{overlay.select.border.color}", + borderRadius: "{overlay.select.border.radius}", + color: "{overlay.select.color}", + shadow: "{overlay.select.shadow}" + }, + list: { + padding: "{list.padding}", + gap: "{list.gap}", + header: { + padding: "{list.header.padding}" + } + }, + option: { + focusBackground: "{list.option.focus.background}", + selectedBackground: "{list.option.selected.background}", + selectedFocusBackground: "{list.option.selected.focus.background}", + color: "{list.option.color}", + focusColor: "{list.option.focus.color}", + selectedColor: "{list.option.selected.color}", + selectedFocusColor: "{list.option.selected.focus.color}", + padding: "{list.option.padding}", + borderRadius: "{list.option.border.radius}", + gap: "0.5rem" + }, + optionGroup: { + background: "{list.option.group.background}", + color: "{list.option.group.color}", + fontWeight: "{list.option.group.font.weight}", + padding: "{list.option.group.padding}" + }, + chip: { + borderRadius: "{border.radius.sm}" + }, + emptyMessage: { + padding: "{list.option.padding}" + } +}; +var index$H = { + root: { + gap: "1.125rem" + }, + controls: { + gap: "0.5rem" + } +}; +var index$G = { + root: { + gutter: "0.75rem", + transitionDuration: "{transition.duration}" + }, + node: { + background: "{content.background}", + hoverBackground: "{content.hover.background}", + selectedBackground: "{highlight.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + selectedColor: "{highlight.color}", + hoverColor: "{content.hover.color}", + padding: "0.75rem 1rem", + toggleablePadding: "0.75rem 1rem 1.25rem 1rem", + borderRadius: "{content.border.radius}" + }, + nodeToggleButton: { + background: "{content.background}", + hoverBackground: "{content.hover.background}", + borderColor: "{content.border.color}", + color: "{text.muted.color}", + hoverColor: "{text.color}", + size: "1.5rem", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + connector: { + color: "{content.border.color}", + borderRadius: "{content.border.radius}", + height: "24px" + } +}; +var index$F = { + root: { + outline: { + width: "2px", + color: "{content.background}" + } + } +}; +var index$E = { + root: { + padding: "0.5rem 1rem", + gap: "0.25rem", + borderRadius: "{content.border.radius}", + background: "{content.background}", + color: "{content.color}", + transitionDuration: "{transition.duration}" + }, + navButton: { + background: "transparent", + hoverBackground: "{content.hover.background}", + selectedBackground: "{highlight.background}", + color: "{text.muted.color}", + hoverColor: "{text.hover.muted.color}", + selectedColor: "{highlight.color}", + width: "2.5rem", + height: "2.5rem", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + currentPageReport: { + color: "{text.muted.color}" + }, + jumpToPageInput: { + maxWidth: "2.5rem" + } +}; +var index$D = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + borderRadius: "{content.border.radius}" + }, + header: { + background: "transparent", + color: "{text.color}", + padding: "1.125rem", + borderColor: "{content.border.color}", + borderWidth: "0", + borderRadius: "0" + }, + toggleableHeader: { + padding: "0.375rem 1.125rem" + }, + title: { + fontWeight: "600" + }, + content: { + padding: "0 1.125rem 1.125rem 1.125rem" + }, + footer: { + padding: "0 1.125rem 1.125rem 1.125rem" + } +}; +var index$C = { + root: { + gap: "0.5rem", + transitionDuration: "{transition.duration}" + }, + panel: { + background: "{content.background}", + borderColor: "{content.border.color}", + borderWidth: "1px", + color: "{content.color}", + padding: "0.25rem 0.25rem", + borderRadius: "{content.border.radius}", + first: { + borderWidth: "1px", + topBorderRadius: "{content.border.radius}" + }, + last: { + borderWidth: "1px", + bottomBorderRadius: "{content.border.radius}" + } + }, + item: { + focusBackground: "{navigation.item.focus.background}", + color: "{navigation.item.color}", + focusColor: "{navigation.item.focus.color}", + gap: "0.5rem", + padding: "{navigation.item.padding}", + borderRadius: "{content.border.radius}", + icon: { + color: "{navigation.item.icon.color}", + focusColor: "{navigation.item.icon.focus.color}" + } + }, + submenu: { + indent: "1rem" + }, + submenuIcon: { + color: "{navigation.submenu.icon.color}", + focusColor: "{navigation.submenu.icon.focus.color}" + } +}; +var index$B = { + meter: { + background: "{content.border.color}", + borderRadius: "{content.border.radius}", + height: ".75rem" + }, + icon: { + color: "{form.field.icon.color}" + }, + overlay: { + background: "{overlay.popover.background}", + borderColor: "{overlay.popover.border.color}", + borderRadius: "{overlay.popover.border.radius}", + color: "{overlay.popover.color}", + padding: "{overlay.popover.padding}", + shadow: "{overlay.popover.shadow}" + }, + content: { + gap: "0.5rem" + }, + colorScheme: { + light: { + strength: { + weakBackground: "{red.500}", + mediumBackground: "{amber.500}", + strongBackground: "{green.500}" + } + }, + dark: { + strength: { + weakBackground: "{red.400}", + mediumBackground: "{amber.400}", + strongBackground: "{green.400}" + } + } + } +}; +var index$A = { + root: { + gap: "1.125rem" + }, + controls: { + gap: "0.5rem" + } +}; +var index$z = { + root: { + background: "{overlay.popover.background}", + borderColor: "{overlay.popover.border.color}", + color: "{overlay.popover.color}", + borderRadius: "{overlay.popover.border.radius}", + shadow: "{overlay.popover.shadow}", + gutter: "10px", + arrowOffset: "1.25rem" + }, + content: { + padding: "{overlay.popover.padding}" + } +}; +var index$y = { + root: { + background: "{content.border.color}", + borderRadius: "{content.border.radius}", + height: "1.25rem" + }, + value: { + background: "{primary.color}" + }, + label: { + color: "{primary.contrast.color}", + fontSize: "0.75rem", + fontWeight: "600" + } +}; +var index$x = { + colorScheme: { + light: { + root: { + "color.1": "{red.500}", + "color.2": "{blue.500}", + "color.3": "{green.500}", + "color.4": "{yellow.500}" + } + }, + dark: { + root: { + "color.1": "{red.400}", + "color.2": "{blue.400}", + "color.3": "{green.400}", + "color.4": "{yellow.400}" + } + } + } +}; +var index$w = { + root: { + width: "1.25rem", + height: "1.25rem", + background: "{form.field.background}", + checkedBackground: "{primary.color}", + checkedHoverBackground: "{primary.hover.color}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.border.color}", + checkedBorderColor: "{primary.color}", + checkedHoverBorderColor: "{primary.hover.color}", + checkedFocusBorderColor: "{primary.color}", + checkedDisabledBorderColor: "{form.field.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + shadow: "{form.field.shadow}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + icon: { + size: "0.75rem", + checkedColor: "{primary.contrast.color}", + checkedHoverColor: "{primary.contrast.color}", + disabledColor: "{form.field.disabled.color}" + } +}; +var index$v = { + root: { + gap: "0.25rem", + transitionDuration: "{transition.duration}" + }, + icon: { + size: "1rem", + color: "{text.muted.color}", + hoverColor: "{primary.color}", + activeColor: "{primary.color}" + } +}; +var index$u = { + colorScheme: { + light: { + root: { + background: "rgba(0,0,0,0.1)" + } + }, + dark: { + root: { + background: "rgba(255,255,255,0.3)" + } + } + } +}; +var index$t = { + root: { + transitionDuration: "{transition.duration}" + }, + bar: { + size: "9px", + borderRadius: "{border.radius.sm}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + colorScheme: { + light: { + bar: { + background: "{surface.100}" + } + }, + dark: { + bar: { + background: "{surface.800}" + } + } + } +}; +var index$s = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + filledFocusBackground: "{form.field.filled.focus.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + placeholderColor: "{form.field.placeholder.color}", + shadow: "{form.field.shadow}", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + dropdown: { + width: "2.5rem", + color: "{form.field.icon.color}" + }, + overlay: { + background: "{overlay.select.background}", + borderColor: "{overlay.select.border.color}", + borderRadius: "{overlay.select.border.radius}", + color: "{overlay.select.color}", + shadow: "{overlay.select.shadow}" + }, + list: { + padding: "{list.padding}", + gap: "{list.gap}", + header: { + padding: "{list.header.padding}" + } + }, + option: { + focusBackground: "{list.option.focus.background}", + selectedBackground: "{list.option.selected.background}", + selectedFocusBackground: "{list.option.selected.focus.background}", + color: "{list.option.color}", + focusColor: "{list.option.focus.color}", + selectedColor: "{list.option.selected.color}", + selectedFocusColor: "{list.option.selected.focus.color}", + padding: "{list.option.padding}", + borderRadius: "{list.option.border.radius}" + }, + optionGroup: { + background: "{list.option.group.background}", + color: "{list.option.group.color}", + fontWeight: "{list.option.group.font.weight}", + padding: "{list.option.group.padding}" + }, + clearIcon: { + color: "{form.field.icon.color}" + }, + checkmark: { + color: "{list.option.color}", + gutterStart: "-0.375rem", + gutterEnd: "0.375rem" + }, + emptyMessage: { + padding: "{list.option.padding}" + } +}; +var index$r = { + root: { + borderRadius: "{form.field.border.radius}" + }, + colorScheme: { + light: { + root: { + invalidBorderColor: "{form.field.invalid.border.color}" + } + }, + dark: { + root: { + invalidBorderColor: "{form.field.invalid.border.color}" + } + } + } +}; +var index$q = { + root: { + borderRadius: "{content.border.radius}" + }, + colorScheme: { + light: { + root: { + background: "{surface.200}", + animationBackground: "rgba(255,255,255,0.4)" + } + }, + dark: { + root: { + background: "rgba(255, 255, 255, 0.06)", + animationBackground: "rgba(255, 255, 255, 0.04)" + } + } + } +}; +var index$p = { + root: { + transitionDuration: "{transition.duration}" + }, + track: { + background: "{content.border.color}", + borderRadius: "{content.border.radius}", + size: "3px" + }, + range: { + background: "{primary.color}" + }, + handle: { + width: "20px", + height: "20px", + borderRadius: "50%", + background: "{content.border.color}", + hoverBackground: "{content.border.color}", + content: { + borderRadius: "50%", + hoverBackground: "{content.background}", + width: "16px", + height: "16px", + shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.08), 0px 1px 1px 0px rgba(0, 0, 0, 0.14)" + }, + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + colorScheme: { + light: { + handle: { + contentBackground: "{surface.0}" + } + }, + dark: { + handle: { + contentBackground: "{surface.950}" + } + } + } +}; +var index$o = { + root: { + gap: "0.5rem", + transitionDuration: "{transition.duration}" + } +}; +var index$n = { + root: { + borderRadius: "{form.field.border.radius}", + roundedBorderRadius: "2rem", + raisedShadow: "0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)" + } +}; +var index$m = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + transitionDuration: "{transition.duration}" + }, + gutter: { + background: "{content.border.color}" + }, + handle: { + size: "24px", + background: "transparent", + borderRadius: "{content.border.radius}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + } +}; +var index$l = { + root: { + transitionDuration: "{transition.duration}" + }, + separator: { + background: "{content.border.color}", + activeBackground: "{primary.color}", + margin: "0 0 0 1.625rem", + size: "2px" + }, + step: { + padding: "0.5rem", + gap: "1rem" + }, + stepHeader: { + padding: "0", + borderRadius: "{content.border.radius}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + }, + gap: "0.5rem" + }, + stepTitle: { + color: "{text.muted.color}", + activeColor: "{primary.color}", + fontWeight: "500" + }, + stepNumber: { + background: "{content.background}", + activeBackground: "{content.background}", + borderColor: "{content.border.color}", + activeBorderColor: "{content.border.color}", + color: "{text.muted.color}", + activeColor: "{primary.color}", + size: "2rem", + fontSize: "1.143rem", + fontWeight: "500", + borderRadius: "50%", + shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)" + }, + steppanels: { + padding: "0.875rem 0.5rem 1.125rem 0.5rem" + }, + steppanel: { + background: "{content.background}", + color: "{content.color}", + padding: "0 0 0 1rem" + } +}; +var index$k = { + root: { + transitionDuration: "{transition.duration}" + }, + separator: { + background: "{content.border.color}" + }, + itemLink: { + borderRadius: "{content.border.radius}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + }, + gap: "0.5rem" + }, + itemLabel: { + color: "{text.muted.color}", + activeColor: "{primary.color}", + fontWeight: "500" + }, + itemNumber: { + background: "{content.background}", + activeBackground: "{content.background}", + borderColor: "{content.border.color}", + activeBorderColor: "{content.border.color}", + color: "{text.muted.color}", + activeColor: "{primary.color}", + size: "2rem", + fontSize: "1.143rem", + fontWeight: "500", + borderRadius: "50%", + shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)" + } +}; +var index$j = { + root: { + transitionDuration: "{transition.duration}" + }, + tablist: { + borderWidth: "0 0 1px 0", + background: "{content.background}", + borderColor: "{content.border.color}" + }, + item: { + background: "transparent", + hoverBackground: "transparent", + activeBackground: "transparent", + borderWidth: "0 0 1px 0", + borderColor: "{content.border.color}", + hoverBorderColor: "{content.border.color}", + activeBorderColor: "{primary.color}", + color: "{text.muted.color}", + hoverColor: "{text.color}", + activeColor: "{primary.color}", + padding: "1rem 1.125rem", + fontWeight: "600", + margin: "0 0 -1px 0", + gap: "0.5rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + itemIcon: { + color: "{text.muted.color}", + hoverColor: "{text.color}", + activeColor: "{primary.color}" + }, + activeBar: { + height: "1px", + bottom: "-1px", + background: "{primary.color}" + } +}; +var index$i = { + root: { + transitionDuration: "{transition.duration}" + }, + tablist: { + borderWidth: "0 0 1px 0", + background: "{content.background}", + borderColor: "{content.border.color}" + }, + tab: { + background: "transparent", + hoverBackground: "transparent", + activeBackground: "transparent", + borderWidth: "0 0 1px 0", + borderColor: "{content.border.color}", + hoverBorderColor: "{content.border.color}", + activeBorderColor: "{primary.color}", + color: "{text.muted.color}", + hoverColor: "{text.color}", + activeColor: "{primary.color}", + padding: "1rem 1.125rem", + fontWeight: "600", + margin: "0 0 -1px 0", + gap: "0.5rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "-1px", + shadow: "{focus.ring.shadow}" + } + }, + tabpanel: { + background: "{content.background}", + color: "{content.color}", + padding: "0.875rem 1.125rem 1.125rem 1.125rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "inset {focus.ring.shadow}" + } + }, + navButton: { + background: "{content.background}", + color: "{text.muted.color}", + hoverColor: "{text.color}", + width: "2.5rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "-1px", + shadow: "{focus.ring.shadow}" + } + }, + activeBar: { + height: "1px", + bottom: "-1px", + background: "{primary.color}" + }, + colorScheme: { + light: { + navButton: { + shadow: "0px 0px 10px 50px rgba(255, 255, 255, 0.6)" + } + }, + dark: { + navButton: { + shadow: "0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)" + } + } + } +}; +var index$h = { + root: { + transitionDuration: "{transition.duration}" + }, + tabList: { + background: "{content.background}", + borderColor: "{content.border.color}" + }, + tab: { + borderColor: "{content.border.color}", + activeBorderColor: "{primary.color}", + color: "{text.muted.color}", + hoverColor: "{text.color}", + activeColor: "{primary.color}" + }, + tabPanel: { + background: "{content.background}", + color: "{content.color}" + }, + navButton: { + background: "{content.background}", + color: "{text.muted.color}", + hoverColor: "{text.color}" + }, + colorScheme: { + light: { + navButton: { + shadow: "0px 0px 10px 50px rgba(255, 255, 255, 0.6)" + } + }, + dark: { + navButton: { + shadow: "0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)" + } + } + } +}; +var index$g = { + root: { + fontSize: "0.875rem", + fontWeight: "700", + padding: "0.25rem 0.5rem", + gap: "0.25rem", + borderRadius: "{content.border.radius}", + roundedBorderRadius: "{border.radius.xl}" + }, + icon: { + size: "0.75rem" + }, + colorScheme: { + light: { + primary: { + background: "{primary.100}", + color: "{primary.700}" + }, + secondary: { + background: "{surface.100}", + color: "{surface.600}" + }, + success: { + background: "{green.100}", + color: "{green.700}" + }, + info: { + background: "{sky.100}", + color: "{sky.700}" + }, + warn: { + background: "{orange.100}", + color: "{orange.700}" + }, + danger: { + background: "{red.100}", + color: "{red.700}" + }, + contrast: { + background: "{surface.950}", + color: "{surface.0}" + } + }, + dark: { + primary: { + background: "color-mix(in srgb, {primary.500}, transparent 84%)", + color: "{primary.300}" + }, + secondary: { + background: "{surface.800}", + color: "{surface.300}" + }, + success: { + background: "color-mix(in srgb, {green.500}, transparent 84%)", + color: "{green.300}" + }, + info: { + background: "color-mix(in srgb, {sky.500}, transparent 84%)", + color: "{sky.300}" + }, + warn: { + background: "color-mix(in srgb, {orange.500}, transparent 84%)", + color: "{orange.300}" + }, + danger: { + background: "color-mix(in srgb, {red.500}, transparent 84%)", + color: "{red.300}" + }, + contrast: { + background: "{surface.0}", + color: "{surface.950}" + } + } + } +}; +var index$f = { + root: { + background: "{form.field.background}", + borderColor: "{form.field.border.color}", + color: "{form.field.color}", + height: "18rem", + padding: "{form.field.padding.y} {form.field.padding.x}", + borderRadius: "{form.field.border.radius}" + }, + prompt: { + gap: "0.25rem" + }, + commandResponse: { + margin: "2px 0" + } +}; +var index$e = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + filledFocusBackground: "{form.field.filled.focus.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + placeholderColor: "{form.field.placeholder.color}", + shadow: "{form.field.shadow}", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + } +}; +var index$d = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + color: "{content.color}", + borderRadius: "{content.border.radius}", + shadow: "{overlay.navigation.shadow}", + transitionDuration: "{transition.duration}" + }, + list: { + padding: "{navigation.list.padding}", + gap: "{navigation.list.gap}" + }, + item: { + focusBackground: "{navigation.item.focus.background}", + activeBackground: "{navigation.item.active.background}", + color: "{navigation.item.color}", + focusColor: "{navigation.item.focus.color}", + activeColor: "{navigation.item.active.color}", + padding: "{navigation.item.padding}", + borderRadius: "{navigation.item.border.radius}", + gap: "{navigation.item.gap}", + icon: { + color: "{navigation.item.icon.color}", + focusColor: "{navigation.item.icon.focus.color}", + activeColor: "{navigation.item.icon.active.color}" + } + }, + submenuLabel: { + padding: "{navigation.submenu.label.padding}", + fontWeight: "{navigation.submenu.label.font.weight}", + background: "{navigation.submenu.label.background.}", + color: "{navigation.submenu.label.color}" + }, + submenuIcon: { + size: "{navigation.submenu.icon.size}", + color: "{navigation.submenu.icon.color}", + focusColor: "{navigation.submenu.icon.focus.color}", + activeColor: "{navigation.submenu.icon.active.color}" + }, + separator: { + borderColor: "{content.border.color}" + } +}; +var index$c = { + event: { + minHeight: "5rem" + }, + horizontal: { + eventContent: { + padding: "1rem 0" + } + }, + vertical: { + eventContent: { + padding: "0 1rem" + } + }, + eventMarker: { + size: "1.125rem", + borderRadius: "50%", + borderWidth: "2px", + background: "{content.background}", + borderColor: "{content.border.color}", + content: { + borderRadius: "50%", + size: "0.375rem", + background: "{primary.color}", + insetShadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)" + } + }, + eventConnector: { + color: "{content.border.color}", + size: "2px" + } +}; +var index$b = { + root: { + width: "25rem", + borderRadius: "{content.border.radius}", + borderWidth: "1px", + transitionDuration: "{transition.duration}" + }, + icon: { + size: "1.125rem" + }, + content: { + padding: "{overlay.popover.padding}", + gap: "0.5rem" + }, + text: { + gap: "0.5rem" + }, + summary: { + fontWeight: "500", + fontSize: "1rem" + }, + detail: { + fontWeight: "500", + fontSize: "0.875rem" + }, + closeButton: { + width: "1.75rem", + height: "1.75rem", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + offset: "{focus.ring.offset}" + } + }, + closeIcon: { + size: "1rem" + }, + colorScheme: { + light: { + blur: "1.5px", + info: { + background: "color-mix(in srgb, {blue.50}, transparent 5%)", + borderColor: "{blue.200}", + color: "{blue.600}", + detailColor: "{surface.700}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", + closeButton: { + hoverBackground: "{blue.100}", + focusRing: { + color: "{blue.600}", + shadow: "none" + } + } + }, + success: { + background: "color-mix(in srgb, {green.50}, transparent 5%)", + borderColor: "{green.200}", + color: "{green.600}", + detailColor: "{surface.700}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", + closeButton: { + hoverBackground: "{green.100}", + focusRing: { + color: "{green.600}", + shadow: "none" + } + } + }, + warn: { + background: "color-mix(in srgb,{yellow.50}, transparent 5%)", + borderColor: "{yellow.200}", + color: "{yellow.600}", + detailColor: "{surface.700}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", + closeButton: { + hoverBackground: "{yellow.100}", + focusRing: { + color: "{yellow.600}", + shadow: "none" + } + } + }, + error: { + background: "color-mix(in srgb, {red.50}, transparent 5%)", + borderColor: "{red.200}", + color: "{red.600}", + detailColor: "{surface.700}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", + closeButton: { + hoverBackground: "{red.100}", + focusRing: { + color: "{red.600}", + shadow: "none" + } + } + }, + secondary: { + background: "{surface.100}", + borderColor: "{surface.200}", + color: "{surface.600}", + detailColor: "{surface.700}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.200}", + focusRing: { + color: "{surface.600}", + shadow: "none" + } + } + }, + contrast: { + background: "{surface.900}", + borderColor: "{surface.950}", + color: "{surface.50}", + detailColor: "{surface.0}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.800}", + focusRing: { + color: "{surface.50}", + shadow: "none" + } + } + } + }, + dark: { + blur: "10px", + info: { + background: "color-mix(in srgb, {blue.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)", + color: "{blue.500}", + detailColor: "{surface.0}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{blue.500}", + shadow: "none" + } + } + }, + success: { + background: "color-mix(in srgb, {green.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {green.700}, transparent 64%)", + color: "{green.500}", + detailColor: "{surface.0}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{green.500}", + shadow: "none" + } + } + }, + warn: { + background: "color-mix(in srgb, {yellow.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)", + color: "{yellow.500}", + detailColor: "{surface.0}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{yellow.500}", + shadow: "none" + } + } + }, + error: { + background: "color-mix(in srgb, {red.500}, transparent 84%)", + borderColor: "color-mix(in srgb, {red.700}, transparent 64%)", + color: "{red.500}", + detailColor: "{surface.0}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", + closeButton: { + hoverBackground: "rgba(255, 255, 255, 0.05)", + focusRing: { + color: "{red.500}", + shadow: "none" + } + } + }, + secondary: { + background: "{surface.800}", + borderColor: "{surface.700}", + color: "{surface.300}", + detailColor: "{surface.0}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.700}", + focusRing: { + color: "{surface.300}", + shadow: "none" + } + } + }, + contrast: { + background: "{surface.0}", + borderColor: "{surface.100}", + color: "{surface.950}", + detailColor: "{surface.950}", + shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", + closeButton: { + hoverBackground: "{surface.100}", + focusRing: { + color: "{surface.950}", + shadow: "none" + } + } + } + } + } +}; +var index$a = { + root: { + padding: "0.5rem 1rem", + borderRadius: "{content.border.radius}", + gap: "0.5rem", + fontWeight: "500", + disabledBackground: "{form.field.disabled.background}", + disabledBorderColor: "{form.field.disabled.background}", + disabledColor: "{form.field.disabled.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + icon: { + disabledColor: "{form.field.disabled.color}" + }, + content: { + left: "0.25rem", + top: "0.25rem", + checkedShadow: "0px 1px 2px 0px rgba(0, 0, 0, 0.02), 0px 1px 2px 0px rgba(0, 0, 0, 0.04)" + }, + colorScheme: { + light: { + root: { + background: "{surface.100}", + checkedBackground: "{surface.100}", + hoverBackground: "{surface.100}", + borderColor: "{surface.100}", + color: "{surface.500}", + hoverColor: "{surface.700}", + checkedColor: "{surface.900}", + checkedBorderColor: "{surface.100}" + }, + content: { + checkedBackground: "{surface.0}" + }, + icon: { + color: "{surface.500}", + hoverColor: "{surface.700}", + checkedColor: "{surface.900}" + } + }, + dark: { + root: { + background: "{surface.950}", + checkedBackground: "{surface.950}", + hoverBackground: "{surface.950}", + borderColor: "{surface.950}", + color: "{surface.400}", + hoverColor: "{surface.300}", + checkedColor: "{surface.0}", + checkedBorderColor: "{surface.950}" + }, + content: { + checkedBackground: "{surface.800}" + }, + icon: { + color: "{surface.400}", + hoverColor: "{surface.300}", + checkedColor: "{surface.0}" + } + } + } +}; +var index$9 = { + root: { + width: "2.5rem", + height: "1.5rem", + borderRadius: "30px", + gap: "0.25rem", + shadow: "{form.field.shadow}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + }, + borderWidth: "1px", + borderColor: "transparent", + hoverBorderColor: "transparent", + checkedBorderColor: "transparent", + checkedHoverBorderColor: "transparent", + invalidBorderColor: "{form.field.invalid.border.color}", + transitionDuration: "{form.field.transition.duration}", + slideDuration: "0.2s", + disabledBackground: "{form.field.disabled.background}" + }, + handle: { + borderRadius: "50%", + size: "1rem", + disabledBackground: "{form.field.disabled.color}" + }, + colorScheme: { + light: { + root: { + background: "{surface.300}", + hoverBackground: "{surface.400}", + checkedBackground: "{primary.color}", + checkedHoverBackground: "{primary.hover.color}" + }, + handle: { + background: "{surface.0}", + hoverBackground: "{surface.0}", + checkedBackground: "{surface.0}", + checkedHoverBackground: "{surface.0}" + } + }, + dark: { + root: { + background: "{surface.700}", + hoverBackground: "{surface.600}", + checkedBackground: "{primary.color}", + checkedHoverBackground: "{primary.hover.color}" + }, + handle: { + background: "{surface.400}", + hoverBackground: "{surface.300}", + checkedBackground: "{surface.900}", + checkedHoverBackground: "{surface.900}" + } + } + } +}; +var index$8 = { + root: { + background: "{content.background}", + borderColor: "{content.border.color}", + borderRadius: "{content.border.radius}", + color: "{content.color}", + gap: "0.5rem", + padding: "0.75rem" + } +}; +var index$7 = { + root: { + maxWidth: "12.5rem", + gutter: "0.25rem", + shadow: "{overlay.popover.shadow}", + padding: "0.5rem 0.75rem", + borderRadius: "{overlay.popover.border.radius}" + }, + colorScheme: { + light: { + root: { + background: "{surface.700}", + color: "{surface.0}" + } + }, + dark: { + root: { + background: "{surface.700}", + color: "{surface.0}" + } + } + } +}; +var index$6 = { + root: { + background: "{content.background}", + color: "{content.color}", + padding: "1rem", + gap: "2px", + indent: "1rem", + transitionDuration: "{transition.duration}" + }, + node: { + padding: "0.25rem 0.5rem", + borderRadius: "{content.border.radius}", + hoverBackground: "{content.hover.background}", + selectedBackground: "{highlight.background}", + color: "{text.color}", + hoverColor: "{text.hover.color}", + selectedColor: "{highlight.color}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "-1px", + shadow: "{focus.ring.shadow}" + }, + gap: "0.25rem" + }, + nodeIcon: { + color: "{text.muted.color}", + hoverColor: "{text.hover.muted.color}", + selectedColor: "{highlight.color}" + }, + nodeToggleButton: { + borderRadius: "50%", + size: "1.75rem", + hoverBackground: "{content.hover.background}", + selectedHoverBackground: "{content.background}", + color: "{text.muted.color}", + hoverColor: "{text.hover.muted.color}", + selectedHoverColor: "{primary.color}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + loadingIcon: { + size: "2rem" + } +}; +var index$5 = { + root: { + background: "{form.field.background}", + disabledBackground: "{form.field.disabled.background}", + filledBackground: "{form.field.filled.background}", + filledFocusBackground: "{form.field.filled.focus.background}", + borderColor: "{form.field.border.color}", + hoverBorderColor: "{form.field.hover.border.color}", + focusBorderColor: "{form.field.focus.border.color}", + invalidBorderColor: "{form.field.invalid.border.color}", + color: "{form.field.color}", + disabledColor: "{form.field.disabled.color}", + placeholderColor: "{form.field.placeholder.color}", + shadow: "{form.field.shadow}", + paddingX: "{form.field.padding.x}", + paddingY: "{form.field.padding.y}", + borderRadius: "{form.field.border.radius}", + focusRing: { + width: "{form.field.focus.ring.width}", + style: "{form.field.focus.ring.style}", + color: "{form.field.focus.ring.color}", + offset: "{form.field.focus.ring.offset}", + shadow: "{form.field.focus.ring.shadow}" + }, + transitionDuration: "{form.field.transition.duration}" + }, + dropdown: { + width: "2.5rem", + color: "{form.field.icon.color}" + }, + overlay: { + background: "{overlay.select.background}", + borderColor: "{overlay.select.border.color}", + borderRadius: "{overlay.select.border.radius}", + color: "{overlay.select.color}", + shadow: "{overlay.select.shadow}" + }, + tree: { + padding: "{list.padding}" + }, + emptyMessage: { + padding: "{list.option.padding}" + }, + chip: { + borderRadius: "{border.radius.sm}" + } +}; +var index$4 = { + root: { + transitionDuration: "{transition.duration}" + }, + header: { + background: "{content.background}", + borderColor: "{treetable.border.color}", + color: "{content.color}", + borderWidth: "0 0 1px 0", + padding: "0.75rem 1rem" + }, + headerCell: { + background: "{content.background}", + hoverBackground: "{content.hover.background}", + selectedBackground: "{highlight.background}", + borderColor: "{treetable.border.color}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + selectedColor: "{highlight.color}", + gap: "0.5rem", + padding: "0.75rem 1rem", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "-1px", + shadow: "{focus.ring.shadow}" + } + }, + columnTitle: { + fontWeight: "600" + }, + row: { + background: "{content.background}", + hoverBackground: "{content.hover.background}", + selectedBackground: "{highlight.background}", + color: "{content.color}", + hoverColor: "{content.hover.color}", + selectedColor: "{highlight.color}", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "-1px", + shadow: "{focus.ring.shadow}" + } + }, + bodyCell: { + borderColor: "{treetable.border.color}", + padding: "0.75rem 1rem", + gap: "0.5rem" + }, + footerCell: { + background: "{content.background}", + borderColor: "{treetable.border.color}", + color: "{content.color}", + padding: "0.75rem 1rem" + }, + columnFooter: { + fontWeight: "600" + }, + footer: { + background: "{content.background}", + borderColor: "{treetable.border.color}", + color: "{content.color}", + borderWidth: "0 0 1px 0", + padding: "0.75rem 1rem" + }, + columnResizerWidth: "0.5rem", + resizeIndicator: { + width: "1px", + color: "{primary.color}" + }, + sortIcon: { + color: "{text.muted.color}", + hoverColor: "{text.hover.muted.color}" + }, + loadingIcon: { + size: "2rem" + }, + nodeToggleButton: { + hoverBackground: "{content.hover.background}", + selectedHoverBackground: "{content.background}", + color: "{text.muted.color}", + hoverColor: "{text.color}", + selectedHoverColor: "{primary.color}", + size: "1.75rem", + borderRadius: "50%", + focusRing: { + width: "{focus.ring.width}", + style: "{focus.ring.style}", + color: "{focus.ring.color}", + offset: "{focus.ring.offset}", + shadow: "{focus.ring.shadow}" + } + }, + paginatorTop: { + borderColor: "{content.border.color}", + borderWidth: "0 0 1px 0" + }, + paginatorBottom: { + borderColor: "{content.border.color}", + borderWidth: "0 0 1px 0" + }, + colorScheme: { + light: { + root: { + borderColor: "{content.border.color}" + }, + bodyCell: { + selectedBorderColor: "{primary.100}" + } + }, + dark: { + root: { + borderColor: "{surface.800}" + }, + bodyCell: { + selectedBorderColor: "{primary.900}" + } + } + } +}; +var index$3 = { + loader: { + mask: { + background: "{content.background}", + color: "{text.muted.color}" + }, + icon: { + size: "2rem" + } + } +}; +var index$2 = { +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js primitive: { borderRadius: { none: "0", @@ -147793,6 +152011,7 @@ function _toPrimitive$1(t2, r) { __name(_toPrimitive$1, "_toPrimitive$1"); var index = _objectSpread(_objectSpread({}, index$1l), {}, { components: { +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js accordion: index$1p, autocomplete: index$1o, avatar: index$1n, @@ -147879,19 +152098,15898 @@ var index = _objectSpread(_objectSpread({}, index$1l), {}, { toast: index$9, toolbar: index$6, virtualscroller: index$1 +======== + accordion: index$1n, + autocomplete: index$1m, + avatar: index$1l, + badge: index$1k, + blockui: index$1j, + breadcrumb: index$1i, + button: index$1h, + datepicker: index$15, + card: index$1g, + carousel: index$1f, + cascadeselect: index$1e, + checkbox: index$1d, + chip: index$1c, + colorpicker: index$1b, + confirmdialog: index$1a, + confirmpopup: index$19, + contextmenu: index$18, + dataview: index$16, + datatable: index$17, + dialog: index$14, + divider: index$13, + dock: index$12, + drawer: index$11, + editor: index$10, + fieldset: index$$, + fileupload: index$_, + floatlabel: index$Z, + galleria: index$Y, + iconfield: index$X, + image: index$W, + inlinemessage: index$V, + inplace: index$U, + inputchips: index$T, + inputgroup: index$S, + inputnumber: index$R, + inputtext: index$Q, + knob: index$P, + listbox: index$O, + megamenu: index$N, + menu: index$M, + menubar: index$L, + message: index$K, + metergroup: index$J, + multiselect: index$I, + orderlist: index$H, + organizationchart: index$G, + overlaybadge: index$F, + popover: index$z, + paginator: index$E, + password: index$B, + panel: index$D, + panelmenu: index$C, + picklist: index$A, + progressbar: index$y, + progressspinner: index$x, + radiobutton: index$w, + rating: index$v, + scrollpanel: index$t, + select: index$s, + selectbutton: index$r, + skeleton: index$q, + slider: index$p, + speeddial: index$o, + splitter: index$m, + splitbutton: index$n, + stepper: index$l, + steps: index$k, + tabmenu: index$j, + tabs: index$i, + tabview: index$h, + textarea: index$e, + tieredmenu: index$d, + tag: index$g, + terminal: index$f, + timeline: index$c, + togglebutton: index$a, + toggleswitch: index$9, + tree: index$6, + treeselect: index$5, + treetable: index$4, + toast: index$b, + toolbar: index$8, + virtualscroller: index$3 +>>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:comfy/web/assets/index-DjNHn37O.js }, directives: { - tooltip: index$5, - ripple: index$s + tooltip: index$7, + ripple: index$u } +<<<<<<<< HEAD:comfy/web/assets/index-BK27PIiK.js }); +======== +}; +/** +* @vue/shared v3.4.31 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function makeMap(str, expectsLowerCase) { + const set3 = new Set(str.split(",")); + return expectsLowerCase ? (val) => set3.has(val.toLowerCase()) : (val) => set3.has(val); +} +__name(makeMap, "makeMap"); +const EMPTY_OBJ = false ? Object.freeze({}) : {}; +const EMPTY_ARR = false ? Object.freeze([]) : []; +const NOOP = /* @__PURE__ */ __name(() => { +}, "NOOP"); +const NO = /* @__PURE__ */ __name(() => false, "NO"); +const isOn = /* @__PURE__ */ __name((key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97), "isOn"); +const isModelListener = /* @__PURE__ */ __name((key) => key.startsWith("onUpdate:"), "isModelListener"); +const extend$1 = Object.assign; +const remove$1 = /* @__PURE__ */ __name((arr, el) => { + const i2 = arr.indexOf(el); + if (i2 > -1) { + arr.splice(i2, 1); + } +}, "remove$1"); +const hasOwnProperty$3 = Object.prototype.hasOwnProperty; +const hasOwn$3 = /* @__PURE__ */ __name((val, key) => hasOwnProperty$3.call(val, key), "hasOwn$3"); +const isArray$4 = Array.isArray; +const isMap = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Map]", "isMap"); +const isSet = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Set]", "isSet"); +const isDate$2 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Date]", "isDate$2"); +const isRegExp$4 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object RegExp]", "isRegExp$4"); +const isFunction$4 = /* @__PURE__ */ __name((val) => typeof val === "function", "isFunction$4"); +const isString$7 = /* @__PURE__ */ __name((val) => typeof val === "string", "isString$7"); +const isSymbol$1 = /* @__PURE__ */ __name((val) => typeof val === "symbol", "isSymbol$1"); +const isObject$6 = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object", "isObject$6"); +const isPromise$1 = /* @__PURE__ */ __name((val) => { + return (isObject$6(val) || isFunction$4(val)) && isFunction$4(val.then) && isFunction$4(val.catch); +}, "isPromise$1"); +const objectToString$1 = Object.prototype.toString; +const toTypeString$1 = /* @__PURE__ */ __name((value4) => objectToString$1.call(value4), "toTypeString$1"); +const toRawType = /* @__PURE__ */ __name((value4) => { + return toTypeString$1(value4).slice(8, -1); +}, "toRawType"); +const isPlainObject$4 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Object]", "isPlainObject$4"); +const isIntegerKey = /* @__PURE__ */ __name((key) => isString$7(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key, "isIntegerKey"); +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction$1 = /* @__PURE__ */ __name((fn) => { + const cache2 = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache2[str]; + return hit || (cache2[str] = fn(str)); + }; +}, "cacheStringFunction$1"); +const camelizeRE$1 = /-(\w)/g; +const camelize$1 = cacheStringFunction$1((str) => { + return str.replace(camelizeRE$1, (_2, c) => c ? c.toUpperCase() : ""); +}); +const hyphenateRE$1 = /\B([A-Z])/g; +const hyphenate$1 = cacheStringFunction$1( + (str) => str.replace(hyphenateRE$1, "-$1").toLowerCase() +); +const capitalize$1 = cacheStringFunction$1((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction$1((str) => { + const s = str ? `on${capitalize$1(str)}` : ``; + return s; +}); +const hasChanged = /* @__PURE__ */ __name((value4, oldValue2) => !Object.is(value4, oldValue2), "hasChanged"); +const invokeArrayFns = /* @__PURE__ */ __name((fns, ...arg) => { + for (let i2 = 0; i2 < fns.length; i2++) { + fns[i2](...arg); + } +}, "invokeArrayFns"); +const def = /* @__PURE__ */ __name((obj, key, value4, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value: value4 + }); +}, "def"); +const looseToNumber = /* @__PURE__ */ __name((val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}, "looseToNumber"); +const toNumber = /* @__PURE__ */ __name((val) => { + const n = isString$7(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}, "toNumber"); +let _globalThis$1; +const getGlobalThis$1 = /* @__PURE__ */ __name(() => { + return _globalThis$1 || (_globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}, "getGlobalThis$1"); +const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; +function genPropsAccessExp(name2) { + return identRE.test(name2) ? `__props.${name2}` : `__props[${JSON.stringify(name2)}]`; +} +__name(genPropsAccessExp, "genPropsAccessExp"); +const PatchFlags = { + "TEXT": 1, + "1": "TEXT", + "CLASS": 2, + "2": "CLASS", + "STYLE": 4, + "4": "STYLE", + "PROPS": 8, + "8": "PROPS", + "FULL_PROPS": 16, + "16": "FULL_PROPS", + "NEED_HYDRATION": 32, + "32": "NEED_HYDRATION", + "STABLE_FRAGMENT": 64, + "64": "STABLE_FRAGMENT", + "KEYED_FRAGMENT": 128, + "128": "KEYED_FRAGMENT", + "UNKEYED_FRAGMENT": 256, + "256": "UNKEYED_FRAGMENT", + "NEED_PATCH": 512, + "512": "NEED_PATCH", + "DYNAMIC_SLOTS": 1024, + "1024": "DYNAMIC_SLOTS", + "DEV_ROOT_FRAGMENT": 2048, + "2048": "DEV_ROOT_FRAGMENT", + "HOISTED": -1, + "-1": "HOISTED", + "BAIL": -2, + "-2": "BAIL" +}; +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `NEED_HYDRATION`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; +const ShapeFlags = { + "ELEMENT": 1, + "1": "ELEMENT", + "FUNCTIONAL_COMPONENT": 2, + "2": "FUNCTIONAL_COMPONENT", + "STATEFUL_COMPONENT": 4, + "4": "STATEFUL_COMPONENT", + "TEXT_CHILDREN": 8, + "8": "TEXT_CHILDREN", + "ARRAY_CHILDREN": 16, + "16": "ARRAY_CHILDREN", + "SLOTS_CHILDREN": 32, + "32": "SLOTS_CHILDREN", + "TELEPORT": 64, + "64": "TELEPORT", + "SUSPENSE": 128, + "128": "SUSPENSE", + "COMPONENT_SHOULD_KEEP_ALIVE": 256, + "256": "COMPONENT_SHOULD_KEEP_ALIVE", + "COMPONENT_KEPT_ALIVE": 512, + "512": "COMPONENT_KEPT_ALIVE", + "COMPONENT": 6, + "6": "COMPONENT" +}; +const SlotFlags = { + "STABLE": 1, + "1": "STABLE", + "DYNAMIC": 2, + "2": "DYNAMIC", + "FORWARDED": 3, + "3": "FORWARDED" +}; +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); +const isGloballyWhitelisted = isGloballyAllowed; +const range = 2; +function generateCodeFrame$1(source, start2 = 0, end = source.length) { + start2 = Math.max(0, Math.min(start2, source.length)); + end = Math.max(0, Math.min(end, source.length)); + if (start2 > end) return ""; + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_2, idx) => idx % 2 === 1); + lines = lines.filter((_2, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i2 = 0; i2 < lines.length; i2++) { + count += lines[i2].length + (newlineSequences[i2] && newlineSequences[i2].length || 0); + if (count >= start2) { + for (let j = i2 - range; j <= i2 + range || end > count; j++) { + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i2) { + const pad = start2 - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start2 + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i2) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} +__name(generateCodeFrame$1, "generateCodeFrame$1"); +function normalizeStyle(value4) { + if (isArray$4(value4)) { + const res = {}; + for (let i2 = 0; i2 < value4.length; i2++) { + const item3 = value4[i2]; + const normalized = isString$7(item3) ? parseStringStyle(item3) : normalizeStyle(item3); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString$7(value4) || isObject$6(value4)) { + return value4; + } +} +__name(normalizeStyle, "normalizeStyle"); +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item3) => { + if (item3) { + const tmp = item3.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +__name(parseStringStyle, "parseStringStyle"); +function stringifyStyle(styles) { + let ret = ""; + if (!styles || isString$7(styles)) { + return ret; + } + for (const key in styles) { + const value4 = styles[key]; + if (isString$7(value4) || typeof value4 === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate$1(key); + ret += `${normalizedKey}:${value4};`; + } + } + return ret; +} +__name(stringifyStyle, "stringifyStyle"); +function normalizeClass(value4) { + let res = ""; + if (isString$7(value4)) { + res = value4; + } else if (isArray$4(value4)) { + for (let i2 = 0; i2 < value4.length; i2++) { + const normalized = normalizeClass(value4[i2]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject$6(value4)) { + for (const name2 in value4) { + if (value4[name2]) { + res += name2 + " "; + } + } + } + return res.trim(); +} +__name(normalizeClass, "normalizeClass"); +function normalizeProps(props) { + if (!props) return null; + let { class: klass, style: style2 } = props; + if (klass && !isString$7(klass)) { + props.class = normalizeClass(klass); + } + if (style2) { + props.style = normalizeStyle(style2); + } + return props; +} +__name(normalizeProps, "normalizeProps"); +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value4) { + return !!value4 || value4 === ""; +} +__name(includeBooleanAttr, "includeBooleanAttr"); +const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const attrValidationCache = {}; +function isSSRSafeAttrName(name2) { + if (attrValidationCache.hasOwnProperty(name2)) { + return attrValidationCache[name2]; + } + const isUnsafe = unsafeAttrCharRE.test(name2); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name2}`); + } + return attrValidationCache[name2] = !isUnsafe; +} +__name(isSSRSafeAttrName, "isSSRSafeAttrName"); +const propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +function isRenderableAttrValue(value4) { + if (value4 == null) { + return false; + } + const type = typeof value4; + return type === "string" || type === "number" || type === "boolean"; +} +__name(isRenderableAttrValue, "isRenderableAttrValue"); +const escapeRE$2 = /["'&<>]/; +function escapeHtml$2(string) { + const str = "" + string; + const match2 = escapeRE$2.exec(str); + if (!match2) { + return str; + } + let html = ""; + let escaped; + let index2; + let lastIndex2 = 0; + for (index2 = match2.index; index2 < str.length; index2++) { + switch (str.charCodeAt(index2)) { + case 34: + escaped = """; + break; + case 38: + escaped = "&"; + break; + case 39: + escaped = "'"; + break; + case 60: + escaped = "<"; + break; + case 62: + escaped = ">"; + break; + default: + continue; + } + if (lastIndex2 !== index2) { + html += str.slice(lastIndex2, index2); + } + lastIndex2 = index2 + 1; + html += escaped; + } + return lastIndex2 !== index2 ? html + str.slice(lastIndex2, index2) : html; +} +__name(escapeHtml$2, "escapeHtml$2"); +const commentStripRE = /^-?>||--!>| looseEqual(item3, val)); +} +__name(looseIndexOf, "looseIndexOf"); +const isRef$1 = /* @__PURE__ */ __name((val) => { + return !!(val && val.__v_isRef === true); +}, "isRef$1"); +const toDisplayString$1 = /* @__PURE__ */ __name((val) => { + return isString$7(val) ? val : val == null ? "" : isArray$4(val) || isObject$6(val) && (val.toString === objectToString$1 || !isFunction$4(val.toString)) ? isRef$1(val) ? toDisplayString$1(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}, "toDisplayString$1"); +const replacer = /* @__PURE__ */ __name((_key, val) => { + if (isRef$1(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i2) => { + entries[stringifySymbol(key, i2) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2)) + }; + } else if (isSymbol$1(val)) { + return stringifySymbol(val); + } else if (isObject$6(val) && !isArray$4(val) && !isPlainObject$4(val)) { + return String(val); + } + return val; +}, "replacer"); +const stringifySymbol = /* @__PURE__ */ __name((v2, i2 = "") => { + var _a2; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol$1(v2) ? `Symbol(${(_a2 = v2.description) != null ? _a2 : i2})` : v2 + ); +}, "stringifySymbol"); +/** +* @vue/reactivity v3.4.31 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +function warn$4(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} +__name(warn$4, "warn$4"); +let activeEffectScope; +class EffectScope { + static { + __name(this, "EffectScope"); + } + constructor(detached = false) { + this.detached = detached; + this._active = true; + this.effects = []; + this.cleanups = []; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else if (false) { + warn$4(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + let i2, l; + for (i2 = 0, l = this.effects.length; i2 < l; i2++) { + this.effects[i2].stop(); + } + for (i2 = 0, l = this.cleanups.length; i2 < l; i2++) { + this.cleanups[i2](); + } + if (this.scopes) { + for (i2 = 0, l = this.scopes.length; i2 < l; i2++) { + this.scopes[i2].stop(true); + } + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + this._active = false; + } + } +} +function effectScope(detached) { + return new EffectScope(detached); +} +__name(effectScope, "effectScope"); +function recordEffectScope(effect2, scope = activeEffectScope) { + if (scope && scope.active) { + scope.effects.push(effect2); + } +} +__name(recordEffectScope, "recordEffectScope"); +function getCurrentScope() { + return activeEffectScope; +} +__name(getCurrentScope, "getCurrentScope"); +function onScopeDispose(fn) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (false) { + warn$4( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } +} +__name(onScopeDispose, "onScopeDispose"); +let activeEffect; +class ReactiveEffect { + static { + __name(this, "ReactiveEffect"); + } + constructor(fn, trigger2, scheduler, scope) { + this.fn = fn; + this.trigger = trigger2; + this.scheduler = scheduler; + this.active = true; + this.deps = []; + this._dirtyLevel = 4; + this._trackId = 0; + this._runnings = 0; + this._shouldSchedule = false; + this._depsLength = 0; + recordEffectScope(this, scope); + } + get dirty() { + if (this._dirtyLevel === 2 || this._dirtyLevel === 3) { + this._dirtyLevel = 1; + pauseTracking(); + for (let i2 = 0; i2 < this._depsLength; i2++) { + const dep = this.deps[i2]; + if (dep.computed) { + triggerComputed(dep.computed); + if (this._dirtyLevel >= 4) { + break; + } + } + } + if (this._dirtyLevel === 1) { + this._dirtyLevel = 0; + } + resetTracking(); + } + return this._dirtyLevel >= 4; + } + set dirty(v2) { + this._dirtyLevel = v2 ? 4 : 0; + } + run() { + this._dirtyLevel = 0; + if (!this.active) { + return this.fn(); + } + let lastShouldTrack = shouldTrack; + let lastEffect = activeEffect; + try { + shouldTrack = true; + activeEffect = this; + this._runnings++; + preCleanupEffect(this); + return this.fn(); + } finally { + postCleanupEffect(this); + this._runnings--; + activeEffect = lastEffect; + shouldTrack = lastShouldTrack; + } + } + stop() { + if (this.active) { + preCleanupEffect(this); + postCleanupEffect(this); + this.onStop && this.onStop(); + this.active = false; + } + } +} +function triggerComputed(computed2) { + return computed2.value; +} +__name(triggerComputed, "triggerComputed"); +function preCleanupEffect(effect2) { + effect2._trackId++; + effect2._depsLength = 0; +} +__name(preCleanupEffect, "preCleanupEffect"); +function postCleanupEffect(effect2) { + if (effect2.deps.length > effect2._depsLength) { + for (let i2 = effect2._depsLength; i2 < effect2.deps.length; i2++) { + cleanupDepEffect(effect2.deps[i2], effect2); + } + effect2.deps.length = effect2._depsLength; + } +} +__name(postCleanupEffect, "postCleanupEffect"); +function cleanupDepEffect(dep, effect2) { + const trackId = dep.get(effect2); + if (trackId !== void 0 && effect2._trackId !== trackId) { + dep.delete(effect2); + if (dep.size === 0) { + dep.cleanup(); + } + } +} +__name(cleanupDepEffect, "cleanupDepEffect"); +function effect(fn, options4) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const _effect = new ReactiveEffect(fn, NOOP, () => { + if (_effect.dirty) { + _effect.run(); + } + }); + if (options4) { + extend$1(_effect, options4); + if (options4.scope) recordEffectScope(_effect, options4.scope); + } + if (!options4 || !options4.lazy) { + _effect.run(); + } + const runner = _effect.run.bind(_effect); + runner.effect = _effect; + return runner; +} +__name(effect, "effect"); +function stop(runner) { + runner.effect.stop(); +} +__name(stop, "stop"); +let shouldTrack = true; +let pauseScheduleStack = 0; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +__name(pauseTracking, "pauseTracking"); +function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; +} +__name(enableTracking, "enableTracking"); +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +__name(resetTracking, "resetTracking"); +function pauseScheduling() { + pauseScheduleStack++; +} +__name(pauseScheduling, "pauseScheduling"); +function resetScheduling() { + pauseScheduleStack--; + while (!pauseScheduleStack && queueEffectSchedulers.length) { + queueEffectSchedulers.shift()(); + } +} +__name(resetScheduling, "resetScheduling"); +function trackEffect(effect2, dep, debuggerEventExtraInfo) { + var _a2; + if (dep.get(effect2) !== effect2._trackId) { + dep.set(effect2, effect2._trackId); + const oldDep = effect2.deps[effect2._depsLength]; + if (oldDep !== dep) { + if (oldDep) { + cleanupDepEffect(oldDep, effect2); + } + effect2.deps[effect2._depsLength++] = dep; + } else { + effect2._depsLength++; + } + if (false) { + (_a2 = effect2.onTrack) == null ? void 0 : _a2.call(effect2, extend$1({ effect: effect2 }, debuggerEventExtraInfo)); + } + } +} +__name(trackEffect, "trackEffect"); +const queueEffectSchedulers = []; +function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) { + var _a2; + pauseScheduling(); + for (const effect2 of dep.keys()) { + let tracking; + if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) { + effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0); + effect2._dirtyLevel = dirtyLevel; + } + if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) { + if (false) { + (_a2 = effect2.onTrigger) == null ? void 0 : _a2.call(effect2, extend$1({ effect: effect2 }, debuggerEventExtraInfo)); + } + effect2.trigger(); + if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) { + effect2._shouldSchedule = false; + if (effect2.scheduler) { + queueEffectSchedulers.push(effect2.scheduler); + } + } + } + } + resetScheduling(); +} +__name(triggerEffects, "triggerEffects"); +const createDep = /* @__PURE__ */ __name((cleanup, computed2) => { + const dep = /* @__PURE__ */ new Map(); + dep.cleanup = cleanup; + dep.computed = computed2; + return dep; +}, "createDep"); +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = Symbol(false ? "iterate" : ""); +const MAP_KEY_ITERATE_KEY = Symbol(false ? "Map key iterate" : ""); +function track(target, type, key) { + if (shouldTrack && activeEffect) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = createDep(() => depsMap.delete(key))); + } + trackEffect( + activeEffect, + dep, + false ? { + target, + type, + key + } : void 0 + ); + } +} +__name(track, "track"); +function trigger(target, type, key, newValue2, oldValue2, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + return; + } + let deps = []; + if (type === "clear") { + deps = [...depsMap.values()]; + } else if (key === "length" && isArray$4(target)) { + const newLength = Number(newValue2); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || !isSymbol$1(key2) && key2 >= newLength) { + deps.push(dep); + } + }); + } else { + if (key !== void 0) { + deps.push(depsMap.get(key)); + } + switch (type) { + case "add": + if (!isArray$4(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isIntegerKey(key)) { + deps.push(depsMap.get("length")); + } + break; + case "delete": + if (!isArray$4(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + } + break; + } + } + pauseScheduling(); + for (const dep of deps) { + if (dep) { + triggerEffects( + dep, + 4, + false ? { + target, + type, + key, + newValue: newValue2, + oldValue: oldValue2, + oldTarget + } : void 0 + ); + } + } + resetScheduling(); +} +__name(trigger, "trigger"); +function getDepFromReactive(object, key) { + const depsMap = targetMap.get(object); + return depsMap && depsMap.get(key); +} +__name(getDepFromReactive, "getDepFromReactive"); +const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$1) +); +const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); +function createArrayInstrumentations() { + const instrumentations = {}; + ["includes", "indexOf", "lastIndexOf"].forEach((key) => { + instrumentations[key] = function(...args) { + const arr = toRaw(this); + for (let i2 = 0, l = this.length; i2 < l; i2++) { + track(arr, "get", i2 + ""); + } + const res = arr[key](...args); + if (res === -1 || res === false) { + return arr[key](...args.map(toRaw)); + } else { + return res; + } + }; + }); + ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { + instrumentations[key] = function(...args) { + pauseTracking(); + pauseScheduling(); + const res = toRaw(this)[key].apply(this, args); + resetScheduling(); + resetTracking(); + return res; + }; + }); + return instrumentations; +} +__name(createArrayInstrumentations, "createArrayInstrumentations"); +function hasOwnProperty$2(key) { + if (!isSymbol$1(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +__name(hasOwnProperty$2, "hasOwnProperty$2"); +class BaseReactiveHandler { + static { + __name(this, "BaseReactiveHandler"); + } + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the reciever is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray$4(target); + if (!isReadonly2) { + if (targetIsArray && hasOwn$3(arrayInstrumentations, key)) { + return Reflect.get(arrayInstrumentations, key, receiver); + } + if (key === "hasOwnProperty") { + return hasOwnProperty$2; + } + } + const res = Reflect.get(target, key, receiver); + if (isSymbol$1(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject$6(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + static { + __name(this, "MutableReactiveHandler"); + } + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value4, receiver) { + let oldValue2 = target[key]; + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue2); + if (!isShallow(value4) && !isReadonly(value4)) { + oldValue2 = toRaw(oldValue2); + value4 = toRaw(value4); + } + if (!isArray$4(target) && isRef(oldValue2) && !isRef(value4)) { + if (isOldValueReadonly) { + return false; + } else { + oldValue2.value = value4; + return true; + } + } + } + const hadKey = isArray$4(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$3(target, key); + const result = Reflect.set(target, key, value4, receiver); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value4); + } else if (hasChanged(value4, oldValue2)) { + trigger(target, "set", key, value4, oldValue2); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn$3(target, key); + const oldValue2 = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue2); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol$1(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray$4(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + static { + __name(this, "ReadonlyReactiveHandler"); + } + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + if (false) { + warn$4( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + if (false) { + warn$4( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler( + true +); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); +const toShallow = /* @__PURE__ */ __name((value4) => value4, "toShallow"); +const getProto = /* @__PURE__ */ __name((v2) => Reflect.getPrototypeOf(v2), "getProto"); +function get$3(target, key, isReadonly2 = false, isShallow2 = false) { + target = target["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!isReadonly2) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has: has2 } = getProto(rawTarget); + const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1; + if (has2.call(rawTarget, key)) { + return wrap2(target.get(key)); + } else if (has2.call(rawTarget, rawKey)) { + return wrap2(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } +} +__name(get$3, "get$3"); +function has$1(key, isReadonly2 = false) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!isReadonly2) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); +} +__name(has$1, "has$1"); +function size(target, isReadonly2 = false) { + target = target["__v_raw"]; + !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); +} +__name(size, "size"); +function add$1(value4) { + value4 = toRaw(value4); + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value4); + if (!hadKey) { + target.add(value4); + trigger(target, "add", value4, value4); + } + return this; +} +__name(add$1, "add$1"); +function set$4(key, value4) { + value4 = toRaw(value4); + const target = toRaw(this); + const { has: has2, get: get22 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has2.call(target, key); + } else if (false) { + checkIdentityKeys(target, has2, key); + } + const oldValue2 = get22.call(target, key); + target.set(key, value4); + if (!hadKey) { + trigger(target, "add", key, value4); + } else if (hasChanged(value4, oldValue2)) { + trigger(target, "set", key, value4, oldValue2); + } + return this; +} +__name(set$4, "set$4"); +function deleteEntry(key) { + const target = toRaw(this); + const { has: has2, get: get22 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has2.call(target, key); + } else if (false) { + checkIdentityKeys(target, has2, key); + } + const oldValue2 = get22 ? get22.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue2); + } + return result; +} +__name(deleteEntry, "deleteEntry"); +function clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = false ? isMap(target) ? new Map(target) : new Set(target) : void 0; + const result = target.clear(); + if (hadItems) { + trigger(target, "clear", void 0, void 0, oldTarget); + } + return result; +} +__name(clear, "clear"); +function createForEach(isReadonly2, isShallow2) { + return /* @__PURE__ */ __name(function forEach3(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1; + !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value4, key) => { + return callback.call(thisArg, wrap2(value4), wrap2(key), observed); + }); + }, "forEach"); +} +__name(createForEach, "createForEach"); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value: value4, done } = innerIterator.next(); + return done ? { value: value4, done } : { + value: isPair ? [wrap2(value4[0]), wrap2(value4[1])] : wrap2(value4), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +__name(createIterableMethod, "createIterableMethod"); +function createReadonlyMethod(type) { + return function(...args) { + if (false) { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn$4( + `${capitalize$1(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +__name(createReadonlyMethod, "createReadonlyMethod"); +function createInstrumentations() { + const mutableInstrumentations2 = { + get(key) { + return get$3(this, key); + }, + get size() { + return size(this); + }, + has: has$1, + add: add$1, + set: set$4, + delete: deleteEntry, + clear, + forEach: createForEach(false, false) + }; + const shallowInstrumentations2 = { + get(key) { + return get$3(this, key, false, true); + }, + get size() { + return size(this); + }, + has: has$1, + add: add$1, + set: set$4, + delete: deleteEntry, + clear, + forEach: createForEach(false, true) + }; + const readonlyInstrumentations2 = { + get(key) { + return get$3(this, key, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, false) + }; + const shallowReadonlyInstrumentations2 = { + get(key) { + return get$3(this, key, true, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, true) + }; + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + mutableInstrumentations2[method] = createIterableMethod(method, false, false); + readonlyInstrumentations2[method] = createIterableMethod(method, true, false); + shallowInstrumentations2[method] = createIterableMethod(method, false, true); + shallowReadonlyInstrumentations2[method] = createIterableMethod( + method, + true, + true + ); + }); + return [ + mutableInstrumentations2, + readonlyInstrumentations2, + shallowInstrumentations2, + shallowReadonlyInstrumentations2 + ]; +} +__name(createInstrumentations, "createInstrumentations"); +const [ + mutableInstrumentations, + readonlyInstrumentations, + shallowInstrumentations, + shallowReadonlyInstrumentations +] = /* @__PURE__ */ createInstrumentations(); +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn$3(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +__name(createInstrumentationGetter, "createInstrumentationGetter"); +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has2, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has2.call(target, rawKey)) { + const type = toRawType(target); + warn$4( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} +__name(checkIdentityKeys, "checkIdentityKeys"); +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2; + default: + return 0; + } +} +__name(targetTypeMap, "targetTypeMap"); +function getTargetType(value4) { + return value4["__v_skip"] || !Object.isExtensible(value4) ? 0 : targetTypeMap(toRawType(value4)); +} +__name(getTargetType, "getTargetType"); +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +__name(reactive, "reactive"); +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +__name(shallowReactive, "shallowReactive"); +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +__name(readonly, "readonly"); +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +__name(shallowReadonly, "shallowReadonly"); +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject$6(target)) { + if (false) { + warn$4( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +__name(createReactiveObject, "createReactiveObject"); +function isReactive(value4) { + if (isReadonly(value4)) { + return isReactive(value4["__v_raw"]); + } + return !!(value4 && value4["__v_isReactive"]); +} +__name(isReactive, "isReactive"); +function isReadonly(value4) { + return !!(value4 && value4["__v_isReadonly"]); +} +__name(isReadonly, "isReadonly"); +function isShallow(value4) { + return !!(value4 && value4["__v_isShallow"]); +} +__name(isShallow, "isShallow"); +function isProxy(value4) { + return value4 ? !!value4["__v_raw"] : false; +} +__name(isProxy, "isProxy"); +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +__name(toRaw, "toRaw"); +function markRaw(value4) { + if (Object.isExtensible(value4)) { + def(value4, "__v_skip", true); + } + return value4; +} +__name(markRaw, "markRaw"); +const toReactive$1 = /* @__PURE__ */ __name((value4) => isObject$6(value4) ? reactive(value4) : value4, "toReactive$1"); +const toReadonly = /* @__PURE__ */ __name((value4) => isObject$6(value4) ? readonly(value4) : value4, "toReadonly"); +const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`; +class ComputedRefImpl { + static { + __name(this, "ComputedRefImpl"); + } + constructor(getter, _setter, isReadonly2, isSSR) { + this.getter = getter; + this._setter = _setter; + this.dep = void 0; + this.__v_isRef = true; + this["__v_isReadonly"] = false; + this.effect = new ReactiveEffect( + () => getter(this._value), + () => triggerRefValue( + this, + this.effect._dirtyLevel === 2 ? 2 : 3 + ) + ); + this.effect.computed = this; + this.effect.active = this._cacheable = !isSSR; + this["__v_isReadonly"] = isReadonly2; + } + get value() { + const self2 = toRaw(this); + if ((!self2._cacheable || self2.effect.dirty) && hasChanged(self2._value, self2._value = self2.effect.run())) { + triggerRefValue(self2, 4); + } + trackRefValue(self2); + if (self2.effect._dirtyLevel >= 2) { + if (false) { + warn$4(COMPUTED_SIDE_EFFECT_WARN, ` + +getter: `, this.getter); + } + triggerRefValue(self2, 2); + } + return self2._value; + } + set value(newValue2) { + this._setter(newValue2); + } + // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x + get _dirty() { + return this.effect.dirty; + } + set _dirty(v2) { + this.effect.dirty = v2; + } + // #endregion +} +function computed$1(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + const onlyGetter = isFunction$4(getterOrOptions); + if (onlyGetter) { + getter = getterOrOptions; + setter = false ? () => { + warn$4("Write operation failed: computed value is readonly"); + } : NOOP; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); + if (false) { + cRef.effect.onTrack = debugOptions.onTrack; + cRef.effect.onTrigger = debugOptions.onTrigger; + } + return cRef; +} +__name(computed$1, "computed$1"); +function trackRefValue(ref2) { + var _a2; + if (shouldTrack && activeEffect) { + ref2 = toRaw(ref2); + trackEffect( + activeEffect, + (_a2 = ref2.dep) != null ? _a2 : ref2.dep = createDep( + () => ref2.dep = void 0, + ref2 instanceof ComputedRefImpl ? ref2 : void 0 + ), + false ? { + target: ref2, + type: "get", + key: "value" + } : void 0 + ); + } +} +__name(trackRefValue, "trackRefValue"); +function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) { + ref2 = toRaw(ref2); + const dep = ref2.dep; + if (dep) { + triggerEffects( + dep, + dirtyLevel, + false ? { + target: ref2, + type: "set", + key: "value", + newValue: newVal, + oldValue: oldVal + } : void 0 + ); + } +} +__name(triggerRefValue, "triggerRefValue"); +function isRef(r) { + return !!(r && r.__v_isRef === true); +} +__name(isRef, "isRef"); +function ref(value4) { + return createRef(value4, false); +} +__name(ref, "ref"); +function shallowRef(value4) { + return createRef(value4, true); +} +__name(shallowRef, "shallowRef"); +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +__name(createRef, "createRef"); +class RefImpl { + static { + __name(this, "RefImpl"); + } + constructor(value4, __v_isShallow) { + this.__v_isShallow = __v_isShallow; + this.dep = void 0; + this.__v_isRef = true; + this._rawValue = __v_isShallow ? value4 : toRaw(value4); + this._value = __v_isShallow ? value4 : toReactive$1(value4); + } + get value() { + trackRefValue(this); + return this._value; + } + set value(newVal) { + const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); + newVal = useDirectValue ? newVal : toRaw(newVal); + if (hasChanged(newVal, this._rawValue)) { + const oldVal = this._rawValue; + this._rawValue = newVal; + this._value = useDirectValue ? newVal : toReactive$1(newVal); + triggerRefValue(this, 4, newVal, oldVal); + } + } +} +function triggerRef(ref2) { + triggerRefValue(ref2, 4, false ? ref2.value : void 0); +} +__name(triggerRef, "triggerRef"); +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +__name(unref, "unref"); +function toValue$1(source) { + return isFunction$4(source) ? source() : unref(source); +} +__name(toValue$1, "toValue$1"); +const shallowUnwrapHandlers = { + get: /* @__PURE__ */ __name((target, key, receiver) => unref(Reflect.get(target, key, receiver)), "get"), + set: /* @__PURE__ */ __name((target, key, value4, receiver) => { + const oldValue2 = target[key]; + if (isRef(oldValue2) && !isRef(value4)) { + oldValue2.value = value4; + return true; + } else { + return Reflect.set(target, key, value4, receiver); + } + }, "set") +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +__name(proxyRefs, "proxyRefs"); +class CustomRefImpl { + static { + __name(this, "CustomRefImpl"); + } + constructor(factory) { + this.dep = void 0; + this.__v_isRef = true; + const { get: get22, set: set22 } = factory( + () => trackRefValue(this), + () => triggerRefValue(this) + ); + this._get = get22; + this._set = set22; + } + get value() { + return this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +__name(customRef, "customRef"); +function toRefs$1(object) { + if (false) { + warn$4(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray$4(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +__name(toRefs$1, "toRefs$1"); +class ObjectRefImpl { + static { + __name(this, "ObjectRefImpl"); + } + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this.__v_isRef = true; + } + get value() { + const val = this._object[this._key]; + return val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } +} +class GetterRefImpl { + static { + __name(this, "GetterRefImpl"); + } + constructor(_getter) { + this._getter = _getter; + this.__v_isRef = true; + this.__v_isReadonly = true; + } + get value() { + return this._getter(); + } +} +function toRef$1(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (isFunction$4(source)) { + return new GetterRefImpl(source); + } else if (isObject$6(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +__name(toRef$1, "toRef$1"); +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); +} +__name(propertyToRef, "propertyToRef"); +const deferredComputed = computed$1; +const TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" +}; +const TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" +}; +const ReactiveFlags = { + "SKIP": "__v_skip", + "IS_REACTIVE": "__v_isReactive", + "IS_READONLY": "__v_isReadonly", + "IS_SHALLOW": "__v_isShallow", + "RAW": "__v_raw" +}; +/** +* @vue/runtime-core v3.4.31 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +const stack = []; +function pushWarningContext(vnode) { + stack.push(vnode); +} +__name(pushWarningContext, "pushWarningContext"); +function popWarningContext() { + stack.pop(); +} +__name(popWarningContext, "popWarningContext"); +function warn$1$1(msg, ...args) { + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a2, _b; + return (_b = (_a2 = a.toString) == null ? void 0 : _a2.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); +} +__name(warn$1$1, "warn$1$1"); +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +__name(getComponentTrace, "getComponentTrace"); +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i2) => { + logs.push(...i2 === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +__name(formatTrace, "formatTrace"); +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open2 = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close5 = `>` + postfix; + return vnode.props ? [open2, ...formatProps(vnode.props), close5] : [open2 + close5]; +} +__name(formatTraceEntry, "formatTraceEntry"); +function formatProps(props) { + const res = []; + const keys2 = Object.keys(props); + keys2.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys2.length > 3) { + res.push(` ...`); + } + return res; +} +__name(formatProps, "formatProps"); +function formatProp(key, value4, raw) { + if (isString$7(value4)) { + value4 = JSON.stringify(value4); + return raw ? value4 : [`${key}=${value4}`]; + } else if (typeof value4 === "number" || typeof value4 === "boolean" || value4 == null) { + return raw ? value4 : [`${key}=${value4}`]; + } else if (isRef(value4)) { + value4 = formatProp(key, toRaw(value4.value), true); + return raw ? value4 : [`${key}=Ref<`, value4, `>`]; + } else if (isFunction$4(value4)) { + return [`${key}=fn${value4.name ? `<${value4.name}>` : ``}`]; + } else { + value4 = toRaw(value4); + return raw ? value4 : [`${key}=`, value4]; + } +} +__name(formatProp, "formatProp"); +function assertNumber(val, type) { + if (true) return; + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn$1$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn$1$1(`${type} is NaN - the duration expression might be incorrect.`); + } +} +__name(assertNumber, "assertNumber"); +const ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "WATCH_GETTER": 2, + "2": "WATCH_GETTER", + "WATCH_CALLBACK": 3, + "3": "WATCH_CALLBACK", + "WATCH_CLEANUP": 4, + "4": "WATCH_CLEANUP", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER" +}; +const ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ." +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +__name(callWithErrorHandling, "callWithErrorHandling"); +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction$4(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise$1(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (isArray$4(fn)) { + const values = []; + for (let i2 = 0; i2 < fn.length; i2++) { + values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args)); + } + return values; + } else if (false) { + warn$1$1( + `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` + ); + } +} +__name(callWithAsyncErrorHandling, "callWithAsyncErrorHandling"); +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = false ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) { + if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + const appErrorHandler = instance.appContext.config.errorHandler; + if (appErrorHandler) { + pauseTracking(); + callWithErrorHandling( + appErrorHandler, + null, + 10, + [err, exposedInstance, errorInfo] + ); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev); +} +__name(handleError, "handleError"); +function logError(err, type, contextVNode, throwInDev = true) { + if (false) { + const info = ErrorTypeStrings$1[type]; + if (contextVNode) { + pushWarningContext(contextVNode); + } + warn$1$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } else { + console.error(err); + } +} +__name(logError, "logError"); +let isFlushing = false; +let isFlushPending = false; +const queue = []; +let flushIndex = 0; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +const RECURSION_LIMIT = 100; +function nextTick(fn) { + const p2 = currentFlushPromise || resolvedPromise; + return fn ? p2.then(this ? fn.bind(this) : fn) : p2; +} +__name(nextTick, "nextTick"); +function findInsertionIndex$1(id3) { + let start2 = flushIndex + 1; + let end = queue.length; + while (start2 < end) { + const middle = start2 + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id3 || middleJobId === id3 && middleJob.pre) { + start2 = middle + 1; + } else { + end = middle; + } + } + return start2; +} +__name(findInsertionIndex$1, "findInsertionIndex$1"); +function queueJob(job) { + if (!queue.length || !queue.includes( + job, + isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex + )) { + if (job.id == null) { + queue.push(job); + } else { + queue.splice(findInsertionIndex$1(job.id), 0, job); + } + queueFlush(); + } +} +__name(queueJob, "queueJob"); +function queueFlush() { + if (!isFlushing && !isFlushPending) { + isFlushPending = true; + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +__name(queueFlush, "queueFlush"); +function invalidateJob(job) { + const i2 = queue.indexOf(job); + if (i2 > flushIndex) { + queue.splice(i2, 1); + } +} +__name(invalidateJob, "invalidateJob"); +function queuePostFlushCb(cb) { + if (!isArray$4(cb)) { + if (!activePostFlushCbs || !activePostFlushCbs.includes( + cb, + cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex + )) { + pendingPostFlushCbs.push(cb); + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +__name(queuePostFlushCb, "queuePostFlushCb"); +function flushPreFlushCbs(instance, seen2, i2 = isFlushing ? flushIndex + 1 : 0) { + if (false) { + seen2 = seen2 || /* @__PURE__ */ new Map(); + } + for (; i2 < queue.length; i2++) { + const cb = queue[i2]; + if (cb && cb.pre) { + if (instance && cb.id !== instance.uid) { + continue; + } + if (false) { + continue; + } + queue.splice(i2, 1); + i2--; + cb(); + } + } +} +__name(flushPreFlushCbs, "flushPreFlushCbs"); +function flushPostFlushCbs(seen2) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + if (false) { + seen2 = seen2 || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (false) { + continue; + } + if (cb.active !== false) cb(); + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +__name(flushPostFlushCbs, "flushPostFlushCbs"); +const getId = /* @__PURE__ */ __name((job) => job.id == null ? Infinity : job.id, "getId"); +const comparator = /* @__PURE__ */ __name((a, b) => { + const diff2 = getId(a) - getId(b); + if (diff2 === 0) { + if (a.pre && !b.pre) return -1; + if (b.pre && !a.pre) return 1; + } + return diff2; +}, "comparator"); +function flushJobs(seen2) { + isFlushPending = false; + isFlushing = true; + if (false) { + seen2 = seen2 || /* @__PURE__ */ new Map(); + } + queue.sort(comparator); + const check = false ? (job) => checkRecursiveUpdates(seen2, job) : NOOP; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && job.active !== false) { + if (false) { + continue; + } + callWithErrorHandling(job, null, 14); + } + } + } finally { + flushIndex = 0; + queue.length = 0; + flushPostFlushCbs(seen2); + isFlushing = false; + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen2); + } + } +} +__name(flushJobs, "flushJobs"); +function checkRecursiveUpdates(seen2, fn) { + if (!seen2.has(fn)) { + seen2.set(fn, 1); + } else { + const count = seen2.get(fn); + if (count > RECURSION_LIMIT) { + const instance = fn.ownerInstance; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 + ); + return true; + } else { + seen2.set(fn, count + 1); + } + } +} +__name(checkRecursiveUpdates, "checkRecursiveUpdates"); +let isHmrUpdating = false; +const hmrDirtyComponents = /* @__PURE__ */ new Set(); +if (false) { + getGlobalThis$1().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; +} +const map$1 = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id3 = instance.type.__hmrId; + let record = map$1.get(id3); + if (!record) { + createRecord(id3, instance.type); + record = map$1.get(id3); + } + record.instances.add(instance); +} +__name(registerHMR, "registerHMR"); +function unregisterHMR(instance) { + map$1.get(instance.type.__hmrId).instances.delete(instance); +} +__name(unregisterHMR, "unregisterHMR"); +function createRecord(id3, initialDef) { + if (map$1.has(id3)) { + return false; + } + map$1.set(id3, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +__name(createRecord, "createRecord"); +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +__name(normalizeClassComponent, "normalizeClassComponent"); +function rerender(id3, newRender) { + const record = map$1.get(id3); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + instance.effect.dirty = true; + instance.update(); + isHmrUpdating = false; + }); +} +__name(rerender, "rerender"); +function reload(id3, newComp) { + const record = map$1.get(id3); + if (!record) return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (const instance of instances) { + const oldComp = normalizeClassComponent(instance.type); + if (!hmrDirtyComponents.has(oldComp)) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.add(oldComp); + } + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + hmrDirtyComponents.add(oldComp); + instance.ceReload(newComp.styles); + hmrDirtyComponents.delete(oldComp); + } else if (instance.parent) { + instance.parent.effect.dirty = true; + queueJob(() => { + instance.parent.update(); + hmrDirtyComponents.delete(oldComp); + }); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + } + queuePostFlushCb(() => { + for (const instance of instances) { + hmrDirtyComponents.delete( + normalizeClassComponent(instance.type) + ); + } + }); +} +__name(reload, "reload"); +function updateComponentDef(oldComp, newComp) { + extend$1(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } +} +__name(updateComponentDef, "updateComponentDef"); +function tryWrap(fn) { + return (id3, arg) => { + try { + return fn(id3, arg); + } catch (e2) { + console.error(e2); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; +} +__name(tryWrap, "tryWrap"); +let devtools$1; +let buffer = []; +let devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools$1) { + devtools$1.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } +} +__name(emit$1, "emit$1"); +function setDevtoolsHook$1(hook, target) { + var _a2, _b; + devtools$1 = hook; + if (devtools$1) { + devtools$1.enabled = true; + buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a2 = window.navigator) == null ? void 0 : _a2.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook$1(newHook, target); + }); + setTimeout(() => { + if (!devtools$1) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } +} +__name(setDevtoolsHook$1, "setDevtoolsHook$1"); +function devtoolsInitApp(app2, version2) { + emit$1("app:init", app2, version2, { + Fragment: Fragment$1, + Text: Text$4, + Comment, + Static + }); +} +__name(devtoolsInitApp, "devtoolsInitApp"); +function devtoolsUnmountApp(app2) { + emit$1("app:unmount", app2); +} +__name(devtoolsUnmountApp, "devtoolsUnmountApp"); +const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( + "component:added" + /* COMPONENT_ADDED */ +); +const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook( + "component:updated" + /* COMPONENT_UPDATED */ +); +const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" + /* COMPONENT_REMOVED */ +); +const devtoolsComponentRemoved = /* @__PURE__ */ __name((component) => { + if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools$1.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } +}, "devtoolsComponentRemoved"); +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; +} +__name(createDevtoolsComponentHook, "createDevtoolsComponentHook"); +const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( + "perf:start" + /* PERFORMANCE_START */ +); +const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( + "perf:end" + /* PERFORMANCE_END */ +); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; +} +__name(createDevtoolsPerformanceHook, "createDevtoolsPerformanceHook"); +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit", + component.appContext.app, + component, + event, + params + ); +} +__name(devtoolsComponentEmit, "devtoolsComponentEmit"); +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || EMPTY_OBJ; + if (false) { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !(toHandlerKey(event) in propsOptions)) { + warn$1$1( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.` + ); + } + } else { + const validator3 = emitsOptions[event]; + if (isFunction$4(validator3)) { + const isValid2 = validator3(...rawArgs); + if (!isValid2) { + warn$1$1( + `Invalid event arguments: event validation failed for event "${event}".` + ); + } + } + } + } + } + let args = rawArgs; + const isModelListener2 = event.startsWith("update:"); + const modelArg = isModelListener2 && event.slice(7); + if (modelArg && modelArg in props) { + const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; + const { number: number2, trim: trim2 } = props[modifiersKey] || EMPTY_OBJ; + if (trim2) { + args = rawArgs.map((a) => isString$7(a) ? a.trim() : a); + } + if (number2) { + args = rawArgs.map(looseToNumber); + } + } + if (false) { + devtoolsComponentEmit(instance, event, args); + } + if (false) { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { + warn$1$1( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate$1( + event + )}" instead of "${event}".` + ); + } + } + let handlerName; + let handler6 = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = toHandlerKey(camelize$1(event))]; + if (!handler6 && isModelListener2) { + handler6 = props[handlerName = toHandlerKey(hyphenate$1(event))]; + } + if (handler6) { + callWithAsyncErrorHandling( + handler6, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +__name(emit, "emit"); +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache2 = appContext.emitsCache; + const cached = cache2.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!isFunction$4(comp)) { + const extendEmits = /* @__PURE__ */ __name((raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend$1(normalized, normalizedFromExtend); + } + }, "extendEmits"); + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (isObject$6(comp)) { + cache2.set(comp, null); + } + return null; + } + if (isArray$4(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + extend$1(normalized, raw); + } + if (isObject$6(comp)) { + cache2.set(comp, normalized); + } + return normalized; +} +__name(normalizeEmitsOptions, "normalizeEmitsOptions"); +function isEmitListener(options4, key) { + if (!options4 || !isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return hasOwn$3(options4, key[0].toLowerCase() + key.slice(1)) || hasOwn$3(options4, hyphenate$1(key)) || hasOwn$3(options4, key); +} +__name(isEmitListener, "isEmitListener"); +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev2 = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev2; +} +__name(setCurrentRenderingInstance, "setCurrentRenderingInstance"); +function pushScopeId(id3) { + currentScopeId = id3; +} +__name(pushScopeId, "pushScopeId"); +function popScopeId() { + currentScopeId = null; +} +__name(popScopeId, "popScopeId"); +const withScopeId = /* @__PURE__ */ __name((_id2) => withCtx, "withScopeId"); +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = /* @__PURE__ */ __name((...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + if (false) { + devtoolsComponentUpdated(ctx); + } + return res; + }, "renderFnWithContext"); + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} +__name(withCtx, "withCtx"); +let accessedAttrs = false; +function markAttrsAccessed() { + accessedAttrs = true; +} +__name(markAttrsAccessed, "markAttrsAccessed"); +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs: attrs4, + emit: emit2, + render: render2, + renderCache, + props, + data: data24, + setupState, + ctx, + inheritAttrs + } = instance; + const prev2 = setCurrentRenderingInstance(instance); + let result; + let fallthroughAttrs; + if (false) { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = false ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode( + render2.call( + thisProxy, + proxyToUse, + renderCache, + false ? shallowReadonly(props) : props, + setupState, + data24, + ctx + ) + ); + fallthroughAttrs = attrs4; + } else { + const render22 = Component; + if (false) { + markAttrsAccessed(); + } + result = normalizeVNode( + render22.length > 1 ? render22( + false ? shallowReadonly(props) : props, + false ? { + get attrs() { + markAttrsAccessed(); + return shallowReadonly(attrs4); + }, + slots, + emit: emit2 + } : { attrs: attrs4, slots, emit: emit2 } + ) : render22( + false ? shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs4 : getFunctionalFallthrough(attrs4); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root24 = result; + let setRoot = void 0; + if (false) { + [root24, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys2 = Object.keys(fallthroughAttrs); + const { shapeFlag } = root24; + if (keys2.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys2.some(isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root24 = cloneVNode(root24, fallthroughAttrs, false, true); + } else if (false) { + const allAttrs = Object.keys(attrs4); + const eventAttrs = []; + const extraAttrs = []; + for (let i2 = 0, l = allAttrs.length; i2 < l; i2++) { + const key = allAttrs[i2]; + if (isOn(key)) { + if (!isModelListener(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } + } + if (extraAttrs.length) { + warn$1$1( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.` + ); + } + if (eventAttrs.length) { + warn$1$1( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); + } + } + } + } + if (vnode.dirs) { + if (false) { + warn$1$1( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root24 = cloneVNode(root24, null, false, true); + root24.dirs = root24.dirs ? root24.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + if (false) { + warn$1$1( + `Component inside renders non-element root node that cannot be animated.` + ); + } + root24.transition = vnode.transition; + } + if (false) { + setRoot(root24); + } else { + result = root24; + } + setCurrentRenderingInstance(prev2); + return result; +} +__name(renderComponentRoot, "renderComponentRoot"); +const getChildRoot = /* @__PURE__ */ __name((vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren, false); + if (!childRoot) { + return [vnode, void 0]; + } else if (false) { + return getChildRoot(childRoot); + } + const index2 = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = /* @__PURE__ */ __name((updatedRoot) => { + rawChildren[index2] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; + } + } + }, "setRoot"); + return [normalizeVNode(childRoot), setRoot]; +}, "getChildRoot"); +function filterSingleRoot(children, recurse = true) { + let singleRoot; + for (let i2 = 0; i2 < children.length; i2++) { + const child = children[i2]; + if (isVNode$1(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + if (false) { + return filterSingleRoot(singleRoot.children); + } + } + } + } else { + return; + } + } + return singleRoot; +} +__name(filterSingleRoot, "filterSingleRoot"); +const getFunctionalFallthrough = /* @__PURE__ */ __name((attrs4) => { + let res; + for (const key in attrs4) { + if (key === "class" || key === "style" || isOn(key)) { + (res || (res = {}))[key] = attrs4[key]; + } + } + return res; +}, "getFunctionalFallthrough"); +const filterModelListeners = /* @__PURE__ */ __name((attrs4, props) => { + const res = {}; + for (const key in attrs4) { + if (!isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs4[key]; + } + } + return res; +}, "filterModelListeners"); +const isElementRoot = /* @__PURE__ */ __name((vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +}, "isElementRoot"); +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if (false) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i2 = 0; i2 < dynamicProps.length; i2++) { + const key = dynamicProps[i2]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +__name(shouldUpdateComponent, "shouldUpdateComponent"); +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i2 = 0; i2 < nextKeys.length; i2++) { + const key = nextKeys[i2]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +__name(hasPropsChanged, "hasPropsChanged"); +function updateHOCHostEl({ vnode, parent }, el) { + while (parent) { + const root24 = parent.subTree; + if (root24.suspense && root24.suspense.activeBranch === vnode) { + root24.el = vnode.el; + } + if (root24 === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } +} +__name(updateHOCHostEl, "updateHOCHostEl"); +const COMPONENTS = "components"; +const DIRECTIVES = "directives"; +function resolveComponent(name2, maybeSelfReference) { + return resolveAsset(COMPONENTS, name2, true, maybeSelfReference) || name2; +} +__name(resolveComponent, "resolveComponent"); +const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (isString$7(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +__name(resolveDynamicComponent, "resolveDynamicComponent"); +function resolveDirective(name2) { + return resolveAsset(DIRECTIVES, name2); +} +__name(resolveDirective, "resolveDirective"); +function resolveAsset(type, name2, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name2 || selfName === camelize$1(name2) || selfName === capitalize$1(camelize$1(name2)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name2) || // global registration + resolve(instance.appContext[type], name2) + ); + if (!res && maybeSelfReference) { + return Component; + } + if (false) { + const extra = type === COMPONENTS ? ` +If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; + warn$1$1(`Failed to resolve ${type.slice(0, -1)}: ${name2}${extra}`); + } + return res; + } else if (false) { + warn$1$1( + `resolve${capitalize$1(type.slice(0, -1))} can only be used in render() or setup().` + ); + } +} +__name(resolveAsset, "resolveAsset"); +function resolve(registry, name2) { + return registry && (registry[name2] || registry[camelize$1(name2)] || registry[capitalize$1(camelize$1(name2))]); +} +__name(resolve, "resolve"); +const isSuspense = /* @__PURE__ */ __name((type) => type.__isSuspense, "isSuspense"); +let suspenseId = 0; +const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } else { + if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { + n2.suspense = n1.suspense; + n2.suspense.vnode = n2; + n2.el = n1.el; + return; + } + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + } + }, + hydrate: hydrateSuspense, + normalize: normalizeSuspenseChildren +}; +const Suspense = SuspenseImpl; +function triggerEvent(vnode, name2) { + const eventListener = vnode.props && vnode.props[name2]; + if (isFunction$4(eventListener)) { + eventListener(); + } +} +__name(triggerEvent, "triggerEvent"); +function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { + const { + p: patch2, + o: { createElement: createElement2 } + } = rendererInternals; + const hiddenContainer = createElement2("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + namespace, + slotScopeIds, + optimized, + rendererInternals + ); + patch2( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch2( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } +} +__name(mountSuspense, "mountSuspense"); +function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch2, um: unmount, o: { createElement: createElement2 } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch2( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + if (!isHydrating) { + patch2( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } + } else { + suspense.pendingId = suspenseId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement2("div"); + if (isInFallback) { + patch2( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch2( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch2( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch2( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch2( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + if (newBranch.shapeFlag & 512) { + suspense.pendingId = newBranch.component.suspenseId; + } else { + suspense.pendingId = suspenseId++; + } + patch2( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + namespace, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } + } + } + } +} +__name(patchSuspense, "patchSuspense"); +let hasWarned$1 = false; +function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + if (false) { + hasWarned$1 = true; + console[console.info ? "info" : "log"]( + ` is an experimental feature and its API will likely change.` + ); + } + const { + p: patch2, + m: move, + um: unmount, + n: next2, + o: { parentNode: parentNode2, remove: remove22 } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } + } + const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; + if (false) { + assertNumber(timeout, `Suspense timeout`); + } + const initialAnchor = anchor; + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + namespace, + container, + hiddenContainer, + deps: 0, + pendingId: suspenseId++, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: !isHydrating, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + if (false) { + if (!resume && !suspense.pendingBranch) { + throw new Error( + `suspense.resolve() is called without a pending branch.` + ); + } + if (suspense.isUnmounted) { + throw new Error( + `suspense.resolve() is called on an already unmounted suspense boundary.` + ); + } + } + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move( + pendingBranch, + container2, + anchor === initialAnchor ? next2(activeBranch) : anchor, + 0 + ); + queuePostFlushCb(effects); + } + }; + } + if (activeBranch) { + if (parentNode2(activeBranch.el) !== suspense.hiddenContainer) { + anchor = next2(activeBranch); + } + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor, 0); + } + } + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; + } + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next2(activeBranch); + const mountFallback = /* @__PURE__ */ __name(() => { + if (!suspense.isInFallback) { + return; + } + patch2( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + namespace2, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, fallbackVNode); + }, "mountFallback"); + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; + } + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove + ); + if (!delayEnter) { + mountFallback(); + } + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next2(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect, optimized2) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; + } + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + if (false) { + pushWarningContext(vnode2); + } + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode2(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next2(instance.subTree), + suspense, + namespace, + optimized2 + ); + if (placeholder) { + remove22(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + if (false) { + popWarningContext(); + } + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); + }, + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + } + }; + return suspense; +} +__name(createSuspenseBoundary, "createSuspenseBoundary"); +function hydrateSuspense(node3, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node3.parentNode, + // eslint-disable-next-line no-restricted-globals + document.createElement("div"), + null, + namespace, + slotScopeIds, + optimized, + rendererInternals, + true + ); + const result = hydrateNode( + node3, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); + } + return result; +} +__name(hydrateSuspense, "hydrateSuspense"); +function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); +} +__name(normalizeSuspenseChildren, "normalizeSuspenseChildren"); +function normalizeSuspenseSlot(s) { + let block3; + if (isFunction$4(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block3 = currentBlock; + closeBlock(); + } + } + if (isArray$4(s)) { + const singleChild = filterSingleRoot(s); + if (false) { + warn$1$1(` slots expect a single root node.`); + } + s = singleChild; + } + s = normalizeVNode(s); + if (block3 && !s.dynamicChildren) { + s.dynamicChildren = block3.filter((c) => c !== s); + } + return s; +} +__name(normalizeSuspenseSlot, "normalizeSuspenseSlot"); +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (isArray$4(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } +} +__name(queueEffectWithSuspense, "queueEffectWithSuspense"); +function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + let el = branch.el; + while (!el && branch.component) { + branch = branch.component.subTree; + el = branch.el; + } + vnode.el = el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); + } +} +__name(setActiveBranch, "setActiveBranch"); +function isVNodeSuspensible(vnode) { + const suspensible = vnode.props && vnode.props.suspensible; + return suspensible != null && suspensible !== false; +} +__name(isVNodeSuspensible, "isVNodeSuspensible"); +function injectHook(type, hook, target = currentInstance, prepend2 = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + pauseTracking(); + const reset2 = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset2(); + resetTracking(); + return res; + }); + if (prepend2) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else if (false) { + const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + warn$1$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` + ); + } +} +__name(injectHook, "injectHook"); +const createHook = /* @__PURE__ */ __name((lifecycle2) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle2 === "sp") { + injectHook(lifecycle2, (...args) => hook(...args), target); + } +}, "createHook"); +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook("bu"); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook("bum"); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook("sp"); +const onRenderTriggered = createHook( + "rtg" +); +const onRenderTracked = createHook( + "rtc" +); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} +__name(onErrorCaptured, "onErrorCaptured"); +function validateDirectiveName(name2) { + if (isBuiltInDirective(name2)) { + warn$1$1("Do not use built-in directive ids as custom directive id: " + name2); + } +} +__name(validateDirectiveName, "validateDirectiveName"); +function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i2 = 0; i2 < directives.length; i2++) { + let [dir, value4, arg, modifiers2 = EMPTY_OBJ] = directives[i2]; + if (dir) { + if (isFunction$4(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value4); + } + bindings.push({ + dir, + instance, + value: value4, + oldValue: void 0, + arg, + modifiers: modifiers2 + }); + } + } + return vnode; +} +__name(withDirectives, "withDirectives"); +function invokeDirectiveHook(vnode, prevVNode, instance, name2) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i2 = 0; i2 < bindings.length; i2++) { + const binding = bindings[i2]; + if (oldBindings) { + binding.oldValue = oldBindings[i2].value; + } + let hook = binding.dir[name2]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } +} +__name(invokeDirectiveHook, "invokeDirectiveHook"); +function renderList(source, renderItem, cache2, index2) { + let ret; + const cached = cache2 && cache2[index2]; + if (isArray$4(source) || isString$7(source)) { + ret = new Array(source.length); + for (let i2 = 0, l = source.length; i2 < l; i2++) { + ret[i2] = renderItem(source[i2], i2, void 0, cached && cached[i2]); + } + } else if (typeof source === "number") { + if (false) { + warn$1$1(`The v-for range expect an integer value but got ${source}.`); + } + ret = new Array(source); + for (let i2 = 0; i2 < source; i2++) { + ret[i2] = renderItem(i2 + 1, i2, void 0, cached && cached[i2]); + } + } else if (isObject$6(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item3, i2) => renderItem(item3, i2, void 0, cached && cached[i2]) + ); + } else { + const keys2 = Object.keys(source); + ret = new Array(keys2.length); + for (let i2 = 0, l = keys2.length; i2 < l; i2++) { + const key = keys2[i2]; + ret[i2] = renderItem(source[key], key, i2, cached && cached[i2]); + } + } + } else { + ret = []; + } + if (cache2) { + cache2[index2] = ret; + } + return ret; +} +__name(renderList, "renderList"); +function createSlots(slots, dynamicSlots) { + for (let i2 = 0; i2 < dynamicSlots.length; i2++) { + const slot = dynamicSlots[i2]; + if (isArray$4(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; +} +__name(createSlots, "createSlots"); +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineComponent(options4, extraOptions) { + return isFunction$4(options4) ? ( + // #8326: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => extend$1({ name: options4.name }, extraOptions, { setup: options4 }))() + ) : options4; +} +__name(defineComponent, "defineComponent"); +const isAsyncWrapper = /* @__PURE__ */ __name((i2) => !!i2.type.__asyncLoader, "isAsyncWrapper"); +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if (isFunction$4(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = /* @__PURE__ */ __name(() => { + retries++; + pendingRequest = null; + return load2(); + }, "retry"); + const load2 = /* @__PURE__ */ __name(() => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve2, reject3) => { + const userRetry = /* @__PURE__ */ __name(() => resolve2(retry()), "userRetry"); + const userFail = /* @__PURE__ */ __name(() => reject3(err), "userFail"); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (false) { + warn$1$1( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if (false) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }, "load"); + return /* @__PURE__ */ defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load2, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = /* @__PURE__ */ __name((err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }, "onError"); + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load2().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = ref(false); + const error2 = ref(); + const delayed = ref(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error2.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error2.value = err; + } + }, timeout); + } + load2().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.effect.dirty = true; + queueJob(instance.parent.update); + } + }).catch((err) => { + onError(err); + error2.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error2.value && errorComponent) { + return createVNode(errorComponent, { + error: error2.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; + } + }); +} +__name(defineAsyncComponent, "defineAsyncComponent"); +function createInnerComp(comp, parent) { + const { ref: ref22, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref22; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} +__name(createInnerComp, "createInnerComp"); +function renderSlot(slots, name2, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { + if (name2 !== "default") props.name = name2; + return createVNode("slot", props, fallback && fallback()); + } + let slot = slots[name2]; + if (false) { + warn$1$1( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` + ); + slot = /* @__PURE__ */ __name(() => [], "slot"); + } + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const rendered = createBlock( + Fragment$1, + { + key: props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key || `_${name2}` + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +__name(renderSlot, "renderSlot"); +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode$1(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment$1 && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} +__name(ensureValidVNode, "ensureValidVNode"); +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if (false) { + warn$1$1(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + } + return ret; +} +__name(toHandlers, "toHandlers"); +const getPublicInstance = /* @__PURE__ */ __name((i2) => { + if (!i2) return null; + if (isStatefulComponent(i2)) return getComponentPublicInstance(i2); + return getPublicInstance(i2.parent); +}, "getPublicInstance"); +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), { + $: /* @__PURE__ */ __name((i2) => i2, "$"), + $el: /* @__PURE__ */ __name((i2) => i2.vnode.el, "$el"), + $data: /* @__PURE__ */ __name((i2) => i2.data, "$data"), + $props: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.props) : i2.props, "$props"), + $attrs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.attrs) : i2.attrs, "$attrs"), + $slots: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.slots) : i2.slots, "$slots"), + $refs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.refs) : i2.refs, "$refs"), + $parent: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.parent), "$parent"), + $root: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.root), "$root"), + $emit: /* @__PURE__ */ __name((i2) => i2.emit, "$emit"), + $options: /* @__PURE__ */ __name((i2) => true ? resolveMergedOptions(i2) : i2.type, "$options"), + $forceUpdate: /* @__PURE__ */ __name((i2) => i2.f || (i2.f = () => { + i2.effect.dirty = true; + queueJob(i2.update); + }), "$forceUpdate"), + $nextTick: /* @__PURE__ */ __name((i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)), "$nextTick"), + $watch: /* @__PURE__ */ __name((i2) => true ? instanceWatch.bind(i2) : NOOP, "$watch") + }) +); +const isReservedPrefix = /* @__PURE__ */ __name((key) => key === "_" || key === "$", "isReservedPrefix"); +const hasSetupBinding = /* @__PURE__ */ __name((state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$3(state, key), "hasSetupBinding"); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data: data24, props, accessCache, type, appContext } = instance; + if (false) { + return true; + } + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1: + return setupState[key]; + case 2: + return data24[key]; + case 4: + return ctx[key]; + case 3: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1; + return setupState[key]; + } else if (data24 !== EMPTY_OBJ && hasOwn$3(data24, key)) { + accessCache[key] = 2; + return data24[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && hasOwn$3(normalizedProps, key) + ) { + accessCache[key] = 3; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) { + accessCache[key] = 4; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance.attrs, "get", ""); + } else if (false) { + track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) { + accessCache[key] = 4; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn$3(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (false) { + if (data24 !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$3(data24, key)) { + warn$1$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value4) { + const { data: data24, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value4; + return true; + } else if (false) { + warn$1$1(`Cannot mutate + + + +
+ + +>>>>>>> 31831e6ef13474b975eee1a94f39078e00b00156:web/index.html diff --git a/comfy/web/scripts/utils.js b/comfy/web/scripts/utils.js index 425d6e2eb..e43f3a8d6 100644 --- a/comfy/web/scripts/utils.js +++ b/comfy/web/scripts/utils.js @@ -3,6 +3,7 @@ export const clone = window.comfyAPI.utils.clone; export const applyTextReplacements = window.comfyAPI.utils.applyTextReplacements; export const addStylesheet = window.comfyAPI.utils.addStylesheet; export const downloadBlob = window.comfyAPI.utils.downloadBlob; +export const uploadFile = window.comfyAPI.utils.uploadFile; export const prop = window.comfyAPI.utils.prop; export const getStorageValue = window.comfyAPI.utils.getStorageValue; export const setStorageValue = window.comfyAPI.utils.setStorageValue; diff --git a/comfy/web/scripts/widgets.js b/comfy/web/scripts/widgets.js index a1385e07c..68b67a392 100644 --- a/comfy/web/scripts/widgets.js +++ b/comfy/web/scripts/widgets.js @@ -1,6 +1,6 @@ // Shim for scripts\widgets.ts export const updateControlWidgetLabel = window.comfyAPI.widgets.updateControlWidgetLabel; +export const IS_CONTROL_WIDGET = window.comfyAPI.widgets.IS_CONTROL_WIDGET; export const addValueControlWidget = window.comfyAPI.widgets.addValueControlWidget; export const addValueControlWidgets = window.comfyAPI.widgets.addValueControlWidgets; -export const initWidgets = window.comfyAPI.widgets.initWidgets; export const ComfyWidgets = window.comfyAPI.widgets.ComfyWidgets; diff --git a/comfy_extras/nodes/nodes_custom_sampler.py b/comfy_extras/nodes/nodes_custom_sampler.py index b5908c012..a3e599f2d 100644 --- a/comfy_extras/nodes/nodes_custom_sampler.py +++ b/comfy_extras/nodes/nodes_custom_sampler.py @@ -235,6 +235,24 @@ class FlipSigmas: sigmas[0] = 0.0001 return (sigmas,) +class SetFirstSigma: + @classmethod + def INPUT_TYPES(s): + return {"required": + {"sigmas": ("SIGMAS", ), + "sigma": ("FLOAT", {"default": 136.0, "min": 0.0, "max": 20000.0, "step": 0.001, "round": False}), + } + } + RETURN_TYPES = ("SIGMAS",) + CATEGORY = "sampling/custom_sampling/sigmas" + + FUNCTION = "set_first_sigma" + + def set_first_sigma(self, sigmas, sigma): + sigmas = sigmas.clone() + sigmas[0] = sigma + return (sigmas, ) + class KSamplerSelect: @classmethod def INPUT_TYPES(s): @@ -714,6 +732,7 @@ NODE_CLASS_MAPPINGS = { "SplitSigmas": SplitSigmas, "SplitSigmasDenoise": SplitSigmasDenoise, "FlipSigmas": FlipSigmas, + "SetFirstSigma": SetFirstSigma, "CFGGuider": CFGGuider, "DualCFGGuider": DualCFGGuider, diff --git a/comfy_extras/nodes/nodes_gits.py b/comfy_extras/nodes/nodes_gits.py index 7bfae4ce6..47b1dd049 100644 --- a/comfy_extras/nodes/nodes_gits.py +++ b/comfy_extras/nodes/nodes_gits.py @@ -162,7 +162,7 @@ NOISE_LEVELS = { [14.61464119, 7.49001646, 5.85520077, 4.45427561, 3.46139455, 2.84484982, 2.19988537, 1.72759056, 1.36964464, 1.08895338, 0.86115354, 0.69515091, 0.54755926, 0.43325692, 0.34370604, 0.25053367, 0.17026083, 0.09824532, 0.02916753], [14.61464119, 11.54541874, 7.49001646, 5.85520077, 4.45427561, 3.46139455, 2.84484982, 2.19988537, 1.72759056, 1.36964464, 1.08895338, 0.86115354, 0.69515091, 0.54755926, 0.43325692, 0.34370604, 0.25053367, 0.17026083, 0.09824532, 0.02916753], [14.61464119, 11.54541874, 7.49001646, 5.85520077, 4.45427561, 3.46139455, 2.84484982, 2.19988537, 1.72759056, 1.36964464, 1.08895338, 0.89115214, 0.72133851, 0.59516323, 0.4783645, 0.38853383, 0.29807833, 0.22545385, 0.17026083, 0.09824532, 0.02916753], - ], + ], 1.15: [ [14.61464119, 0.83188516, 0.02916753], [14.61464119, 1.84880662, 0.59516323, 0.02916753], @@ -246,7 +246,7 @@ NOISE_LEVELS = { [14.61464119, 5.85520077, 2.84484982, 1.72759056, 1.162866, 0.83188516, 0.64427125, 0.52423614, 0.43325692, 0.36617002, 0.32104823, 0.27464288, 0.25053367, 0.22545385, 0.19894916, 0.17026083, 0.13792117, 0.09824532, 0.02916753], [14.61464119, 5.85520077, 2.84484982, 1.78698075, 1.24153244, 0.92192322, 0.72133851, 0.57119018, 0.45573691, 0.38853383, 0.34370604, 0.29807833, 0.27464288, 0.25053367, 0.22545385, 0.19894916, 0.17026083, 0.13792117, 0.09824532, 0.02916753], [14.61464119, 5.85520077, 2.84484982, 1.78698075, 1.24153244, 0.92192322, 0.72133851, 0.57119018, 0.4783645, 0.41087446, 0.36617002, 0.32104823, 0.29807833, 0.27464288, 0.25053367, 0.22545385, 0.19894916, 0.17026083, 0.13792117, 0.09824532, 0.02916753], - ], + ], 1.35: [ [14.61464119, 0.69515091, 0.02916753], [14.61464119, 0.95350921, 0.34370604, 0.02916753], diff --git a/comfy_extras/nodes/nodes_hooks.py b/comfy_extras/nodes/nodes_hooks.py index 334d78753..356a200b5 100644 --- a/comfy_extras/nodes/nodes_hooks.py +++ b/comfy_extras/nodes/nodes_hooks.py @@ -1,6 +1,5 @@ from __future__ import annotations -import logging from typing import TYPE_CHECKING, Union import logging import torch @@ -38,7 +37,7 @@ class PairConditioningSetProperties: "timesteps": ("TIMESTEPS_RANGE",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("CONDITIONING", "CONDITIONING") RETURN_NAMES = ("positive", "negative") @@ -52,7 +51,7 @@ class PairConditioningSetProperties: strength=strength, set_cond_area=set_cond_area, mask=mask, hooks=hooks, timesteps_range=timesteps) return (final_positive, final_negative) - + class PairConditioningSetPropertiesAndCombine: NodeId = 'PairConditioningSetPropertiesAndCombine' NodeName = 'Cond Pair Set Props Combine' @@ -73,7 +72,7 @@ class PairConditioningSetPropertiesAndCombine: "timesteps": ("TIMESTEPS_RANGE",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("CONDITIONING", "CONDITIONING") RETURN_NAMES = ("positive", "negative") @@ -164,7 +163,7 @@ class PairConditioningCombine: "negative_B": ("CONDITIONING",), }, } - + EXPERIMENTAL = True RETURN_TYPES = ("CONDITIONING", "CONDITIONING") RETURN_NAMES = ("positive", "negative") @@ -191,7 +190,7 @@ class PairConditioningSetDefaultAndCombine: "hooks": ("HOOKS",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("CONDITIONING", "CONDITIONING") RETURN_NAMES = ("positive", "negative") @@ -203,7 +202,7 @@ class PairConditioningSetDefaultAndCombine: final_positive, final_negative = comfy.hooks.set_default_conds_and_combine(conds=[positive, negative], new_conds=[positive_DEFAULT, negative_DEFAULT], hooks=hooks) return (final_positive, final_negative) - + class ConditioningSetDefaultAndCombine: NodeId = 'ConditioningSetDefaultCombine' NodeName = 'Cond Set Default Combine' @@ -229,7 +228,7 @@ class ConditioningSetDefaultAndCombine: (final_conditioning,) = comfy.hooks.set_default_conds_and_combine(conds=[cond], new_conds=[cond_DEFAULT], hooks=hooks) return (final_conditioning,) - + class SetClipHooks: NodeId = 'SetClipHooks' NodeName = 'Set CLIP Hooks' @@ -245,13 +244,13 @@ class SetClipHooks: "hooks": ("HOOKS",) } } - + EXPERIMENTAL = True RETURN_TYPES = ("CLIP",) CATEGORY = "advanced/hooks/clip" FUNCTION = "apply_hooks" - def apply_hooks(self, clip: 'CLIP', schedule_clip: bool, apply_to_conds: bool, hooks: comfy.hooks.HookGroup=None): + def apply_hooks(self, clip: CLIP, schedule_clip: bool, apply_to_conds: bool, hooks: comfy.hooks.HookGroup=None): if hooks is not None: clip = clip.clone() if apply_to_conds: @@ -260,7 +259,7 @@ class SetClipHooks: clip.use_clip_schedule = schedule_clip if not clip.use_clip_schedule: clip.patcher.forced_hooks.set_keyframes_on_hooks(None) - clip.patcher.register_all_hook_patches(hooks.get_dict_repr(), comfy.hooks.EnumWeightTarget.Clip) + clip.patcher.register_all_hook_patches(hooks, comfy.hooks.create_target_dict(comfy.hooks.EnumWeightTarget.Clip)) return (clip,) class ConditioningTimestepsRange: @@ -274,7 +273,7 @@ class ConditioningTimestepsRange: "end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001}) }, } - + EXPERIMENTAL = True RETURN_TYPES = ("TIMESTEPS_RANGE", "TIMESTEPS_RANGE", "TIMESTEPS_RANGE") RETURN_NAMES = ("TIMESTEPS_RANGE", "BEFORE_RANGE", "AFTER_RANGE") @@ -295,7 +294,7 @@ class CreateHookLora: NodeName = 'Create Hook LoRA' def __init__(self): self.loaded_lora = None - + @classmethod def INPUT_TYPES(s): return { @@ -308,7 +307,7 @@ class CreateHookLora: "prev_hooks": ("HOOKS",) } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/create" @@ -321,7 +320,7 @@ class CreateHookLora: if strength_model == 0 and strength_clip == 0: return (prev_hooks,) - + lora_path = get_or_download("loras", lora_name) lora = None if self.loaded_lora is not None: @@ -331,7 +330,7 @@ class CreateHookLora: temp = self.loaded_lora self.loaded_lora = None del temp - + if lora is None: lora = comfy.utils.load_torch_file(lora_path, safe_load=True) self.loaded_lora = (lora_path, lora) @@ -353,7 +352,7 @@ class CreateHookLoraModelOnly(CreateHookLora): "prev_hooks": ("HOOKS",) } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/create" @@ -383,7 +382,7 @@ class CreateHookModelAsLora: "prev_hooks": ("HOOKS",) } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/create" @@ -406,7 +405,7 @@ class CreateHookModelAsLora: temp = self.loaded_weights self.loaded_weights = None del temp - + if weights_model is None: out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings")) weights_model = comfy.hooks.get_patch_weights_from_model(out[0]) @@ -431,7 +430,7 @@ class CreateHookModelAsLoraModelOnly(CreateHookModelAsLora): "prev_hooks": ("HOOKS",) } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/create" @@ -460,7 +459,7 @@ class SetHookKeyframes: "hook_kf": ("HOOK_KEYFRAMES",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/scheduling" @@ -486,7 +485,7 @@ class CreateHookKeyframe: "prev_hook_kf": ("HOOK_KEYFRAMES",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOK_KEYFRAMES",) RETURN_NAMES = ("HOOK_KF",) @@ -520,7 +519,7 @@ class CreateHookKeyframesInterpolated: "prev_hook_kf": ("HOOK_KEYFRAMES",), }, } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOK_KEYFRAMES",) RETURN_NAMES = ("HOOK_KF",) @@ -564,7 +563,7 @@ class CreateHookKeyframesFromFloats: "prev_hook_kf": ("HOOK_KEYFRAMES",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOK_KEYFRAMES",) RETURN_NAMES = ("HOOK_KF",) @@ -585,7 +584,7 @@ class CreateHookKeyframesFromFloats: raise Exception(f"floats_strength must be either an iterable input or a float, but was{type(floats_strength).__repr__}.") percents = comfy.hooks.InterpolationMethod.get_weights(num_from=start_percent, num_to=end_percent, length=len(floats_strength), method=comfy.hooks.InterpolationMethod.LINEAR) - + is_first = True for percent, strength in zip(percents, floats_strength): guarantee_steps = 0 @@ -609,7 +608,7 @@ class SetModelHooksOnCond: "hooks": ("HOOKS",), }, } - + EXPERIMENTAL = True RETURN_TYPES = ("CONDITIONING",) CATEGORY = "advanced/hooks/manual" @@ -635,7 +634,7 @@ class CombineHooks: "hooks_B": ("HOOKS",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/combine" @@ -662,7 +661,7 @@ class CombineHooksFour: "hooks_D": ("HOOKS",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/combine" @@ -695,7 +694,7 @@ class CombineHooksEight: "hooks_H": ("HOOKS",), } } - + EXPERIMENTAL = True RETURN_TYPES = ("HOOKS",) CATEGORY = "advanced/hooks/combine" diff --git a/comfy_extras/nodes/nodes_load_3d.py b/comfy_extras/nodes/nodes_load_3d.py index 17ec49a7b..2c8d2783f 100644 --- a/comfy_extras/nodes/nodes_load_3d.py +++ b/comfy_extras/nodes/nodes_load_3d.py @@ -29,6 +29,7 @@ class Load3D(): "bg_color": ("STRING", {"default": "#000000", "multiline": False}), "light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}), "up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],), + "fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}), }} RETURN_TYPES = ("IMAGE", "MASK", "STRING") @@ -40,13 +41,22 @@ class Load3D(): CATEGORY = "3d" def process(self, model_file, image, **kwargs): - imagepath = folder_paths.get_annotated_filepath(image) + if isinstance(image, dict): + image_path = folder_paths.get_annotated_filepath(image['image']) + mask_path = folder_paths.get_annotated_filepath(image['mask']) - load_image_node = nodes.LoadImage() + load_image_node = nodes.LoadImage() + output_image, ignore_mask = load_image_node.load_image(image=image_path) + ignore_image, output_mask = load_image_node.load_image(image=mask_path) - output_image, output_mask = load_image_node.load_image(image=imagepath) - - return output_image, output_mask, model_file, + return output_image, output_mask, model_file, + else: + # to avoid the format is not dict which will happen the FE code is not compatibility to core, + # we need to this to double-check, it can be removed after merged FE into the core + image_path = folder_paths.get_annotated_filepath(image) + load_image_node = nodes.LoadImage() + output_image, output_mask = load_image_node.load_image(image=image_path) + return output_image, output_mask, model_file, class Load3DAnimation(): @@ -71,6 +81,7 @@ class Load3DAnimation(): "light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}), "up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],), "animation_speed": (["0.1", "0.5", "1", "1.5", "2"], {"default": "1"}), + "fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}), }} RETURN_TYPES = ("IMAGE", "MASK", "STRING") @@ -82,13 +93,20 @@ class Load3DAnimation(): CATEGORY = "3d" def process(self, model_file, image, **kwargs): - imagepath = folder_paths.get_annotated_filepath(image) + if isinstance(image, dict): + image_path = folder_paths.get_annotated_filepath(image['image']) + mask_path = folder_paths.get_annotated_filepath(image['mask']) - load_image_node = nodes.LoadImage() + load_image_node = nodes.LoadImage() + output_image, ignore_mask = load_image_node.load_image(image=image_path) + ignore_image, output_mask = load_image_node.load_image(image=mask_path) - output_image, output_mask = load_image_node.load_image(image=imagepath) - - return output_image, output_mask, model_file, + return output_image, output_mask, model_file, + else: + image_path = folder_paths.get_annotated_filepath(image) + load_image_node = nodes.LoadImage() + output_image, output_mask = load_image_node.load_image(image=image_path) + return output_image, output_mask, model_file, class Preview3D(): @@ -103,6 +121,7 @@ class Preview3D(): "bg_color": ("STRING", {"default": "#000000", "multiline": False}), "light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}), "up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],), + "fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}), }} OUTPUT_NODE = True diff --git a/comfy_extras/nodes/nodes_model_advanced.py b/comfy_extras/nodes/nodes_model_advanced.py index 1dc4f5353..a9ae4992a 100644 --- a/comfy_extras/nodes/nodes_model_advanced.py +++ b/comfy_extras/nodes/nodes_model_advanced.py @@ -195,7 +195,7 @@ class ModelSamplingContinuousEDM: @classmethod def INPUT_TYPES(s): return {"required": { "model": ("MODEL",), - "sampling": (["v_prediction", "edm_playground_v2.5", "eps"],), + "sampling": (["v_prediction", "edm", "edm_playground_v2.5", "eps"],), "sigma_max": ("FLOAT", {"default": 120.0, "min": 0.0, "max": 1000.0, "step":0.001, "round": False}), "sigma_min": ("FLOAT", {"default": 0.002, "min": 0.0, "max": 1000.0, "step":0.001, "round": False}), }} @@ -213,6 +213,9 @@ class ModelSamplingContinuousEDM: sampling_type = comfy.model_sampling.EPS if sampling == "eps": sampling_type = comfy.model_sampling.EPS + elif sampling == "edm": + sampling_type = comfy.model_sampling.EDM + sigma_data = 0.5 elif sampling == "v_prediction": sampling_type = comfy.model_sampling.V_PREDICTION elif sampling == "edm_playground_v2.5": diff --git a/comfy_extras/nodes/nodes_morphology.py b/comfy_extras/nodes/nodes_morphology.py index 071521d87..b1372b8ce 100644 --- a/comfy_extras/nodes/nodes_morphology.py +++ b/comfy_extras/nodes/nodes_morphology.py @@ -46,4 +46,4 @@ NODE_CLASS_MAPPINGS = { NODE_DISPLAY_NAME_MAPPINGS = { "Morphology": "ImageMorphology", -} \ No newline at end of file +} diff --git a/comfy_extras/nodes_cosmos.py b/comfy_extras/nodes_cosmos.py new file mode 100644 index 000000000..bd35ddb06 --- /dev/null +++ b/comfy_extras/nodes_cosmos.py @@ -0,0 +1,82 @@ +import nodes +import torch +import comfy.model_management +import comfy.utils + + +class EmptyCosmosLatentVideo: + @classmethod + def INPUT_TYPES(s): + return {"required": { "width": ("INT", {"default": 1280, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}), + "height": ("INT", {"default": 704, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}), + "length": ("INT", {"default": 121, "min": 1, "max": nodes.MAX_RESOLUTION, "step": 8}), + "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096})}} + RETURN_TYPES = ("LATENT",) + FUNCTION = "generate" + + CATEGORY = "latent/video" + + def generate(self, width, height, length, batch_size=1): + latent = torch.zeros([batch_size, 16, ((length - 1) // 8) + 1, height // 8, width // 8], device=comfy.model_management.intermediate_device()) + return ({"samples": latent}, ) + + +def vae_encode_with_padding(vae, image, width, height, length, padding=0): + pixels = comfy.utils.common_upscale(image[..., :3].movedim(-1, 1), width, height, "bilinear", "center").movedim(1, -1) + pixel_len = min(pixels.shape[0], length) + padded_length = min(length, (((pixel_len - 1) // 8) + 1 + padding) * 8 - 7) + padded_pixels = torch.ones((padded_length, height, width, 3)) * 0.5 + padded_pixels[:pixel_len] = pixels[:pixel_len] + latent_len = ((pixel_len - 1) // 8) + 1 + latent_temp = vae.encode(padded_pixels) + return latent_temp[:, :, :latent_len] + + +class CosmosImageToVideoLatent: + @classmethod + def INPUT_TYPES(s): + return {"required": {"vae": ("VAE", ), + "width": ("INT", {"default": 1280, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}), + "height": ("INT", {"default": 704, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}), + "length": ("INT", {"default": 121, "min": 1, "max": nodes.MAX_RESOLUTION, "step": 8}), + "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096}), + }, + "optional": {"start_image": ("IMAGE", ), + "end_image": ("IMAGE", ), + }} + + + RETURN_TYPES = ("LATENT",) + FUNCTION = "encode" + + CATEGORY = "conditioning/inpaint" + + def encode(self, vae, width, height, length, batch_size, start_image=None, end_image=None): + latent = torch.zeros([1, 16, ((length - 1) // 8) + 1, height // 8, width // 8], device=comfy.model_management.intermediate_device()) + if start_image is None and end_image is None: + out_latent = {} + out_latent["samples"] = latent + return (out_latent,) + + mask = torch.ones([latent.shape[0], 1, ((length - 1) // 8) + 1, latent.shape[-2], latent.shape[-1]], device=comfy.model_management.intermediate_device()) + + if start_image is not None: + latent_temp = vae_encode_with_padding(vae, start_image, width, height, length, padding=1) + latent[:, :, :latent_temp.shape[-3]] = latent_temp + mask[:, :, :latent_temp.shape[-3]] *= 0.0 + + if end_image is not None: + latent_temp = vae_encode_with_padding(vae, end_image, width, height, length, padding=0) + latent[:, :, -latent_temp.shape[-3]:] = latent_temp + mask[:, :, -latent_temp.shape[-3]:] *= 0.0 + + out_latent = {} + out_latent["samples"] = latent.repeat((batch_size, ) + (1,) * (latent.ndim - 1)) + out_latent["noise_mask"] = mask.repeat((batch_size, ) + (1,) * (mask.ndim - 1)) + return (out_latent,) + + +NODE_CLASS_MAPPINGS = { + "EmptyCosmosLatentVideo": EmptyCosmosLatentVideo, + "CosmosImageToVideoLatent": CosmosImageToVideoLatent, +} diff --git a/comfyui_version.py b/comfyui_version.py new file mode 100644 index 000000000..7cccc7535 --- /dev/null +++ b/comfyui_version.py @@ -0,0 +1,3 @@ +# This file is automatically generated by the build process when version is +# updated in pyproject.toml. +__version__ = "0.3.10" diff --git a/pyproject.toml b/pyproject.toml index d745a98df..b1d65e755 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,17 @@ [build-system] requires = ["setuptools", "wheel", "pip"] build-backend = "setuptools.build_meta" + +# [project] section omitted deliberately to prevent UV from installing using pyproject.toml + +[tool.ruff] +lint.select = [ + "S307", # suspicious-eval-usage + "S102", # exec + "T", # print-usage + "W", + # The "F" series in Ruff stands for "Pyflakes" rules, which catch various Python syntax errors and undefined names. + # See all rules here: https://docs.astral.sh/ruff/rules/#pyflakes-f + "F", +] +exclude = ["*.ipynb"] diff --git a/requirements.txt b/requirements.txt index eca6407f7..bc32316d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ torch torchvision torchdiffeq>=0.2.3 torchsde>=0.2.6 +numpy>=1.25.0 einops>=0.6.0 open-clip-torch>=2.24.0 transformers>=4.29.1 @@ -53,7 +54,7 @@ opentelemetry-semantic-conventions wrapt>=1.16.0 certifi spandrel>=0.3.4 -numpy>=1.24.4,<2.0.0 +numpy>=1.24.4 soundfile watchdog PySoundFile diff --git a/ruff.toml b/ruff.toml deleted file mode 100644 index c354505f8..000000000 --- a/ruff.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Disable all rules by default -lint.ignore = ["ALL"] - -# Enable specific rules -lint.select = [ - "S307", # suspicious-eval-usage - "T201", # print-usage - # The "F" series in Ruff stands for "Pyflakes" rules, which catch various Python syntax errors and undefined names. - # See all rules here: https://docs.astral.sh/ruff/rules/#pyflakes-f - "F", -] - -exclude = ["*.ipynb"] diff --git a/tests-unit/utils/extra_config_test.py b/tests-unit/utils/extra_config_test.py new file mode 100644 index 000000000..b23f5bd08 --- /dev/null +++ b/tests-unit/utils/extra_config_test.py @@ -0,0 +1,303 @@ +import pytest +import yaml +import os +import sys +from unittest.mock import Mock, patch, mock_open + +from utils.extra_config import load_extra_path_config +import folder_paths + + +@pytest.fixture() +def clear_folder_paths(): + # Clear the global dictionary before each test to ensure isolation + original = folder_paths.folder_names_and_paths.copy() + folder_paths.folder_names_and_paths.clear() + yield + folder_paths.folder_names_and_paths = original + + +@pytest.fixture +def mock_yaml_content(): + return { + 'test_config': { + 'base_path': '~/App/', + 'checkpoints': 'subfolder1', + } + } + + +@pytest.fixture +def mock_expanded_home(): + return '/home/user' + + +@pytest.fixture +def yaml_config_with_appdata(): + return """ + test_config: + base_path: '%APPDATA%/ComfyUI' + checkpoints: 'models/checkpoints' + """ + + +@pytest.fixture +def mock_yaml_content_appdata(yaml_config_with_appdata): + return yaml.safe_load(yaml_config_with_appdata) + + +@pytest.fixture +def mock_expandvars_appdata(): + mock = Mock() + + def expandvars(path): + if '%APPDATA%' in path: + if sys.platform == 'win32': + return path.replace('%APPDATA%', 'C:/Users/TestUser/AppData/Roaming') + else: + return path.replace('%APPDATA%', '/Users/TestUser/AppData/Roaming') + return path + + mock.side_effect = expandvars + return mock + + +@pytest.fixture +def mock_add_model_folder_path(): + return Mock() + + +@pytest.fixture +def mock_expanduser(mock_expanded_home): + def _expanduser(path): + if path.startswith('~/'): + return os.path.join(mock_expanded_home, path[2:]) + return path + return _expanduser + + +@pytest.fixture +def mock_yaml_safe_load(mock_yaml_content): + return Mock(return_value=mock_yaml_content) + + +@patch('builtins.open', new_callable=mock_open, read_data="dummy file content") +def test_load_extra_model_paths_expands_userpath( + mock_file, + monkeypatch, + mock_add_model_folder_path, + mock_expanduser, + mock_yaml_safe_load, + mock_expanded_home +): + # Attach mocks used by load_extra_path_config + monkeypatch.setattr(folder_paths, 'add_model_folder_path', mock_add_model_folder_path) + monkeypatch.setattr(os.path, 'expanduser', mock_expanduser) + monkeypatch.setattr(yaml, 'safe_load', mock_yaml_safe_load) + + dummy_yaml_file_name = 'dummy_path.yaml' + load_extra_path_config(dummy_yaml_file_name) + + expected_calls = [ + ('checkpoints', os.path.join(mock_expanded_home, 'App', 'subfolder1'), False), + ] + + assert mock_add_model_folder_path.call_count == len(expected_calls) + + # Check if add_model_folder_path was called with the correct arguments + for actual_call, expected_call in zip(mock_add_model_folder_path.call_args_list, expected_calls): + assert actual_call.args[0] == expected_call[0] + assert os.path.normpath(actual_call.args[1]) == os.path.normpath(expected_call[1]) # Normalize and check the path to check on multiple OS. + assert actual_call.args[2] == expected_call[2] + + # Check if yaml.safe_load was called + mock_yaml_safe_load.assert_called_once() + + # Check if open was called with the correct file path + mock_file.assert_called_once_with(dummy_yaml_file_name, 'r') + + +@patch('builtins.open', new_callable=mock_open) +def test_load_extra_model_paths_expands_appdata( + mock_file, + monkeypatch, + mock_add_model_folder_path, + mock_expandvars_appdata, + yaml_config_with_appdata, + mock_yaml_content_appdata +): + # Set the mock_file to return yaml with appdata as a variable + mock_file.return_value.read.return_value = yaml_config_with_appdata + + # Attach mocks + monkeypatch.setattr(folder_paths, 'add_model_folder_path', mock_add_model_folder_path) + monkeypatch.setattr(os.path, 'expandvars', mock_expandvars_appdata) + monkeypatch.setattr(yaml, 'safe_load', Mock(return_value=mock_yaml_content_appdata)) + + # Mock expanduser to do nothing (since we're not testing it here) + monkeypatch.setattr(os.path, 'expanduser', lambda x: x) + + dummy_yaml_file_name = 'dummy_path.yaml' + load_extra_path_config(dummy_yaml_file_name) + + if sys.platform == "win32": + expected_base_path = 'C:/Users/TestUser/AppData/Roaming/ComfyUI' + else: + expected_base_path = '/Users/TestUser/AppData/Roaming/ComfyUI' + expected_calls = [ + ('checkpoints', os.path.join(expected_base_path, 'models/checkpoints'), False), + ] + + assert mock_add_model_folder_path.call_count == len(expected_calls) + + # Check the base path variable was expanded + for actual_call, expected_call in zip(mock_add_model_folder_path.call_args_list, expected_calls): + assert actual_call.args == expected_call + + # Verify that expandvars was called + assert mock_expandvars_appdata.called + + +@patch("builtins.open", new_callable=mock_open, read_data="dummy yaml content") +@patch("yaml.safe_load") +def test_load_extra_path_config_relative_base_path( + mock_yaml_load, _mock_file, clear_folder_paths, monkeypatch, tmp_path +): + """ + Test that when 'base_path' is a relative path in the YAML, it is joined to the YAML file directory, and then + the items in the config are correctly converted to absolute paths. + """ + sub_folder = "./my_rel_base" + config_data = { + "some_model_folder": { + "base_path": sub_folder, + "is_default": True, + "checkpoints": "checkpoints", + "some_key": "some_value" + } + } + mock_yaml_load.return_value = config_data + + dummy_yaml_name = "dummy_file.yaml" + + def fake_abspath(path): + if path == dummy_yaml_name: + # If it's the YAML path, treat it like it lives in tmp_path + return os.path.join(str(tmp_path), dummy_yaml_name) + return os.path.join(str(tmp_path), path) # Otherwise, do a normal join relative to tmp_path + + def fake_dirname(path): + # We expect path to be the result of fake_abspath(dummy_yaml_name) + if path.endswith(dummy_yaml_name): + return str(tmp_path) + return os.path.dirname(path) + + monkeypatch.setattr(os.path, "abspath", fake_abspath) + monkeypatch.setattr(os.path, "dirname", fake_dirname) + + load_extra_path_config(dummy_yaml_name) + + expected_checkpoints = os.path.abspath(os.path.join(str(tmp_path), sub_folder, "checkpoints")) + expected_some_value = os.path.abspath(os.path.join(str(tmp_path), sub_folder, "some_value")) + + actual_paths = folder_paths.folder_names_and_paths["checkpoints"][0] + assert len(actual_paths) == 1, "Should have one path added for 'checkpoints'." + assert actual_paths[0] == expected_checkpoints + + actual_paths = folder_paths.folder_names_and_paths["some_key"][0] + assert len(actual_paths) == 1, "Should have one path added for 'some_key'." + assert actual_paths[0] == expected_some_value + + +@patch("builtins.open", new_callable=mock_open, read_data="dummy yaml content") +@patch("yaml.safe_load") +def test_load_extra_path_config_absolute_base_path( + mock_yaml_load, _mock_file, clear_folder_paths, monkeypatch, tmp_path +): + """ + Test that when 'base_path' is an absolute path, each subdirectory is joined with that absolute path, + rather than being relative to the YAML's directory. + """ + abs_base = os.path.join(str(tmp_path), "abs_base") + config_data = { + "some_absolute_folder": { + "base_path": abs_base, # <-- absolute + "is_default": True, + "loras": "loras_folder", + "embeddings": "embeddings_folder" + } + } + mock_yaml_load.return_value = config_data + + dummy_yaml_name = "dummy_abs.yaml" + + def fake_abspath(path): + if path == dummy_yaml_name: + # If it's the YAML path, treat it like it is in tmp_path + return os.path.join(str(tmp_path), dummy_yaml_name) + return path # For absolute base, we just return path directly + + def fake_dirname(path): + return str(tmp_path) if path.endswith(dummy_yaml_name) else os.path.dirname(path) + + monkeypatch.setattr(os.path, "abspath", fake_abspath) + monkeypatch.setattr(os.path, "dirname", fake_dirname) + + load_extra_path_config(dummy_yaml_name) + + # Expect the final paths to be /loras_folder and /embeddings_folder + expected_loras = os.path.join(abs_base, "loras_folder") + expected_embeddings = os.path.join(abs_base, "embeddings_folder") + + actual_loras = folder_paths.folder_names_and_paths["loras"][0] + assert len(actual_loras) == 1, "Should have one path for 'loras'." + assert actual_loras[0] == os.path.abspath(expected_loras) + + actual_embeddings = folder_paths.folder_names_and_paths["embeddings"][0] + assert len(actual_embeddings) == 1, "Should have one path for 'embeddings'." + assert actual_embeddings[0] == os.path.abspath(expected_embeddings) + + +@patch("builtins.open", new_callable=mock_open, read_data="dummy yaml content") +@patch("yaml.safe_load") +def test_load_extra_path_config_no_base_path( + mock_yaml_load, _mock_file, clear_folder_paths, monkeypatch, tmp_path +): + """ + Test that if 'base_path' is not present, each path is joined + with the directory of the YAML file (unless it's already absolute). + """ + config_data = { + "some_folder_without_base": { + "is_default": True, + "text_encoders": "clip", + "diffusion_models": "unet" + } + } + mock_yaml_load.return_value = config_data + + dummy_yaml_name = "dummy_no_base.yaml" + + def fake_abspath(path): + if path == dummy_yaml_name: + return os.path.join(str(tmp_path), dummy_yaml_name) + return os.path.join(str(tmp_path), path) + + def fake_dirname(path): + return str(tmp_path) if path.endswith(dummy_yaml_name) else os.path.dirname(path) + + monkeypatch.setattr(os.path, "abspath", fake_abspath) + monkeypatch.setattr(os.path, "dirname", fake_dirname) + + load_extra_path_config(dummy_yaml_name) + + expected_clip = os.path.join(str(tmp_path), "clip") + expected_unet = os.path.join(str(tmp_path), "unet") + + actual_text_encoders = folder_paths.folder_names_and_paths["text_encoders"][0] + assert len(actual_text_encoders) == 1, "Should have one path for 'text_encoders'." + assert actual_text_encoders[0] == os.path.abspath(expected_clip) + + actual_diffusion = folder_paths.folder_names_and_paths["diffusion_models"][0] + assert len(actual_diffusion) == 1, "Should have one path for 'diffusion_models'." + assert actual_diffusion[0] == os.path.abspath(expected_unet) diff --git a/tests/inference/testing_pack/specific_tests.py b/tests/inference/testing_pack/specific_tests.py index d411d29c9..f87838b9e 100644 --- a/tests/inference/testing_pack/specific_tests.py +++ b/tests/inference/testing_pack/specific_tests.py @@ -87,7 +87,7 @@ class TestCustomIsChanged: def custom_is_changed(self, image, should_change=False): return (image,) - + @classmethod def IS_CHANGED(cls, should_change=False, *args, **kwargs): if should_change: @@ -112,7 +112,7 @@ class TestIsChangedWithConstants: def custom_is_changed(self, image, value): return (image * value,) - + @classmethod def IS_CHANGED(cls, image, value): if image is None: diff --git a/tests/inference/testing_pack/util.py b/tests/inference/testing_pack/util.py index 17b727d1b..1a3fca0c9 100644 --- a/tests/inference/testing_pack/util.py +++ b/tests/inference/testing_pack/util.py @@ -145,7 +145,7 @@ class TestAccumulationGetLengthNode: def accumlength(self, accumulation): return (len(accumulation['accum']),) - + @VariantSupport() class TestAccumulationGetItemNode: def __init__(self): @@ -168,7 +168,7 @@ class TestAccumulationGetItemNode: def get_item(self, accumulation, index): return (accumulation['accum'][index],) - + @VariantSupport() class TestAccumulationSetItemNode: def __init__(self): diff --git a/tests/unit/app_test/custom_node_manager_test.py b/tests/unit/app_test/custom_node_manager_test.py new file mode 100644 index 000000000..89598de84 --- /dev/null +++ b/tests/unit/app_test/custom_node_manager_test.py @@ -0,0 +1,40 @@ +import pytest +from aiohttp import web +from unittest.mock import patch +from app.custom_node_manager import CustomNodeManager + +pytestmark = ( + pytest.mark.asyncio +) # This applies the asyncio mark to all test functions in the module + +@pytest.fixture +def custom_node_manager(): + return CustomNodeManager() + +@pytest.fixture +def app(custom_node_manager): + app = web.Application() + routes = web.RouteTableDef() + custom_node_manager.add_routes(routes, app, [("ComfyUI-TestExtension1", "ComfyUI-TestExtension1")]) + app.add_routes(routes) + return app + +async def test_get_workflow_templates(aiohttp_client, app, tmp_path): + client = await aiohttp_client(app) + # Setup temporary custom nodes file structure with 1 workflow file + custom_nodes_dir = tmp_path / "custom_nodes" + example_workflows_dir = custom_nodes_dir / "ComfyUI-TestExtension1" / "example_workflows" + example_workflows_dir.mkdir(parents=True) + template_file = example_workflows_dir / "workflow1.json" + template_file.write_text('') + + with patch('folder_paths.folder_names_and_paths', { + 'custom_nodes': ([str(custom_nodes_dir)], None) + }): + response = await client.get('/workflow_templates') + assert response.status == 200 + workflows_dict = await response.json() + assert isinstance(workflows_dict, dict) + assert "ComfyUI-TestExtension1" in workflows_dict + assert isinstance(workflows_dict["ComfyUI-TestExtension1"], list) + assert workflows_dict["ComfyUI-TestExtension1"][0] == "workflow1" diff --git a/tests/unit/comfy_test/folder_path_test.py b/tests/unit/comfy_test/folder_path_test.py index 442f55433..d7a21d7ef 100644 --- a/tests/unit/comfy_test/folder_path_test.py +++ b/tests/unit/comfy_test/folder_path_test.py @@ -19,6 +19,7 @@ def clear_folder_paths(): with context_folder_names_and_paths(FolderNames()): yield + @pytest.fixture def temp_dir(): with tempfile.TemporaryDirectory() as tmpdirname: @@ -84,7 +85,7 @@ def test_get_filename_list(temp_dir): base_path = Path(temp_dir) fn = FolderNames(base_paths=[base_path]) rel_path = Path("test/path") - fn.add(ModelPaths(["test_folder"], additional_relative_directory_paths={rel_path}, supported_extensions={".txt"})) + fn.add(ModelPaths(["test_folder"], additional_relative_directory_paths=[rel_path], supported_extensions={".txt"})) dir_path = base_path / rel_path Path.mkdir(dir_path, parents=True, exist_ok=True) files = ["file1.txt", "file2.jpg"] diff --git a/tests/unit/server/utils/file_operations_test.py b/tests/unit/server/utils/file_operations_test.py index 14cac65d1..911dc5f7f 100644 --- a/tests/unit/server/utils/file_operations_test.py +++ b/tests/unit/server/utils/file_operations_test.py @@ -16,18 +16,18 @@ def temp_directory(tmp_path): def test_walk_directory(temp_directory): result: List[FileSystemItem] = FileSystemOperations.walk_directory(str(temp_directory)) - + assert len(result) == 5 # 2 directories and 3 files - + files = [item for item in result if item['type'] == 'file'] dirs = [item for item in result if item['type'] == 'directory'] - + assert len(files) == 3 assert len(dirs) == 2 - + file_names = {file['name'] for file in files} assert file_names == {'file1.txt', 'file2.txt', 'file3.txt'} - + dir_names = {dir['name'] for dir in dirs} assert dir_names == {'dir1', 'dir2'}