Files
nc-talk-ai/js/BotForm-S-ACeDfi.chunk.mjs
T
Pascal Kienast 0739d3da6a Initial open-source release of Talk AI
Talk AI is a multi-bot AI assistant manager for Nextcloud Talk:
per-bot prompts and models, agentic tool calling (MCP + built-in
tools), RAG over Nextcloud files, room-document search, vision and
speech-to-text attachments, persistent bot wikis, approval workflows,
rate limiting, and multi-provider LLM support (any OpenAI-compatible
endpoint).

Developed within EDUC - the European Digital UniverCity
(https://educalliance.eu), where it runs as the 'EDUC AI' assistant on
the alliance-wide Nextcloud portal. This public repository is the
upstream point of truth; deployment-specific tools plug in via the
tool-provider extension point (docs/TOOL_PROVIDERS.md).

License: AGPL-3.0-or-later.
2026-07-08 21:13:13 +02:00

90 lines
193 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('educai', '', 'js/index-BMbtc3xh-BhmZIV9M.chunk.mjs'),window.OC.filePath('educai', '', 'js/branding-cqWE0Otc.chunk.mjs')])))=>i.map(i=>d[i]);
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`/*!
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/.toastify.dialogs{min-width:200px;background:none;background-color:var(--color-main-background);color:var(--color-main-text);box-shadow:0 0 6px 0 var(--color-box-shadow);padding:0 12px;margin-top:45px;position:fixed;z-index:10100;border-radius:var(--border-radius);display:flex;align-items:center;min-height:50px}.toastify.dialogs .toast-loader-container,.toastify.dialogs .toast-undo-container{display:flex;align-items:center;width:100%}.toastify.dialogs .toast-undo-button,.toastify.dialogs .toast-close{position:static;overflow:hidden;box-sizing:border-box;min-width:44px;height:100%;padding:12px;white-space:nowrap;background-repeat:no-repeat;background-position:center;background-color:transparent;min-height:0}.toastify.dialogs .toast-undo-button.toast-close,.toastify.dialogs .toast-close.toast-close{text-indent:0;opacity:.4;border:none;min-height:44px;margin-left:10px;font-size:0}.toastify.dialogs .toast-undo-button.toast-close:before,.toastify.dialogs .toast-close.toast-close:before{background-image:url("data:image/svg+xml,%3csvg%20viewBox='0%200%2016%2016'%20height='16'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2'%3e%3cpath%20d='M6.4%2019%205%2017.6l5.6-5.6L5%206.4%206.4%205l5.6%205.6L17.6%205%2019%206.4%2013.4%2012l5.6%205.6-1.4%201.4-5.6-5.6L6.4%2019Z'%20style='fill-rule:nonzero'%20transform='matrix(.85714%200%200%20.85714%20-2.286%20-2.286)'/%3e%3c/svg%3e");content:" ";filter:var(--background-invert-if-dark);display:inline-block;width:16px;height:16px}.toastify.dialogs .toast-undo-button.toast-undo-button,.toastify.dialogs .toast-close.toast-undo-button{height:calc(100% - 6px);margin:3px 3px 3px 12px}.toastify.dialogs .toast-undo-button:hover,.toastify.dialogs .toast-undo-button:focus,.toastify.dialogs .toast-undo-button:active,.toastify.dialogs .toast-close:hover,.toastify.dialogs .toast-close:focus,.toastify.dialogs .toast-close:active{cursor:pointer;opacity:1}.toastify.dialogs.toastify-top{right:10px}.toastify.dialogs.toast-with-click{cursor:pointer}.toastify.dialogs.toast-error{border-left:3px solid var(--color-element-error, var(--color-error))}.toastify.dialogs.toast-info{border-left:3px solid var(--color-element-info, var(--color-primary))}.toastify.dialogs.toast-warning{border-left:3px solid var(--color-element-warning, var(--color-warning))}.toastify.dialogs.toast-success,.toastify.dialogs.toast-undo{border-left:3px solid var(--color-element-success, var(--color-success))}.toastify.dialogs.toast-loading{border-left:3px solid var(--color-element-info, var(--color-primary))}.toastify.dialogs.toast-loading .toast-loader{display:inline-block;width:20px;height:20px;animation:rotate var(--animation-duration, .8s) linear infinite;margin-left:auto}.theme--dark .toastify.dialogs .toast-close.toast-close:before{background-image:url("data:image/svg+xml,%3csvg%20viewBox='0%200%2016%2016'%20height='16'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2'%3e%3cpath%20d='M6.4%2019%205%2017.6l5.6-5.6L5%206.4%206.4%205l5.6%205.6L17.6%205%2019%206.4%2013.4%2012l5.6%205.6-1.4%201.4-5.6-5.6L6.4%2019Z'%20style='fill:%23fff;fill-rule:nonzero'%20transform='matrix(.85714%200%200%20.85714%20-2.286%20-2.286)'/%3e%3c/svg%3e")}.nc-generic-dialog .dialog__actions{justify-content:space-between;min-width:calc(100% - 12px)}/*!
* SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/._file-picker__file-icon_3v9zx_9{position:relative;width:32px;height:32px;min-width:32px;min-height:32px;background-repeat:no-repeat;background-size:contain;display:flex;justify-content:center}._file-picker__file-icon--primary_3v9zx_21{color:var(--color-primary-element)}._file-picker__file-icon-overlay_3v9zx_25{color:var(--color-primary-element-text);position:absolute;inset-block-start:10px}tr.file-picker__row[data-v-15187afc]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-15187afc]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-15187afc]{padding:0 2px}tr.file-picker__row td[data-v-15187afc]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-15187afc]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-15187afc]{padding-inline:2px 0}@keyframes gradient-15187afc{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}.loading-row .row-checkbox[data-v-15187afc]{text-align:center!important}.loading-row span[data-v-15187afc]{display:inline-block;height:24px;background:linear-gradient(to right,var(--color-background-darker),var(--color-text-maxcontrast),var(--color-background-darker));background-size:600px 100%;border-radius:var(--border-radius);animation:gradient-15187afc 12s ease infinite}.loading-row .row-wrapper[data-v-15187afc]{display:inline-flex;align-items:center}.loading-row .row-checkbox span[data-v-15187afc]{width:24px}.loading-row .row-name span[data-v-15187afc]:last-of-type{margin-inline-start:6px;width:130px}.loading-row .row-size span[data-v-15187afc]{width:80px}.loading-row .row-modified span[data-v-15187afc]{width:90px}/*!
* SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/tr.file-picker__row[data-v-82f380c9]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-82f380c9]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-82f380c9]{padding:0 2px}tr.file-picker__row td[data-v-82f380c9]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-82f380c9]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-82f380c9]{padding-inline:2px 0}.file-picker__row *[data-v-82f380c9]{cursor:pointer}.file-picker__row--selected[data-v-82f380c9]{background-color:var(--color-background-dark)}.file-picker__row--not-navigatable[data-v-82f380c9]{filter:saturate(.7);opacity:.7}.file-picker__row--not-navigatable *[data-v-82f380c9],.file-picker__row--not-pickable *[data-v-82f380c9]{cursor:default!important}.file-picker__row[data-v-82f380c9]:hover{background-color:var(--color-background-hover)}.file-picker__name-container[data-v-82f380c9]{display:flex;justify-content:start;align-items:center;height:100%}.file-picker__file-name[data-v-82f380c9]{padding-inline-start:6px;min-width:0;overflow:hidden;text-overflow:ellipsis}.file-picker__file-extension[data-v-82f380c9]{color:var(--color-text-maxcontrast);min-width:fit-content}.file-picker__header-preview[data-v-6503afab]{width:22px;height:32px;flex:0 0 auto}.file-picker__files[data-v-6503afab]{margin:2px;margin-inline-start:12px;overflow:scroll auto}.file-picker__files table[data-v-6503afab]{width:100%;max-height:100%;table-layout:fixed}.file-picker__files th[data-v-6503afab]{position:sticky;z-index:1;top:0;background-color:var(--color-main-background);padding:2px}.file-picker__files th .header-wrapper[data-v-6503afab]{display:flex}.file-picker__files th.row-checkbox[data-v-6503afab]{width:44px}.file-picker__files th.row-name[data-v-6503afab]{width:230px}.file-picker__files th.row-size[data-v-6503afab]{width:100px}.file-picker__files th.row-modified[data-v-6503afab]{width:120px}.file-picker__files th[data-v-6503afab]:not(.row-size) .button-vue__wrapper{justify-content:start;flex-direction:row-reverse}.file-picker__files th[data-v-6503afab]:not(.row-size) .button-vue{padding-inline:16px 4px}.file-picker__files th.row-size[data-v-6503afab] .button-vue__wrapper{justify-content:end}.file-picker__files th[data-v-6503afab] .button-vue__wrapper{color:var(--color-text-maxcontrast)}.file-picker__files th[data-v-6503afab] .button-vue__wrapper .button-vue__text{font-weight:400}.file-picker__breadcrumbs[data-v-1a8cb0b2]{flex-grow:0!important}.file-picker__side[data-v-f5975252]{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;min-width:200px;padding:2px;margin-block-start:7px;overflow:auto}.file-picker__side[data-v-f5975252] .button-vue__wrapper{justify-content:start}.file-picker__filter-input[data-v-f5975252]{margin-block:7px;max-width:260px}@media(max-width:736px){.file-picker__side[data-v-f5975252]{flex-direction:row;min-width:unset}}@media(max-width:512px){.file-picker__side[data-v-f5975252]{flex-direction:row;min-width:unset}.file-picker__filter-input[data-v-f5975252]{max-width:unset}}.file-picker__navigation{padding-inline:8px 2px}.file-picker__navigation,.file-picker__navigation *{box-sizing:border-box}.file-picker__navigation .v-select.select{min-width:220px}@media(min-width:513px)and (max-width:736px){.file-picker__navigation{gap:11px}}@media(max-width:512px){.file-picker__navigation{flex-direction:column-reverse!important}}.file-picker__view[data-v-dda9b42b]{height:50px;display:flex;justify-content:start;align-items:center}.file-picker__view h3[data-v-dda9b42b]{font-weight:700;height:fit-content;margin:0}.file-picker__main[data-v-dda9b42b]{box-sizing:border-box;width:100%;display:flex;flex-direction:column;min-height:0;flex:1;padding-inline:2px}.file-picker__main *[data-v-dda9b42b]{box-sizing:border-box}[data-v-dda9b42b] .file-picker{height:min(80vh,800px)!important}@media(max-width:512px){[data-v-dda9b42b] .file-picker{height:calc(100% - 16px - var(--default-clickable-area))!important}}[data-v-dda9b42b] .file-picker__content{display:flex;flex-direction:column;overflow:hidden}.public-auth-prompt__text[data-v-a2f36bdb]{font-size:1.25em;margin-block:0 calc(3 * var(--default-grid-baseline))}.public-auth-prompt__header[data-v-a2f36bdb]{margin-block:0 calc(3 * var(--default-grid-baseline))}.public-auth-prompt__header[data-v-a2f36bdb]:first-child{margin-top:0}.public-auth-prompt__input[data-v-a2f36bdb]{margin-block:calc(4 * var(--default-grid-baseline)) calc(2 * var(--default-grid-baseline))}.material-design-icon[data-v-06c9abdc]{display:flex;align-self:center;justify-self:center;align-items:center;justify-content:center}.progress-bar[data-v-06c9abdc]{display:block;height:var(--progress-bar-height);--progress-bar-color: var(--15a054de)}.progress-bar--linear[data-v-06c9abdc]{width:100%;overflow:hidden;border:0;padding:0;background:var(--color-background-dark);border-radius:calc(var(--progress-bar-height) / 2)}.progress-bar--linear[data-v-06c9abdc]::-webkit-progress-bar{height:var(--progress-bar-height);background-color:transparent}.progress-bar--linear[data-v-06c9abdc]::-webkit-progress-value{background:var(--progress-bar-color, var(--gradient-primary-background));border-radius:calc(var(--progress-bar-height) / 2)}.progress-bar--linear[data-v-06c9abdc]::-moz-progress-bar{background:var(--progress-bar-color, var(--gradient-primary-background));border-radius:calc(var(--progress-bar-height) / 2)}.progress-bar--circular[data-v-06c9abdc]{width:var(--progress-bar-height);color:var(--progress-bar-color, var(--color-primary-element))}.progress-bar--error[data-v-06c9abdc]{color:var(--color-text-error, var(--color-error))!important}.progress-bar--error[data-v-06c9abdc]::-moz-progress-bar{background:var(--color-text-error, var(--color-error))!important}.progress-bar--error[data-v-06c9abdc]::-webkit-progress-value{background:var(--color-text-error, var(--color-error))!important}.modal-mask[data-v-9677cc70]{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;align-items:center;justify-content:center}.modal-container[data-v-9677cc70]{background:var(--color-main-background);border-radius:8px;box-shadow:0 2px 8px #00000054;max-width:600px;width:90%;max-height:90vh;overflow-y:auto}.modal-header[data-v-9677cc70]{padding:20px;border-bottom:1px solid var(--color-border);display:flex;justify-content:space-between;align-items:center}.modal-header h2[data-v-9677cc70]{margin:0;font-size:20px}.close-button[data-v-9677cc70]{background:none;border:none;cursor:pointer;padding:8px;font-size:20px;opacity:.7}.close-button[data-v-9677cc70]:hover{opacity:1}.modal-body[data-v-9677cc70]{padding:20px}.form-group[data-v-9677cc70]{margin-bottom:20px}.form-group label[data-v-9677cc70]{display:block;margin-bottom:6px;font-weight:600}.form-group input[data-v-9677cc70],.form-group textarea[data-v-9677cc70],.form-group select[data-v-9677cc70]{width:100%;padding:10px;border:1px solid var(--color-border);border-radius:3px;font-family:inherit;font-size:14px}.form-group input[data-v-9677cc70]:focus,.form-group textarea[data-v-9677cc70]:focus{outline:none;border-color:var(--color-primary)}.form-group textarea[data-v-9677cc70]{resize:vertical;min-height:120px}.input-group[data-v-9677cc70]{display:flex;align-items:center}.input-group .prefix[data-v-9677cc70]{padding:10px 12px;background:var(--color-background-dark);border:1px solid var(--color-border);border-right:none;border-radius:3px 0 0 3px;font-weight:600}.input-group input[data-v-9677cc70]{border-radius:0 3px 3px 0}#group-select[data-v-9677cc70],#team-select[data-v-9677cc70]{min-height:140px}.hint[data-v-9677cc70]{margin:6px 0 0;font-size:13px;color:var(--color-text-lighter)}.form-actions[data-v-9677cc70]{display:flex;gap:10px;justify-content:flex-end;margin-top:24px}.button[data-v-9677cc70]{padding:10px 20px;border:1px solid var(--color-border);background:var(--color-main-background);border-radius:3px;cursor:pointer;font-size:14px}.button[data-v-9677cc70]:hover{background:var(--color-background-hover)}.button.primary[data-v-9677cc70]{background-color:var(--color-primary);color:#fff;border-color:var(--color-primary)}.button.primary[data-v-9677cc70]:hover{background-color:var(--color-primary-element-light)}.form-group label.checkbox[data-v-9677cc70]{display:inline-flex;align-items:center;gap:8px}.form-group label.checkbox input[type=checkbox][data-v-9677cc70]{width:16px;height:16px;margin:0;vertical-align:middle}.section-divider[data-v-9677cc70]{margin:24px 0;border:none;border-top:1px solid var(--color-border);height:0;background:transparent}.rag-source-panel[data-v-9677cc70]{display:flex;flex-direction:column;gap:12px;margin-top:12px}.rag-actions[data-v-9677cc70]{display:flex;justify-content:flex-start;gap:10px}.personal-wiki-section[data-v-9677cc70]{display:flex;flex-direction:column;gap:8px}.wiki-path-panel[data-v-9677cc70]{margin-top:4px}.wiki-path-panel code[data-v-9677cc70]{word-break:break-all}.advanced-settings[data-v-9677cc70]{margin-top:10px}.advanced-settings summary[data-v-9677cc70]{cursor:pointer;color:var(--color-primary);font-weight:600}.advanced-settings .form-group.compact[data-v-9677cc70]{margin-top:10px;margin-bottom:0}.source-list[data-v-9677cc70]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:12px}.source-item[data-v-9677cc70]{border:1px solid var(--color-border);border-radius:6px;padding:12px;background:var(--color-background-dark)}.source-main[data-v-9677cc70]{display:flex;justify-content:space-between;align-items:center;gap:12px}.source-path[data-v-9677cc70]{font-weight:600;word-break:break-all}.status-pill[data-v-9677cc70]{padding:2px 10px;border-radius:12px;font-size:12px;font-weight:600;text-transform:uppercase}.status-ready[data-v-9677cc70]{background:var(--color-success);color:#000}.status-pending[data-v-9677cc70]{background:var(--color-warning);color:#000}.status-error[data-v-9677cc70]{background:var(--color-error);color:#fff}.source-meta[data-v-9677cc70]{font-size:12px;color:var(--color-text-lighter);margin-top:6px}.source-meta.source-error[data-v-9677cc70]{color:var(--color-error)}.source-actions[data-v-9677cc70]{display:flex;gap:8px;margin-top:10px}.button.subtle[data-v-9677cc70]{border-color:var(--color-border);background:var(--color-main-background)}.button.subtle[data-v-9677cc70]:hover{background:var(--color-background-hover)}.tool-list[data-v-9677cc70]{display:flex;flex-direction:column;gap:12px;margin-top:12px}.tool-row[data-v-9677cc70]{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--color-border);border-radius:6px;background:var(--color-background-dark)}.tool-row--disabled[data-v-9677cc70]{opacity:.65;background:var(--color-background-hover)}.tool-row input[type=checkbox][data-v-9677cc70]{margin-top:4px}.tool-info[data-v-9677cc70]{display:flex;flex-direction:column;gap:4px}.tool-name[data-v-9677cc70]{font-weight:600;display:flex;align-items:center;gap:8px}.tool-badge[data-v-9677cc70]{padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600;text-transform:uppercase}.tool-badge.builtin[data-v-9677cc70]{background:var(--color-primary-element-light);color:var(--color-primary-element-dark)}.tool-description[data-v-9677cc70]{font-size:13px;color:var(--color-text-lighter)}.tool-unavailable[data-v-9677cc70]{color:var(--color-error)}.tool-endpoint[data-v-9677cc70]{font-size:12px;color:var(--color-text-lighter);word-break:break-all}.hint.muted[data-v-9677cc70]{color:var(--color-text-lighter)}.source-progress[data-v-9677cc70]{margin-top:10px;display:flex;flex-direction:column;gap:6px}.progress-container[data-v-9677cc70],.progress-container[data-v-9677cc70] .progress-bar{width:100%}.progress-label[data-v-9677cc70]{font-size:12px;color:var(--color-text-lighter);display:flex;align-items:center;gap:4px}.source-actions .button[data-v-9677cc70]:disabled{opacity:.5;cursor:not-allowed}.url-modal-overlay[data-v-9677cc70]{position:fixed;z-index:10000;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;align-items:center;justify-content:center}.url-modal[data-v-9677cc70]{background:var(--color-main-background);border-radius:8px;box-shadow:0 4px 16px #0000004d;max-width:500px;width:90%}.url-modal-header[data-v-9677cc70]{padding:16px 20px;border-bottom:1px solid var(--color-border);display:flex;justify-content:space-between;align-items:center}.url-modal-header h3[data-v-9677cc70]{margin:0;font-size:18px}.url-modal-body[data-v-9677cc70]{padding:20px}.url-modal-body .form-group[data-v-9677cc70]{margin-bottom:0}.url-modal-footer[data-v-9677cc70]{padding:16px 20px;border-top:1px solid var(--color-border);display:flex;gap:10px;justify-content:flex-end}.source-type-icon[data-v-9677cc70]{display:inline-flex;align-items:center;margin-right:6px;color:var(--color-text-lighter)}.source-type-icon.url-icon[data-v-9677cc70]:before{content:"🔗";font-size:14px}.source-type-icon.file-icon[data-v-9677cc70]:before{content:"📄";font-size:14px}.source-type-icon.folder-icon[data-v-9677cc70]:before{content:"📁";font-size:14px}.approval-notice[data-v-9677cc70]{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:10px 14px;background:var(--color-warning-light, #fff3cd);border:1px solid var(--color-warning);border-radius:6px;font-size:13px;color:var(--color-warning-text, #856404)}.approval-notice .icon-info[data-v-9677cc70]{flex-shrink:0;margin-top:2px}.pending-changes-notice[data-v-9677cc70]{display:flex;align-items:flex-start;gap:12px;margin-bottom:20px;padding:14px 16px;background:var(--color-primary-element-light, #e8f4fd);border:1px solid var(--color-primary-element, #0082c9);border-radius:8px;font-size:13px;color:var(--color-main-text)}.pending-changes-notice .icon-info[data-v-9677cc70]{flex-shrink:0;margin-top:2px;color:var(--color-primary-element, #0082c9)}.pending-changes-notice .notice-content[data-v-9677cc70]{flex:1}.pending-changes-notice .notice-content strong[data-v-9677cc70]{display:block;margin-bottom:4px;color:var(--color-primary-element, #0082c9)}.pending-changes-notice .notice-content p[data-v-9677cc70]{margin:0;color:var(--color-text-lighter)}.onboarding-empty[data-v-9677cc70]{padding:20px;text-align:center;background:var(--color-background-dark);border-radius:8px;margin-top:12px}.onboarding-empty p[data-v-9677cc70]{margin:0 0 12px;color:var(--color-text-lighter)}.onboarding-questions-list[data-v-9677cc70]{display:flex;flex-direction:column;gap:16px;margin-top:12px}.onboarding-question-card[data-v-9677cc70]{border:1px solid var(--color-border);border-radius:8px;background:var(--color-background-dark);overflow:hidden}.question-header[data-v-9677cc70]{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--color-background-hover);border-bottom:1px solid var(--color-border)}.question-badge[data-v-9677cc70]{background:var(--color-primary-element);color:#fff;padding:2px 8px;border-radius:4px;font-size:12px;font-weight:600}.question-id[data-v-9677cc70]{color:var(--color-text-lighter);font-size:12px;font-family:monospace}.question-header .button[data-v-9677cc70]{margin-left:auto}.question-body[data-v-9677cc70]{padding:14px}.question-body .form-group.compact[data-v-9677cc70]{margin-bottom:14px}.question-body .form-group.compact label[data-v-9677cc70]{font-size:12px;margin-bottom:4px}.answers-grid[data-v-9677cc70]{display:flex;flex-direction:column;gap:8px}.answer-row[data-v-9677cc70]{display:flex;align-items:center;gap:8px}.answer-label[data-v-9677cc70]{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background:var(--color-primary-element-light);color:var(--color-primary-element);border-radius:50%;font-size:12px;font-weight:600;flex-shrink:0}input.answer-text[data-v-9677cc70]{flex:1;min-width:0;width:auto;padding:8px 10px;border:1px solid var(--color-border);border-radius:4px;font-size:14px}input.answer-text.free-text[data-v-9677cc70]:disabled{background:var(--color-background-dark);color:var(--color-text-lighter);font-style:italic}select.answer-next[data-v-9677cc70]{width:160px;flex:0 0 160px;padding:8px;border:1px solid var(--color-border);border-radius:4px;font-size:13px;background:var(--color-main-background)}.add-answer-btn[data-v-9677cc70]{margin-top:8px;align-self:flex-start}.button.small[data-v-9677cc70]{padding:4px 10px;font-size:12px}.temperature-field[data-v-9677cc70]{display:flex;flex-direction:column;gap:8px;margin-top:10px}.temperature-readonly[data-v-9677cc70]{margin-top:10px;padding:10px 12px;border:1px solid var(--color-border);border-radius:6px;background:var(--color-background-dark);font-size:14px}.inline-error[data-v-9677cc70]{margin:0;color:var(--color-error);font-size:13px;font-weight:600}.onboarding-error[data-v-9677cc70]{margin-top:12px;padding:10px 14px;background:var(--color-error-light, #fdecea);border:1px solid color-mix(in srgb,var(--color-error, #b91c1c) 65%,#000 35%);border-radius:6px;font-size:13px;color:var(--color-main-text, #111);font-weight:600}`)),document.head.appendChild(a)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
import{V as Hn,z as Yn,B as ct,C as Zn,D as Lt,E as Nt,F as Xn,H as he,I as Kn,J as Jn,g as ti,K as ei,n as ni,b as q,c as G,a as Q,s as Dt,W as $e}from"./branding-cqWE0Otc.chunk.mjs";const ii="modulepreload",si=function(t,e){return new URL(t,e).href},Ie={},ri=function(t,e,n){let i=Promise.resolve();if(e&&e.length>0){let r=function(c){return Promise.all(c.map(l=>Promise.resolve(l).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");i=r(e.map(c=>{if(c=si(c,n),c in Ie)return;Ie[c]=!0;const l=c.endsWith(".css"),p=l?'[rel="stylesheet"]':"";if(n)for(let m=o.length-1;m>=0;m--){const f=o[m];if(f.href===c&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${p}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":ii,l||(h.as="script"),h.crossOrigin="",h.href=c,u&&h.setAttribute("nonce",u),document.head.appendChild(h),l)return new Promise((m,f)=>{h.addEventListener("load",m),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(r){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r}return i.then(r=>{for(const o of r||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};function oi(t){return t&&t.split("/").map(encodeURIComponent).join("/")}function de(t,e){return t=t.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/.*\//,""),t}function St(t){t=t.replaceAll(/\\/g,"/");const e=t.split("/");return e.length<=1?".":(e.pop(),e.length===1&&e[0]===""?"/":e.join("/"))}function ai(t){const e=de(t),n=e.lastIndexOf(".");return n>0?e.substring(n):""}function li(...t){if(arguments.length<1)return"";const e=t.filter(u=>u.length>0);if(e.length<1)return"";const n=e[e.length-1],i=e[0].charAt(0)==="/",s=n.charAt(n.length-1)==="/",r=e.reduce((u,c)=>u.concat(c.split("/")),[]);let o=!i;const a=r.reduce((u,c)=>c===""?u:o?(o=!1,u+c):u+"/"+c,"");return s?a+"/":a}function ui(t,e={},n={},i=()=>{}){typeof n=="function"&&(i=n,n={});let{container:s}=n;"container"in e&&typeof e.container=="string"&&(s??=e.container);const r=(typeof s=="string"&&document.querySelector(s)||document.body).appendChild(document.createElement("div")),o=new Hn({el:r,name:"VueDialogHelper",render:a=>a(t,{props:{container:null,...e},on:{close:(...u)=>{i(...u.map(c=>Yn(c))),o.$destroy(),r.remove()}}})});return o}const ci='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-move" viewBox="0 0 24 24"><path d="M14,18V15H10V11H14V8L19,13M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z" /></svg>',hi='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-multiple" viewBox="0 0 24 24"><path d="M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z" /></svg>';var gn=(t=>(t[t.Choose=1]="Choose",t[t.Move=2]="Move",t[t.Copy=3]="Copy",t[t.CopyMove=4]="CopyMove",t[t.Custom=5]="Custom",t))(gn||{});class di extends Error{}class pi{title;multiSelect;mimeTypeFilter;directoriesAllowed;buttons;path;filter;canPick;container;disabledNavigation;constructor(e,n,i,s,r,o,a,u,c,l=!1){this.title=e,this.multiSelect=n,this.mimeTypeFilter=i,this.directoriesAllowed=s,this.path=o,this.filter=a,this.canPick=u,this.buttons=r,this.container=c,this.disabledNavigation=l}async pickNodes(){const{FilePickerVue:e}=await ri(async()=>{const{FilePickerVue:n}=await import("./index-BMbtc3xh-BhmZIV9M.chunk.mjs");return{FilePickerVue:n}},__vite__mapDeps([0,1]),import.meta.url);return new Promise((n,i)=>{ui(e,{allowPickDirectory:this.directoriesAllowed,buttons:this.buttons,container:this.container,name:this.title,path:this.path,mimetypeFilter:this.mimeTypeFilter,multiselect:this.multiSelect,filterFn:this.filter,canPickFn:this.canPick,disabledNavigation:this.disabledNavigation},(...s)=>{const[r]=s;!Array.isArray(r)||r.length===0?i(new di("FilePicker: No nodes selected")):n(r)})})}async pick(){const e=await this.pickNodes();return this.multiSelect?e.map(n=>n.path):e[0]?.path??"/"}}class fi{title;multiSelect=!1;mimeTypeFilter=[];directoriesAllowed=!1;path;filter;canPick;buttons=[];container;disabledNavigation=!1;constructor(e){this.title=e}setContainer(e){return this.container=e,this}setMultiSelect(e){return this.multiSelect=e,this}addMimeTypeFilter(e){return this.mimeTypeFilter.push(e),this}setMimeTypeFilter(e){return this.mimeTypeFilter=e,this}addButton(e){return typeof this.buttons=="function"&&(console.warn("FilePicker buttons were set to factory, now overwritten with button object."),this.buttons=[]),this.buttons.push(e),this}setButtonFactory(e){return this.buttons=e,this}setType(e){return this.buttons=(n,i)=>{const s=[],r=n[0]?.displayname||de(i);if(e===1){let o=ct("Choose");n.length===1?o=ct("Choose {file}",{file:r}):this.multiSelect&&(o=Zn("Choose %n file","Choose %n files",n.length)),s.push({callback:()=>{},type:"primary",label:o})}return(e===4||e===3)&&s.push({callback:()=>{},label:r?ct("Copy to {target}",{target:r}):ct("Copy"),icon:hi,variant:e===3?"primary":"secondary"}),(e===4||e===2)&&s.push({callback:()=>{},label:r?ct("Move to {target}",{target:r}):ct("Move"),icon:ci,variant:"primary"}),s},this}allowDirectories(e=!0){return this.directoriesAllowed=e,this}startAt(e){return this.path=e,this}setFilter(e){return this.filter=e,this}setCanPick(e){return this.canPick=e,this}disableNavigation(){return this.disabledNavigation=!0,this}build(){return new pi(this.title,this.multiSelect,this.mimeTypeFilter,this.directoriesAllowed,this.buttons,this.path,this.filter,this.canPick,this.container,this.disabledNavigation)}}function mi(t){return new fi(t)}function vn(t,e,n){const i=`#initial-state-${t}-${e}`;if(window._nc_initial_state?.has(i))return window._nc_initial_state.get(i);window._nc_initial_state||(window._nc_initial_state=new Map);const s=document.querySelector(i);if(s===null)return n;try{const r=JSON.parse(atob(s.value));return window._nc_initial_state.set(i,r),r}catch(r){return console.error("[@nextcloud/initial-state] Could not parse initial state",{key:e,app:t,error:r}),n}}function pe(){return vn("files_sharing","isPublic",null)??document.querySelector('input#isPublic[type="hidden"][name="isPublic"][value="1"]')!==null}function gi(){return vn("files_sharing","sharingToken",null)??document.querySelector('input#sharingToken[type="hidden"]')?.value??null}const vi=t=>"/remote.php/"+t,bi=(t,e)=>yi()+vi(t),yi=()=>window.location.protocol+"//"+window.location.host+wi();function wi(){let t=window._oc_webroot;if(typeof t>"u"){t=location.pathname;const e=t.indexOf("/index.php/");if(e!==-1)t=t.slice(0,e);else{const n=t.indexOf("/",1);t=t.slice(0,n>0?n:void 0)}}return t}function it(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Le(t,e,n){_i(t,e),e.set(t,n)}function _i(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function L(t,e){var n=bn(t,e,"get");return xi(t,n)}function xi(t,e){return e.get?e.get.call(t):e.value}function je(t,e,n){var i=bn(t,e,"set");return Ei(t,i,n),n}function bn(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ei(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Ci=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",j=new WeakMap,wt=new WeakMap;class Vt{constructor(e){var{executor:n=()=>{},internals:i=me(),promise:s=new Promise((r,o)=>n(r,o,a=>{i.onCancelList.push(a)}))}=e;Le(this,j,{writable:!0,value:void 0}),Le(this,wt,{writable:!0,value:void 0}),it(this,Ci,"CancelablePromise"),this.cancel=this.cancel.bind(this),je(this,j,i),je(this,wt,s||new Promise((r,o)=>n(r,o,a=>{i.onCancelList.push(a)})))}then(e,n){return jt(L(this,wt).then(Ot(e,L(this,j)),Ot(n,L(this,j))),L(this,j))}catch(e){return jt(L(this,wt).catch(Ot(e,L(this,j))),L(this,j))}finally(e,n){return n&&L(this,j).onCancelList.push(e),jt(L(this,wt).finally(Ot(()=>{if(e)return n&&(L(this,j).onCancelList=L(this,j).onCancelList.filter(i=>i!==e)),e()},L(this,j))),L(this,j))}cancel(){L(this,j).isCanceled=!0;var e=L(this,j).onCancelList;L(this,j).onCancelList=[];for(var n of e)if(typeof n=="function")try{n()}catch(i){console.error(i)}}isCanceled(){return L(this,j).isCanceled===!0}}class J extends Vt{constructor(e){super({executor:e})}}it(J,"all",function(t){return $t(t,Promise.all(t))}),it(J,"allSettled",function(t){return $t(t,Promise.allSettled(t))}),it(J,"any",function(t){return $t(t,Promise.any(t))}),it(J,"race",function(t){return $t(t,Promise.race(t))}),it(J,"resolve",function(t){return We(Promise.resolve(t))}),it(J,"reject",function(t){return We(Promise.reject(t))}),it(J,"isCancelable",fe);function We(t){return jt(t,me())}function fe(t){return t instanceof J||t instanceof Vt}function Ot(t,e){if(t)return n=>{if(!e.isCanceled){var i=t(n);return fe(i)&&e.onCancelList.push(i.cancel),i}return n}}function jt(t,e){return new Vt({internals:e,promise:t})}function $t(t,e){var n=me();return n.onCancelList.push(()=>{for(var i of t)fe(i)&&i.cancel()}),new Vt({internals:n,promise:e})}function me(){return{isCanceled:!1,onCancelList:[]}}var Qt={},ki={2:t=>{function e(s,r,o){s instanceof RegExp&&(s=n(s,o)),r instanceof RegExp&&(r=n(r,o));var a=i(s,r,o);return a&&{start:a[0],end:a[1],pre:o.slice(0,a[0]),body:o.slice(a[0]+s.length,a[1]),post:o.slice(a[1]+r.length)}}function n(s,r){var o=r.match(s);return o?o[0]:null}function i(s,r,o){var a,u,c,l,p,h=o.indexOf(s),m=o.indexOf(r,h+1),f=h;if(h>=0&&m>0){for(a=[],c=o.length;f>=0&&!p;)f==h?(a.push(f),h=o.indexOf(s,f+1)):a.length==1?p=[a.pop(),m]:((u=a.pop())<c&&(c=u,l=m),m=o.indexOf(r,f+1)),f=h<m&&h>=0?h:m;a.length&&(p=[c,l])}return p}t.exports=e,e.range=i},47:(t,e,n)=>{var i=n(410),s=function(c){return typeof c=="string"};function r(c,l){for(var p=[],h=0;h<c.length;h++){var m=c[h];m&&m!=="."&&(m===".."?p.length&&p[p.length-1]!==".."?p.pop():l&&p.push(".."):p.push(m))}return p}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function u(c){return o.exec(c).slice(1)}a.resolve=function(){for(var c="",l=!1,p=arguments.length-1;p>=-1&&!l;p--){var h=p>=0?arguments[p]:Lt.cwd();if(!s(h))throw new TypeError("Arguments to path.resolve must be strings");h&&(c=h+"/"+c,l=h.charAt(0)==="/")}return(l?"/":"")+(c=r(c.split("/"),!l).join("/"))||"."},a.normalize=function(c){var l=a.isAbsolute(c),p=c.substr(-1)==="/";return(c=r(c.split("/"),!l).join("/"))||l||(c="."),c&&p&&(c+="/"),(l?"/":"")+c},a.isAbsolute=function(c){return c.charAt(0)==="/"},a.join=function(){for(var c="",l=0;l<arguments.length;l++){var p=arguments[l];if(!s(p))throw new TypeError("Arguments to path.join must be strings");p&&(c+=c?"/"+p:p)}return a.normalize(c)},a.relative=function(c,l){function p(v){for(var y=0;y<v.length&&v[y]==="";y++);for(var w=v.length-1;w>=0&&v[w]==="";w--);return y>w?[]:v.slice(y,w+1)}c=a.resolve(c).substr(1),l=a.resolve(l).substr(1);for(var h=p(c.split("/")),m=p(l.split("/")),f=Math.min(h.length,m.length),d=f,g=0;g<f;g++)if(h[g]!==m[g]){d=g;break}var b=[];for(g=d;g<h.length;g++)b.push("..");return(b=b.concat(m.slice(d))).join("/")},a._makeLong=function(c){return c},a.dirname=function(c){var l=u(c),p=l[0],h=l[1];return p||h?(h&&(h=h.substr(0,h.length-1)),p+h):"."},a.basename=function(c,l){var p=u(c)[2];return l&&p.substr(-1*l.length)===l&&(p=p.substr(0,p.length-l.length)),p},a.extname=function(c){return u(c)[3]},a.format=function(c){if(!i.isObject(c))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof c);var l=c.root||"";if(!s(l))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof c.root);return(c.dir?c.dir+a.sep:"")+(c.base||"")},a.parse=function(c){if(!s(c))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof c);var l=u(c);if(!l||l.length!==4)throw new TypeError("Invalid path '"+c+"'");return l[1]=l[1]||"",l[2]=l[2]||"",l[3]=l[3]||"",{root:l[0],dir:l[0]+l[1].slice(0,l[1].length-1),base:l[2],ext:l[3],name:l[2].slice(0,l[2].length-l[3].length)}},a.sep="/",a.delimiter=":",t.exports=a},101:function(t,e,n){var i;t=n.nmd(t),(function(){var s=(t&&t.exports,typeof Nt=="object"&&Nt);s.global!==s&&s.window;var r=function(l){this.message=l};(r.prototype=new Error).name="InvalidCharacterError";var o=function(l){throw new r(l)},a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,c={encode:function(l){l=String(l),/[^\0-\xFF]/.test(l)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var p,h,m,f,d=l.length%3,g="",b=-1,v=l.length-d;++b<v;)p=l.charCodeAt(b)<<16,h=l.charCodeAt(++b)<<8,m=l.charCodeAt(++b),g+=a.charAt((f=p+h+m)>>18&63)+a.charAt(f>>12&63)+a.charAt(f>>6&63)+a.charAt(63&f);return d==2?(p=l.charCodeAt(b)<<8,h=l.charCodeAt(++b),g+=a.charAt((f=p+h)>>10)+a.charAt(f>>4&63)+a.charAt(f<<2&63)+"="):d==1&&(f=l.charCodeAt(b),g+=a.charAt(f>>2)+a.charAt(f<<4&63)+"=="),g},decode:function(l){var p=(l=String(l).replace(u,"")).length;p%4==0&&(p=(l=l.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(l))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var h,m,f=0,d="",g=-1;++g<p;)m=a.indexOf(l.charAt(g)),h=f%4?64*h+m:m,f++%4&&(d+=String.fromCharCode(255&h>>(-2*f&6)));return d},version:"1.0.0"};(i=function(){return c}.call(e,n,e,t))===void 0||(t.exports=i)})()},135:t=>{function e(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}t.exports=function(n){return n!=null&&(e(n)||(function(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&e(i.slice(0,0))})(n)||!!n._isBuffer)}},172:(t,e)=>{e.d=function(n){if(!n)return 0;for(var i=(n=n.toString()).length,s=n.length;s--;){var r=n.charCodeAt(s);56320<=r&&r<=57343&&s--,127<r&&r<=2047?i++:2047<r&&r<=65535&&(i+=2)}return i}},285:(t,e,n)=>{var i=n(2);t.exports=function(b){return b?(b.substr(0,2)==="{}"&&(b="\\{\\}"+b.substr(2)),g((function(v){return v.split("\\\\").join(s).split("\\{").join(r).split("\\}").join(o).split("\\,").join(a).split("\\.").join(u)})(b),!0).map(l)):[]};var s="\0SLASH"+Math.random()+"\0",r="\0OPEN"+Math.random()+"\0",o="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function c(b){return parseInt(b,10)==b?parseInt(b,10):b.charCodeAt(0)}function l(b){return b.split(s).join("\\").split(r).join("{").split(o).join("}").split(a).join(",").split(u).join(".")}function p(b){if(!b)return[""];var v=[],y=i("{","}",b);if(!y)return b.split(",");var w=y.pre,_=y.body,E=y.post,C=w.split(",");C[C.length-1]+="{"+_+"}";var P=p(E);return E.length&&(C[C.length-1]+=P.shift(),C.push.apply(C,P)),v.push.apply(v,C),v}function h(b){return"{"+b+"}"}function m(b){return/^-?0\d/.test(b)}function f(b,v){return b<=v}function d(b,v){return b>=v}function g(b,v){var y=[],w=i("{","}",b);if(!w)return[b];var _=w.pre,E=w.post.length?g(w.post,!1):[""];if(/\$$/.test(w.pre))for(var C=0;C<E.length;C++){var P=_+"{"+w.body+"}"+E[C];y.push(P)}else{var k,I,ft=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body),mt=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body),x=ft||mt,gt=w.body.indexOf(",")>=0;if(!x&&!gt)return w.post.match(/,(?!,).*\}/)?g(b=w.pre+"{"+w.body+o+w.post):[b];if(x)k=w.body.split(/\.\./);else if((k=p(w.body)).length===1&&(k=g(k[0],!1).map(h)).length===1)return E.map((function(Qn){return w.pre+k[0]+Qn}));if(x){var vt=c(k[0]),bt=c(k[1]),z=Math.max(k[0].length,k[1].length),Z=k.length==3?Math.abs(c(k[2])):1,yt=f;bt<vt&&(Z*=-1,yt=d);var At=k.some(m);I=[];for(var K=vt;yt(K,bt);K+=Z){var et;if(mt)(et=String.fromCharCode(K))==="\\"&&(et="");else if(et=String(K),At){var Se=z-et.length;if(Se>0){var Oe=new Array(Se+1).join("0");et=K<0?"-"+Oe+et.slice(1):Oe+et}}I.push(et)}}else{I=[];for(var ot=0;ot<k.length;ot++)I.push.apply(I,g(k[ot],!1))}for(ot=0;ot<I.length;ot++)for(C=0;C<E.length;C++)P=_+I[ot]+E[C],(!v||x||P)&&y.push(P)}return y}},298:t=>{var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(i,s){return i<<s|i>>>32-s},rotr:function(i,s){return i<<32-s|i>>>s},endian:function(i){if(i.constructor==Number)return 16711935&n.rotl(i,8)|4278255360&n.rotl(i,24);for(var s=0;s<i.length;s++)i[s]=n.endian(i[s]);return i},randomBytes:function(i){for(var s=[];i>0;i--)s.push(Math.floor(256*Math.random()));return s},bytesToWords:function(i){for(var s=[],r=0,o=0;r<i.length;r++,o+=8)s[o>>>5]|=i[r]<<24-o%32;return s},wordsToBytes:function(i){for(var s=[],r=0;r<32*i.length;r+=8)s.push(i[r>>>5]>>>24-r%32&255);return s},bytesToHex:function(i){for(var s=[],r=0;r<i.length;r++)s.push((i[r]>>>4).toString(16)),s.push((15&i[r]).toString(16));return s.join("")},hexToBytes:function(i){for(var s=[],r=0;r<i.length;r+=2)s.push(parseInt(i.substr(r,2),16));return s},bytesToBase64:function(i){for(var s=[],r=0;r<i.length;r+=3)for(var o=i[r]<<16|i[r+1]<<8|i[r+2],a=0;a<4;a++)8*r+6*a<=8*i.length?s.push(e.charAt(o>>>6*(3-a)&63)):s.push("=");return s.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/gi,"");for(var s=[],r=0,o=0;r<i.length;o=++r%4)o!=0&&s.push((e.indexOf(i.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(i.charAt(r))>>>6-2*o);return s}},t.exports=n},345:()=>{},388:()=>{},410:()=>{},526:t=>{var e={utf8:{stringToBytes:function(n){return e.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(e.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var i=[],s=0;s<n.length;s++)i.push(255&n.charCodeAt(s));return i},bytesToString:function(n){for(var i=[],s=0;s<n.length;s++)i.push(String.fromCharCode(n[s]));return i.join("")}}};t.exports=e},542:(t,e,n)=>{(function(){var i=n(298),s=n(526).utf8,r=n(135),o=n(526).bin,a=function(u,c){u.constructor==String?u=c&&c.encoding==="binary"?o.stringToBytes(u):s.stringToBytes(u):r(u)?u=Array.prototype.slice.call(u,0):Array.isArray(u)||u.constructor===Uint8Array||(u=u.toString());for(var l=i.bytesToWords(u),p=8*u.length,h=1732584193,m=-271733879,f=-1732584194,d=271733878,g=0;g<l.length;g++)l[g]=16711935&(l[g]<<8|l[g]>>>24)|4278255360&(l[g]<<24|l[g]>>>8);l[p>>>5]|=128<<p%32,l[14+(p+64>>>9<<4)]=p;var b=a._ff,v=a._gg,y=a._hh,w=a._ii;for(g=0;g<l.length;g+=16){var _=h,E=m,C=f,P=d;h=b(h,m,f,d,l[g+0],7,-680876936),d=b(d,h,m,f,l[g+1],12,-389564586),f=b(f,d,h,m,l[g+2],17,606105819),m=b(m,f,d,h,l[g+3],22,-1044525330),h=b(h,m,f,d,l[g+4],7,-176418897),d=b(d,h,m,f,l[g+5],12,1200080426),f=b(f,d,h,m,l[g+6],17,-1473231341),m=b(m,f,d,h,l[g+7],22,-45705983),h=b(h,m,f,d,l[g+8],7,1770035416),d=b(d,h,m,f,l[g+9],12,-1958414417),f=b(f,d,h,m,l[g+10],17,-42063),m=b(m,f,d,h,l[g+11],22,-1990404162),h=b(h,m,f,d,l[g+12],7,1804603682),d=b(d,h,m,f,l[g+13],12,-40341101),f=b(f,d,h,m,l[g+14],17,-1502002290),h=v(h,m=b(m,f,d,h,l[g+15],22,1236535329),f,d,l[g+1],5,-165796510),d=v(d,h,m,f,l[g+6],9,-1069501632),f=v(f,d,h,m,l[g+11],14,643717713),m=v(m,f,d,h,l[g+0],20,-373897302),h=v(h,m,f,d,l[g+5],5,-701558691),d=v(d,h,m,f,l[g+10],9,38016083),f=v(f,d,h,m,l[g+15],14,-660478335),m=v(m,f,d,h,l[g+4],20,-405537848),h=v(h,m,f,d,l[g+9],5,568446438),d=v(d,h,m,f,l[g+14],9,-1019803690),f=v(f,d,h,m,l[g+3],14,-187363961),m=v(m,f,d,h,l[g+8],20,1163531501),h=v(h,m,f,d,l[g+13],5,-1444681467),d=v(d,h,m,f,l[g+2],9,-51403784),f=v(f,d,h,m,l[g+7],14,1735328473),h=y(h,m=v(m,f,d,h,l[g+12],20,-1926607734),f,d,l[g+5],4,-378558),d=y(d,h,m,f,l[g+8],11,-2022574463),f=y(f,d,h,m,l[g+11],16,1839030562),m=y(m,f,d,h,l[g+14],23,-35309556),h=y(h,m,f,d,l[g+1],4,-1530992060),d=y(d,h,m,f,l[g+4],11,1272893353),f=y(f,d,h,m,l[g+7],16,-155497632),m=y(m,f,d,h,l[g+10],23,-1094730640),h=y(h,m,f,d,l[g+13],4,681279174),d=y(d,h,m,f,l[g+0],11,-358537222),f=y(f,d,h,m,l[g+3],16,-722521979),m=y(m,f,d,h,l[g+6],23,76029189),h=y(h,m,f,d,l[g+9],4,-640364487),d=y(d,h,m,f,l[g+12],11,-421815835),f=y(f,d,h,m,l[g+15],16,530742520),h=w(h,m=y(m,f,d,h,l[g+2],23,-995338651),f,d,l[g+0],6,-198630844),d=w(d,h,m,f,l[g+7],10,1126891415),f=w(f,d,h,m,l[g+14],15,-1416354905),m=w(m,f,d,h,l[g+5],21,-57434055),h=w(h,m,f,d,l[g+12],6,1700485571),d=w(d,h,m,f,l[g+3],10,-1894986606),f=w(f,d,h,m,l[g+10],15,-1051523),m=w(m,f,d,h,l[g+1],21,-2054922799),h=w(h,m,f,d,l[g+8],6,1873313359),d=w(d,h,m,f,l[g+15],10,-30611744),f=w(f,d,h,m,l[g+6],15,-1560198380),m=w(m,f,d,h,l[g+13],21,1309151649),h=w(h,m,f,d,l[g+4],6,-145523070),d=w(d,h,m,f,l[g+11],10,-1120210379),f=w(f,d,h,m,l[g+2],15,718787259),m=w(m,f,d,h,l[g+9],21,-343485551),h=h+_>>>0,m=m+E>>>0,f=f+C>>>0,d=d+P>>>0}return i.endian([h,m,f,d])};a._ff=function(u,c,l,p,h,m,f){var d=u+(c&l|~c&p)+(h>>>0)+f;return(d<<m|d>>>32-m)+c},a._gg=function(u,c,l,p,h,m,f){var d=u+(c&p|l&~p)+(h>>>0)+f;return(d<<m|d>>>32-m)+c},a._hh=function(u,c,l,p,h,m,f){var d=u+(c^l^p)+(h>>>0)+f;return(d<<m|d>>>32-m)+c},a._ii=function(u,c,l,p,h,m,f){var d=u+(l^(c|~p))+(h>>>0)+f;return(d<<m|d>>>32-m)+c},a._blocksize=16,a._digestsize=16,t.exports=function(u,c){if(u==null)throw new Error("Illegal argument "+u);var l=i.wordsToBytes(a(u,c));return c&&c.asBytes?l:c&&c.asString?o.bytesToString(l):i.bytesToHex(l)}})()},647:(t,e)=>{var n=Object.prototype.hasOwnProperty;function i(r){try{return decodeURIComponent(r.replace(/\+/g," "))}catch{return null}}function s(r){try{return encodeURIComponent(r)}catch{return null}}e.stringify=function(r,o){o=o||"";var a,u,c=[];for(u in typeof o!="string"&&(o="?"),r)if(n.call(r,u)){if((a=r[u])||a!=null&&!isNaN(a)||(a=""),u=s(u),a=s(a),u===null||a===null)continue;c.push(u+"="+a)}return c.length?o+c.join("&"):""},e.parse=function(r){for(var o,a=/([^=?#&]+)=?([^&]*)/g,u={};o=a.exec(r);){var c=i(o[1]),l=i(o[2]);c===null||l===null||c in u||(u[c]=l)}return u}},670:t=>{t.exports=function(e,n){if(n=n.split(":")[0],!(e=+e))return!1;switch(n){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}},737:(t,e,n)=>{var i=n(670),s=n(647),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function p(v){return(v||"").toString().replace(r,"")}var h=[["#","hash"],["?","query"],function(v,y){return d(y.protocol)?v.replace(/\\/g,"/"):v},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],m={hash:1,query:1};function f(v){var y,w=(typeof window<"u"?window:typeof Nt<"u"?Nt:typeof self<"u"?self:{}).location||{},_={},E=typeof(v=v||w);if(v.protocol==="blob:")_=new b(unescape(v.pathname),{});else if(E==="string")for(y in _=new b(v,{}),m)delete _[y];else if(E==="object"){for(y in v)y in m||(_[y]=v[y]);_.slashes===void 0&&(_.slashes=a.test(v.href))}return _}function d(v){return v==="file:"||v==="ftp:"||v==="http:"||v==="https:"||v==="ws:"||v==="wss:"}function g(v,y){v=(v=p(v)).replace(o,""),y=y||{};var w,_=c.exec(v),E=_[1]?_[1].toLowerCase():"",C=!!_[2],P=!!_[3],k=0;return C?P?(w=_[2]+_[3]+_[4],k=_[2].length+_[3].length):(w=_[2]+_[4],k=_[2].length):P?(w=_[3]+_[4],k=_[3].length):w=_[4],E==="file:"?k>=2&&(w=w.slice(2)):d(E)?w=_[4]:E?C&&(w=w.slice(2)):k>=2&&d(y.protocol)&&(w=_[4]),{protocol:E,slashes:C||d(E),slashesCount:k,rest:w}}function b(v,y,w){if(v=(v=p(v)).replace(o,""),!(this instanceof b))return new b(v,y,w);var _,E,C,P,k,I,ft=h.slice(),mt=typeof y,x=this,gt=0;for(mt!=="object"&&mt!=="string"&&(w=y,y=null),w&&typeof w!="function"&&(w=s.parse),_=!(E=g(v||"",y=f(y))).protocol&&!E.slashes,x.slashes=E.slashes||_&&y.slashes,x.protocol=E.protocol||y.protocol||"",v=E.rest,(E.protocol==="file:"&&(E.slashesCount!==2||l.test(v))||!E.slashes&&(E.protocol||E.slashesCount<2||!d(x.protocol)))&&(ft[3]=[/(.*)/,"pathname"]);gt<ft.length;gt++)typeof(P=ft[gt])!="function"?(C=P[0],I=P[1],C!=C?x[I]=v:typeof C=="string"?~(k=C==="@"?v.lastIndexOf(C):v.indexOf(C))&&(typeof P[2]=="number"?(x[I]=v.slice(0,k),v=v.slice(k+P[2])):(x[I]=v.slice(k),v=v.slice(0,k))):(k=C.exec(v))&&(x[I]=k[1],v=v.slice(0,k.index)),x[I]=x[I]||_&&P[3]&&y[I]||"",P[4]&&(x[I]=x[I].toLowerCase())):v=P(v,x);w&&(x.query=w(x.query)),_&&y.slashes&&x.pathname.charAt(0)!=="/"&&(x.pathname!==""||y.pathname!=="")&&(x.pathname=(function(vt,bt){if(vt==="")return bt;for(var z=(bt||"/").split("/").slice(0,-1).concat(vt.split("/")),Z=z.length,yt=z[Z-1],At=!1,K=0;Z--;)z[Z]==="."?z.splice(Z,1):z[Z]===".."?(z.splice(Z,1),K++):K&&(Z===0&&(At=!0),z.splice(Z,1),K--);return At&&z.unshift(""),yt!=="."&&yt!==".."||z.push(""),z.join("/")})(x.pathname,y.pathname)),x.pathname.charAt(0)!=="/"&&d(x.protocol)&&(x.pathname="/"+x.pathname),i(x.port,x.protocol)||(x.host=x.hostname,x.port=""),x.username=x.password="",x.auth&&(~(k=x.auth.indexOf(":"))?(x.username=x.auth.slice(0,k),x.username=encodeURIComponent(decodeURIComponent(x.username)),x.password=x.auth.slice(k+1),x.password=encodeURIComponent(decodeURIComponent(x.password))):x.username=encodeURIComponent(decodeURIComponent(x.auth)),x.auth=x.password?x.username+":"+x.password:x.username),x.origin=x.protocol!=="file:"&&d(x.protocol)&&x.host?x.protocol+"//"+x.host:"null",x.href=x.toString()}b.prototype={set:function(v,y,w){var _=this;switch(v){case"query":typeof y=="string"&&y.length&&(y=(w||s.parse)(y)),_[v]=y;break;case"port":_[v]=y,i(y,_.protocol)?y&&(_.host=_.hostname+":"+y):(_.host=_.hostname,_[v]="");break;case"hostname":_[v]=y,_.port&&(y+=":"+_.port),_.host=y;break;case"host":_[v]=y,u.test(y)?(y=y.split(":"),_.port=y.pop(),_.hostname=y.join(":")):(_.hostname=y,_.port="");break;case"protocol":_.protocol=y.toLowerCase(),_.slashes=!w;break;case"pathname":case"hash":if(y){var E=v==="pathname"?"/":"#";_[v]=y.charAt(0)!==E?E+y:y}else _[v]=y;break;case"username":case"password":_[v]=encodeURIComponent(y);break;case"auth":var C=y.indexOf(":");~C?(_.username=y.slice(0,C),_.username=encodeURIComponent(decodeURIComponent(_.username)),_.password=y.slice(C+1),_.password=encodeURIComponent(decodeURIComponent(_.password))):_.username=encodeURIComponent(decodeURIComponent(y))}for(var P=0;P<h.length;P++){var k=h[P];k[4]&&(_[k[1]]=_[k[1]].toLowerCase())}return _.auth=_.password?_.username+":"+_.password:_.username,_.origin=_.protocol!=="file:"&&d(_.protocol)&&_.host?_.protocol+"//"+_.host:"null",_.href=_.toString(),_},toString:function(v){v&&typeof v=="function"||(v=s.stringify);var y,w=this,_=w.host,E=w.protocol;E&&E.charAt(E.length-1)!==":"&&(E+=":");var C=E+(w.protocol&&w.slashes||d(w.protocol)?"//":"");return w.username?(C+=w.username,w.password&&(C+=":"+w.password),C+="@"):w.password?(C+=":"+w.password,C+="@"):w.protocol!=="file:"&&d(w.protocol)&&!_&&w.pathname!=="/"&&(C+="@"),(_[_.length-1]===":"||u.test(w.hostname)&&!w.port)&&(_+=":"),C+=_+w.pathname,(y=typeof w.query=="object"?v(w.query):w.query)&&(C+=y.charAt(0)!=="?"?"?"+y:y),w.hash&&(C+=w.hash),C}},b.extractProtocol=g,b.location=f,b.trimLeft=p,b.qs=s,t.exports=b},800:()=>{},805:()=>{},829:t=>{function e(c){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(c)}function n(c){var l=typeof Map=="function"?new Map:void 0;return n=function(p){if(p===null||(h=p,Function.toString.call(h).indexOf("[native code]")===-1))return p;var h;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(l!==void 0){if(l.has(p))return l.get(p);l.set(p,m)}function m(){return i(p,arguments,r(this).constructor)}return m.prototype=Object.create(p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),s(m,p)},n(c)}function i(c,l,p){return i=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(h,m,f){var d=[null];d.push.apply(d,m);var g=new(Function.bind.apply(h,d));return f&&s(g,f.prototype),g},i.apply(null,arguments)}function s(c,l){return s=Object.setPrototypeOf||function(p,h){return p.__proto__=h,p},s(c,l)}function r(c){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},r(c)}var o=(function(c){function l(p){var h;return(function(m,f){if(!(m instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l),(h=(function(m,f){return!f||e(f)!=="object"&&typeof f!="function"?(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(m):f})(this,r(l).call(this,p))).name="ObjectPrototypeMutationError",h}return(function(p,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(h&&h.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),h&&s(p,h)})(l,c),l})(n(Error));function a(c,l){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},h=l.split("."),m=h.length,f=function(b){var v=h[b];if(!c)return{v:void 0};if(v==="+"){if(Array.isArray(c))return{v:c.map((function(w,_){var E=h.slice(b+1);return E.length>0?a(w,E.join("."),p):p(c,_,h,b)}))};var y=h.slice(0,b).join(".");throw new Error("Object at wildcard (".concat(y,") is not an array"))}c=p(c,v,h,b)},d=0;d<m;d++){var g=f(d);if(e(g)==="object")return g.v}return c}function u(c,l){return c.length===l+1}t.exports={set:function(c,l,p){if(e(c)!="object"||c===null||l===void 0)return c;if(typeof l=="number")return c[l]=p,c[l];try{return a(c,l,(function(h,m,f,d){if(h===Reflect.getPrototypeOf({}))throw new o("Attempting to mutate Object.prototype");if(!h[m]){var g=Number.isInteger(Number(f[d+1])),b=f[d+1]==="+";h[m]=g||b?[]:{}}return u(f,d)&&(h[m]=p),h[m]}))}catch(h){if(h instanceof o)throw h;return c}},get:function(c,l){if(e(c)!="object"||c===null||l===void 0)return c;if(typeof l=="number")return c[l];try{return a(c,l,(function(p,h){return p[h]}))}catch{return c}},has:function(c,l){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(e(c)!="object"||c===null||l===void 0)return!1;if(typeof l=="number")return l in c;try{var h=!1;return a(c,l,(function(m,f,d,g){if(!u(d,g))return m&&m[f];h=p.own?m.hasOwnProperty(f):f in m})),h}catch{return!1}},hasOwn:function(c,l,p){return this.has(c,l,p||{own:!0})},isIn:function(c,l,p){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(e(c)!="object"||c===null||l===void 0)return!1;try{var m=!1,f=!1;return a(c,l,(function(d,g,b,v){return m=m||d===p||!!d&&d[g]===p,f=u(b,v)&&e(d)==="object"&&g in d,d&&d[g]})),h.validPath?m&&f:m}catch{return!1}},ObjectPrototypeMutationError:o}}},Re={};function T(t){var e=Re[t];if(e!==void 0)return e.exports;var n=Re[t]={id:t,loaded:!1,exports:{}};return ki[t].call(n.exports,n,n.exports,T),n.loaded=!0,n.exports}T.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return T.d(e,{a:e}),e},T.d=(t,e)=>{for(var n in e)T.o(e,n)&&!T.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},T.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),T.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var Pi=T(737),Ti=T.n(Pi);function Ht(t){if(!se(t))throw new Error("Parameter was not an error")}function se(t){return!!t&&typeof t=="object"&&(e=t,Object.prototype.toString.call(e)==="[object Error]")||t instanceof Error;var e}class F extends Error{constructor(e,n){const i=[...arguments],{options:s,shortMessage:r}=(function(a){let u,c="";if(a.length===0)u={};else if(se(a[0]))u={cause:a[0]},c=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")u=Object.assign({},a[0]),c=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");u={},c=c=a.join(" ")||""}return{options:u,shortMessage:c}})(i);let o=r;if(s.cause&&(o=`${o}: ${s.cause.message}`),super(o),this.message=o,s.name&&typeof s.name=="string"?this.name=s.name:this.name="Layerr",s.cause&&Object.defineProperty(this,"_cause",{value:s.cause}),Object.defineProperty(this,"_info",{value:{}}),s.info&&typeof s.info=="object"&&Object.assign(this._info,s.info),Error.captureStackTrace){const a=s.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(e){return Ht(e),e._cause&&se(e._cause)?e._cause:null}static fullStack(e){Ht(e);const n=F.cause(e);return n?`${e.stack}
caused by: ${F.fullStack(n)}`:e.stack??""}static info(e){Ht(e);const n={},i=F.cause(e);return i&&Object.assign(n,F.info(i)),e._info&&Object.assign(n,e._info),n}toString(){let e=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e=`${e}: ${this.message}`),e}}var Ai=T(47),Wt=T.n(Ai);const Ue="__PATH_SEPARATOR_POSIX__",Me="__PATH_SEPARATOR_WINDOWS__";function A(t){try{const e=t.replace(/\//g,Ue).replace(/\\\\/g,Me);return encodeURIComponent(e).split(Me).join("\\\\").split(Ue).join("/")}catch(e){throw new F(e,"Failed encoding path")}}function Fe(t){return t.startsWith("/")?t:"/"+t}function Tt(t){let e=t;return e[0]!=="/"&&(e="/"+e),/^.+\/$/.test(e)&&(e=e.substr(0,e.length-1)),e}function Ni(t){let e=new(Ti())(t).pathname;return e.length<=0&&(e="/"),Tt(e)}function N(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return(function(){return(function(i){var s=[];if(i.length===0)return"";if(typeof i[0]!="string")throw new TypeError("Url must be a string. Received "+i[0]);if(i[0].match(/^[^/:]+:\/*$/)&&i.length>1){var r=i.shift();i[0]=r+i[0]}i[0].match(/^file:\/\/\//)?i[0]=i[0].replace(/^([^/:]+):\/*/,"$1:///"):i[0]=i[0].replace(/^([^/:]+):\/*/,"$1://");for(var o=0;o<i.length;o++){var a=i[o];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(o>0&&(a=a.replace(/^[\/]+/,"")),a=o<i.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),s.push(a))}var u=s.join("/"),c=(u=u.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return c.shift()+(c.length>0?"?":"")+c.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(e.reduce(((i,s,r)=>((r===0||s!=="/"||s==="/"&&i[i.length-1]!=="/")&&i.push(s),i)),[]))}var Di=T(542),_t=T.n(Di);function Be(t,e){const n=t.url.replace("//",""),i=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),s=t.method?t.method.toUpperCase():"GET",r=!!/(^|,)\s*auth\s*($|,)/.test(e.qop)&&"auth",o=`00000000${e.nc}`.slice(-8),a=(function(h,m,f,d,g,b,v){const y=v||_t()(`${m}:${f}:${d}`);return h&&h.toLowerCase()==="md5-sess"?_t()(`${y}:${g}:${b}`):y})(e.algorithm,e.username,e.realm,e.password,e.nonce,e.cnonce,e.ha1),u=_t()(`${s}:${i}`),c=r?_t()(`${a}:${e.nonce}:${o}:${e.cnonce}:${r}:${u}`):_t()(`${a}:${e.nonce}:${u}`),l={username:e.username,realm:e.realm,nonce:e.nonce,uri:i,qop:r,response:c,nc:o,cnonce:e.cnonce,algorithm:e.algorithm,opaque:e.opaque},p=[];for(const h in l)l[h]&&(h==="qop"||h==="nc"||h==="algorithm"?p.push(`${h}=${l[h]}`):p.push(`${h}="${l[h]}"`));return`Digest ${p.join(", ")}`}function yn(t){return(t.headers&&t.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var Si=T(101),wn=T.n(Si);function Ve(t){return wn().decode(t)}function qe(t,e){var n;return`Basic ${n=`${t}:${e}`,wn().encode(n)}`}const ze=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,Oi=ze.fetch.bind(ze);let V=(function(t){return t.Auto="auto",t.Digest="digest",t.None="none",t.Password="password",t.Token="token",t})({}),rt=(function(t){return t.DataTypeNoLength="data-type-no-length",t.InvalidAuthType="invalid-auth-type",t.InvalidOutputFormat="invalid-output-format",t.LinkUnsupportedAuthType="link-unsupported-auth",t.InvalidUpdateRange="invalid-update-range",t.NotSupported="not-supported",t})({});function _n(t,e,n,i,s){switch(t.authType){case V.Auto:e&&n&&(t.headers.Authorization=qe(e,n));break;case V.Digest:t.digest=(function(o,a,u){return{username:o,password:a,ha1:u,nc:0,algorithm:"md5",hasDigestAuth:!1}})(e,n,s);break;case V.None:break;case V.Password:t.headers.Authorization=qe(e,n);break;case V.Token:t.headers.Authorization=`${(r=i).token_type} ${r.access_token}`;break;default:throw new F({info:{code:rt.InvalidAuthType}},`Invalid auth type: ${t.authType}`)}var r}T(345),T(800);const Ge="@@HOTPATCHER",$i=()=>{};function Yt(t){return{original:t,methods:[t],final:!1}}class Ii{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=Ge}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(e){this.configuration.getEmptyAction=e}control(e){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!e||e.__type__!==Ge)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(e.configuration.registry).forEach((i=>{this.configuration.registry.hasOwnProperty(i)?n&&(this.configuration.registry[i]=Object.assign({},e.configuration.registry[i])):this.configuration.registry[i]=Object.assign({},e.configuration.registry[i])})),e._configuration=this.configuration,this}execute(e){const n=this.get(e)||$i;for(var i=arguments.length,s=new Array(i>1?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];return n(...s)}get(e){const n=this.configuration.registry[e];if(!n)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error(`Failed handling method request: No method provided for override: ${e}`);default:throw new Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`)}return(function(){for(var i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];if(s.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];let c=a;const l=this;for(;s.length>0;)c=[s.shift().apply(l,c)];return c[0]}})(...n.methods)}isPatched(e){return!!this.configuration.registry[e]}patch(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:s=!1}=i;if(this.configuration.registry[e]&&this.configuration.registry[e].final)throw new Error(`Failed patching '${e}': Method marked as being final`);if(typeof n!="function")throw new Error(`Failed patching '${e}': Provided method is not a function`);if(s)this.configuration.registry[e]?this.configuration.registry[e].methods.push(n):this.configuration.registry[e]=Yt(n);else if(this.isPatched(e)){const{original:r}=this.configuration.registry[e];this.configuration.registry[e]=Object.assign(Yt(n),{original:r})}else this.configuration.registry[e]=Yt(n);return this}patchInline(e,n){this.isPatched(e)||this.patch(e,n);for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return this.execute(e,...s)}plugin(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return i.forEach((r=>{this.patch(e,r,{chain:!0})})),this}restore(e){if(!this.isPatched(e))throw new Error(`Failed restoring method: No method present for key: ${e}`);if(typeof this.configuration.registry[e].original!="function")throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${e}`);return this.configuration.registry[e].methods=[this.configuration.registry[e].original],this}setFinal(e){if(!this.configuration.registry.hasOwnProperty(e))throw new Error(`Failed marking '${e}' as final: No method found for key`);return this.configuration.registry[e].final=!0,this}}let Zt=null;function xn(){return Zt||(Zt=new Ii),Zt}function Rt(t){return(function(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let n=e;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n})(t)?Object.assign({},t):Object.setPrototypeOf(Object.assign({},t),Object.getPrototypeOf(t))}function Qe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];let i=null,s=[...e];for(;s.length>0;){const r=s.shift();i=i?En(i,r):Rt(r)}return i}function En(t,e){const n=Rt(t);return Object.keys(e).forEach((i=>{n.hasOwnProperty(i)?Array.isArray(e[i])?n[i]=Array.isArray(n[i])?[...n[i],...e[i]]:[...e[i]]:typeof e[i]=="object"&&e[i]?n[i]=typeof n[i]=="object"&&n[i]?En(n[i],e[i]):Rt(e[i]):n[i]=e[i]:n[i]=e[i]})),n}function Li(t){const e={};for(const n of t.keys())e[n]=t.get(n);return e}function re(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(e.length===0)return{};const i={};return e.reduce(((s,r)=>(Object.keys(r).forEach((o=>{const a=o.toLowerCase();i.hasOwnProperty(a)?s[i[a]]=r[o]:(i[a]=o,s[o]=r[o])})),s)),{})}T(805);const ji=typeof ArrayBuffer=="function",{toString:Wi}=Object.prototype;function Cn(t){return ji&&(t instanceof ArrayBuffer||Wi.call(t)==="[object ArrayBuffer]")}function kn(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ge(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}}function oe(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const Pn=ge((function(t){const e=t._digest;return delete t._digest,e.hasDigestAuth&&(t=Qe(t,{headers:{Authorization:Be(t,e)}})),oe(Ut(t),(function(n){let i=!1;return s=function(o){return i?o:n},(r=(function(){if(n.status==401)return e.hasDigestAuth=(function(o,a){if(!yn(o))return!1;const u=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const c=o.headers&&o.headers.get("www-authenticate")||"",l=u.exec(c);if(!l)break;a[l[1]]=l[2]||l[3]}return a.nc+=1,a.cnonce=(function(){let c="";for(let l=0;l<32;++l)c=`${c}${"abcdef0123456789"[Math.floor(16*Math.random())]}`;return c})(),!0})(n,e),(function(){if(e.hasDigestAuth)return oe(Ut(t=Qe(t,{headers:{Authorization:Be(t,e)}})),(function(o){return o.status==401?e.hasDigestAuth=!1:e.nc++,i=!0,o}))})();e.nc++})())&&r.then?r.then(s):s(r);var s,r}))})),Ri=ge((function(t,e){return oe(Ut(t),(function(n){return n.ok?(e.authType=V.Password,n):n.status==401&&yn(n)?(e.authType=V.Digest,_n(e,e.username,e.password,void 0,void 0),t._digest=e.digest,Pn(t)):n}))})),S=ge((function(t,e){return e.authType===V.Auto?Ri(t,e):t._digest?Pn(t):Ut(t)}));function O(t,e,n){const i=Rt(t);return i.headers=re(e.headers,i.headers||{},n.headers||{}),n.data!==void 0&&(i.data=n.data),n.signal&&(i.signal=n.signal),e.httpAgent&&(i.httpAgent=e.httpAgent),e.httpsAgent&&(i.httpsAgent=e.httpsAgent),e.digest&&(i._digest=e.digest),typeof e.withCredentials=="boolean"&&(i.withCredentials=e.withCredentials),i}function Ut(t){const e=xn();return e.patchInline("request",(n=>e.patchInline("fetch",Oi,n.url,(function(i){let s={};const r={method:i.method};if(i.headers&&(s=re(s,i.headers)),i.data!==void 0){const[o,a]=(function(u){if(typeof u=="string")return[u,{}];if(kn(u))return[u,{}];if(Cn(u))return[u,{}];if(u&&typeof u=="object")return[JSON.stringify(u),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof u)})(i.data);r.body=o,s=re(s,a)}return i.signal&&(r.signal=i.signal),i.withCredentials&&(r.credentials="include"),r.headers=s,r})(n))),t)}var Ui=T(285);const Mt=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},Mi={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},xt=t=>t.replace(/[[\]\\-]/g,"\\$&"),He=t=>t.join(""),Fi=(t,e)=>{const n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");const i=[],s=[];let r=n+1,o=!1,a=!1,u=!1,c=!1,l=n,p="";t:for(;r<t.length;){const d=t.charAt(r);if(d!=="!"&&d!=="^"||r!==n+1){if(d==="]"&&o&&!u){l=r+1;break}if(o=!0,d!=="\\"||u){if(d==="["&&!u){for(const[g,[b,v,y]]of Object.entries(Mi))if(t.startsWith(g,r)){if(p)return["$.",!1,t.length-n,!0];r+=g.length,y?s.push(b):i.push(b),a=a||v;continue t}}u=!1,p?(d>p?i.push(xt(p)+"-"+xt(d)):d===p&&i.push(xt(d)),p="",r++):t.startsWith("-]",r+1)?(i.push(xt(d+"-")),r+=2):t.startsWith("-",r+1)?(p=d,r+=2):(i.push(xt(d)),r++)}else u=!0,r++}else c=!0,r++}if(l<r)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-n,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!c)return[(h=i[0].length===2?i[0].slice(-1):i[0],h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,l-n,!1];var h;const m="["+(c?"^":"")+He(i)+"]",f="["+(c?"":"^")+He(s)+"]";return[i.length&&s.length?"("+m+"|"+f+")":i.length?m:f,a,l-n,!0]},kt=function(t){let{windowsPathsNoEscape:e=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},Bi=new Set(["!","?","+","*","@"]),Ye=t=>Bi.has(t),Xt="(?!\\.)",Vi=new Set(["[","."]),qi=new Set(["..","."]),zi=new Set("().*{}+?[]^$\\!"),ve="[^/]",Ze=ve+"*?",Xe=ve+"+?";class U{type;#n;#i;#r=!1;#t=[];#e;#o;#l;#a=!1;#s;#u;#h=!1;constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=e,e&&(this.#i=!0),this.#e=n,this.#n=this.#e?this.#e.#n:this,this.#s=this.#n===this?i:this.#n.#s,this.#l=this.#n===this?[]:this.#n.#l,e!=="!"||this.#n.#a||this.#l.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#i!==void 0)return this.#i;for(const e of this.#t)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#i=!0;return this.#i}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#t.map((e=>String(e))).join("|")+")":this.#u=this.#t.map((e=>String(e))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let e;for(this.toString(),this.#a=!0;e=this.#l.pop();){if(e.type!=="!")continue;let n=e,i=n.#e;for(;i;){for(let s=n.#o+1;!i.type&&s<i.#t.length;s++)for(const r of e.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(i.#t[s])}n=i,i=n.#e}}return this}push(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];for(const s of n)if(s!==""){if(typeof s!="string"&&!(s instanceof U&&s.#e===this))throw new Error("invalid part: "+s);this.#t.push(s)}}toJSON(){const e=this.type===null?this.#t.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#t.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#e?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;const e=this.#e;for(let n=0;n<this.#o;n++){const i=e.#t[n];if(!(i instanceof U&&i.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const e=this.#e?this.#e.#t.length:0;return this.#o===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){const n=new U(this.type,e);for(const i of this.#t)n.copyIn(i);return n}static#c(e,n,i,s){let r=!1,o=!1,a=-1,u=!1;if(n.type===null){let m=i,f="";for(;m<e.length;){const d=e.charAt(m++);if(r||d==="\\")r=!r,f+=d;else if(o)m===a+1?d!=="^"&&d!=="!"||(u=!0):d!=="]"||m===a+2&&u||(o=!1),f+=d;else if(d!=="[")if(s.noext||!Ye(d)||e.charAt(m)!=="(")f+=d;else{n.push(f),f="";const g=new U(d,n);m=U.#c(e,g,m,s),n.push(g)}else o=!0,a=m,u=!1,f+=d}return n.push(f),m}let c=i+1,l=new U(null,n);const p=[];let h="";for(;c<e.length;){const m=e.charAt(c++);if(r||m==="\\")r=!r,h+=m;else if(o)c===a+1?m!=="^"&&m!=="!"||(u=!0):m!=="]"||c===a+2&&u||(o=!1),h+=m;else if(m!=="[")if(Ye(m)&&e.charAt(c)==="("){l.push(h),h="";const f=new U(m,l);l.push(f),c=U.#c(e,f,c,s)}else if(m!=="|"){if(m===")")return h===""&&n.#t.length===0&&(n.#h=!0),l.push(h),h="",n.push(...p,l),c;h+=m}else l.push(h),h="",p.push(l),l=new U(null,n);else o=!0,a=c,u=!1,h+=m}return n.type=null,n.#i=void 0,n.#t=[e.substring(i-1)],c}static fromGlob(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=new U(null,void 0,n);return U.#c(e,i,0,n),i}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const e=this.toString(),[n,i,s,r]=this.toRegExpSource();if(!(s||this.#i||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;const o=(this.#s.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${n}$`,o),{_src:n,_glob:e})}get options(){return this.#s}toRegExpSource(e){const n=e??!!this.#s.dot;if(this.#n===this&&this.#p(),!this.type){const u=this.isStart()&&this.isEnd(),c=this.#t.map((h=>{const[m,f,d,g]=typeof h=="string"?U.#f(h,this.#i,u):h.toRegExpSource(e);return this.#i=this.#i||d,this.#r=this.#r||g,m})).join("");let l="";if(this.isStart()&&typeof this.#t[0]=="string"&&(this.#t.length!==1||!qi.has(this.#t[0]))){const h=Vi,m=n&&h.has(c.charAt(0))||c.startsWith("\\.")&&h.has(c.charAt(2))||c.startsWith("\\.\\.")&&h.has(c.charAt(4)),f=!n&&!e&&h.has(c.charAt(0));l=m?"(?!(?:^|/)\\.\\.?(?:$|/))":f?Xt:""}let p="";return this.isEnd()&&this.#n.#a&&this.#e?.type==="!"&&(p="(?:$|\\/)"),[l+c+p,kt(c),this.#i=!!this.#i,this.#r]}const i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let r=this.#d(n);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){const u=this.toString();return this.#t=[u],this.type=null,this.#i=void 0,[u,kt(this.toString()),!1,!1]}let o=!i||e||n?"":this.#d(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";return a=this.type==="!"&&this.#h?(this.isStart()&&!n?Xt:"")+Xe:s+r+(this.type==="!"?"))"+(!this.isStart()||n||e?"":Xt)+Ze+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`),[a,kt(r),this.#i=!!this.#i,this.#r]}#d(e){return this.#t.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[i,s,r,o]=n.toRegExpSource(e);return this.#r=this.#r||o,i})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#f(e,n){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=!1,r="",o=!1;for(let a=0;a<e.length;a++){const u=e.charAt(a);if(s)s=!1,r+=(zi.has(u)?"\\":"")+u;else if(u!=="\\"){if(u==="["){const[c,l,p,h]=Fi(e,a);if(p){r+=c,o=o||l,a+=p-1,n=n||h;continue}}u!=="*"?u!=="?"?r+=u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(r+=ve,n=!0):(r+=i&&e==="*"?Xe:Ze,n=!0)}else a===e.length-1?r+="\\\\":s=!0}return[r,kt(e),!!n,o]}}const W=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Mt(e),!(!n.nocomment&&e.charAt(0)==="#")&&new Ft(e,n).match(t)},Gi=/^\*+([^+@!?\*\[\(]*)$/,Qi=t=>e=>!e.startsWith(".")&&e.endsWith(t),Hi=t=>e=>e.endsWith(t),Yi=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),Zi=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Xi=/^\*+\.\*+$/,Ki=t=>!t.startsWith(".")&&t.includes("."),Ji=t=>t!=="."&&t!==".."&&t.includes("."),ts=/^\.\*+$/,es=t=>t!=="."&&t!==".."&&t.startsWith("."),ns=/^\*+$/,is=t=>t.length!==0&&!t.startsWith("."),ss=t=>t.length!==0&&t!=="."&&t!=="..",rs=/^\?+([^+@!?\*\[\(]*)?$/,os=t=>{let[e,n=""]=t;const i=Tn([e]);return n?(n=n.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(n)):i},as=t=>{let[e,n=""]=t;const i=An([e]);return n?(n=n.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(n)):i},ls=t=>{let[e,n=""]=t;const i=An([e]);return n?s=>i(s)&&s.endsWith(n):i},us=t=>{let[e,n=""]=t;const i=Tn([e]);return n?s=>i(s)&&s.endsWith(n):i},Tn=t=>{let[e]=t;const n=e.length;return i=>i.length===n&&!i.startsWith(".")},An=t=>{let[e]=t;const n=e.length;return i=>i.length===n&&i!=="."&&i!==".."},Nn=typeof Lt=="object"&&Lt?typeof Qt=="object"&&Qt&&Qt.__MINIMATCH_TESTING_PLATFORM__||Lt.platform:"posix";W.sep=Nn==="win32"?"\\":"/";const Y=Symbol("globstar **");W.GLOBSTAR=Y,W.filter=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>W(n,t,e)};const H=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},t,e)};W.defaults=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return W;const e=W;return Object.assign((function(n,i){return e(n,i,H(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends e.Minimatch{constructor(n){super(n,H(t,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return e.defaults(H(t,n)).Minimatch}},AST:class extends e.AST{constructor(n,i){super(n,i,H(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.AST.fromGlob(n,H(t,i))}},unescape:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.unescape(n,H(t,i))},escape:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.escape(n,H(t,i))},filter:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.filter(n,H(t,i))},defaults:n=>e.defaults(H(t,n)),makeRe:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.makeRe(n,H(t,i))},braceExpand:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.braceExpand(n,H(t,i))},match:function(n,i){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.match(n,i,H(t,s))},sep:e.sep,GLOBSTAR:Y})};const Dn=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Mt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Ui(t)};W.braceExpand=Dn,W.makeRe=function(t){return new Ft(t,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},W.match=function(t,e){const n=new Ft(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return t=t.filter((i=>n.match(i))),n.options.nonull&&!t.length&&t.push(e),t};const Ke=/[?*]|[+@!]\(.*?\)|\[|\]/;class Ft{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Mt(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||Nn,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const e of this.set)for(const n of e)if(typeof n!="string")return!0;return!1}debug(){}make(){const e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#")return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const i=this.globSet.map((r=>this.slashSplit(r)));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map(((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=!(r[0]!==""||r[1]!==""||r[2]!=="?"&&Ke.test(r[2])||Ke.test(r[3])),c=/^[a-z]:/i.test(r[0]);if(u)return[...r.slice(0,4),...r.slice(4).map((l=>this.parse(l)))];if(c)return[r[0],...r.slice(1).map((l=>this.parse(l)))]}return r.map((u=>this.parse(u)))}));if(this.debug(this.pattern,s),this.set=s.filter((r=>r.indexOf(!1)===-1)),this.isWindows)for(let r=0;r<this.set.length;r++){const o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=n>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map((n=>{let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let s=i;for(;n[s+1]==="**";)s++;s!==i&&n.splice(i,s-i)}return n}))}levelOneOptimize(e){return e.map((n=>(n=n.reduce(((i,s)=>{const r=i[i.length-1];return s==="**"&&r==="**"?i:s===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(s),i)}),[])).length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){const r=e[s];s===1&&r===""&&e[0]===""||r!=="."&&r!==""||(n=!0,e.splice(s,1),s--)}e[0]!=="."||e.length!==2||e[1]!=="."&&e[1]!==""||(n=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){const s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,e.splice(i-1,2),i-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let o=s;for(;i[o+1]==="**";)o++;o>s&&i.splice(s+1,o-s);let a=i[s+1];const u=i[s+2],c=i[s+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;n=!0,i.splice(s,1);const l=i.slice(0);l[s]="**",e.push(l),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){const a=i[o];o===1&&a===""&&i[0]===""||a!=="."&&a!==""||(n=!0,i.splice(o,1),o--)}i[0]!=="."||i.length!==2||i[1]!=="."&&i[1]!==""||(n=!0,i.pop())}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){const o=i[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;const a=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...a),i.length===0&&i.push(""),r-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let i=n+1;i<e.length;i++){const s=this.partsMatch(e[n],e[i],!this.preserveMultipleSlashes);if(s){e[n]=[],e[i]=s;break}}return e.filter((n=>n.length))}partsMatch(e,n){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=0,r=0,o=[],a="";for(;s<e.length&&r<n.length;)if(e[s]===n[r])o.push(a==="b"?n[r]:e[s]),s++,r++;else if(i&&e[s]==="**"&&n[r]===e[s+1])o.push(e[s]),s++;else if(i&&n[r]==="**"&&e[s]===n[r+1])o.push(n[r]),r++;else if(e[s]!=="*"||!n[r]||!this.options.dot&&n[r].startsWith(".")||n[r]==="**"){if(n[r]!=="*"||!e[s]||!this.options.dot&&e[s].startsWith(".")||e[s]==="**"||a==="a")return!1;a="b",o.push(n[r]),s++,r++}else{if(a==="b")return!1;a="a",o.push(e[s]),s++,r++}return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;const e=this.pattern;let n=!1,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)n=!n,i++;i&&(this.pattern=e.slice(i)),this.negate=n}matchOne(e,n){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const s=this.options;if(this.isWindows){const d=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!d&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),b=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),v=g?3:d?0:void 0,y=!b&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:b?0:void 0;if(typeof v=="number"&&typeof y=="number"){const[w,_]=[e[v],n[y]];w.toLowerCase()===_.toLowerCase()&&(n[y]=w,y>v?n=n.slice(y):v>y&&(e=e.slice(v)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,u=e.length,c=n.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=n[a],p=e[o];if(this.debug(n,l,p),l===!1)return!1;if(l===Y){this.debug("GLOBSTAR",[n,l,p]);var h=o,m=a+1;if(m===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;h<u;){var f=e[h];if(this.debug(`
globstar while`,e,h,n,m,f),this.matchOne(e.slice(h),n.slice(m),i))return this.debug("globstar found match!",h,u,f),!0;if(f==="."||f===".."||!s.dot&&f.charAt(0)==="."){this.debug("dot detected!",e,h,n,m);break}this.debug("globstar swallow a segment, and continue"),h++}return!(!i||(this.debug(`
>>> no match, partial?`,e,h,n,m),h!==u))}let d;if(typeof l=="string"?(d=p===l,this.debug("string match",l,p,d)):(d=l.test(p),this.debug("pattern match",l,p,d)),!d)return!1}if(o===u&&a===c)return!0;if(o===u)return i;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Dn(this.pattern,this.options)}parse(e){Mt(e);const n=this.options;if(e==="**")return Y;if(e==="")return"";let i,s=null;(i=e.match(ns))?s=n.dot?ss:is:(i=e.match(Gi))?s=(n.nocase?n.dot?Zi:Yi:n.dot?Hi:Qi)(i[1]):(i=e.match(rs))?s=(n.nocase?n.dot?as:os:n.dot?ls:us)(i):(i=e.match(Xi))?s=n.dot?Ji:Ki:(i=e.match(ts))&&(s=es);const r=U.fromGlob(e,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const n=this.options,i=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",s=new Set(n.nocase?["i"]:[]);let r=e.map((u=>{const c=u.map((l=>{if(l instanceof RegExp)for(const p of l.flags.split(""))s.add(p);return typeof l=="string"?l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):l===Y?Y:l._src}));return c.forEach(((l,p)=>{const h=c[p+1],m=c[p-1];l===Y&&m!==Y&&(m===void 0?h!==void 0&&h!==Y?c[p+1]="(?:\\/|"+i+"\\/)?"+h:c[p]=i:h===void 0?c[p-1]=m+"(?:\\/|"+i+")?":h!==Y&&(c[p-1]=m+"(?:\\/|\\/"+i+"\\/)"+h,c[p+1]=Y))})),c.filter((l=>l!==Y)).join("/")})).join("|");const[o,a]=e.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;const i=this.options;this.isWindows&&(e=e.split("\\").join("/"));const s=this.slashSplit(e);this.debug(this.pattern,"split",s);const r=this.set;this.debug(this.pattern,"set",r);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<r.length;a++){const u=r[a];let c=s;if(i.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,n))return!!i.flipNegate||!this.negate}return!i.flipNegate&&this.negate}static defaults(e){return W.defaults(e).Minimatch}}function be(t){const e=new Error(`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${t.status} ${t.statusText}`);return e.status=t.status,e.response=t,e}function $(t,e){const{status:n}=e;if(n===401&&t.digest)return e;if(n>=400)throw be(e);return e}function pt(t,e){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:e,headers:t.headers?Li(t.headers):{},status:t.status,statusText:t.statusText}:e}W.AST=U,W.Minimatch=Ft,W.escape=function(t){let{windowsPathsNoEscape:e=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")},W.unescape=kt;const cs=(Je=function(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=O({url:N(t.remoteURL,A(e)),method:"COPY",headers:{Destination:N(t.remoteURL,A(n)),Overwrite:i.overwrite===!1?"F":"T",Depth:i.shallow?"0":"infinity"}},t,i);return o=function(a){$(t,a)},(r=S(s,t))&&r.then||(r=Promise.resolve(r)),o?r.then(o):r;var r,o},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(Je.apply(this,t))}catch(n){return Promise.reject(n)}});var Je;const hs={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1},tn=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ds=new RegExp("^["+tn+"]["+tn+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function Sn(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let o=0;o<r;o++)s.push(i[o]);n.push(s),i=e.exec(t)}return n}const qt=function(t){return ds.exec(t)!=null};let ae;ae=typeof Symbol!="function"?"@@xmlMetadata":Symbol("XML Node Metadata");class lt{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n})}addChild(e,n){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),n!==void 0&&(this.child[this.child.length-1][ae]={startIndex:n})}static getMetaDataSymbol(){return ae}}class ps{constructor(e){this.suppressValidationErr=!e}readDocType(e,n){const i={};if(e[n+3]!=="O"||e[n+4]!=="C"||e[n+5]!=="T"||e[n+6]!=="Y"||e[n+7]!=="P"||e[n+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{n+=9;let s=1,r=!1,o=!1,a="";for(;n<e.length;n++)if(e[n]!=="<"||o)if(e[n]===">"){if(o?e[n-1]==="-"&&e[n-2]==="-"&&(o=!1,s--):s--,s===0)break}else e[n]==="["?r=!0:a+=e[n];else{if(r&&at(e,"!ENTITY",n)){let u,c;n+=7,[u,c,n]=this.readEntityExp(e,n+1,this.suppressValidationErr),c.indexOf("&")===-1&&(i[u]={regx:RegExp(`&${u};`,"g"),val:c})}else if(r&&at(e,"!ELEMENT",n)){n+=8;const{index:u}=this.readElementExp(e,n+1);n=u}else if(r&&at(e,"!ATTLIST",n))n+=8;else if(r&&at(e,"!NOTATION",n)){n+=9;const{index:u}=this.readNotationExp(e,n+1,this.suppressValidationErr);n=u}else{if(!at(e,"!--",n))throw new Error("Invalid DOCTYPE");o=!0}s++,a=""}if(s!==0)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:n}}readEntityExp(e,n){n=B(e,n);let i="";for(;n<e.length&&!/\s/.test(e[n])&&e[n]!=='"'&&e[n]!=="'";)i+=e[n],n++;if(Et(i),n=B(e,n),!this.suppressValidationErr){if(e.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[n]==="%")throw new Error("Parameter entities are not supported")}let s="";return[n,s]=this.readIdentifierVal(e,n,"entity"),[i,s,--n]}readNotationExp(e,n){n=B(e,n);let i="";for(;n<e.length&&!/\s/.test(e[n]);)i+=e[n],n++;!this.suppressValidationErr&&Et(i),n=B(e,n);const s=e.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);n+=s.length,n=B(e,n);let r=null,o=null;if(s==="PUBLIC")[n,r]=this.readIdentifierVal(e,n,"publicIdentifier"),e[n=B(e,n)]!=='"'&&e[n]!=="'"||([n,o]=this.readIdentifierVal(e,n,"systemIdentifier"));else if(s==="SYSTEM"&&([n,o]=this.readIdentifierVal(e,n,"systemIdentifier"),!this.suppressValidationErr&&!o))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:r,systemIdentifier:o,index:--n}}readIdentifierVal(e,n,i){let s="";const r=e[n];if(r!=='"'&&r!=="'")throw new Error(`Expected quoted string, found "${r}"`);for(n++;n<e.length&&e[n]!==r;)s+=e[n],n++;if(e[n]!==r)throw new Error(`Unterminated ${i} value`);return[++n,s]}readElementExp(e,n){n=B(e,n);let i="";for(;n<e.length&&!/\s/.test(e[n]);)i+=e[n],n++;if(!this.suppressValidationErr&&!qt(i))throw new Error(`Invalid element name: "${i}"`);let s="";if(e[n=B(e,n)]==="E"&&at(e,"MPTY",n))n+=4;else if(e[n]==="A"&&at(e,"NY",n))n+=2;else if(e[n]==="("){for(n++;n<e.length&&e[n]!==")";)s+=e[n],n++;if(e[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[n]}"`);return{elementName:i,contentModel:s.trim(),index:n}}readAttlistExp(e,n){n=B(e,n);let i="";for(;n<e.length&&!/\s/.test(e[n]);)i+=e[n],n++;Et(i),n=B(e,n);let s="";for(;n<e.length&&!/\s/.test(e[n]);)s+=e[n],n++;if(!Et(s))throw new Error(`Invalid attribute name: "${s}"`);n=B(e,n);let r="";if(e.substring(n,n+8).toUpperCase()==="NOTATION"){if(r="NOTATION",e[n=B(e,n+=8)]!=="(")throw new Error(`Expected '(', found "${e[n]}"`);n++;let a=[];for(;n<e.length&&e[n]!==")";){let u="";for(;n<e.length&&e[n]!=="|"&&e[n]!==")";)u+=e[n],n++;if(u=u.trim(),!Et(u))throw new Error(`Invalid notation name: "${u}"`);a.push(u),e[n]==="|"&&(n++,n=B(e,n))}if(e[n]!==")")throw new Error("Unterminated list of notations");n++,r+=" ("+a.join("|")+")"}else{for(;n<e.length&&!/\s/.test(e[n]);)r+=e[n],n++;const a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(r.toUpperCase()))throw new Error(`Invalid attribute type: "${r}"`)}n=B(e,n);let o="";return e.substring(n,n+8).toUpperCase()==="#REQUIRED"?(o="#REQUIRED",n+=8):e.substring(n,n+7).toUpperCase()==="#IMPLIED"?(o="#IMPLIED",n+=7):[n,o]=this.readIdentifierVal(e,n,"ATTLIST"),{elementName:i,attributeName:s,attributeType:r,defaultValue:o,index:n}}}const B=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function at(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function Et(t){if(qt(t))return t;throw new Error(`Invalid entity name ${t}`)}const fs=/^[-+]?0x[a-fA-F0-9]+$/,ms=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,gs={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0},vs=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function On(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1}class bs{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,i)=>en(i,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,i)=>en(i,16,"&#x")}},this.addExternalEntities=ys,this.parseXml=Cs,this.parseTextData=ws,this.resolveNameSpace=_s,this.buildAttributesMap=Es,this.isItStopNode=As,this.replaceEntitiesValue=Ps,this.readStopNodeData=Ns,this.saveTextToParentTag=Ts,this.addChild=ks,this.ignoreAttributesFn=On(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let n=0;n<this.options.stopNodes.length;n++){const i=this.options.stopNodes[n];typeof i=="string"&&(i.startsWith("*.")?this.stopNodesWildcard.add(i.substring(2)):this.stopNodesExact.add(i))}}}}function ys(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function ws(t,e,n,i,s,r,o){if(t!==void 0&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const a=this.options.tagValueProcessor(e,t,n,s,r);return a==null?t:typeof a!=typeof t||a!==t?a:this.options.trimValues||t.trim()===t?$n(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function _s(t){if(this.options.removeNSPrefix){const e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=n+e[1])}return t}const xs=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Es(t,e){if(this.options.ignoreAttributes!==!0&&typeof t=="string"){const n=Sn(t,xs),i=n.length,s={};for(let r=0;r<i;r++){const o=this.resolveNameSpace(n[r][1]);if(this.ignoreAttributesFn(o,e))continue;let a=n[r][4],u=this.options.attributeNamePrefix+o;if(o.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),u==="__proto__"&&(u="#__proto__"),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);const c=this.options.attributeValueProcessor(o,a,e);s[u]=c==null?a:typeof c!=typeof a||c!==a?c:$n(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[u]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const r={};return r[this.options.attributesGroupName]=s,r}return s}}const Cs=function(t){t=t.replace(/\r\n?/g,`
`);const e=new lt("!xml");let n=e,i="",s="";const r=new ps(this.options.processEntities);for(let o=0;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="/"){const a=ut(t,">",o,"Closing Tag is not closed.");let u=t.substring(o+2,a).trim();if(this.options.removeNSPrefix){const p=u.indexOf(":");p!==-1&&(u=u.substr(p+1))}this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&(i=this.saveTextToParentTag(i,n,s));const c=s.substring(s.lastIndexOf(".")+1);if(u&&this.options.unpairedTags.indexOf(u)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${u}>`);let l=0;c&&this.options.unpairedTags.indexOf(c)!==-1?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",o=a}else if(t[o+1]==="?"){let a=le(t,o,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const u=new lt(a.tagName);u.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(u[":@"]=this.buildAttributesMap(a.tagExp,s)),this.addChild(n,u,s,o)}o=a.closeIndex+1}else if(t.substr(o+1,3)==="!--"){const a=ut(t,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const u=t.substring(o+4,a-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:u}])}o=a}else if(t.substr(o+1,2)==="!D"){const a=r.readDocType(t,o);this.docTypeEntities=a.entities,o=a.i}else if(t.substr(o+1,2)==="!["){const a=ut(t,"]]>",o,"CDATA is not closed.")-2,u=t.substring(o+9,a);i=this.saveTextToParentTag(i,n,s);let c=this.parseTextData(u,n.tagname,s,!0,!1,!0,!0);c==null&&(c=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:u}]):n.add(this.options.textNodeName,c),o=a+2}else{let a=le(t,o,this.options.removeNSPrefix),u=a.tagName;const c=a.rawTagName;let l=a.tagExp,p=a.attrExpPresent,h=a.closeIndex;if(this.options.transformTagName){const d=this.options.transformTagName(u);l===u&&(l=d),u=d}n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,s,!1));const m=n;m&&this.options.unpairedTags.indexOf(m.tagname)!==-1&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),u!==e.tagname&&(s+=s?"."+u:u);const f=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,u)){let d="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)u[u.length-1]==="/"?(u=u.substr(0,u.length-1),s=s.substr(0,s.length-1),l=u):l=l.substr(0,l.length-1),o=a.closeIndex;else if(this.options.unpairedTags.indexOf(u)!==-1)o=a.closeIndex;else{const b=this.readStopNodeData(t,c,h+1);if(!b)throw new Error(`Unexpected end of ${c}`);o=b.i,d=b.tagContent}const g=new lt(u);u!==l&&p&&(g[":@"]=this.buildAttributesMap(l,s)),d&&(d=this.parseTextData(d,u,s,!0,p,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),g.add(this.options.textNodeName,d),this.addChild(n,g,s,f)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){if(u[u.length-1]==="/"?(u=u.substr(0,u.length-1),s=s.substr(0,s.length-1),l=u):l=l.substr(0,l.length-1),this.options.transformTagName){const g=this.options.transformTagName(u);l===u&&(l=g),u=g}const d=new lt(u);u!==l&&p&&(d[":@"]=this.buildAttributesMap(l,s)),this.addChild(n,d,s,f),s=s.substr(0,s.lastIndexOf("."))}else{const d=new lt(u);this.tagsNodeStack.push(n),u!==l&&p&&(d[":@"]=this.buildAttributesMap(l,s)),this.addChild(n,d,s,f),n=d}i="",o=h}}else i+=t[o];return e.child};function ks(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.updateTag(e.tagname,n,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),t.addChild(e,i))}const Ps=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function Ts(t,e,n,i){return t&&(i===void 0&&(i=e.child.length===0),(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&Object.keys(e[":@"]).length!==0,i))!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function As(t,e,n,i){return!(!e||!e.has(i))||!(!t||!t.has(n))}function ut(t,e,n,i){const s=t.indexOf(e,n);if(s===-1)throw new Error(i);return s+e.length-1}function le(t,e,n){const i=(function(l,p){let h,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",f="";for(let d=p;d<l.length;d++){let g=l[d];if(h)g===h&&(h="");else if(g==='"'||g==="'")h=g;else if(g===m[0]){if(!m[1])return{data:f,index:d};if(l[d+1]===m[1])return{data:f,index:d}}else g===" "&&(g=" ");f+=g}})(t,e+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!i)return;let s=i.data;const r=i.index,o=s.search(/\s/);let a=s,u=!0;o!==-1&&(a=s.substring(0,o),s=s.substring(o+1).trimStart());const c=a;if(n){const l=a.indexOf(":");l!==-1&&(a=a.substr(l+1),u=a!==i.data.substr(l+1))}return{tagName:a,tagExp:s,closeIndex:r,attrExpPresent:u,rawTagName:c}}function Ns(t,e,n){const i=n;let s=1;for(;n<t.length;n++)if(t[n]==="<")if(t[n+1]==="/"){const r=ut(t,">",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,s===0))return{tagContent:t.substring(i,n),i:r};n=r}else if(t[n+1]==="?")n=ut(t,"?>",n+1,"StopNode is not closed.");else if(t.substr(n+1,3)==="!--")n=ut(t,"-->",n+3,"StopNode is not closed.");else if(t.substr(n+1,2)==="![")n=ut(t,"]]>",n,"StopNode is not closed.")-2;else{const r=le(t,n,">");r&&((r&&r.tagName)===e&&r.tagExp[r.tagExp.length-1]!=="/"&&s++,n=r.closeIndex)}}function $n(t,e,n){if(e&&typeof t=="string"){const i=t.trim();return i==="true"||i!=="false"&&(function(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r=Object.assign({},gs,r),!s||typeof s!="string")return s;let o=s.trim();if(r.skipLike!==void 0&&r.skipLike.test(o))return s;if(s==="0")return 0;if(r.hex&&fs.test(o))return(function(u){if(parseInt)return parseInt(u,16);if(Number.parseInt)return Number.parseInt(u,16);if(window&&window.parseInt)return window.parseInt(u,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")})(o);if(o.includes("e")||o.includes("E"))return(function(u,c,l){if(!l.eNotation)return u;const p=c.match(vs);if(p){let h=p[1]||"";const m=p[3].indexOf("e")===-1?"E":"e",f=p[2],d=h?u[f.length+1]===m:u[f.length]===m;return f.length>1&&d?u:f.length!==1||!p[3].startsWith(`.${m}`)&&p[3][0]!==m?l.leadingZeros&&!d?(c=(p[1]||"")+p[3],Number(c)):u:Number(c)}return u})(s,o,r);{const u=ms.exec(o);if(u){const c=u[1]||"",l=u[2];let p=((a=u[3])&&a.indexOf(".")!==-1&&((a=a.replace(/0+$/,""))==="."?a="0":a[0]==="."?a="0"+a:a[a.length-1]==="."&&(a=a.substring(0,a.length-1))),a);const h=c?s[l.length+1]===".":s[l.length]===".";if(!r.leadingZeros&&(l.length>1||l.length===1&&!h))return s;{const m=Number(o),f=String(m);if(m===0)return m;if(f.search(/[eE]/)!==-1)return r.eNotation?m:s;if(o.indexOf(".")!==-1)return f==="0"||f===p||f===`${c}${p}`?m:s;let d=l?p:o;return l?d===f||c+d===f?m:s:d===f||d===c+f?m:s}}return s}var a})(t,n)}return t!==void 0?t:""}function en(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}const Kt=lt.getMetaDataSymbol();function Ds(t,e){return In(t,e)}function In(t,e,n){let i;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=Ss(o);let u="";if(u=n===void 0?a:n+"."+a,a===e.textNodeName)i===void 0?i=o[a]:i+=""+o[a];else{if(a===void 0)continue;if(o[a]){let c=In(o[a],e,u);const l=$s(c,e);o[Kt]!==void 0&&(c[Kt]=o[Kt]),o[":@"]?Os(c,o[":@"],u,e):Object.keys(c).length!==1||c[e.textNodeName]===void 0||e.alwaysCreateTextNode?Object.keys(c).length===0&&(e.alwaysCreateTextNode?c[e.textNodeName]="":c=""):c=c[e.textNodeName],s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(c)):e.isArray(a,u,l)?s[a]=[c]:s[a]=c}}}return typeof i=="string"?i.length>0&&(s[e.textNodeName]=i):i!==void 0&&(s[e.textNodeName]=i),s}function Ss(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(i!==":@")return i}}function Os(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const a=s[o];i.isArray(a,n+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}}function $s(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return i===0||!(i!==1||!t[n]&&typeof t[n]!="boolean"&&t[n]!==0)}const Is={allowBooleanAttributes:!1,unpairedTags:[]};function nn(t){return t===" "||t===" "||t===`
`||t==="\r"}function sn(t,e){const n=e;for(;e<t.length;e++)if(!(t[e]!="?"&&t[e]!=" ")){const i=t.substr(n,e-n);if(e>5&&i==="xml")return D("InvalidXml","XML declaration allowed only at the start of the document.",R(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}}return e}function rn(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}function Ls(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]==='"'||t[e]==="'")i===""?i=t[e]:i!==t[e]||(i="");else if(t[e]===">"&&i===""){s=!0;break}n+=t[e]}return i===""&&{value:n,index:e,tagClosed:s}}const js=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function on(t,e){const n=Sn(t,js),i={};for(let s=0;s<n.length;s++){if(n[s][1].length===0)return D("InvalidAttr","Attribute '"+n[s][2]+"' has no space in starting.",Ct(n[s]));if(n[s][3]!==void 0&&n[s][4]===void 0)return D("InvalidAttr","Attribute '"+n[s][2]+"' is without value.",Ct(n[s]));if(n[s][3]===void 0&&!e.allowBooleanAttributes)return D("InvalidAttr","boolean attribute '"+n[s][2]+"' is not allowed.",Ct(n[s]));const r=n[s][2];if(!Rs(r))return D("InvalidAttr","Attribute '"+r+"' is an invalid name.",Ct(n[s]));if(i.hasOwnProperty(r))return D("InvalidAttr","Attribute '"+r+"' is repeated.",Ct(n[s]));i[r]=1}return!0}function Ws(t,e){if(t[++e]===";")return-1;if(t[e]==="#")return(function(i,s){let r=/\d/;for(i[s]==="x"&&(s++,r=/[\da-fA-F]/);s<i.length;s++){if(i[s]===";")return s;if(!i[s].match(r))break}return-1})(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return-1}return e}function D(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function Rs(t){return qt(t)}function R(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ct(t){return t.startIndex+t[1].length}class Ln{constructor(e){this.externalEntities={},this.options=(function(n){return Object.assign({},hs,n)})(e)}parse(e,n){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const r=(function(o,a){a=Object.assign({},Is,a);const u=[];let c=!1,l=!1;o[0]==="\uFEFF"&&(o=o.substr(1));for(let p=0;p<o.length;p++)if(o[p]==="<"&&o[p+1]==="?"){if(p+=2,p=sn(o,p),p.err)return p}else{if(o[p]!=="<"){if(nn(o[p]))continue;return D("InvalidChar","char '"+o[p]+"' is not expected.",R(o,p))}{let h=p;if(p++,o[p]==="!"){p=rn(o,p);continue}{let m=!1;o[p]==="/"&&(m=!0,p++);let f="";for(;p<o.length&&o[p]!==">"&&o[p]!==" "&&o[p]!==" "&&o[p]!==`
`&&o[p]!=="\r";p++)f+=o[p];if(f=f.trim(),f[f.length-1]==="/"&&(f=f.substring(0,f.length-1),p--),!qt(f)){let b;return b=f.trim().length===0?"Invalid space after '<'.":"Tag '"+f+"' is an invalid name.",D("InvalidTag",b,R(o,p))}const d=Ls(o,p);if(d===!1)return D("InvalidAttr","Attributes for '"+f+"' have open quote.",R(o,p));let g=d.value;if(p=d.index,g[g.length-1]==="/"){const b=p-g.length;g=g.substring(0,g.length-1);const v=on(g,a);if(v!==!0)return D(v.err.code,v.err.msg,R(o,b+v.err.line));c=!0}else if(m){if(!d.tagClosed)return D("InvalidTag","Closing tag '"+f+"' doesn't have proper closing.",R(o,p));if(g.trim().length>0)return D("InvalidTag","Closing tag '"+f+"' can't have attributes or invalid starting.",R(o,h));if(u.length===0)return D("InvalidTag","Closing tag '"+f+"' has not been opened.",R(o,h));{const b=u.pop();if(f!==b.tagName){let v=R(o,b.tagStartPos);return D("InvalidTag","Expected closing tag '"+b.tagName+"' (opened in line "+v.line+", col "+v.col+") instead of closing tag '"+f+"'.",R(o,h))}u.length==0&&(l=!0)}}else{const b=on(g,a);if(b!==!0)return D(b.err.code,b.err.msg,R(o,p-g.length+b.err.line));if(l===!0)return D("InvalidXml","Multiple possible root nodes found.",R(o,p));a.unpairedTags.indexOf(f)!==-1||u.push({tagName:f,tagStartPos:h}),c=!0}for(p++;p<o.length;p++)if(o[p]==="<"){if(o[p+1]==="!"){p++,p=rn(o,p);continue}if(o[p+1]!=="?")break;if(p=sn(o,++p),p.err)return p}else if(o[p]==="&"){const b=Ws(o,p);if(b==-1)return D("InvalidChar","char '&' is not expected.",R(o,p));p=b}else if(l===!0&&!nn(o[p]))return D("InvalidXml","Extra text at the end",R(o,p));o[p]==="<"&&p--}}}return c?u.length==1?D("InvalidTag","Unclosed tag '"+u[0].tagName+"'.",R(o,u[0].tagStartPos)):!(u.length>0)||D("InvalidXml","Invalid '"+JSON.stringify(u.map((p=>p.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):D("InvalidXml","Start tag expected.",1)})(e,n);if(r!==!0)throw Error(`${r.err.msg}:${r.err.line}:${r.err.col}`)}const i=new bs(this.options);i.addExternalEntities(this.externalEntities);const s=i.parseXml(e);return this.options.preserveOrder||s===void 0?s:Ds(s,this.options)}addEntity(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n}static getMetaDataSymbol(){return lt.getMetaDataSymbol()}}var Us=T(829),tt=T.n(Us),ht=(function(t){return t.Array="array",t.Object="object",t.Original="original",t})(ht||{});function jn(t,e){if(!t.endsWith("propstat.prop.displayname"))return e}function It(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ht.Original;const i=tt().get(t,e);return n==="array"&&Array.isArray(i)===!1?[i]:n==="object"&&Array.isArray(i)?i[0]:i}function zt(t,e){return e=e??{attributeNamePrefix:"@",attributeParsers:[],tagParsers:[jn]},new Promise((n=>{n((function(i){const{multistatus:s}=i;if(s==="")return{multistatus:{response:[]}};if(!s)throw new Error("Invalid response: No root multistatus found");const r={multistatus:Array.isArray(s)?s[0]:s};return tt().set(r,"multistatus.response",It(r,"multistatus.response",ht.Array)),tt().set(r,"multistatus.response",tt().get(r,"multistatus.response").map((o=>(function(a){const u=Object.assign({},a);return u.status?tt().set(u,"status",It(u,"status",ht.Object)):(tt().set(u,"propstat",It(u,"propstat",ht.Object)),tt().set(u,"propstat.prop",It(u,"propstat.prop",ht.Object))),u})(o)))),r})((function(i){let{attributeNamePrefix:s,attributeParsers:r,tagParsers:o}=i;return new Ln({allowBooleanAttributes:!0,attributeNamePrefix:s,textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor(a,u,c){for(const l of r)try{const p=l(c,u);if(p!==u)return p}catch{}return u},tagValueProcessor(a,u,c){for(const l of o)try{const p=l(c,u);if(p!==u)return p}catch{}return u}})})(e).parse(t)))}))}function ye(t,e){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:i=null,getcontentlength:s="0",resourcetype:r=null,getcontenttype:o=null,getetag:a=null}=t,u=r&&typeof r=="object"&&r.collection!==void 0?"directory":"file",c={filename:e,basename:Wt().basename(e),lastmod:i,size:parseInt(s,10),type:u,etag:typeof a=="string"?a.replace(/"/g,""):null};return u==="file"&&(c.mime=o&&typeof o=="string"?o.split(";")[0]:""),n&&(t.displayname!==void 0&&(t.displayname=String(t.displayname)),c.props=t),c}function Ms(t,e){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=null;try{t.multistatus.response[0].propstat&&(i=t.multistatus.response[0])}catch{}if(!i)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:s,status:r}}=i,[o,a,u]=r.split(" ",3),c=parseInt(a,10);if(c>=400){const l=new Error(`Invalid response: ${c} ${u}`);throw l.status=c,l}return ye(s,Tt(e),n)}function Fs(t){switch(String(t)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(t),10)}}function Jt(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const we=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:i=!1}=n,s=O({url:N(t.remoteURL,A(e)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},t,n);return Jt(S(s,t),(function(r){return $(t,r),Jt(r.text(),(function(o){return Jt(zt(o,t.parsing),(function(a){const u=Ms(a,e,i);return pt(r,u,i)}))}))}))}));function Wn(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const Bs=Rn((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=(function(r){if(!r||r==="/")return[];let o=r;const a=[];do a.push(o),o=Wt().dirname(o);while(o&&o!=="/");return a})(Tt(e));i.sort(((r,o)=>r.length>o.length?1:o.length>r.length?-1:0));let s=!1;return(function(r,o,a){if(typeof r[ln]=="function"){let d=function(g){try{for(;!(u=p.next()).done;)if((g=o(u.value))&&g.then){if(!un(g))return void g.then(d,l||(l=M.bind(null,c=new dt,2)));g=g.v}c?M(c,1,g):c=g}catch(b){M(c||(c=new dt),2,b)}};var u,c,l,p=r[ln]();if(d(),p.return){var h=function(g){try{u.done||p.return()}catch{}return g};if(c&&c.then)return c.then(h,(function(g){throw h(g)}));h()}return c}if(!("length"in r))throw new TypeError("Object is not iterable");for(var m=[],f=0;f<r.length;f++)m.push(r[f]);return(function(d,g,b){var v,y,w=-1;return(function _(E){try{for(;++w<d.length&&(!b||!b());)if((E=g(w))&&E.then){if(!un(E))return void E.then(_,y||(y=M.bind(null,v=new dt,2)));E=E.v}v?M(v,1,E):v=E}catch(C){M(v||(v=new dt),2,C)}})(),v})(m,(function(d){return o(m[d])}),a)})(i,(function(r){return o=function(){return(function(u,c){try{var l=Wn(we(t,r),(function(p){if(p.type!=="directory")throw new Error(`Path includes a file: ${e}`)}))}catch(p){return c(p)}return l&&l.then?l.then(void 0,c):l})(0,(function(u){const c=u;return(function(){if(c.status===404)return s=!0,an(ue(t,r,{...n,recursive:!1}));throw u})()}))},(a=(function(){if(s)return an(ue(t,r,{...n,recursive:!1}))})())&&a.then?a.then(o):o();var o,a}),(function(){return!1}))}));function Rn(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}}function Vs(){}function an(t,e){return t&&t.then?t.then(Vs):Promise.resolve()}const ln=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function M(t,e,n){if(!t.s){if(n instanceof dt){if(!n.s)return void(n.o=M.bind(null,t,e));1&e&&(e=n.s),n=n.v}if(n&&n.then)return void n.then(M.bind(null,t,e),M.bind(null,t,2));t.s=e,t.v=n;const i=t.o;i&&i(t)}}const dt=(function(){function t(){}return t.prototype.then=function(e,n){const i=new t,s=this.s;if(s){const r=1&s?e:n;if(r){try{M(i,1,r(this.v))}catch(o){M(i,2,o)}return i}return this}return this.o=function(r){try{const o=r.v;1&r.s?M(i,1,e?e(o):o):n?M(i,1,n(o)):M(i,2,o)}catch(o){M(i,2,o)}},i},t})();function un(t){return t instanceof dt&&1&t.s}const ue=Rn((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return Bs(t,e,n);const i=O({url:N(t.remoteURL,(s=A(e),s.endsWith("/")?s:s+"/")),method:"MKCOL"},t,n);var s;return Wn(S(i,t),(function(r){$(t,r)}))}));var qs=T(388),cn=T.n(qs);const zs=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let a=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(a=`${a}${n.range.end}`),i.Range=a}const s=O({url:N(t.remoteURL,A(e)),method:"GET",headers:i},t,n);return o=function(a){if($(t,a),i.Range&&a.status!==206){const u=new Error(`Invalid response code for partial request: ${a.status}`);throw u.status=a.status,u}return n.callback&&setTimeout((()=>{n.callback(a)}),0),a.body},(r=S(s,t))&&r.then||(r=Promise.resolve(r)),o?r.then(o):r;var r,o})),Gs=()=>{},Qs=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e,n){n.url||(n.url=N(t.remoteURL,A(e)));const i=O(n,t,{});return r=function(o){return $(t,o),o},(s=S(i,t))&&s.then||(s=Promise.resolve(s)),r?s.then(r):s;var s,r})),Hs=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=O({url:N(t.remoteURL,A(e)),method:"DELETE"},t,n);return r=function(o){$(t,o)},(s=S(i,t))&&s.then||(s=Promise.resolve(s)),r?s.then(r):s;var s,r})),Ys=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function(i,s){try{var r=(o=we(t,e,n),a=function(){return!0},u?a?a(o):o:(o&&o.then||(o=Promise.resolve(o)),a?o.then(a):o))}catch(c){return s(c)}var o,a,u;return r&&r.then?r.then(void 0,s):r})(0,(function(i){if(i.status===404)return!1;throw i}))}));function te(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const Zs=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=O({url:N(t.remoteURL,A(e),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},t,n);return te(S(i,t),(function(s){return $(t,s),te(s.text(),(function(r){if(!r)throw new Error("Failed parsing directory contents: Empty response");return te(zt(r,t.parsing),(function(o){const a=Fe(e);let u=(function(c,l,p){let h=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const f=Wt().join(l,"/"),{multistatus:{response:d}}=c,g=d.map((b=>{const v=(function(w){try{return w.replace(/^https?:\/\/[^\/]+/,"")}catch(_){throw new F(_,"Failed normalising HREF")}})(b.href),{propstat:{prop:y}}=b;return ye(y,f==="/"?decodeURIComponent(Tt(v)):Tt(Wt().relative(decodeURIComponent(f),decodeURIComponent(v))),h)}));return m?g:g.filter((b=>b.basename&&(b.type==="file"||b.filename!==p.replace(/\/$/,""))))})(o,Fe(t.remoteBasePath||t.remotePath),a,n.details,n.includeSelf);return n.glob&&(u=(function(c,l){return c.filter((p=>W(p.filename,l,{matchBase:!0})))})(u,n.glob)),pt(s,u,n.details)}))}))}))}));function _e(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}}const Xs=_e((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=O({url:N(t.remoteURL,A(e)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[tr]},t,n);return Bt(S(i,t),(function(s){return $(t,s),Bt(s.text(),(function(r){return pt(s,r,n.details)}))}))}));function Bt(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const Ks=_e((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=O({url:N(t.remoteURL,A(e)),method:"GET"},t,n);return Bt(S(i,t),(function(s){let r;return $(t,s),(function(o,a){var u=o();return u&&u.then?u.then(a):a()})((function(){return Bt(s.arrayBuffer(),(function(o){r=o}))}),(function(){return pt(s,r,n.details)}))}))})),Js=_e((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:i="binary"}=n;if(i!=="binary"&&i!=="text")throw new F({info:{code:rt.InvalidOutputFormat}},`Invalid output format: ${i}`);return i==="text"?Xs(t,e,n):Ks(t,e,n)})),tr=t=>t;function er(t,e){let n="";return e.format&&e.indentBy.length>0&&(n=`
`),Un(t,e,"",n)}function Un(t,e,n,i){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],u=nr(a);if(u===void 0)continue;let c="";if(c=n.length===0?u:`${n}.${u}`,u===e.textNodeName){let m=a[u];ir(c,e)||(m=e.tagValueProcessor(u,m),m=Mn(m,e)),r&&(s+=i),s+=m,r=!1;continue}if(u===e.cdataPropName){r&&(s+=i),s+=`<![CDATA[${a[u][0][e.textNodeName]}]]>`,r=!1;continue}if(u===e.commentPropName){s+=i+`<!--${a[u][0][e.textNodeName]}-->`,r=!0;continue}if(u[0]==="?"){const m=hn(a[":@"],e),f=u==="?xml"?"":i;let d=a[u][0][e.textNodeName];d=d.length!==0?" "+d:"",s+=f+`<${u}${d}${m}?>`,r=!0;continue}let l=i;l!==""&&(l+=e.indentBy);const p=i+`<${u}${hn(a[":@"],e)}`,h=Un(a[u],e,c,l);e.unpairedTags.indexOf(u)!==-1?e.suppressUnpairedNode?s+=p+">":s+=p+"/>":h&&h.length!==0||!e.suppressEmptyNode?h&&h.endsWith(">")?s+=p+`>${h}${i}</${u}>`:(s+=p+">",h&&i!==""&&(h.includes("/>")||h.includes("</"))?s+=i+e.indentBy+h+i:s+=h,s+=`</${u}>`):s+=p+"/>",r=!0}return s}function nr(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&i!==":@")return i}}function hn(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let s=e.attributeValueProcessor(i,t[i]);s=Mn(s,e),s===!0&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function ir(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function Mn(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const sr={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function st(t){this.options=Object.assign({},sr,t),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=On(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ar),this.processTextOrObjNode=rr,this.options.format?(this.indentate=or,this.tagEndChar=`>
`,this.newLine=`
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function rr(t,e,n,i){const s=this.j2x(t,n+1,i.concat(e));return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}function or(t){return this.options.indentBy.repeat(t)}function ar(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}function lr(t){return new st({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Fn({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:t}}},"d"))}function Fn(t,e){const n={...t};for(const i in n)n.hasOwnProperty(i)&&(n[i]&&typeof n[i]=="object"&&i.indexOf(":")===-1?(n[`${e}:${i}`]=Fn(n[i],e),delete n[i]):/^@_/.test(i)===!1&&(n[`${e}:${i}`]=n[i],delete n[i]));return n}function ce(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function Bn(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}}st.prototype.build=function(t){return this.options.preserveOrder?er(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},st.prototype.j2x=function(t,e,n){let i="",s="";const r=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(t[o]===void 0)this.isAttribute(o)&&(s+="");else if(t[o]===null)this.isAttribute(o)||o===this.options.cdataPropName?s+="":o[0]==="?"?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if(typeof t[o]!="object"){const a=this.isAttribute(o);if(a&&!this.ignoreAttributesFn(a,r))i+=this.buildAttrPairStr(a,""+t[o]);else if(!a)if(o===this.options.textNodeName){let u=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(u)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const a=t[o].length;let u="",c="";for(let l=0;l<a;l++){const p=t[o][l];if(p!==void 0)if(p===null)o[0]==="?"?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(typeof p=="object")if(this.options.oneListGroup){const h=this.j2x(p,e+1,n.concat(o));u+=h.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(c+=h.attrStr)}else u+=this.processTextOrObjNode(p,o,e,n);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(o,p);h=this.replaceEntitiesValue(h),u+=h}else u+=this.buildTextValNode(p,o,"",e)}this.options.oneListGroup&&(u=this.buildObjectNode(u,o,c,e)),s+=u}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const a=Object.keys(t[o]),u=a.length;for(let c=0;c<u;c++)i+=this.buildAttrPairStr(a[c],""+t[o][a[c]])}else s+=this.processTextOrObjNode(t[o],o,e,n);return{attrStr:i,val:s}},st.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'},st.prototype.buildObjectNode=function(t,e,n,i){if(t==="")return e[0]==="?"?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return e[0]==="?"&&(r="?",s=""),!n&&n!==""||t.indexOf("<")!==-1?this.options.commentPropName!==!1&&e===this.options.commentPropName&&r.length===0?this.indentate(i)+`<!--${t}-->`+this.newLine:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+"<"+e+n+r+">"+t+s}},st.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},st.prototype.buildTextValNode=function(t,e,n,i){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(i)+`<!--${t}-->`+this.newLine;if(e[0]==="?")return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),s===""?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}},st.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};const ur=Bn((function(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=O({url:N(t.remoteURL,A(e)),method:"UNLOCK",headers:{"Lock-Token":n}},t,i);return ce(S(s,t),(function(r){if($(t,r),r.status!==204&&r.status!==200)throw be(r)}))})),cr=Bn((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:i,timeout:s=hr}=n,r={Accept:"text/plain,application/xml",Timeout:s};i&&(r.If=i);const o=O({url:N(t.remoteURL,A(e)),method:"LOCK",headers:r,data:lr(t.contactHref)},t,n);return ce(S(o,t),(function(a){return $(t,a),ce(a.text(),(function(u){const c=(h=u,new Ln({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(h)),l=tt().get(c,"prop.lockdiscovery.activelock.locktoken.href"),p=tt().get(c,"prop.lockdiscovery.activelock.timeout");var h;if(!l)throw be(a,"No lock token received: ");return{token:l,serverTimeout:p}}))}))})),hr="Infinite, Second-4100000000";function ee(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const dr=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=e.path||"/",i=O({url:N(t.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},t,e);return ee(S(i,t),(function(s){return $(t,s),ee(s.text(),(function(r){return ee(zt(r,t.parsing),(function(o){const a=(function(u){try{const[c]=u.multistatus.response,{propstat:{prop:{"quota-used-bytes":l,"quota-available-bytes":p}}}=c;return l!==void 0&&p!==void 0?{used:parseInt(String(l),10),available:Fs(p)}:null}catch{}return null})(o);return pt(s,a,e.details)}))}))}))}));function ne(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const pr=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:i=!1}=n,s=O({url:N(t.remoteURL,A(e)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":t.headers["Content-Type"]||"application/xml; charset=utf-8"}},t,n);return ne(S(s,t),(function(r){return $(t,r),ne(r.text(),(function(o){return ne(zt(o,t.parsing),(function(a){const u=(function(c,l,p){const h={truncated:!1,results:[]};return h.truncated=c.multistatus.response.some((m=>(m.status||m.propstat?.status).split(" ",3)?.[1]==="507"&&m.href.replace(/\/$/,"").endsWith(A(l).replace(/\/$/,"")))),c.multistatus.response.forEach((m=>{if(m.propstat===void 0)return;const f=m.href.split("/").map(decodeURIComponent).join("/");h.results.push(ye(m.propstat.prop,f,p))})),h})(a,e,i);return pt(r,u,i)}))}))}))})),fr=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=O({url:N(t.remoteURL,A(e)),method:"MOVE",headers:{Destination:N(t.remoteURL,A(n)),Overwrite:i.overwrite===!1?"F":"T"}},t,i);return o=function(a){$(t,a)},(r=S(s,t))&&r.then||(r=Promise.resolve(r)),o?r.then(o):r;var r,o}));var mr=T(172);function gr(t){if(Cn(t))return t.byteLength;if(kn(t))return t.length;if(typeof t=="string")return(0,mr.d)(t);throw new F({info:{code:rt.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}const vr=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:s=!0,overwrite:r=!0}=i,o={"Content-Type":"application/octet-stream"};s===!1||(o["Content-Length"]=typeof s=="number"?`${s}`:`${gr(n)}`),r||(o["If-None-Match"]="*");const a=O({url:N(t.remoteURL,A(e)),method:"PUT",headers:o,data:n},t,i);return c=function(l){try{$(t,l)}catch(p){const h=p;if(h.status!==412||r)throw h;return!1}return!0},(u=S(a,t))&&u.then||(u=Promise.resolve(u)),c?u.then(c):u;var u,c})),Vn=(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}})((function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=O({url:N(t.remoteURL,A(e)),method:"OPTIONS"},t,n);return r=function(o){try{$(t,o)}catch(a){throw a}return{compliance:(o.headers.get("DAV")??"").split(",").map((a=>a.trim())),server:o.headers.get("Server")??""}},(s=S(i,t))&&s.then||(s=Promise.resolve(s)),r?s.then(r):s;var s,r}));function Pt(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const br=xe((function(t,e,n,i,s){let r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>i||n<0)throw new F({info:{code:rt.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const o={"Content-Type":"application/octet-stream","Content-Length":""+(i-n+1),"Content-Range":`bytes ${n}-${i}/*`},a=O({url:N(t.remoteURL,A(e)),method:"PUT",headers:o,data:s},t,r);return Pt(S(a,t),(function(u){$(t,u)}))}));function dn(t,e){var n=t();return n&&n.then?n.then(e):e(n)}const yr=xe((function(t,e,n,i,s){let r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>i||n<0)throw new F({info:{code:rt.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const o={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(i-n+1),"X-Update-Range":`bytes=${n}-${i}`},a=O({url:N(t.remoteURL,A(e)),method:"PATCH",headers:o,data:s},t,r);return Pt(S(a,t),(function(u){$(t,u)}))}));function xe(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}}const wr=xe((function(t,e,n,i,s){let r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Pt(Vn(t,e,r),(function(o){let a=!1;return dn((function(){if(o.compliance.includes("sabredav-partialupdate"))return Pt(yr(t,e,n,i,s,r),(function(u){return a=!0,u}))}),(function(u){let c=!1;return a?u:dn((function(){if(o.server.includes("Apache")&&o.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return Pt(br(t,e,n,i,s,r),(function(l){return c=!0,l}))}),(function(l){if(c)return l;throw new F({info:{code:rt.NotSupported}},"Not supported")}))}))}))})),_r="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function xr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:i,contactHref:s=_r,ha1:r,headers:o={},httpAgent:a,httpsAgent:u,password:c,token:l,username:p,withCredentials:h}=e;let m=n;m||(m=p||c?V.Password:V.None);const f={authType:m,remoteBasePath:i,contactHref:s,ha1:r,headers:Object.assign({},o),httpAgent:a,httpsAgent:u,password:c,parsing:{attributeNamePrefix:e.attributeNamePrefix??"@",attributeParsers:[],tagParsers:[jn]},remotePath:Ni(t),remoteURL:t,token:l,username:p,withCredentials:h};return _n(f,p,c,l,r),{copyFile:(d,g,b)=>cs(f,d,g,b),createDirectory:(d,g)=>ue(f,d,g),createReadStream:(d,g)=>(function(b,v){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const w=new(cn()).PassThrough;return zs(b,v,y).then((_=>{_.pipe(w)})).catch((_=>{w.emit("error",_)})),w})(f,d,g),createWriteStream:(d,g,b)=>(function(v,y){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Gs;const E=new(cn()).PassThrough,C={};w.overwrite===!1&&(C["If-None-Match"]="*");const P=O({url:N(v.remoteURL,A(y)),method:"PUT",headers:C,data:E,maxRedirects:0},v,w);return S(P,v).then((k=>$(v,k))).then((k=>{setTimeout((()=>{_(k)}),0)})).catch((k=>{E.emit("error",k)})),E})(f,d,g,b),customRequest:(d,g)=>Qs(f,d,g),deleteFile:(d,g)=>Hs(f,d,g),exists:(d,g)=>Ys(f,d,g),getDirectoryContents:(d,g)=>Zs(f,d,g),getFileContents:(d,g)=>Js(f,d,g),getFileDownloadLink:d=>(function(g,b){let v=N(g.remoteURL,A(b));const y=/^https:/i.test(v)?"https":"http";switch(g.authType){case V.None:break;case V.Password:{const w=Ve(g.headers.Authorization.replace(/^Basic /i,"").trim());v=v.replace(/^https?:\/\//,`${y}://${w}@`);break}default:throw new F({info:{code:rt.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${g.authType}`)}return v})(f,d),getFileUploadLink:d=>(function(g,b){let v=`${N(g.remoteURL,A(b))}?Content-Type=application/octet-stream`;const y=/^https:/i.test(v)?"https":"http";switch(g.authType){case V.None:break;case V.Password:{const w=Ve(g.headers.Authorization.replace(/^Basic /i,"").trim());v=v.replace(/^https?:\/\//,`${y}://${w}@`);break}default:throw new F({info:{code:rt.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${g.authType}`)}return v})(f,d),getHeaders:()=>Object.assign({},f.headers),getQuota:d=>dr(f,d),lock:(d,g)=>cr(f,d,g),moveFile:(d,g,b)=>fr(f,d,g,b),putFileContents:(d,g,b)=>vr(f,d,g,b),partialUpdateFileContents:(d,g,b,v,y)=>wr(f,d,g,b,v,y),getDAVCompliance:d=>Vn(f,d),search:(d,g)=>pr(f,d,g),setHeaders:d=>{f.headers=Object.assign({},d)},stat:(d,g)=>we(f,d,g),unlock:(d,g,b)=>ur(f,d,g,b),registerAttributeParser:d=>{f.parsing.attributeParsers.push(d)},registerTagParser:d=>{f.parsing.tagParsers.push(d)}}}const Er=Xn().setApp("@nextcloud/files").detectUser().build();var Ee=(t=>(t.Folder="folder",t.File="file",t))(Ee||{}),X=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(X||{});const qn=function(t,e){return t.match(e)!==null},nt=(t,e)=>{if(t.id&&typeof t.id!="number")throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.displayname&&typeof t.displayname!="string")throw new Error("Invalid displayname type");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||typeof t.mime!="string"||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&typeof t.size!="number"&&t.size!==void 0)throw new Error("Invalid size type");if("permissions"in t&&t.permissions!==void 0&&!(typeof t.permissions=="number"&&t.permissions>=X.NONE&&t.permissions<=X.ALL))throw new Error("Invalid permissions");if(t.owner&&t.owner!==null&&typeof t.owner!="string")throw new Error("Invalid owner type");if(t.attributes&&typeof t.attributes!="object")throw new Error("Invalid attributes type");if(t.root&&typeof t.root!="string")throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&qn(t.source,e)){const n=t.source.match(e)[0];if(!t.source.includes(li(n,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(Ce).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var Ce=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(Ce||{});class Gt{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(Gt.prototype)).filter(e=>typeof e[1].get=="function"&&e[0]!=="__proto__").map(e=>e[0]);handler={set:(e,n,i)=>this.readonlyAttributes.includes(n)?!1:Reflect.set(e,n,i),deleteProperty:(e,n)=>this.readonlyAttributes.includes(n)?!1:Reflect.deleteProperty(e,n),get:(e,n,i)=>this.readonlyAttributes.includes(n)?(Er.warn(`Accessing "Node.attributes.${n}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,n)):Reflect.get(e,n,i)};constructor(e,n){e.mime||(e.mime="application/octet-stream"),nt(e,n||this._knownDavService),this._data={displayname:e.attributes?.displayname,...e,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(e.attributes??{}),n&&(this._knownDavService=n)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:e}=new URL(this.source);return e+oi(this.source.slice(e.length))}get basename(){return de(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(e){nt({...this._data,displayname:e},this._knownDavService),this._data.displayname=e}get extension(){return ai(this.source)}get dirname(){if(this.root){let n=this.source;this.isDavResource&&(n=n.split(this._knownDavService).pop());const i=n.indexOf(this.root),s=this.root.replace(/\/$/,"");return St(n.slice(i+s.length)||"/")}const e=new URL(this.source);return St(e.pathname)}get mime(){return this._data.mime||"application/octet-stream"}set mime(e){e??="application/octet-stream",nt({...this._data,mime:e},this._knownDavService),this._data.mime=e}get mtime(){return this._data.mtime}set mtime(e){nt({...this._data,mtime:e},this._knownDavService),this._data.mtime=e}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(e){nt({...this._data,size:e},this._knownDavService),this.updateMtime(),this._data.size=e}get attributes(){return this._attributes}get permissions(){return this.owner===null&&!this.isDavResource?X.READ:this._data.permissions!==void 0?this._data.permissions:X.NONE}set permissions(e){nt({...this._data,permissions:e},this._knownDavService),this.updateMtime(),this._data.permissions=e}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return qn(this.source,this._knownDavService)}get isDavRessource(){return this.isDavResource}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavResource&&St(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let e=this.source;this.isDavResource&&(e=e.split(this._knownDavService).pop());const n=e.indexOf(this.root),i=this.root.replace(/\/$/,"");return e.slice(n+i.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(e){nt({...this._data,status:e},this._knownDavService),this._data.status=e}get data(){return structuredClone(this._data)}move(e){nt({...this._data,source:e},this._knownDavService);const n=this.basename;this._data.source=e,this.displayname===n&&this.basename!==n&&(this.displayname=this.basename)}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move(St(this.source)+"/"+e)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(e){for(const[n,i]of Object.entries(e))try{i===void 0?delete this.attributes[n]:this.attributes[n]=i}catch(s){if(s instanceof TypeError)continue;throw s}}}class ke extends Gt{get type(){return Ee.File}clone(){return new ke(this.data)}}class Pe extends Gt{constructor(e){super({...e,mime:"httpd/unix-directory"})}get type(){return Ee.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}clone(){return new Pe(this.data)}}const Cr=function(t=""){let e=X.NONE;return t&&((t.includes("C")||t.includes("K"))&&(e|=X.CREATE),t.includes("G")&&(e|=X.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=X.UPDATE),t.includes("D")&&(e|=X.DELETE),t.includes("R")&&(e|=X.SHARE)),e},kr=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],Pr={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},Te=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...kr]),window._nc_dav_properties.map(t=>`<${t} />`).join(" ")},Ae=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...Pr}),Object.keys(window._nc_dav_namespaces).map(t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`).join(" ")},Tr=function(){return`<?xml version="1.0"?>
<d:propfind ${Ae()}>
<d:prop>
${Te()}
</d:prop>
</d:propfind>`},Ar=function(){return`<?xml version="1.0"?>
<oc:filter-files ${Ae()}>
<d:prop>
${Te()}
</d:prop>
<oc:filter-rules>
<oc:favorite>1</oc:favorite>
</oc:filter-rules>
</oc:filter-files>`},Br=function(t){return`<?xml version="1.0" encoding="UTF-8"?>
<d:searchrequest ${Ae()}
xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
<d:basicsearch>
<d:select>
<d:prop>
${Te()}
</d:prop>
</d:select>
<d:from>
<d:scope>
<d:href>/files/${he()?.uid}/</d:href>
<d:depth>infinity</d:depth>
</d:scope>
</d:from>
<d:where>
<d:and>
<d:or>
<d:not>
<d:eq>
<d:prop>
<d:getcontenttype/>
</d:prop>
<d:literal>httpd/unix-directory</d:literal>
</d:eq>
</d:not>
<d:eq>
<d:prop>
<oc:size/>
</d:prop>
<d:literal>0</d:literal>
</d:eq>
</d:or>
<d:gt>
<d:prop>
<d:getlastmodified/>
</d:prop>
<d:literal>${t}</d:literal>
</d:gt>
</d:and>
</d:where>
<d:orderby>
<d:order>
<d:prop>
<d:getlastmodified/>
</d:prop>
<d:descending/>
</d:order>
</d:orderby>
<d:limit>
<d:nresults>100</d:nresults>
<ns:firstresult>0</ns:firstresult>
</d:limit>
</d:basicsearch>
</d:searchrequest>`};function Nr(){return pe()?`/files/${gi()}`:`/files/${he()?.uid}`}const Ne=Nr();function Dr(){const t=bi("dav");return pe()?t.replace("remote.php","public.php"):t}const zn=Dr(),Sr=function(t=zn,e={}){const n=xr(t,{headers:e});function i(s){n.setHeaders({...e,"X-Requested-With":"XMLHttpRequest",requesttoken:s??""})}return Kn(i),i(Jn()),xn().patch("fetch",(s,r)=>{const o=r.headers;return o?.method&&(r.method=o.method,delete o.method),fetch(s,r)}),n},Vr=(t,e="/",n=Ne)=>{const i=new AbortController;return new J(async(s,r,o)=>{o(()=>i.abort());try{const a=(await t.getDirectoryContents(`${n}${e}`,{signal:i.signal,details:!0,data:Ar(),headers:{method:"REPORT"},includeSelf:!0})).data.filter(u=>u.filename!==e).map(u=>Gn(u,n));s(a)}catch(a){r(a)}})},Gn=function(t,e=Ne,n=zn){let i=he()?.uid;if(pe())i=i??"anonymous";else if(!i)throw new Error("No user id found");const s=t.props,r=Cr(s?.permissions),o=String(s?.["owner-id"]||i),a=s.fileid||0,u=new Date(Date.parse(t.lastmod)),c=new Date(Date.parse(s.creationdate)),l={id:a,source:`${n}${t.filename}`,mtime:!isNaN(u.getTime())&&u.getTime()!==0?u:void 0,crtime:!isNaN(c.getTime())&&c.getTime()!==0?c:void 0,mime:t.mime||"application/octet-stream",displayname:s.displayname!==void 0?String(s.displayname):void 0,size:s?.size||Number.parseInt(s.getcontentlength||"0"),status:a<0?Ce.FAILED:void 0,permissions:r,owner:o,root:e,attributes:{...t,...s,hasPreview:s?.["has-preview"]}};return delete l.attributes?.props,t.type==="file"?new ke(l):new Pe(l)},De={name:"NcProgressBar",props:{value:{type:Number,default:0,validator(t){return t>=0&&t<=100}},size:{type:[String,Number],default:"small",validator(t){return["small","medium"].includes(t)||typeof t=="number"}},error:{type:Boolean,default:!1},type:{type:String,default:"linear",validator(t){return["linear","circular"].includes(t)}},color:{type:String,default:null}},data(){return{stroke:4}},computed:{height(){return this.type==="circular"?Number.isInteger(this.size)?this.size:44:this.size==="small"?4:this.size==="medium"?6:this.size},progress(){return this.value/100},radius(){return this.height/2},radiusNormalized(){return this.radius-3*this.stroke},circumference(){return this.radiusNormalized*2*Math.PI}}},pn=()=>{ei((t,e)=>({"15a054de":t.color}))},fn=De.setup;De.setup=fn?(t,e)=>(pn(),fn(t,e)):pn;const Or=De;var $r=function(){var t=this,e=t._self._c;return t.type==="circular"?e("span",{staticClass:"progress-bar progress-bar--circular",class:{"progress-bar--error":t.error},style:{"--progress-bar-height":t.height+"px"},attrs:{role:"progressbar","aria-valuenow":t.value}},[e("svg",{attrs:{height:t.height,width:t.height}},[e("circle",{attrs:{stroke:"currentColor",fill:"transparent","stroke-dasharray":`${t.progress*t.circumference} ${(1-t.progress)*t.circumference}`,"stroke-dashoffset":.25*t.circumference,"stroke-width":t.stroke,r:t.radiusNormalized,cx:t.radius,cy:t.radius}}),e("circle",{attrs:{stroke:"var(--color-background-darker)",fill:"transparent","stroke-dasharray":`${(1-t.progress)*t.circumference} ${t.progress*t.circumference}`,"stroke-dashoffset":(.25-t.progress)*t.circumference,"stroke-width":t.stroke,r:t.radiusNormalized,cx:t.radius,cy:t.radius}})])]):e("progress",{staticClass:"progress-bar progress-bar--linear vue",class:{"progress-bar--error":t.error},style:{"--progress-bar-height":t.height+"px"},attrs:{max:"100"},domProps:{value:t.value}})},Ir=[],Lr=ti(Or,$r,Ir,!1,null,"06c9abdc");const jr=Lr.exports,ie=new Set(["wiki_search","wiki_read_page","wiki_write_page","wiki_log_event"]),mn=t=>String(t||"").trim().toLowerCase().replace(/^builtin:/,"").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),Wr={name:"BotForm",components:{NcProgressBar:jr},props:{bot:{type:Object,default:null},userPermissions:{type:Object,default:()=>({isAdmin:!1,isGroupAdmin:!1,isTeamAdmin:!1,hasApprovalRights:!1,adminGroups:[],adminTeams:[]})}},data(){return{WIKI_ROOT_FOLDER:$e,formData:{botName:"",mentionName:"",description:"",systemPrompt:"",visibility:"personal",allowedGroups:[],allowedTeams:[],model:"",useCustomTemperature:!1,temperature:null,ragEnabled:!1,personalWikiEnabled:!1,personalWikiLocation:"personal_files",personalWikiCollectiveId:"",personalWikiPath:"",selectedTools:[],onboardingQuestions:{start:"q1",questions:[]}},settings:{defaultTemperature:.2,allowMultipleModels:!1,allowedModels:[],secondaryEndpointEnabled:!1,modelOptions:[]},availableGroups:[],availableTeams:[],availableCollectives:[],wikiLocationsLoading:!1,availableTools:[],toolLoading:!1,toolConfigs:{},rag:{sources:[],loading:!1,adding:!1,addingUrl:!1,reindexing:{},removing:{},pollingInterval:null},showUrlModal:!1,urlInput:"",personalWikiInitiallyEnabled:!1,personalWikiChanged:!1}},computed:{isEditing(){return!!this.bot},hasPendingChanges(){return this.bot&&this.bot.has_pending_changes},isPendingApproval(){return this.bot&&this.bot.approval_status==="pending"},hasPendingSources(){return this.rag.sources.some(t=>t.status==="pending")},isValidUrl(){if(!this.urlInput||this.urlInput.trim()==="")return!1;try{const t=new URL(this.urlInput.trim());return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}},onboardingValidationError(){const t=this.formData.onboardingQuestions.questions;if(t.length===0)return null;for(const s of t){if(!s.text||s.text.trim()==="")return`Question ${s.id} has no text`;for(const r of s.answers)if(!(r&&r.type==="free_text")&&(!r.text||r.text.trim()===""))return`Question ${s.id}, answer ${r.id.toUpperCase()} has no text`}const e=this.formData.onboardingQuestions.start,n=new Set([e]);let i=!0;for(;i;){i=!1;for(const s of t)if(n.has(s.id))for(const r of s.answers)r.next&&!n.has(r.next)&&(n.add(r.next),i=!0)}for(const s of t)if(!n.has(s.id))return`Question ${s.id} is unreachable from the start`;return null},temperatureValidationError(){if(!this.formData.useCustomTemperature)return null;const t=this.normalizeTemperatureValue(this.formData.temperature);return t===null?"Enter a temperature between 0.0 and 1.0.":t<0||t>1?"Temperature must be between 0.0 and 1.0.":null},inheritedTemperatureLabel(){return this.formatTemperature(this.settings.defaultTemperature)},hasOnboardingQuestions(){return this.formData.onboardingQuestions.questions.length>0},requiresApprovalForGroups(){return this.userPermissions.isAdmin?!1:!this.userPermissions.isGroupAdmin},requiresApprovalForTeams(){return this.userPermissions.isAdmin?!1:!this.userPermissions.isTeamAdmin},willRequireApproval(){if(this.formData.visibility==="personal"||this.userPermissions.isAdmin)return!1;if(this.formData.visibility==="global")return!0;if(this.formData.visibility==="groups"){if(!this.userPermissions.isGroupAdmin)return!0;const t=this.userPermissions.adminGroups||[];for(const e of this.formData.allowedGroups)if(!t.includes(e))return!0;return!1}if(this.formData.visibility==="teams"){if(!this.userPermissions.isTeamAdmin)return!0;const t=this.userPermissions.adminTeams||[];for(const e of this.formData.allowedTeams)if(!t.includes(e))return!0;return!1}return!1},selectableModelOptions(){const t=(this.settings.allowMultipleModels?this.settings.allowedModels.map(e=>this.findOrCreateModelOption(e)):this.settings.secondaryEndpointEnabled?this.settings.modelOptions:[]).filter(Boolean);if(this.formData.model){const e=this.toEndpointModelId(this.formData.model);t.some(n=>n.id===e)||t.push(this.findOrCreateModelOption(e))}return t},isPersonalBot(){return this.formData.visibility==="personal"},isTeamBot(){return this.formData.visibility==="teams"},isWikiCapableBot(){return this.isPersonalBot||this.isTeamBot},defaultPersonalWikiPath(){const t=this.formData.mentionName||this.formData.botName||"wiki";return`${$e}/Personal Wikis/${this.slugifyWikiPathSegment(t)}`},filteredWikiCollectives(){if(!this.isTeamBot)return this.availableCollectives;const t=new Set((this.formData.allowedTeams||[]).map(e=>String(e)));return this.availableCollectives.filter(e=>{const n=e.team_id!==void 0&&e.team_id!==null?String(e.team_id):"";return n!==""&&t.has(n)})},visibleTools(){return this.availableTools.filter(t=>!this.isWikiTool(t))},submitButtonText(){return this.isEditing?"Update Bot":this.willRequireApproval?"Save as Draft":"Create Bot"}},watch:{"formData.visibility"(){this.isWikiCapableBot?this.isTeamBot?(this.formData.personalWikiLocation="collective",this.formData.personalWikiPath=""):this.personalWikiInitiallyEnabled&&!this.personalWikiChanged&&(this.formData.personalWikiEnabled=!0):this.formData.personalWikiEnabled=!1,this.ensureWikiSelectionValid(),this.removeUnavailableSelectedTools()},"formData.allowedTeams"(){this.ensureWikiSelectionValid()}},mounted(){if(this.loadSettings(),this.loadGroups(),this.loadTeams(),this.loadWikiLocations(),this.loadAvailableTools(),this.bot){const t=this.bot.pending_changes,e=this.bot.has_pending_changes&&t;let n={start:"q1",questions:[]};e&&t.onboarding_questions?n=t.onboarding_questions:this.bot.onboarding_questions&&(n=this.bot.onboarding_questions);const i=e&&Object.prototype.hasOwnProperty.call(t,"temperature")?this.normalizeTemperatureValue(t.temperature):this.normalizeTemperatureValue(this.bot.temperature);this.formData={botName:e&&t.bot_name?t.bot_name:this.bot.bot_name,mentionName:this.bot.mention_name.replace("@",""),description:e&&t.description!==void 0?t.description:this.bot.description||"",systemPrompt:e&&t.system_prompt?t.system_prompt:this.bot.system_prompt,visibility:e&&t.visibility?t.visibility:this.bot.visibility?this.bot.visibility:this.bot.is_public?"global":"groups",allowedGroups:e&&t.allowed_groups?typeof t.allowed_groups=="string"?JSON.parse(t.allowed_groups||"[]"):t.allowed_groups:Array.isArray(this.bot.allowed_groups)?this.bot.allowed_groups:[],allowedTeams:e&&t.allowed_teams?typeof t.allowed_teams=="string"?JSON.parse(t.allowed_teams||"[]"):t.allowed_teams:Array.isArray(this.bot.allowed_teams)?this.bot.allowed_teams:[],model:e&&t.model!==void 0?t.model:this.bot.model||"",useCustomTemperature:i!==null,temperature:i,ragEnabled:e&&t.rag_enabled!==void 0?!!t.rag_enabled:!!this.bot.rag_enabled,personalWikiEnabled:!1,personalWikiLocation:"personal_files",personalWikiCollectiveId:"",personalWikiPath:"",selectedTools:[],onboardingQuestions:n},this.loadBotTools(),this.loadRagSources()}},beforeDestroy(){this.stopPolling()},methods:{startPolling(){this.rag.pollingInterval||(this.rag.pollingInterval=setInterval(()=>{this.hasPendingSources?this.loadRagSources():this.stopPolling()},2e3))},stopPolling(){this.rag.pollingInterval&&(clearInterval(this.rag.pollingInterval),this.rag.pollingInterval=null)},async loadGroups(){try{const t=(await G.get(Q.generateUrl("/apps/educai/api/v1/groups"))).data;this.availableGroups=Array.isArray(t.groups)?t.groups:[]}catch{}},async loadTeams(){try{const t=(await G.get(Q.generateUrl("/apps/educai/api/v1/teams"))).data;this.availableTeams=Array.isArray(t.teams)?t.teams:[]}catch{}},async loadWikiLocations(){this.wikiLocationsLoading=!0;try{const t=(await G.get(Q.generateUrl("/apps/educai/api/v1/wiki/locations"))).data;this.availableCollectives=Array.isArray(t.collectives)?t.collectives:[],this.ensureWikiSelectionValid()}catch{this.availableCollectives=[],this.ensureWikiSelectionValid()}finally{this.wikiLocationsLoading=!1}},async loadSettings(){try{const t=(await G.get(Q.generateUrl("/apps/educai/api/v1/settings"))).data;this.settings.defaultTemperature=this.normalizeTemperatureValue(t.default_temperature)??.2,this.settings.allowMultipleModels=!!t.allow_multiple_models,this.settings.allowedModels=Array.isArray(t.allowed_models)?t.allowed_models:[],this.settings.secondaryEndpointEnabled=!!(t.secondary_api_endpoint||"").trim(),(this.settings.allowMultipleModels||this.settings.secondaryEndpointEnabled)&&await this.loadModelOptions(),this.formData.model?this.formData.model=this.toEndpointModelId(this.formData.model):this.selectableModelOptions.length>0&&(this.formData.model=this.selectableModelOptions[0].id)}catch{}},async loadModelOptions(){try{const t=await G.get(Q.generateUrl("/apps/educai/api/v1/models"));this.settings.modelOptions=this.normalizeModelOptions(t.data?.model_options,t.data?.models)}catch{this.settings.modelOptions=[]}},toEndpointModelId(t){const e=(t||"").trim();if(e==="")return"";if(/^(primary|secondary):/.test(e))return e;const n=this.settings.modelOptions.filter(i=>i.model===e);return n.length===1?n[0].id:`primary:${e}`},toStoredModelReference(t){const e=this.toEndpointModelId(t);if(e==="")return"";const n=e.replace(/^(primary|secondary):/,"");return this.settings.modelOptions.filter(i=>i.model===n).length>1?e:n},normalizeModelOptions(t,e){return Array.isArray(t)&&t.length>0?t.filter(n=>n&&n.id&&n.model).map(n=>({id:String(n.id),label:n.label||this.modelLabel(n.id),model:String(n.model),endpoint:n.endpoint==="secondary"?"secondary":"primary"})):Array.isArray(e)?e.map(n=>this.findOrCreateModelOption(n)):[]},findOrCreateModelOption(t){const e=this.toEndpointModelId(t);if(e==="")return null;const n=this.settings.modelOptions.find(s=>s.id===e);if(n)return n;const i=e.startsWith("secondary:")?"secondary":"primary";return{id:e,label:this.modelLabel(e),model:e.replace(/^(primary|secondary):/,""),endpoint:i}},modelLabel(t){const e=this.toEndpointModelId(t);return e===""?"":e.replace(/^primary:/,"Primary · ").replace(/^secondary:/,"Secondary · ")},normalizeTemperatureValue(t){if(t==null||t==="")return null;const e=Number(t);return Number.isFinite(e)?Math.round(e*100)/100:null},formatTemperature(t){const e=this.normalizeTemperatureValue(t);return e===null?"0.20":e.toFixed(2)},onCustomTemperatureToggle(){this.formData.useCustomTemperature&&this.normalizeTemperatureValue(this.formData.temperature)===null&&(this.formData.temperature=this.settings.defaultTemperature)},async loadAvailableTools(){this.toolLoading=!0;try{const t=(await G.get(Q.generateUrl("/apps/educai/api/v1/tools"))).data?.tools;this.availableTools=Array.isArray(t)?t.filter(e=>!(e.is_builtin&&(e.builtin_name==="rag_search_documents"||this.isWikiTool(e)))):[]}catch{this.availableTools=[]}finally{this.toolLoading=!1}},getToolKey(t){return t.is_builtin&&t.builtin_name?"builtin:"+t.builtin_name:t.is_builtin?(console.warn("[DEBUG] Built-in tool missing builtin_name:",t),null):t.id},isWikiTool(t){return t?typeof t=="string"?ie.has(mn(t)):t.is_builtin?[t.builtin_name,t.builtinName,t.name].some(e=>ie.has(mn(e))):!1:!1},markPersonalWikiChanged(){this.personalWikiChanged=!0},onPersonalWikiLocationChange(){if(this.markPersonalWikiChanged(),this.isTeamBot){this.formData.personalWikiLocation="collective",this.formData.personalWikiPath="";return}this.formData.personalWikiLocation==="personal_files"?this.formData.personalWikiCollectiveId="":this.formData.personalWikiPath=""},slugifyWikiPathSegment(t){return String(t||"wiki").trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"")||"wiki"},normalizePersonalWikiPath(t){return String(t||"").replace(/\\/g,"/").trim().replace(/^\/+|\/+$/g,"")},getPersonalWikiConfig(){if(this.formData.personalWikiLocation==="collective")return{wiki_location:"collective",wiki_collective_id:Number(this.formData.personalWikiCollectiveId)};const t=this.normalizePersonalWikiPath(this.formData.personalWikiPath);return t!==""?{wiki_location:"personal_files",wiki_root_path:t}:{}},getWikiToolEntries(){if(!this.isWikiCapableBot||!this.formData.personalWikiEnabled)return[];const t=this.getPersonalWikiConfig();return Array.from(ie).map(e=>{const n={is_builtin:!0,builtin_name:e};return Object.keys(t).length>0&&(n.config={...t}),n})},isToolDisabled(t){return!this.isWikiCapableBot&&this.isWikiTool(t)},removeUnavailableSelectedTools(){const t=this.sanitizeSelectedToolsForVisibility(this.formData.selectedTools);t.length!==this.formData.selectedTools.length&&(this.formData.selectedTools=t);const e=t.map(n=>String(n));Object.keys(this.toolConfigs).forEach(n=>{e.includes(n)||this.$delete(this.toolConfigs,n)})},sanitizeSelectedToolsForVisibility(t){return Array.isArray(t)?this.isWikiCapableBot?t:t.filter(e=>!this.isWikiTool(e)):[]},ensureWikiSelectionValid(){if(!this.isWikiCapableBot){this.formData.personalWikiEnabled=!1,this.formData.personalWikiCollectiveId="";return}if(this.isTeamBot&&(this.formData.personalWikiLocation="collective",this.formData.personalWikiPath=""),this.formData.personalWikiLocation!=="collective"||!this.formData.personalWikiCollectiveId)return;const t=String(this.formData.personalWikiCollectiveId);this.filteredWikiCollectives.some(e=>String(e.id)===t)||(this.formData.personalWikiCollectiveId="")},async loadBotTools(){if(!this.isEditing)return;const t=this.bot?.has_pending_changes&&Array.isArray(this.bot?.pending_changes?.tools)?this.bot.pending_changes.tools:null;if(t){this.applyToolSelection(t);return}try{const e=await G.get(Q.generateUrl(`/apps/educai/api/v1/bots/${this.bot.id}/tools`)),n=Array.isArray(e.data?.tools)?e.data.tools:[];this.applyToolSelection(n)}catch{}},applyToolSelection(t){const e=[],n={};let i=!1,s={};t.forEach(r=>{if(!r)return;if(r.is_builtin&&r.builtin_name){const a="builtin:"+r.builtin_name;if(this.isWikiTool(a)){i=!0,r.config&&Object.keys(r.config).length>0&&(s=r.config);return}e.push(a),r.config&&Object.keys(r.config).length>0&&(n[a]=r.config);return}const o=r.tool_id??r.tool?.id??r.id;o!=null&&(e.push(o),r.config&&Object.keys(r.config).length>0&&(n[o]=r.config))}),this.personalWikiInitiallyEnabled=i,this.formData.personalWikiEnabled=this.isWikiCapableBot&&i,this.formData.personalWikiLocation=s.wiki_location==="collective"?"collective":"personal_files",this.formData.personalWikiCollectiveId=s.wiki_collective_id!==void 0&&s.wiki_collective_id!==null?String(s.wiki_collective_id):"",this.formData.personalWikiPath=this.formData.personalWikiLocation==="personal_files"&&typeof s.wiki_root_path=="string"?s.wiki_root_path:"",this.ensureWikiSelectionValid(),this.personalWikiChanged=!1,this.formData.selectedTools=this.sanitizeSelectedToolsForVisibility(e),this.toolConfigs=n,this.removeUnavailableSelectedTools()},async loadRagSources(){if(this.isEditing){this.rag.loading=!0;try{const t=(await G.get(Q.generateUrl(`/apps/educai/api/v1/bots/${this.bot.id}/sources`))).data?.sources;this.rag.sources=Array.isArray(t)?t:[],this.hasPendingSources&&this.startPolling()}catch{q("Failed to load attached sources")}finally{this.rag.loading=!1}}},async promptAddSources(){if(!this.isEditing||this.rag.adding)return;const t=await this.pickNodes();if(!(!t||t.length===0)){this.rag.adding=!0;try{for(const e of t){console.log("[DEBUG] Processing node:",JSON.stringify(e,null,2));const n=this.extractNodeId(e);if(console.log("[DEBUG] Extracted nodeId:",n),!n){console.warn("[DEBUG] Skipping node - no nodeId");continue}const i=this.deriveNodeType(e);console.log("[DEBUG] Derived nodeType:",i);const s={nodeId:n,nodeType:i};console.log("[DEBUG] Sending to backend:",JSON.stringify(s,null,2)),await G.post(Q.generateUrl(`/apps/educai/api/v1/bots/${this.bot.id}/sources`),s)}Dt("Sources queued for indexing"),await this.loadRagSources()}catch(e){console.error("Failed to attach sources",e),q(e.response?.data?.error||"Failed to attach sources")}finally{this.rag.adding=!1}}},async removeSource(t){if(!(!this.isEditing||!t||!t.id)){this.$set(this.rag.removing,t.id,!0);try{await G.delete(Q.generateUrl(`/apps/educai/api/v1/bots/${this.bot.id}/sources/${t.id}`)),Dt("Source removed"),await this.loadRagSources()}catch(e){console.error("Failed to remove source",e),q(e.response?.data?.error||"Failed to remove source")}finally{this.$delete(this.rag.removing,t.id)}}},async reindexSource(t){if(!(!this.isEditing||!t||!t.id)){this.$set(this.rag.reindexing,t.id,!0);try{await G.post(Q.generateUrl(`/apps/educai/api/v1/bots/${this.bot.id}/sources/${t.id}/reindex`)),Dt("Reindex queued"),await this.loadRagSources()}catch(e){console.error("Failed to reindex source",e),q(e.response?.data?.error||"Failed to reindex source")}finally{this.$delete(this.rag.reindexing,t.id)}}},closeUrlModal(){this.showUrlModal=!1,this.urlInput=""},async submitUrl(){if(!(!this.isEditing||!this.isValidUrl||this.rag.addingUrl)){this.rag.addingUrl=!0;try{const t=this.urlInput.trim();await G.post(Q.generateUrl(`/apps/educai/api/v1/bots/${this.bot.id}/sources`),{sourceUrl:t}),Dt("URL source queued for indexing"),this.closeUrlModal(),await this.loadRagSources()}catch(t){console.error("Failed to add URL source",t),q(t.response?.data?.error||"Failed to add URL source")}finally{this.rag.addingUrl=!1}}},async pickNodes(){try{const t=await mi("Select files or folders").setMultiSelect(!0).allowDirectories(!0).setType(gn.Choose).build().pick();if(!t||t.length===0)return null;const e=Sr(),n=[];for(const i of t)try{const s=`${Ne}${i}`,r=await e.stat(s,{details:!0,data:Tr()}),o=Gn(r.data);if(o&&o.fileid){let a="file";(o.type==="folder"||o.mime==="httpd/unix-directory")&&(a="folder"),n.push({fileid:o.fileid,path:i,mimetype:o.mime||"application/octet-stream",type:a})}else console.warn("No fileid found for path:",i),q("Failed to get file info for "+i)}catch(s){console.error("Failed to get file info for",i,s),q("Failed to get file info for "+i+": "+(s.response?.statusText||s.message))}return n.length>0?n:null}catch(t){return t.message&&(t.message.includes("No nodes selected")||t.message.includes("FilePicker"))||(console.error("File picker error:",t),q("Failed to open file picker: "+(t.message||t))),null}},extractNodeId(t){if(!t||typeof t!="object")return null;const e=[t.fileid,t.id,t?.attributes?.fileid];for(const n of e){if(n==null)continue;const i=parseInt(n,10);if(!Number.isNaN(i)&&i>0)return i}return null},deriveNodeType(t){if(!t||typeof t!="object")return"file";const e=t.type||t.nodeType;return e==="dir"||e==="folder"||t.isDirectory||t.isFolder||(t.mimetype||t.mime||t?.attributes?.mimetype)==="httpd/unix-directory"?"folder":"file"},describeSource(t){return t?t.path?t.path:t.display_name?t.display_name:t.source_url?t.source_url:`Node #${t.node_id}`:""},getSourceTypeIconClass(t){return t?t.node_type==="url"?"url-icon":t.node_type==="folder"?"folder-icon":"file-icon":"file-icon"},formatSourceStatus(t){switch(t){case"ready":return"Ready";case"pending":return"Pending";case"error":return"Error";default:return t||"Unknown"}},formatProgressStage(t){return{collecting:"Collecting files…",extracting:"Extracting text…",chunking:"Processing content…",embedding:"Generating embeddings…",storing:"Saving results…",ready:"Complete"}[t]||"Processing…"},formatTimestamp(t){return t?new Date(t*1e3).toLocaleString():""},addOnboardingQuestion(){const t=this.formData.onboardingQuestions.questions;if(t.length>=15)return;let e=t.length+1,n=`q${e}`;for(;t.some(i=>i.id===n);)e++,n=`q${e}`;t.push({id:n,text:"",answers:[{id:"a",text:"",next:null},{id:"b",text:"",next:null}]}),t.length===1&&(this.formData.onboardingQuestions.start=n)},removeOnboardingQuestion(t){const e=this.formData.onboardingQuestions.questions,n=e[t].id;e.splice(t,1);for(const i of e)for(const s of i.answers)s.next===n&&(s.next=null);this.formData.onboardingQuestions.start===n&&(this.formData.onboardingQuestions.start=e.length>0?e[0].id:"q1")},addAnswer(t){const e=this.formData.onboardingQuestions.questions[t];if(this.isFreeTextQuestion(e)||e.answers.length>=4)return;const n=new Set(e.answers.map(s=>s.id)),i=["a","b","c","d"].find(s=>!n.has(s))||"x";e.answers.push({id:i,text:"",next:null})},removeAnswer(t,e){const n=this.formData.onboardingQuestions.questions[t];this.isFreeTextQuestion(n)||n.answers.length<=2||n.answers.splice(e,1)},isFreeTextAnswer(t){return!!t&&t.type==="free_text"},isFreeTextQuestion(t){return!t||!Array.isArray(t.answers)?!1:t.answers.length===1&&this.isFreeTextAnswer(t.answers[0])},setQuestionFreeText(t,e){const n=this.formData.onboardingQuestions.questions[t];if(n){if(e){const i=Array.isArray(n.answers)&&n.answers[0]?n.answers[0].next:null;this.$set(n,"answers",[{id:"text",text:"",type:"free_text",next:i||null}]);return}this.$set(n,"answers",[{id:"a",text:"",next:null},{id:"b",text:"",next:null}])}},getAvailableNextQuestions(t){return this.formData.onboardingQuestions.questions.filter(e=>e.id!==t)},submitForm(){if(this.temperatureValidationError){q(this.temperatureValidationError);return}if(this.formData.personalWikiEnabled&&this.isTeamBot&&this.formData.allowedTeams.length===0){q("Select at least one team before enabling the LLM Wiki.");return}if(this.formData.personalWikiEnabled&&this.formData.personalWikiLocation==="collective"&&!this.formData.personalWikiCollectiveId){q("Select a collective for the LLM Wiki location.");return}if(this.formData.personalWikiEnabled&&this.formData.personalWikiLocation==="collective"){const i=String(this.formData.personalWikiCollectiveId);if(!this.filteredWikiCollectives.some(s=>String(s.id)===i)){q("Select a collective from one of the selected teams.");return}}if(this.formData.personalWikiEnabled&&this.isTeamBot&&this.formData.personalWikiLocation!=="collective"){q("Team bots can use LLM Wiki only with a Collective.");return}console.log("[DEBUG] selectedTools before submit:",JSON.stringify(this.formData.selectedTools));const t=this.sanitizeSelectedToolsForVisibility(this.formData.selectedTools);this.formData.selectedTools=t;const e=t.filter(i=>i!=null).map(i=>{const s=this.toolConfigs[i];if(console.log("[DEBUG] Processing toolKey:",i,"type:",typeof i),typeof i=="string"&&i.startsWith("builtin:")){const r={is_builtin:!0,builtin_name:i.substring(8)};return s&&Object.keys(s).length>0&&(r.config=s),r}if(typeof i=="number"||typeof i=="string"&&!isNaN(parseInt(i,10))){const r=typeof i=="number"?i:parseInt(i,10);return s&&Object.keys(s).length>0?{tool_id:r,config:s}:r}return console.warn("[DEBUG] Skipping invalid toolKey:",i),null}).filter(i=>i!==null);e.push(...this.getWikiToolEntries()),console.log("[DEBUG] toolPayload:",JSON.stringify(e));let n=null;this.formData.onboardingQuestions.questions.length>0&&(this.onboardingValidationError&&console.warn("[DEBUG] Onboarding validation error:",this.onboardingValidationError),n={start:this.formData.onboardingQuestions.start,questions:this.formData.onboardingQuestions.questions.map(i=>({id:i.id,text:i.text,answers:i.answers.map(s=>({id:s.id,text:s.text,next:s.next,type:s.type}))}))}),this.$emit("save",{id:this.bot?.id,botName:this.formData.botName,mentionName:this.formData.mentionName,description:this.formData.description||null,systemPrompt:this.formData.systemPrompt,visibility:this.formData.visibility,allowedGroups:this.formData.visibility==="groups"?this.formData.allowedGroups:[],allowedTeams:this.formData.visibility==="teams"?this.formData.allowedTeams:[],model:this.selectableModelOptions.length>0?this.toStoredModelReference(this.formData.model):void 0,temperature:this.formData.useCustomTemperature?this.normalizeTemperatureValue(this.formData.temperature):null,ragEnabled:this.formData.ragEnabled,tools:e,onboardingQuestions:n})}}};var Rr=function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal-mask",on:{click:function(n){return n.target!==n.currentTarget?null:t.$emit("cancel")}}},[e("div",{staticClass:"modal-container"},[e("div",{staticClass:"modal-header"},[e("h2",[t._v(t._s(t.isEditing?"Edit Bot":"Create New Bot"))]),e("button",{staticClass:"close-button",on:{click:function(n){return t.$emit("cancel")}}},[e("span",{staticClass:"icon-close"})])]),e("div",{staticClass:"modal-body"},[t.hasPendingChanges?e("div",{staticClass:"pending-changes-notice"},[e("span",{staticClass:"icon-info"}),t._m(0)]):t._e(),e("form",{on:{submit:function(n){return n.preventDefault(),t.submitForm.apply(null,arguments)}}},[e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"bot-name"}},[t._v("Bot Name")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.botName,expression:"formData.botName"}],attrs:{id:"bot-name",type:"text",placeholder:"Support Helper",required:""},domProps:{value:t.formData.botName},on:{input:function(n){n.target.composing||t.$set(t.formData,"botName",n.target.value)}}})]),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"mention-name"}},[t._v("Mention Name")]),e("div",{staticClass:"input-group"},[e("span",{staticClass:"prefix"},[t._v("@")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.mentionName,expression:"formData.mentionName"}],attrs:{id:"mention-name",type:"text",placeholder:"supportbot",disabled:t.isEditing,pattern:"[a-zA-Z0-9_-]+",required:""},domProps:{value:t.formData.mentionName},on:{input:function(n){n.target.composing||t.$set(t.formData,"mentionName",n.target.value)}}})]),e("p",{staticClass:"hint"},[t._v(" Lowercase letters, numbers, hyphens, and underscores only. "+t._s(t.isEditing?"Cannot be changed after creation.":"")+" ")])]),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"bot-description"}},[t._v("Bot Description")]),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.formData.description,expression:"formData.description"}],attrs:{id:"bot-description",rows:"3",placeholder:"A helpful assistant that answers questions about..."},domProps:{value:t.formData.description},on:{input:function(n){n.target.composing||t.$set(t.formData,"description",n.target.value)}}}),t._v(" "),e("p",{staticClass:"hint"},[t._v(" This description is shown in the public bot listing to help users understand what this bot does. ")])]),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"system-prompt"}},[t._v("System Prompt")]),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.formData.systemPrompt,expression:"formData.systemPrompt"}],attrs:{id:"system-prompt",rows:"10",placeholder:"You are a helpful support assistant. Your role is to...",required:""},domProps:{value:t.formData.systemPrompt},on:{input:function(n){n.target.composing||t.$set(t.formData,"systemPrompt",n.target.value)}}}),t._v(" "),e("p",{staticClass:"hint"},[t._v(" This defines the bot's personality and behavior. Be specific about what the bot should do and how it should respond. ")])]),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"availability-select"}},[t._v("Availability")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.formData.visibility,expression:"formData.visibility"}],attrs:{id:"availability-select"},on:{change:function(n){var i=Array.prototype.filter.call(n.target.options,function(s){return s.selected}).map(function(s){var r="_value"in s?s._value:s.value;return r});t.$set(t.formData,"visibility",n.target.multiple?i:i[0])}}},[e("option",{attrs:{value:"personal"}},[t._v(" Just for me (personal) ")]),e("option",{attrs:{value:"global"}},[t._v(" Global (requires approval for non-admins) ")]),e("option",{attrs:{value:"groups"}},[t._v(" Specific groups "+t._s(t.requiresApprovalForGroups?"(requires approval)":"")+" ")]),e("option",{attrs:{value:"teams"}},[t._v(" Specific teams "+t._s(t.requiresApprovalForTeams?"(requires approval)":"")+" ")])]),e("p",{staticClass:"hint"},[t._v(" Choose who can use this bot. Personal bots are only visible to you. "),t.userPermissions.isAdmin?[t._v(" Global makes it available to everyone. ")]:t._e(),t._v(" Groups or teams restrict usage to selected audiences. ")],2),t.willRequireApproval&&!t.isEditing?e("div",{staticClass:"approval-notice"},[e("span",{staticClass:"icon-info"}),t._v(" This bot will be saved as a draft. You'll need to submit it for approval before others can use it. ")]):t._e()]),t.formData.visibility==="groups"?e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"group-select"}},[t._v("Allowed groups")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.formData.allowedGroups,expression:"formData.allowedGroups"}],attrs:{id:"group-select",multiple:""},on:{change:function(n){var i=Array.prototype.filter.call(n.target.options,function(s){return s.selected}).map(function(s){var r="_value"in s?s._value:s.value;return r});t.$set(t.formData,"allowedGroups",n.target.multiple?i:i[0])}}},t._l(t.availableGroups,function(n){return e("option",{key:n.id,domProps:{value:n.id}},[t._v(" "+t._s(n.displayName||n.id)+" ")])}),0),e("p",{staticClass:"hint"},[t._v(" Only members of the selected groups (and the bot owner) can mention and use this bot. ")])]):t._e(),t.formData.visibility==="teams"?e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"team-select"}},[t._v("Allowed teams")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.formData.allowedTeams,expression:"formData.allowedTeams"}],attrs:{id:"team-select",multiple:""},on:{change:function(n){var i=Array.prototype.filter.call(n.target.options,function(s){return s.selected}).map(function(s){var r="_value"in s?s._value:s.value;return r});t.$set(t.formData,"allowedTeams",n.target.multiple?i:i[0])}}},t._l(t.availableTeams,function(n){return e("option",{key:n.id,domProps:{value:n.id}},[t._v(" "+t._s(n.displayName||n.id)+" ")])}),0),e("p",{staticClass:"hint"},[t._v(" Only members of the selected teams (and the bot owner) can mention and use this bot. ")])]):t._e(),t.selectableModelOptions.length>0?e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"model-select"}},[t._v("Model")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.formData.model,expression:"formData.model"}],attrs:{id:"model-select",disabled:t.selectableModelOptions.length===0},on:{change:function(n){var i=Array.prototype.filter.call(n.target.options,function(s){return s.selected}).map(function(s){var r="_value"in s?s._value:s.value;return r});t.$set(t.formData,"model",n.target.multiple?i:i[0])}}},t._l(t.selectableModelOptions,function(n){return e("option",{key:n.id,domProps:{value:n.id}},[t._v(" "+t._s(n.label)+" ")])}),0),t.selectableModelOptions.length===0?e("p",{staticClass:"hint"},[t._v(" No models are allowed by the administrator yet. ")]):t._e()]):t._e(),e("div",{staticClass:"form-group"},[e("label",{staticClass:"checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.useCustomTemperature,expression:"formData.useCustomTemperature"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.formData.useCustomTemperature)?t._i(t.formData.useCustomTemperature,null)>-1:t.formData.useCustomTemperature},on:{change:[function(n){var i=t.formData.useCustomTemperature,s=n.target,r=!!s.checked;if(Array.isArray(i)){var o=null,a=t._i(i,o);s.checked?a<0&&t.$set(t.formData,"useCustomTemperature",i.concat([o])):a>-1&&t.$set(t.formData,"useCustomTemperature",i.slice(0,a).concat(i.slice(a+1)))}else t.$set(t.formData,"useCustomTemperature",r)},t.onCustomTemperatureToggle]}}),t._v(" Use custom temperature ")]),t.formData.useCustomTemperature?e("div",{staticClass:"temperature-field"},[e("label",{attrs:{for:"bot-temperature"}},[t._v("Temperature")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.formData.temperature,expression:"formData.temperature",modifiers:{number:!0}}],attrs:{id:"bot-temperature",type:"number",min:"0",max:"1",step:"0.05",placeholder:"0.20"},domProps:{value:t.formData.temperature},on:{input:function(n){n.target.composing||t.$set(t.formData,"temperature",t._n(n.target.value))},blur:function(n){return t.$forceUpdate()}}}),e("p",{staticClass:"hint"},[t._v(" Lower temperature is usually better for agentic, tool-enabled, RAG, and workflow bots. Use higher temperature only when you want more variation or creativity. ")]),t._m(1),t.temperatureValidationError?e("p",{staticClass:"inline-error"},[t._v(" "+t._s(t.temperatureValidationError)+" ")]):t._e()]):e("div",{staticClass:"temperature-readonly"},[t._v(" Using the global default temperature: "),e("strong",[t._v(t._s(t.inheritedTemperatureLabel))])])]),e("hr",{staticClass:"section-divider",attrs:{role:"presentation"}}),e("div",{staticClass:"form-group"},[e("label",{staticClass:"checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.ragEnabled,expression:"formData.ragEnabled"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.formData.ragEnabled)?t._i(t.formData.ragEnabled,null)>-1:t.formData.ragEnabled},on:{change:function(n){var i=t.formData.ragEnabled,s=n.target,r=!!s.checked;if(Array.isArray(i)){var o=null,a=t._i(i,o);s.checked?a<0&&t.$set(t.formData,"ragEnabled",i.concat([o])):a>-1&&t.$set(t.formData,"ragEnabled",i.slice(0,a).concat(i.slice(a+1)))}else t.$set(t.formData,"ragEnabled",r)}}}),t._v(" Enable Retrieval-Augmented Responses ")]),e("p",{staticClass:"hint"},[t._v(" When enabled, attach files so the bot can reference your documents during conversations. ")]),t.isEditing?e("div",{staticClass:"rag-source-panel"},[t.formData.ragEnabled?t._e():e("p",{staticClass:"hint muted"},[t._v(" Attachments remain stored but are ignored until retrieval is enabled. ")]),e("div",{staticClass:"rag-actions"},[e("button",{staticClass:"button",attrs:{type:"button",disabled:t.rag.loading||t.rag.adding||!t.formData.ragEnabled},on:{click:t.promptAddSources}},[t._v(" "+t._s(t.rag.adding?"Adding…":"Attach Files or Folders")+" ")]),e("button",{staticClass:"button",attrs:{type:"button",disabled:t.rag.loading||t.rag.addingUrl||!t.formData.ragEnabled},on:{click:function(n){t.showUrlModal=!0}}},[t._v(" "+t._s(t.rag.addingUrl?"Adding…":"Add Link")+" ")])]),t.showUrlModal?e("div",{staticClass:"url-modal-overlay",on:{click:function(n){return n.target!==n.currentTarget?null:t.closeUrlModal.apply(null,arguments)}}},[e("div",{staticClass:"url-modal"},[e("div",{staticClass:"url-modal-header"},[e("h3",[t._v("Add URL Source")]),e("button",{staticClass:"close-button",attrs:{type:"button"},on:{click:t.closeUrlModal}},[e("span",{staticClass:"icon-close"})])]),e("div",{staticClass:"url-modal-body"},[e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"url-input"}},[t._v("URL")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.urlInput,expression:"urlInput"}],attrs:{id:"url-input",type:"url",placeholder:"https://example.com/document.pdf",disabled:t.rag.addingUrl},domProps:{value:t.urlInput},on:{keyup:function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:t.submitUrl.apply(null,arguments)},input:function(n){n.target.composing||(t.urlInput=n.target.value)}}}),e("p",{staticClass:"hint"},[t._v(" Enter a URL to fetch and index. Supports HTML pages, PDF documents, JSON, and plain text. ")])])]),e("div",{staticClass:"url-modal-footer"},[e("button",{staticClass:"button",attrs:{type:"button"},on:{click:t.closeUrlModal}},[t._v(" Cancel ")]),e("button",{staticClass:"button primary",attrs:{type:"button",disabled:!t.isValidUrl||t.rag.addingUrl},on:{click:t.submitUrl}},[t._v(" "+t._s(t.rag.addingUrl?"Adding…":"Add URL")+" ")])])])]):t._e(),t.rag.loading?e("div",{staticClass:"hint"},[t._v(" Loading sources… ")]):t.rag.sources.length===0?e("div",{staticClass:"hint"},[t._v(" No knowledge sources attached yet. ")]):e("ul",{staticClass:"source-list"},t._l(t.rag.sources,function(n){return e("li",{key:n.id,staticClass:"source-item"},[e("div",{staticClass:"source-main"},[e("span",{staticClass:"source-path"},[e("span",{staticClass:"source-type-icon",class:t.getSourceTypeIconClass(n)}),t._v(" "+t._s(t.describeSource(n))+" ")]),n.status!=="pending"?e("span",{staticClass:"status-pill",class:`status-${n.status}`},[t._v(" "+t._s(t.formatSourceStatus(n.status))+" ")]):t._e()]),n.status==="pending"?e("div",{staticClass:"source-progress"},[e("div",{staticClass:"progress-container"},[e("NcProgressBar",{attrs:{value:n.progress||0,size:"small"}})],1),e("span",{staticClass:"progress-label"},[t._v(" "+t._s(t.formatProgressStage(n.progress_stage))+" "),n.progress_total>0?[t._v(" ("+t._s(n.progress_current)+"/"+t._s(n.progress_total)+") ")]:n.progress>0?[t._v(" "+t._s(n.progress)+"% ")]:t._e()],2)]):t._e(),n.last_indexed_at&&n.status==="ready"?e("div",{staticClass:"source-meta"},[t._v(" Last indexed "+t._s(t.formatTimestamp(n.last_indexed_at))+" ")]):t._e(),n.error_message?e("div",{staticClass:"source-meta source-error"},[t._v(" "+t._s(n.error_message)+" ")]):t._e(),e("div",{staticClass:"source-actions"},[e("button",{staticClass:"button subtle",attrs:{type:"button",disabled:t.rag.reindexing[n.id]||n.status==="pending"},on:{click:function(i){return t.reindexSource(n)}}},[t._v(" "+t._s(t.rag.reindexing[n.id]?"Reindexing…":"Reindex")+" ")]),e("button",{staticClass:"button danger",attrs:{type:"button",disabled:t.rag.removing[n.id]||n.status==="pending"},on:{click:function(i){return t.removeSource(n)}}},[t._v(" "+t._s(t.rag.removing[n.id]?"Removing…":"Remove")+" ")])])])}),0)]):e("div",{staticClass:"hint"},[t._v(" Save the bot before attaching files or folders. ")])]),e("hr",{staticClass:"section-divider",attrs:{role:"presentation"}}),t.isWikiCapableBot?e("div",{staticClass:"form-group personal-wiki-section"},[e("label",{staticClass:"checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.personalWikiEnabled,expression:"formData.personalWikiEnabled"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.formData.personalWikiEnabled)?t._i(t.formData.personalWikiEnabled,null)>-1:t.formData.personalWikiEnabled},on:{change:[function(n){var i=t.formData.personalWikiEnabled,s=n.target,r=!!s.checked;if(Array.isArray(i)){var o=null,a=t._i(i,o);s.checked?a<0&&t.$set(t.formData,"personalWikiEnabled",i.concat([o])):a>-1&&t.$set(t.formData,"personalWikiEnabled",i.slice(0,a).concat(i.slice(a+1)))}else t.$set(t.formData,"personalWikiEnabled",r)},t.markPersonalWikiChanged]}}),t._v(" Enable LLM Wiki ")]),e("p",{staticClass:"hint"},[t.isTeamBot?[t._v(" Let this team bot use a Markdown wiki in a Collective from one of the selected teams. ")]:[t._v(" Let this personal bot maintain a visible Markdown wiki in your Nextcloud files for durable personal or bot knowledge. The wiki can be read, edited, or deleted from Files. ")]],2),t.formData.personalWikiEnabled?e("div",{staticClass:"wiki-path-panel"},[e("div",{staticClass:"form-group compact"},[e("label",{attrs:{for:"personal-wiki-location"}},[t._v("Wiki location")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.formData.personalWikiLocation,expression:"formData.personalWikiLocation"}],attrs:{id:"personal-wiki-location",disabled:t.isTeamBot},on:{change:[function(n){var i=Array.prototype.filter.call(n.target.options,function(s){return s.selected}).map(function(s){var r="_value"in s?s._value:s.value;return r});t.$set(t.formData,"personalWikiLocation",n.target.multiple?i:i[0])},t.onPersonalWikiLocationChange]}},[t.isPersonalBot?e("option",{attrs:{value:"personal_files"}},[t._v(" Personal Files: "+t._s(t.defaultPersonalWikiPath)+" ")]):t._e(),e("option",{attrs:{value:"collective"}},[t._v(" Existing Collective ")])])]),t.formData.personalWikiLocation==="personal_files"?e("div",[e("p",{staticClass:"hint"},[t._v(" Default path: "),e("code",[t._v(t._s(t.defaultPersonalWikiPath))])]),e("details",{staticClass:"advanced-settings",attrs:{open:t.normalizePersonalWikiPath(t.formData.personalWikiPath)!==""}},[e("summary",[t._v("Use a custom wiki path")]),e("div",{staticClass:"form-group compact"},[e("label",{attrs:{for:"personal-wiki-path"}},[t._v("Custom path")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.personalWikiPath,expression:"formData.personalWikiPath"}],attrs:{id:"personal-wiki-path",type:"text",placeholder:t.WIKI_ROOT_FOLDER+"/Personal Wikis/my-bot"},domProps:{value:t.formData.personalWikiPath},on:{input:[function(n){n.target.composing||t.$set(t.formData,"personalWikiPath",n.target.value)},t.markPersonalWikiChanged]}}),e("p",{staticClass:"hint"},[t._v(" Optional. Leave blank to use the default path. Custom paths must be relative and start with "),e("code",[t._v(t._s(t.WIKI_ROOT_FOLDER)+"/")]),t._v(". ")])])])]):e("div",{staticClass:"form-group compact"},[e("label",{attrs:{for:"personal-wiki-collective"}},[t._v("Collective")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.formData.personalWikiCollectiveId,expression:"formData.personalWikiCollectiveId"}],attrs:{id:"personal-wiki-collective",disabled:t.wikiLocationsLoading||t.filteredWikiCollectives.length===0},on:{change:[function(n){var i=Array.prototype.filter.call(n.target.options,function(s){return s.selected}).map(function(s){var r="_value"in s?s._value:s.value;return r});t.$set(t.formData,"personalWikiCollectiveId",n.target.multiple?i:i[0])},t.markPersonalWikiChanged]}},[e("option",{attrs:{value:""}},[t._v(" Select a collective ")]),t._l(t.filteredWikiCollectives,function(n){return e("option",{key:n.id,domProps:{value:String(n.id)}},[t._v(" "+t._s(n.display_name)+" ")])})],2),t.wikiLocationsLoading?e("p",{staticClass:"hint"},[t._v(" Loading collectives... ")]):t.availableCollectives.length===0?e("p",{staticClass:"hint"},[t._v(" No admin-owned collectives available for this account. ")]):t.filteredWikiCollectives.length===0?e("p",{staticClass:"hint"},[t._v(" Select a team that matches one of your admin-owned collectives. ")]):e("p",{staticClass:"hint"},[t._v(" Wiki pages will be written to the selected collective and visible to its members. ")])])]):t._e()]):t._e(),t.isWikiCapableBot?e("hr",{staticClass:"section-divider",attrs:{role:"presentation"}}):t._e(),e("div",{staticClass:"form-group"},[e("label",[t._v("Agent Tools")]),t.toolLoading?e("div",{staticClass:"hint"},[t._v(" Loading tools… ")]):t.visibleTools.length===0?e("div",{staticClass:"hint"},[t._v(" No tools are currently enabled by the administrator. ")]):e("div",{staticClass:"tool-list"},t._l(t.visibleTools,function(n){return e("label",{key:t.getToolKey(n),staticClass:"checkbox tool-row",class:{"tool-row--disabled":t.isToolDisabled(n)}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.selectedTools,expression:"formData.selectedTools"}],attrs:{type:"checkbox",disabled:t.isToolDisabled(n)},domProps:{value:t.getToolKey(n),checked:Array.isArray(t.formData.selectedTools)?t._i(t.formData.selectedTools,t.getToolKey(n))>-1:t.formData.selectedTools},on:{change:function(i){var s=t.formData.selectedTools,r=i.target,o=!!r.checked;if(Array.isArray(s)){var a=t.getToolKey(n),u=t._i(s,a);r.checked?u<0&&t.$set(t.formData,"selectedTools",s.concat([a])):u>-1&&t.$set(t.formData,"selectedTools",s.slice(0,u).concat(s.slice(u+1)))}else t.$set(t.formData,"selectedTools",o)}}}),e("span",{staticClass:"tool-info"},[e("span",{staticClass:"tool-name"},[t._v(" "+t._s(n.name)+" "),n.is_builtin?e("span",{staticClass:"tool-badge builtin"},[t._v("Built-in")]):t._e()]),n.description?e("span",{staticClass:"tool-description"},[t._v(t._s(n.description))]):t._e(),t.isToolDisabled(n)?e("span",{staticClass:"tool-description tool-unavailable"},[t._v(" Only available for personal bots. ")]):t._e(),n.mcp_endpoint_url?e("span",{staticClass:"tool-endpoint"},[t._v(t._s(n.mcp_endpoint_url))]):t._e()])])}),0),e("p",{staticClass:"hint"},[t._v(" Selected tools allow the bot to call external capabilities during conversations. ")])]),e("hr",{staticClass:"section-divider",attrs:{role:"presentation"}}),e("div",{staticClass:"form-group"},[e("label",[t._v("Onboarding Questions")]),e("p",{staticClass:"hint"},[t._v(" Optional: Add questions that users will be asked when they first activate this bot in a chat room. Answers are stored and provided as context to the bot. ")]),t.formData.onboardingQuestions.questions.length===0?e("div",{staticClass:"onboarding-empty"},[e("p",[t._v("No onboarding questions configured.")]),e("button",{staticClass:"button",attrs:{type:"button",disabled:t.formData.onboardingQuestions.questions.length>=15},on:{click:t.addOnboardingQuestion}},[t._v(" Add Question ")])]):e("div",{staticClass:"onboarding-questions-list"},[t._l(t.formData.onboardingQuestions.questions,function(n,i){return e("div",{key:n.id,staticClass:"onboarding-question-card"},[e("div",{staticClass:"question-header"},[e("span",{staticClass:"question-badge"},[t._v("Q"+t._s(i+1))]),e("span",{staticClass:"question-id"},[t._v(t._s(n.id))]),e("button",{staticClass:"button subtle small",attrs:{type:"button"},on:{click:function(s){return t.removeOnboardingQuestion(i)}}},[t._v(" Remove ")])]),e("div",{staticClass:"question-body"},[e("div",{staticClass:"form-group compact"},[e("label",{attrs:{for:"q-text-"+n.id}},[t._v("Question Text")]),e("input",{directives:[{name:"model",rawName:"v-model",value:n.text,expression:"question.text"}],attrs:{id:"q-text-"+n.id,type:"text",placeholder:"What is your main use case?"},domProps:{value:n.text},on:{input:function(s){s.target.composing||t.$set(n,"text",s.target.value)}}})]),e("div",{staticClass:"form-group compact"},[e("label",{staticClass:"checkbox"},[e("input",{attrs:{type:"checkbox"},domProps:{checked:t.isFreeTextQuestion(n)},on:{change:function(s){return t.setQuestionFreeText(i,s.target.checked)}}}),t._v(" Free text answer (user reply will be stored) ")])]),e("div",{staticClass:"answers-grid"},t._l(n.answers,function(s,r){return e("div",{key:s.id,staticClass:"answer-row"},[e("div",{staticClass:"answer-label"},[t._v(" "+t._s(t.isFreeTextAnswer(s)?"TXT":s.id.toUpperCase())+" ")]),t.isFreeTextAnswer(s)?e("input",{staticClass:"answer-text free-text",attrs:{type:"text",disabled:""},domProps:{value:"Free text (user types the answer)"}}):e("input",{directives:[{name:"model",rawName:"v-model",value:s.text,expression:"answer.text"}],staticClass:"answer-text",attrs:{type:"text",placeholder:"Answer text"},domProps:{value:s.text},on:{input:function(o){o.target.composing||t.$set(s,"text",o.target.value)}}}),e("select",{directives:[{name:"model",rawName:"v-model",value:s.next,expression:"answer.next"}],staticClass:"answer-next",on:{change:function(o){var a=Array.prototype.filter.call(o.target.options,function(u){return u.selected}).map(function(u){var c="_value"in u?u._value:u.value;return c});t.$set(s,"next",o.target.multiple?a:a[0])}}},[e("option",{domProps:{value:null}},[t._v(" End ")]),t._l(t.getAvailableNextQuestions(n.id),function(o){return e("option",{key:o.id,domProps:{value:o.id}},[t._v(" → "+t._s(o.id)+" ")])})],2),!t.isFreeTextQuestion(n)&&n.answers.length>2?e("button",{staticClass:"button subtle small",attrs:{type:"button"},on:{click:function(o){return t.removeAnswer(i,r)}}},[t._v(" × ")]):t._e()])}),0),!t.isFreeTextQuestion(n)&&n.answers.length<4?e("button",{staticClass:"button subtle small add-answer-btn",attrs:{type:"button"},on:{click:function(s){return t.addAnswer(i)}}},[t._v(" + Add Answer ")]):t._e()])])}),t.formData.onboardingQuestions.questions.length<15?e("button",{staticClass:"button",attrs:{type:"button"},on:{click:t.addOnboardingQuestion}},[t._v(" Add Another Question ")]):t._e()],2),t.onboardingValidationError?e("div",{staticClass:"onboarding-error"},[t._v(" "+t._s(t.onboardingValidationError)+" ")]):t._e()]),e("div",{staticClass:"form-actions"},[e("button",{staticClass:"button",attrs:{type:"button"},on:{click:function(n){return t.$emit("cancel")}}},[t._v(" Cancel ")]),e("button",{staticClass:"button primary",attrs:{type:"submit"}},[t._v(" "+t._s(t.submitButtonText)+" ")])])])])])])},Ur=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"notice-content"},[e("strong",[t._v("Pending Changes")]),e("p",[t._v(" This bot has changes awaiting approval. You are viewing/editing the pending version. The currently approved version remains live until these changes are approved. ")])])},function(){var t=this,e=t._self._c;return e("p",{staticClass:"hint"},[e("code",[t._v("0.2")]),t._v(" precise and stable, "),e("code",[t._v("0.4")]),t._v(" balanced, "),e("code",[t._v("0.6")]),t._v(" creative. ")])}],Mr=ni(Wr,Rr,Ur,!1,null,"9677cc70");const qr=Mr.exports;export{qr as B,J as C,Ee as F,X as P,ri as _,Vr as a,Br as b,Tr as c,Ne as d,ai as e,Sr as g,pe as i,Gn as r};
//# sourceMappingURL=BotForm-S-ACeDfi.chunk.mjs.map