| null = null;
+
+ constructor(loader: ThumbnailLoader) {
+ this.#loader = loader;
+ }
+
+ activate() {
+ if (this.active) {
+ return;
+ }
+
+ this.active = true;
+ this.clearInterval();
+ this.#interval = setInterval(() => {
+ this.loadNextIfRemoved();
+ }, 500);
+ }
+
+ deactivate() {
+ if (!this.active) {
+ return;
+ }
+
+ this.active = false;
+ this.clearInterval();
+ this.clearTimeout();
+ }
+
+ clearInterval() {
+ if (this.#interval) {
+ clearInterval(this.#interval);
+ this.#interval = null;
+ }
+ }
+
+ clearTimeout() {
+ if (this.#timeout) {
+ clearTimeout(this.#timeout);
+ this.#timeout = null;
+ }
+ }
+
+ loadNext() {
+ this.clearTimeout();
+
+ this.container = this.#loader?.queue.shift();
+ if (typeof this.container === 'undefined') {
+ this.deactivate();
+ return;
+ }
+
+ if (this.loadNextIfRemoved()) {
+ return;
+ }
+
+ if (this.container.querySelectorAll('img').length > 0) {
+ this.loadNext();
+ return;
+ }
+
+ this.activate();
+
+ // Give up after 30 seconds
+ this.#timeout = setTimeout(() => {
+ this.loadNext();
+ }, 30_000);
+
+ const img = document.createElement('img');
+ img.sizes = this.container.getAttribute('data-sizes') ?? '';
+ img.srcset = this.container.getAttribute('data-srcset') ?? '';
+ img.alt = this.container.getAttribute('data-alt') ?? '';
+ img.setAttribute(
+ 'data-animated',
+ this.container.getAttribute('data-animated') ?? ''
+ );
+ img.src = this.container.getAttribute('data-src') ?? '';
+
+ // add our event listeners
+ img.onload = () => this.loadNext();
+ img.onabort = () => this.loadNext();
+ img.onerror = () => this.loadNext();
+
+ this.container.appendChild(img);
+
+ // Picturefill was here.
+ }
+
+ loadNextIfRemoved() {
+ if (this.container && !document.body.contains(this.container)) {
+ this.loadNext();
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/packages/craftcms-legacy/cp/src/Craft.js b/packages/craftcms-legacy/cp/src/Craft.js
index 8b3aac249fd..7d85ae6d968 100644
--- a/packages/craftcms-legacy/cp/src/Craft.js
+++ b/packages/craftcms-legacy/cp/src/Craft.js
@@ -103,8 +103,8 @@ import './js/UriFormatGenerator.js';
import './js/UserIndex.js';
// Custom elements
-import './js/CraftGlobalSidebar.js';
-import './js/CraftDisclosure.js';
-import './js/CraftTooltip.js';
+// import './js/CraftGlobalSidebar.js';
+// import './js/CraftDisclosure.js';
+// import './js/CraftTooltip.js';
import './js/CraftElementLabel';
import './js/CraftProxyScrollbar';
diff --git a/packages/craftcms-legacy/cp/src/css/_cp.scss b/packages/craftcms-legacy/cp/src/css/_cp.scss
index 6041a22c3d0..6141833e550 100644
--- a/packages/craftcms-legacy/cp/src/css/_cp.scss
+++ b/packages/craftcms-legacy/cp/src/css/_cp.scss
@@ -1577,21 +1577,6 @@ li.breadcrumb-toggle-wrapper {
}
}
-/* grids */
-.grid {
- position: relative;
- min-height: 1px; // Required for Grid.js to run
-
- &::after {
- @include mixins.clearafter;
- }
-
- & > .item {
- display: none;
- box-sizing: border-box;
- }
-}
-
%type-heading-small {
text-transform: uppercase;
color: var(--medium-text-color);
diff --git a/packages/craftcms-legacy/cp/src/css/_customize-sources.scss b/packages/craftcms-legacy/cp/src/css/_customize-sources.scss
new file mode 100644
index 00000000000..64a15fc1bda
--- /dev/null
+++ b/packages/craftcms-legacy/cp/src/css/_customize-sources.scss
@@ -0,0 +1,246 @@
+@use '@craftcms/sass/mixins';
+
+/* ----------------------------------------
+/* Customize sources modal
+/* ---------------------------------------- */
+
+.cs-modal {
+ display: flex !important;
+ flex-direction: column;
+
+ & > .cs-body {
+ flex: 1;
+ display: flex;
+ flex-flow: row nowrap;
+ height: calc(100% - 44px);
+ container-type: inline-size;
+
+ @container (max-width: 699px) {
+ & > .cs-sidebar,
+ & > .cs-source-settings--outer {
+ &.cs-selected-screen {
+ flex: 1;
+ }
+
+ &:not(.cs-selected-screen) {
+ display: none;
+ }
+ }
+ }
+
+ .cs-header {
+ height: 44px;
+ border-block-end: 1px solid var(--hairline-color);
+ display: flex;
+ align-items: center;
+ gap: var(--s);
+ padding-inline: var(--m);
+
+ .cs-back-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-inline-start: -6px;
+ width: var(--touch-target-size);
+ height: var(--touch-target-size);
+
+ @container (min-width: 700px) {
+ display: none;
+ }
+ }
+
+ h2 {
+ margin-block: 0;
+ }
+ }
+
+ & > .cs-sidebar {
+ flex: 0 0 200px;
+ height: 100%;
+ border-inline-end: 1px solid var(--hairline-color);
+
+ & > .cs-sidebar-content {
+ padding: var(--m);
+ border: none;
+ height: calc(100% - 44px);
+ box-sizing: border-box;
+ overflow: auto;
+
+ & > .cs-sidebar-list {
+ padding-inline-start: 0;
+
+ &:not(:empty) {
+ margin-block-end: var(--m);
+ }
+ }
+ }
+ }
+
+ &.sidebar-hidden {
+ padding-inline-start: 0;
+
+ & > .cs-sidebar {
+ display: none;
+ }
+ }
+
+ & > .cs-source-settings--outer {
+ flex: 1;
+ height: 100%;
+
+ & > .cs-source-settings {
+ height: calc(100% - 44px);
+ position: relative;
+ padding: var(--m);
+ overflow: auto;
+ }
+ }
+ }
+
+ & > .footer {
+ flex: 0 0 44px;
+ width: 100%;
+ }
+}
+
+.cs-item {
+ --light-text-color: var(--gray-600);
+ --selected-item-color: var(--white);
+ display: flex;
+ gap: var(--s);
+ padding-inline-end: var(--s);
+ flex-direction: row;
+ width: 100%;
+ align-items: center;
+ position: relative;
+ background-color: var(--gray-100);
+ border-radius: var(--radius-lg);
+ user-select: none;
+ cursor: default;
+
+ & + .cs-item {
+ &.cs-item--heading {
+ margin-block-start: var(--m);
+ }
+
+ &:not(.cs-item--heading) {
+ margin-block-start: var(--2xs);
+ }
+ }
+
+ @container (min-width: 700px) {
+ &.sel,
+ &.active {
+ --focus-ring: var(--focus-ring-outset);
+ --ui-control-color: var(--selected-item-color);
+ --text-color: var(--selected-item-color);
+ background-color: var(--bg-selection-dark);
+ color: var(--selected-item-color);
+ }
+ }
+
+ .label,
+ .handle {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ .handle {
+ @include mixins.fixed-width-font;
+ font-size: 0.8em !important;
+ }
+
+ &:not(.sel) .handle {
+ color: var(--fg-subtle);
+ }
+
+ @container (max-width: 699px) {
+ .handle {
+ color: var(--fg-subtle);
+ }
+ }
+
+ &.cs-item--heading {
+ .label {
+ text-transform: uppercase;
+ color: var(--light-text-color);
+ font-size: 12px;
+ font-weight: bold;
+ }
+
+ @container (min-width: 700px) {
+ &.sel .label {
+ color: var(--selected-item-color);
+ }
+ }
+ }
+}
+
+.cs-item__move {
+ justify-content: center;
+ align-items: center;
+
+ &.icon {
+ display: flex;
+ text-decoration: none;
+ }
+}
+
+.cs-item__btn {
+ flex: 1;
+ padding-block: 6px;
+ padding-inline-start: var(--m);
+ border-radius: var(--radius-lg);
+ overflow: hidden;
+
+ &.cs-item__page-btn {
+ display: flex;
+ flex-direction: row;
+ gap: var(--s);
+ align-items: center;
+
+ .cp-icon:empty {
+ display: none;
+ }
+ }
+
+ &:focus {
+ position: relative;
+ z-index: 1;
+ }
+}
+
+/* Shared modal chrome (also applied to .elementselectormodal in _main.scss). */
+.cs-modal {
+ .main-header {
+ display: flex;
+ align-items: center;
+ margin-block-end: var(--s);
+ }
+
+ .main-heading {
+ margin-block-end: 0;
+ }
+
+ .nav-toggle {
+ margin-inline-start: 4px;
+ @include mixins.touch-target;
+ color: var(--ui-control-color);
+
+ &:hover {
+ color: var(--gray-500);
+ }
+ }
+
+ .sidebar-header {
+ display: flex;
+ justify-content: flex-end;
+ padding-block: 0;
+ padding-inline: var(--s);
+ margin-block-end: var(--s);
+ }
+
+ .nav-close {
+ @include mixins.touch-target;
+ }
+}
diff --git a/packages/craftcms-legacy/cp/src/css/_main.scss b/packages/craftcms-legacy/cp/src/css/_main.scss
index dfc83aeaac4..2093a3e0c90 100644
--- a/packages/craftcms-legacy/cp/src/css/_main.scss
+++ b/packages/craftcms-legacy/cp/src/css/_main.scss
@@ -1479,210 +1479,23 @@ td.right {
@include mixins.clearafter;
}
-.cs-modal {
- display: flex !important;
- flex-direction: column;
-
- & > .cs-body {
- flex: 1;
- display: flex;
- flex-flow: row nowrap;
- height: calc(100% - 44px);
- container-type: inline-size;
-
- @container (max-width: 699px) {
- & > .cs-sidebar,
- & > .cs-source-settings--outer {
- &.cs-selected-screen {
- flex: 1;
- }
-
- &:not(.cs-selected-screen) {
- display: none;
- }
- }
- }
-
- .cs-header {
- height: 44px;
- border-block-end: 1px solid var(--hairline-color);
- display: flex;
- align-items: center;
- gap: var(--s);
- padding-inline: var(--m);
-
- .cs-back-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-inline-start: -6px;
- width: var(--touch-target-size);
- height: var(--touch-target-size);
-
- @container (min-width: 700px) {
- display: none;
- }
- }
-
- h2 {
- margin-block: 0;
- }
- }
-
- & > .cs-sidebar {
- flex: 0 0 200px;
- height: 100%;
- border-inline-end: 1px solid var(--hairline-color);
-
- & > .cs-sidebar-content {
- padding: var(--m);
- border: none;
- height: calc(100% - 44px);
- box-sizing: border-box;
- overflow: auto;
-
- & > .cs-sidebar-list {
- padding-inline-start: 0;
-
- &:not(:empty) {
- margin-block-end: var(--m);
- }
- }
- }
- }
-
- &.sidebar-hidden {
- padding-inline-start: 0;
-
- & > .cs-sidebar {
- display: none;
- }
- }
-
- & > .cs-source-settings--outer {
- flex: 1;
- height: 100%;
-
- & > .cs-source-settings {
- height: calc(100% - 44px);
- position: relative;
- padding: var(--m);
- overflow: auto;
- }
- }
- }
-
- & > .footer {
- flex: 0 0 44px;
- width: 100%;
- }
-}
-
-.cs-item {
- --light-text-color: var(--gray-600);
- --selected-item-color: var(--white);
+.checkbox-select-item {
display: flex;
- gap: var(--s);
- padding-inline-end: var(--s);
- flex-direction: row;
- width: 100%;
- align-items: center;
- position: relative;
- background-color: var(--gray-100);
- border-radius: var(--radius-lg);
- user-select: none;
- cursor: default;
-
- & + .cs-item {
- &.cs-item--heading {
- margin-block-start: var(--m);
- }
-
- &:not(.cs-item--heading) {
- margin-block-start: var(--2xs);
- }
- }
-
- @container (min-width: 700px) {
- &.sel,
- &.active {
- --focus-ring: var(--focus-ring-outset);
- --ui-control-color: var(--selected-item-color);
- --text-color: var(--selected-item-color);
- background-color: var(--bg-selection-dark);
- color: var(--selected-item-color);
- }
- }
-
- .label,
- .handle {
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- .handle {
- @include mixins.fixed-width-font;
- font-size: 0.8em !important;
- }
-
- &:not(.sel) .handle {
- color: var(--fg-subtle);
- }
-
- @container (max-width: 699px) {
- .handle {
- color: var(--fg-subtle);
- }
- }
-
- &.cs-item--heading {
- .label {
- text-transform: uppercase;
- color: var(--light-text-color);
- font-size: 12px;
- font-weight: bold;
- }
-
- @container (min-width: 700px) {
- &.sel .label {
- color: var(--selected-item-color);
- }
- }
- }
-}
-
-.cs-item__move {
- justify-content: center;
- align-items: center;
-
- &.icon {
- display: flex;
- text-decoration: none;
- }
-}
-
-.cs-item__btn {
- flex: 1;
- padding-block: 6px;
- padding-inline-start: var(--m);
- border-radius: var(--radius-lg);
- overflow: hidden;
-
- &.cs-item__page-btn {
- display: flex;
- flex-direction: row;
- gap: var(--s);
- align-items: center;
-
- .cp-icon:empty {
- display: none;
- }
- }
+ gap: var(--xs);
+ align-items: flex-start;
+ align-content: stretch;
+ padding-block: 4px;
- &:focus {
+ .move {
+ margin-block-start: -4px;
+ margin-inline-end: var(--xs);
position: relative;
z-index: 1;
}
+
+ .action-btn {
+ margin-block: -4px;
+ }
}
ul.path {
@@ -6590,9 +6403,9 @@ $min2ColWidth: 400px;
}
}
-/* element selector modals & customize sources modal */
-.elementselectormodal,
-.cs-modal {
+/* element selector modals */
+/* (the matching .cs-modal rules live in _customize-sources.scss) */
+.elementselectormodal {
.main-header {
display: flex;
align-items: center;
@@ -8138,29 +7951,29 @@ tr.indexingSession td.progress div.progressContainer div.progressInfo {
}
// Selects
-.select:not(.selectize):not(.cp-select),
-.select:not(.selectize):not(.cp-select) select {
+.select:not(.selectize),
+.select:not(.selectize) select {
@include mixins.select-styles;
}
-.select:not(.selectize):not(.cp-select) {
+.select:not(.selectize) {
@include mixins.select-container-styles;
}
-.select:not(.selectize):not(.cp-select)::after {
+.select:not(.selectize)::after {
@include mixins.select-arrow-styles;
}
-.select:not(.selectize):not(.cp-select) select {
+.select:not(.selectize) select {
@include mixins.select-input-styles;
white-space: pre;
}
-.select:not(.selectize):not(.cp-select).fullwidth select {
+.select:not(.selectize).fullwidth select {
@include mixins.select-input-fullwidth-styles;
}
-.select:not(.selectize):not(.cp-select) select {
+.select:not(.selectize) select {
&:hover:not(:disabled) {
@include mixins.select-input-hovered-styles;
}
@@ -8170,11 +7983,11 @@ tr.indexingSession td.progress div.progressContainer div.progressInfo {
}
}
-.select:not(.selectize):not(.cp-select).small::after {
+.select:not(.selectize).small::after {
inset-block-start: 9px;
}
-.select:not(.selectize):not(.cp-select).small select {
+.select:not(.selectize).small select {
padding-block: 4px !important;
font-size: 11px;
}
diff --git a/packages/craftcms-legacy/cp/src/css/craft.scss b/packages/craftcms-legacy/cp/src/css/craft.scss
index 4f9b0fbbaa5..4628c523337 100644
--- a/packages/craftcms-legacy/cp/src/css/craft.scss
+++ b/packages/craftcms-legacy/cp/src/css/craft.scss
@@ -6,7 +6,7 @@
@import 'hud';
@import 'icon-picker';
@import 'login';
-
+@import 'customize-sources';
@import 'main';
@import 'cp';
@import 'range';
diff --git a/packages/craftcms-legacy/cp/src/js/CustomizeSourcesModal.js b/packages/craftcms-legacy/cp/src/js/CustomizeSourcesModal.js
index 9d8f7423ec4..d065f77585c 100644
--- a/packages/craftcms-legacy/cp/src/js/CustomizeSourcesModal.js
+++ b/packages/craftcms-legacy/cp/src/js/CustomizeSourcesModal.js
@@ -42,6 +42,7 @@ Craft.CustomizeSourcesModal = Garnish.Modal.extend({
sourceDrag: null,
sources: null,
selectedSource: null,
+ destroying: false,
elementTypeName: null,
baseSortOptions: null,
@@ -643,6 +644,8 @@ Craft.CustomizeSourcesModal = Garnish.Modal.extend({
},
destroy: function () {
+ this.destroying = true;
+
const sources = [...this.sources];
for (const source of sources) {
source.destroy();
@@ -1383,15 +1386,17 @@ Craft.CustomizeSourcesModal.BaseSource = Garnish.Base.extend({
if (this.isSelected()) {
this.deselect();
- let $closestItem = this.$item.prev('.cs-item');
- if (!$closestItem.length) {
- $closestItem = this.$item.next('.cs-item');
- }
- if ($closestItem.length) {
- $closestItem.data('source').select();
- }
+ if (!this.modal.destroying) {
+ let $closestItem = this.$item.prev('.cs-item');
+ if (!$closestItem.length) {
+ $closestItem = this.$item.next('.cs-item');
+ }
+ if ($closestItem.length) {
+ $closestItem.data('source').select();
+ }
- Garnish.setFocusWithin(this.modal.$sourceSettingsContainer);
+ Garnish.setFocusWithin(this.modal.$sourceSettingsContainer);
+ }
}
this.$item.data('source', null);
diff --git a/packages/craftcms-legacy/cp/src/js/ElementActionTrigger.js b/packages/craftcms-legacy/cp/src/js/ElementActionTrigger.js
index 0218fe5026a..43601a81e11 100644
--- a/packages/craftcms-legacy/cp/src/js/ElementActionTrigger.js
+++ b/packages/craftcms-legacy/cp/src/js/ElementActionTrigger.js
@@ -16,6 +16,10 @@ Craft.ElementActionTrigger = Garnish.Base.extend(
// Save a reference to the element index that this trigger will be used with
this.elementIndex = Craft.currentElementIndex;
+ if (!this.elementIndex?.triggers) {
+ return;
+ }
+
// Register the trigger on the element index, so it can be destroyed when the view is updated
this.elementIndex.triggers.push(this);
diff --git a/packages/craftcms-legacy/cp/src/js/ElementThumbLoader.js b/packages/craftcms-legacy/cp/src/js/ElementThumbLoader.js
index 8523017fcd3..884e0851b54 100644
--- a/packages/craftcms-legacy/cp/src/js/ElementThumbLoader.js
+++ b/packages/craftcms-legacy/cp/src/js/ElementThumbLoader.js
@@ -1,167 +1,12 @@
+import {ThumbnailLoader} from '@craftcms/cp/utilities/thumbnail-loader.ts.mjs';
+
/** global: Craft */
/** global: Garnish */
/**
* Base Element Index View
*/
-Craft.ElementThumbLoader = Garnish.Base.extend(
- {
- queue: null,
- workers: [],
-
- init: function () {
- this.queue = [];
-
- for (let i = 0; i < 3; i++) {
- this.workers.push(new Craft.ElementThumbLoader.Worker(this));
- }
- },
-
- load: function ($elements) {
- // Only immediately load the visible images
- const $thumbs = $elements.find('.thumb[data-sizes]');
- for (let i = 0; i < $thumbs.length; i++) {
- const $thumb = $thumbs.eq(i);
- if ($thumb.is(':visible')) {
- this.addToQueue($thumb[0]);
- } else {
- const key = `thumb${Math.floor(Math.random() * 1000000)}`;
- Craft.ElementThumbLoader.invisibleThumbs[key] = [this, $thumb];
- const handler = () => {
- if (
- Craft.ElementThumbLoader.invisibleThumbs[key] &&
- $thumb.is(':visible')
- ) {
- delete Craft.ElementThumbLoader.invisibleThumbs[key];
- this.addToQueue($thumb[0]);
- }
- };
- Garnish.$doc.on(`scroll.${key}`, handler);
- Garnish.$win.on(`resize.${key}`, handler);
- }
- }
- },
-
- addToQueue: function (thumb) {
- this.queue.push(thumb);
-
- // See if there are any inactive workers
- for (let i = 0; i < this.workers.length; i++) {
- if (!this.workers[i].active) {
- this.workers[i].loadNext();
- }
- }
- },
-
- destroy: function () {
- for (let i = 0; i < this.workers.length; i++) {
- this.workers[i].destroy();
- }
-
- this.base();
- },
- },
- {
- invisibleThumbs: {},
- retryAll: function () {
- for (const key in Craft.ElementThumbLoader.invisibleThumbs) {
- const [queue, $thumb] = Craft.ElementThumbLoader.invisibleThumbs[key];
- delete Craft.ElementThumbLoader.invisibleThumbs[key];
- queue.load($thumb.parent());
- }
- },
+Craft.ElementThumbLoader = class extends ThumbnailLoader {
+ load($elements) {
+ super.load($elements[0], '.thumb[data-sizes]');
}
-);
-
-Craft.ElementThumbLoader.Worker = Garnish.Base.extend({
- loader: null,
- active: false,
- container: null,
- _interval: null,
- _timeout: null,
-
- init: function (loader) {
- this.loader = loader;
- },
-
- activate: function () {
- if (this.active) {
- return;
- }
- this.active = true;
- // keep track of whether the current container is actually in the DOM
- this.clearInterval();
- this._interval = setInterval(() => {
- this.loadNextIfRemoved();
- }, 500);
- },
-
- deactivate: function () {
- if (!this.active) {
- return;
- }
- this.active = false;
- this.clearInterval();
- this.clearTimeout();
- },
-
- clearInterval: function () {
- if (this._interval) {
- clearInterval(this._interval);
- this._interval = null;
- }
- },
-
- clearTimeout: function () {
- if (this._timeout) {
- clearTimeout(this._timeout);
- this._timeout = null;
- }
- },
-
- loadNext: function () {
- this.clearTimeout();
-
- this.container = this.loader.queue.shift();
- if (typeof this.container === 'undefined') {
- this.deactivate();
- return;
- }
-
- if (this.loadNextIfRemoved()) {
- return;
- }
-
- const $container = $(this.container);
- if ($container.find('img').length) {
- this.loadNext();
- return;
- }
-
- this.activate();
-
- // give up after 30 seconds
- this._timeout = setTimeout(() => {
- this.loadNext();
- }, 30000);
-
- const $img = $(' ', {
- sizes: $container.attr('data-sizes'),
- srcset: $container.attr('data-srcset'),
- alt: $container.attr('data-alt') || '',
- 'data-animated': $container.attr('data-animated'),
- });
- this.addListener($img, 'load,abort,error', 'loadNext');
- $img.appendTo($container);
- picturefill({
- elements: [$img[0]],
- });
- },
-
- loadNextIfRemoved() {
- if (this.container && !document.body.contains(this.container)) {
- this.loadNext();
- return true;
- }
- return false;
- },
-});
+};
diff --git a/resources/build/assets/AdminTable-32qWVDq-.js b/resources/build/assets/AdminTable-32qWVDq-.js
new file mode 100644
index 00000000000..aacfcd0703d
--- /dev/null
+++ b/resources/build/assets/AdminTable-32qWVDq-.js
@@ -0,0 +1,3195 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ I as r,
+ J as i,
+ L as a,
+ N as o,
+ P as s,
+ Q as c,
+ R as l,
+ T as u,
+ U as d,
+ V as f,
+ W as p,
+ X as m,
+ Y as h,
+ Z as g,
+ _,
+ b as v,
+ ct as y,
+ et as ee,
+ f as te,
+ ht as b,
+ it as ne,
+ k as re,
+ l as ie,
+ m as x,
+ t as ae,
+ tt as S,
+ ut as oe,
+ v as C,
+ w,
+ x as T,
+ y as E,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as se, n as ce, r as le, t as ue} from './Empty-D0VMu5kQ.js';
+import {t as de} from './Select-uUcGssK_.js';
+function D() {
+ return {
+ accessor: (e, t) =>
+ typeof e == `function` ? {...t, accessorFn: e} : {...t, accessorKey: e},
+ display: (e) => e,
+ group: (e) => e,
+ };
+}
+function O(e, t) {
+ return typeof e == `function` ? e(t) : e;
+}
+function k(e, t) {
+ return (n) => {
+ t.setState((t) => ({...t, [e]: O(n, t[e])}));
+ };
+}
+function A(e) {
+ return e instanceof Function;
+}
+function j(e) {
+ return Array.isArray(e) && e.every((e) => typeof e == `number`);
+}
+function fe(e, t) {
+ let n = [],
+ r = (e) => {
+ e.forEach((e) => {
+ n.push(e);
+ let i = t(e);
+ i != null && i.length && r(i);
+ });
+ };
+ return (r(e), n);
+}
+function M(e, t, n) {
+ let r = [],
+ i;
+ return (a) => {
+ let o;
+ n.key && n.debug && (o = Date.now());
+ let s = e(a);
+ if (!(s.length !== r.length || s.some((e, t) => r[t] !== e))) return i;
+ r = s;
+ let c;
+ if (
+ (n.key && n.debug && (c = Date.now()),
+ (i = t(...s)),
+ n == null || n.onChange == null || n.onChange(i),
+ n.key && n.debug && n != null && n.debug())
+ ) {
+ let e = Math.round((Date.now() - o) * 100) / 100,
+ t = Math.round((Date.now() - c) * 100) / 100,
+ r = t / 16,
+ i = (e, t) => {
+ for (e = String(e); e.length < t; ) e = ` ` + e;
+ return e;
+ };
+ console.info(
+ `%c⏱ ${i(t, 5)} /${i(e, 5)} ms`,
+ `
+ font-size: .6rem;
+ font-weight: bold;
+ color: hsl(${Math.max(0, Math.min(120 - 120 * r, 120))}deg 100% 31%);`,
+ n?.key
+ );
+ }
+ return i;
+ };
+}
+function N(e, t, n, r) {
+ return {debug: () => e?.debugAll ?? e[t], key: !1, onChange: r};
+}
+function pe(e, t, n, r) {
+ let i = {
+ id: `${t.id}_${n.id}`,
+ row: t,
+ column: n,
+ getValue: () => t.getValue(r),
+ renderValue: () => i.getValue() ?? e.options.renderFallbackValue,
+ getContext: M(
+ () => [e, n, t, i],
+ (e, t, n, r) => ({
+ table: e,
+ column: t,
+ row: n,
+ cell: r,
+ getValue: r.getValue,
+ renderValue: r.renderValue,
+ }),
+ N(e.options, `debugCells`, `cell.getContext`)
+ ),
+ };
+ return (
+ e._features.forEach((r) => {
+ r.createCell == null || r.createCell(i, n, t, e);
+ }, {}),
+ i
+ );
+}
+function me(e, t, n, r) {
+ let i = {...e._getDefaultColumnDef(), ...t},
+ a = i.accessorKey,
+ o =
+ i.id ??
+ (a
+ ? typeof String.prototype.replaceAll == `function`
+ ? a.replaceAll(`.`, `_`)
+ : a.replace(/\./g, `_`)
+ : void 0) ??
+ (typeof i.header == `string` ? i.header : void 0),
+ s;
+ if (
+ (i.accessorFn
+ ? (s = i.accessorFn)
+ : a &&
+ (s = a.includes(`.`)
+ ? (e) => {
+ let t = e;
+ for (let e of a.split(`.`)) t = t?.[e];
+ return t;
+ }
+ : (e) => e[i.accessorKey]),
+ !o)
+ )
+ throw Error();
+ let c = {
+ id: `${String(o)}`,
+ accessorFn: s,
+ parent: r,
+ depth: n,
+ columnDef: i,
+ columns: [],
+ getFlatColumns: M(
+ () => [!0],
+ () => [c, ...c.columns?.flatMap((e) => e.getFlatColumns())],
+ N(e.options, `debugColumns`, `column.getFlatColumns`)
+ ),
+ getLeafColumns: M(
+ () => [e._getOrderColumnsFn()],
+ (e) => {
+ var t;
+ return (t = c.columns) != null && t.length
+ ? e(c.columns.flatMap((e) => e.getLeafColumns()))
+ : [c];
+ },
+ N(e.options, `debugColumns`, `column.getLeafColumns`)
+ ),
+ };
+ for (let t of e._features) t.createColumn == null || t.createColumn(c, e);
+ return c;
+}
+var P = `debugHeaders`;
+function he(e, t, n) {
+ let r = {
+ id: n.id ?? t.id,
+ column: t,
+ index: n.index,
+ isPlaceholder: !!n.isPlaceholder,
+ placeholderId: n.placeholderId,
+ depth: n.depth,
+ subHeaders: [],
+ colSpan: 0,
+ rowSpan: 0,
+ headerGroup: null,
+ getLeafHeaders: () => {
+ let e = [],
+ t = (n) => {
+ (n.subHeaders && n.subHeaders.length && n.subHeaders.map(t),
+ e.push(n));
+ };
+ return (t(r), e);
+ },
+ getContext: () => ({table: e, header: r, column: t}),
+ };
+ return (
+ e._features.forEach((t) => {
+ t.createHeader == null || t.createHeader(r, e);
+ }),
+ r
+ );
+}
+var ge = {
+ createTable: (e) => {
+ ((e.getHeaderGroups = M(
+ () => [
+ e.getAllColumns(),
+ e.getVisibleLeafColumns(),
+ e.getState().columnPinning.left,
+ e.getState().columnPinning.right,
+ ],
+ (t, n, r, i) => {
+ let a = r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [],
+ o = i?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [],
+ s = n.filter(
+ (e) =>
+ !(r != null && r.includes(e.id)) &&
+ !(i != null && i.includes(e.id))
+ );
+ return F(t, [...a, ...s, ...o], e);
+ },
+ N(e.options, P, `getHeaderGroups`)
+ )),
+ (e.getCenterHeaderGroups = M(
+ () => [
+ e.getAllColumns(),
+ e.getVisibleLeafColumns(),
+ e.getState().columnPinning.left,
+ e.getState().columnPinning.right,
+ ],
+ (t, n, r, i) => (
+ (n = n.filter(
+ (e) =>
+ !(r != null && r.includes(e.id)) &&
+ !(i != null && i.includes(e.id))
+ )),
+ F(t, n, e, `center`)
+ ),
+ N(e.options, P, `getCenterHeaderGroups`)
+ )),
+ (e.getLeftHeaderGroups = M(
+ () => [
+ e.getAllColumns(),
+ e.getVisibleLeafColumns(),
+ e.getState().columnPinning.left,
+ ],
+ (t, n, r) =>
+ F(
+ t,
+ r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [],
+ e,
+ `left`
+ ),
+ N(e.options, P, `getLeftHeaderGroups`)
+ )),
+ (e.getRightHeaderGroups = M(
+ () => [
+ e.getAllColumns(),
+ e.getVisibleLeafColumns(),
+ e.getState().columnPinning.right,
+ ],
+ (t, n, r) =>
+ F(
+ t,
+ r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [],
+ e,
+ `right`
+ ),
+ N(e.options, P, `getRightHeaderGroups`)
+ )),
+ (e.getFooterGroups = M(
+ () => [e.getHeaderGroups()],
+ (e) => [...e].reverse(),
+ N(e.options, P, `getFooterGroups`)
+ )),
+ (e.getLeftFooterGroups = M(
+ () => [e.getLeftHeaderGroups()],
+ (e) => [...e].reverse(),
+ N(e.options, P, `getLeftFooterGroups`)
+ )),
+ (e.getCenterFooterGroups = M(
+ () => [e.getCenterHeaderGroups()],
+ (e) => [...e].reverse(),
+ N(e.options, P, `getCenterFooterGroups`)
+ )),
+ (e.getRightFooterGroups = M(
+ () => [e.getRightHeaderGroups()],
+ (e) => [...e].reverse(),
+ N(e.options, P, `getRightFooterGroups`)
+ )),
+ (e.getFlatHeaders = M(
+ () => [e.getHeaderGroups()],
+ (e) => e.map((e) => e.headers).flat(),
+ N(e.options, P, `getFlatHeaders`)
+ )),
+ (e.getLeftFlatHeaders = M(
+ () => [e.getLeftHeaderGroups()],
+ (e) => e.map((e) => e.headers).flat(),
+ N(e.options, P, `getLeftFlatHeaders`)
+ )),
+ (e.getCenterFlatHeaders = M(
+ () => [e.getCenterHeaderGroups()],
+ (e) => e.map((e) => e.headers).flat(),
+ N(e.options, P, `getCenterFlatHeaders`)
+ )),
+ (e.getRightFlatHeaders = M(
+ () => [e.getRightHeaderGroups()],
+ (e) => e.map((e) => e.headers).flat(),
+ N(e.options, P, `getRightFlatHeaders`)
+ )),
+ (e.getCenterLeafHeaders = M(
+ () => [e.getCenterFlatHeaders()],
+ (e) =>
+ e.filter((e) => {
+ var t;
+ return !((t = e.subHeaders) != null && t.length);
+ }),
+ N(e.options, P, `getCenterLeafHeaders`)
+ )),
+ (e.getLeftLeafHeaders = M(
+ () => [e.getLeftFlatHeaders()],
+ (e) =>
+ e.filter((e) => {
+ var t;
+ return !((t = e.subHeaders) != null && t.length);
+ }),
+ N(e.options, P, `getLeftLeafHeaders`)
+ )),
+ (e.getRightLeafHeaders = M(
+ () => [e.getRightFlatHeaders()],
+ (e) =>
+ e.filter((e) => {
+ var t;
+ return !((t = e.subHeaders) != null && t.length);
+ }),
+ N(e.options, P, `getRightLeafHeaders`)
+ )),
+ (e.getLeafHeaders = M(
+ () => [
+ e.getLeftHeaderGroups(),
+ e.getCenterHeaderGroups(),
+ e.getRightHeaderGroups(),
+ ],
+ (e, t, n) =>
+ [
+ ...(e[0]?.headers ?? []),
+ ...(t[0]?.headers ?? []),
+ ...(n[0]?.headers ?? []),
+ ]
+ .map((e) => e.getLeafHeaders())
+ .flat(),
+ N(e.options, P, `getLeafHeaders`)
+ )));
+ },
+};
+function F(e, t, n, r) {
+ let i = 0,
+ a = function (e, t) {
+ (t === void 0 && (t = 1),
+ (i = Math.max(i, t)),
+ e
+ .filter((e) => e.getIsVisible())
+ .forEach((e) => {
+ var n;
+ (n = e.columns) != null && n.length && a(e.columns, t + 1);
+ }, 0));
+ };
+ a(e);
+ let o = [],
+ s = (e, t) => {
+ let i = {
+ depth: t,
+ id: [r, `${t}`].filter(Boolean).join(`_`),
+ headers: [],
+ },
+ a = [];
+ (e.forEach((e) => {
+ let o = [...a].reverse()[0],
+ s = e.column.depth === i.depth,
+ c,
+ l = !1;
+ if (
+ (s && e.column.parent
+ ? (c = e.column.parent)
+ : ((c = e.column), (l = !0)),
+ o && o?.column === c)
+ )
+ o.subHeaders.push(e);
+ else {
+ let i = he(n, c, {
+ id: [r, t, c.id, e?.id].filter(Boolean).join(`_`),
+ isPlaceholder: l,
+ placeholderId: l
+ ? `${a.filter((e) => e.column === c).length}`
+ : void 0,
+ depth: t,
+ index: a.length,
+ });
+ (i.subHeaders.push(e), a.push(i));
+ }
+ (i.headers.push(e), (e.headerGroup = i));
+ }),
+ o.push(i),
+ t > 0 && s(a, t - 1));
+ };
+ (s(
+ t.map((e, t) => he(n, e, {depth: i, index: t})),
+ i - 1
+ ),
+ o.reverse());
+ let c = (e) =>
+ e
+ .filter((e) => e.column.getIsVisible())
+ .map((e) => {
+ let t = 0,
+ n = 0,
+ r = [0];
+ e.subHeaders && e.subHeaders.length
+ ? ((r = []),
+ c(e.subHeaders).forEach((e) => {
+ let {colSpan: n, rowSpan: i} = e;
+ ((t += n), r.push(i));
+ }))
+ : (t = 1);
+ let i = Math.min(...r);
+ return (
+ (n += i),
+ (e.colSpan = t),
+ (e.rowSpan = n),
+ {colSpan: t, rowSpan: n}
+ );
+ });
+ return (c(o[0]?.headers ?? []), o);
+}
+var _e = (e, t, n, r, i, a, o) => {
+ let s = {
+ id: t,
+ index: r,
+ original: n,
+ depth: i,
+ parentId: o,
+ _valuesCache: {},
+ _uniqueValuesCache: {},
+ getValue: (t) => {
+ if (s._valuesCache.hasOwnProperty(t)) return s._valuesCache[t];
+ let n = e.getColumn(t);
+ if (n != null && n.accessorFn)
+ return (
+ (s._valuesCache[t] = n.accessorFn(s.original, r)),
+ s._valuesCache[t]
+ );
+ },
+ getUniqueValues: (t) => {
+ if (s._uniqueValuesCache.hasOwnProperty(t))
+ return s._uniqueValuesCache[t];
+ let n = e.getColumn(t);
+ if (n != null && n.accessorFn)
+ return n.columnDef.getUniqueValues
+ ? ((s._uniqueValuesCache[t] = n.columnDef.getUniqueValues(
+ s.original,
+ r
+ )),
+ s._uniqueValuesCache[t])
+ : ((s._uniqueValuesCache[t] = [s.getValue(t)]),
+ s._uniqueValuesCache[t]);
+ },
+ renderValue: (t) => s.getValue(t) ?? e.options.renderFallbackValue,
+ subRows: a ?? [],
+ getLeafRows: () => fe(s.subRows, (e) => e.subRows),
+ getParentRow: () => (s.parentId ? e.getRow(s.parentId, !0) : void 0),
+ getParentRows: () => {
+ let e = [],
+ t = s;
+ for (;;) {
+ let n = t.getParentRow();
+ if (!n) break;
+ (e.push(n), (t = n));
+ }
+ return e.reverse();
+ },
+ getAllCells: M(
+ () => [e.getAllLeafColumns()],
+ (t) => t.map((t) => pe(e, s, t, t.id)),
+ N(e.options, `debugRows`, `getAllCells`)
+ ),
+ _getAllCellsByColumnId: M(
+ () => [s.getAllCells()],
+ (e) => e.reduce((e, t) => ((e[t.column.id] = t), e), {}),
+ N(e.options, `debugRows`, `getAllCellsByColumnId`)
+ ),
+ };
+ for (let t = 0; t < e._features.length; t++) {
+ let n = e._features[t];
+ n == null || n.createRow == null || n.createRow(s, e);
+ }
+ return s;
+ },
+ ve = {
+ createColumn: (e, t) => {
+ ((e._getFacetedRowModel =
+ t.options.getFacetedRowModel && t.options.getFacetedRowModel(t, e.id)),
+ (e.getFacetedRowModel = () =>
+ e._getFacetedRowModel
+ ? e._getFacetedRowModel()
+ : t.getPreFilteredRowModel()),
+ (e._getFacetedUniqueValues =
+ t.options.getFacetedUniqueValues &&
+ t.options.getFacetedUniqueValues(t, e.id)),
+ (e.getFacetedUniqueValues = () =>
+ e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : new Map()),
+ (e._getFacetedMinMaxValues =
+ t.options.getFacetedMinMaxValues &&
+ t.options.getFacetedMinMaxValues(t, e.id)),
+ (e.getFacetedMinMaxValues = () => {
+ if (e._getFacetedMinMaxValues) return e._getFacetedMinMaxValues();
+ }));
+ },
+ },
+ ye = (e, t, n) => {
+ var r, i;
+ let a = n == null || (r = n.toString()) == null ? void 0 : r.toLowerCase();
+ return !!(
+ !(
+ (i = e.getValue(t)) == null ||
+ (i = i.toString()) == null ||
+ (i = i.toLowerCase()) == null
+ ) && i.includes(a)
+ );
+ };
+ye.autoRemove = (e) => R(e);
+var be = (e, t, n) => {
+ var r;
+ return !!(
+ !((r = e.getValue(t)) == null || (r = r.toString()) == null) &&
+ r.includes(n)
+ );
+};
+be.autoRemove = (e) => R(e);
+var xe = (e, t, n) => {
+ var r;
+ return (
+ ((r = e.getValue(t)) == null || (r = r.toString()) == null
+ ? void 0
+ : r.toLowerCase()) === n?.toLowerCase()
+ );
+};
+xe.autoRemove = (e) => R(e);
+var Se = (e, t, n) => e.getValue(t)?.includes(n);
+Se.autoRemove = (e) => R(e);
+var Ce = (e, t, n) =>
+ !n.some((n) => {
+ var r;
+ return !((r = e.getValue(t)) != null && r.includes(n));
+ });
+Ce.autoRemove = (e) => R(e) || !(e != null && e.length);
+var we = (e, t, n) => n.some((n) => e.getValue(t)?.includes(n));
+we.autoRemove = (e) => R(e) || !(e != null && e.length);
+var Te = (e, t, n) => e.getValue(t) === n;
+Te.autoRemove = (e) => R(e);
+var Ee = (e, t, n) => e.getValue(t) == n;
+Ee.autoRemove = (e) => R(e);
+var I = (e, t, n) => {
+ let [r, i] = n,
+ a = e.getValue(t);
+ return a >= r && a <= i;
+};
+((I.resolveFilterValue = (e) => {
+ let [t, n] = e,
+ r = typeof t == `number` ? t : parseFloat(t),
+ i = typeof n == `number` ? n : parseFloat(n),
+ a = t === null || Number.isNaN(r) ? -1 / 0 : r,
+ o = n === null || Number.isNaN(i) ? 1 / 0 : i;
+ if (a > o) {
+ let e = a;
+ ((a = o), (o = e));
+ }
+ return [a, o];
+}),
+ (I.autoRemove = (e) => R(e) || (R(e[0]) && R(e[1]))));
+var L = {
+ includesString: ye,
+ includesStringSensitive: be,
+ equalsString: xe,
+ arrIncludes: Se,
+ arrIncludesAll: Ce,
+ arrIncludesSome: we,
+ equals: Te,
+ weakEquals: Ee,
+ inNumberRange: I,
+};
+function R(e) {
+ return e == null || e === ``;
+}
+var De = {
+ getDefaultColumnDef: () => ({filterFn: `auto`}),
+ getInitialState: (e) => ({columnFilters: [], ...e}),
+ getDefaultOptions: (e) => ({
+ onColumnFiltersChange: k(`columnFilters`, e),
+ filterFromLeafRows: !1,
+ maxLeafRowFilterDepth: 100,
+ }),
+ createColumn: (e, t) => {
+ ((e.getAutoFilterFn = () => {
+ let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
+ return typeof n == `string`
+ ? L.includesString
+ : typeof n == `number`
+ ? L.inNumberRange
+ : typeof n == `boolean` || (typeof n == `object` && n)
+ ? L.equals
+ : Array.isArray(n)
+ ? L.arrIncludes
+ : L.weakEquals;
+ }),
+ (e.getFilterFn = () =>
+ A(e.columnDef.filterFn)
+ ? e.columnDef.filterFn
+ : e.columnDef.filterFn === `auto`
+ ? e.getAutoFilterFn()
+ : (t.options.filterFns?.[e.columnDef.filterFn] ??
+ L[e.columnDef.filterFn])),
+ (e.getCanFilter = () =>
+ (e.columnDef.enableColumnFilter ?? !0) &&
+ (t.options.enableColumnFilters ?? !0) &&
+ (t.options.enableFilters ?? !0) &&
+ !!e.accessorFn),
+ (e.getIsFiltered = () => e.getFilterIndex() > -1),
+ (e.getFilterValue = () => {
+ var n;
+ return (n = t.getState().columnFilters) == null ||
+ (n = n.find((t) => t.id === e.id)) == null
+ ? void 0
+ : n.value;
+ }),
+ (e.getFilterIndex = () =>
+ t.getState().columnFilters?.findIndex((t) => t.id === e.id) ?? -1),
+ (e.setFilterValue = (n) => {
+ t.setColumnFilters((t) => {
+ let r = e.getFilterFn(),
+ i = t?.find((t) => t.id === e.id),
+ a = O(n, i ? i.value : void 0);
+ if (Oe(r, a, e)) return t?.filter((t) => t.id !== e.id) ?? [];
+ let o = {id: e.id, value: a};
+ return i
+ ? (t?.map((t) => (t.id === e.id ? o : t)) ?? [])
+ : t != null && t.length
+ ? [...t, o]
+ : [o];
+ });
+ }));
+ },
+ createRow: (e, t) => {
+ ((e.columnFilters = {}), (e.columnFiltersMeta = {}));
+ },
+ createTable: (e) => {
+ ((e.setColumnFilters = (t) => {
+ let n = e.getAllLeafColumns();
+ e.options.onColumnFiltersChange == null ||
+ e.options.onColumnFiltersChange((e) =>
+ O(t, e)?.filter((e) => {
+ let t = n.find((t) => t.id === e.id);
+ return !(t && Oe(t.getFilterFn(), e.value, t));
+ })
+ );
+ }),
+ (e.resetColumnFilters = (t) => {
+ e.setColumnFilters(t ? [] : (e.initialState?.columnFilters ?? []));
+ }),
+ (e.getPreFilteredRowModel = () => e.getCoreRowModel()),
+ (e.getFilteredRowModel = () => (
+ !e._getFilteredRowModel &&
+ e.options.getFilteredRowModel &&
+ (e._getFilteredRowModel = e.options.getFilteredRowModel(e)),
+ e.options.manualFiltering || !e._getFilteredRowModel
+ ? e.getPreFilteredRowModel()
+ : e._getFilteredRowModel()
+ )));
+ },
+};
+function Oe(e, t, n) {
+ return (
+ (e && e.autoRemove ? e.autoRemove(t, n) : !1) ||
+ t === void 0 ||
+ (typeof t == `string` && !t)
+ );
+}
+var z = {
+ sum: (e, t, n) =>
+ n.reduce((t, n) => {
+ let r = n.getValue(e);
+ return t + (typeof r == `number` ? r : 0);
+ }, 0),
+ min: (e, t, n) => {
+ let r;
+ return (
+ n.forEach((t) => {
+ let n = t.getValue(e);
+ n != null && (r > n || (r === void 0 && n >= n)) && (r = n);
+ }),
+ r
+ );
+ },
+ max: (e, t, n) => {
+ let r;
+ return (
+ n.forEach((t) => {
+ let n = t.getValue(e);
+ n != null && (r < n || (r === void 0 && n >= n)) && (r = n);
+ }),
+ r
+ );
+ },
+ extent: (e, t, n) => {
+ let r, i;
+ return (
+ n.forEach((t) => {
+ let n = t.getValue(e);
+ n != null &&
+ (r === void 0
+ ? n >= n && (r = i = n)
+ : (r > n && (r = n), i < n && (i = n)));
+ }),
+ [r, i]
+ );
+ },
+ mean: (e, t) => {
+ let n = 0,
+ r = 0;
+ if (
+ (t.forEach((t) => {
+ let i = t.getValue(e);
+ i != null && (i = +i) >= i && (++n, (r += i));
+ }),
+ n)
+ )
+ return r / n;
+ },
+ median: (e, t) => {
+ if (!t.length) return;
+ let n = t.map((t) => t.getValue(e));
+ if (!j(n)) return;
+ if (n.length === 1) return n[0];
+ let r = Math.floor(n.length / 2),
+ i = n.sort((e, t) => e - t);
+ return n.length % 2 == 0 ? (i[r - 1] + i[r]) / 2 : i[r];
+ },
+ unique: (e, t) => Array.from(new Set(t.map((t) => t.getValue(e))).values()),
+ uniqueCount: (e, t) => new Set(t.map((t) => t.getValue(e))).size,
+ count: (e, t) => t.length,
+ },
+ ke = {
+ getDefaultColumnDef: () => ({
+ aggregatedCell: (e) => {
+ var t;
+ return (
+ ((t = e.getValue()) == null || t.toString == null
+ ? void 0
+ : t.toString()) ?? null
+ );
+ },
+ aggregationFn: `auto`,
+ }),
+ getInitialState: (e) => ({grouping: [], ...e}),
+ getDefaultOptions: (e) => ({
+ onGroupingChange: k(`grouping`, e),
+ groupedColumnMode: `reorder`,
+ }),
+ createColumn: (e, t) => {
+ ((e.toggleGrouping = () => {
+ t.setGrouping((t) =>
+ t != null && t.includes(e.id)
+ ? t.filter((t) => t !== e.id)
+ : [...(t ?? []), e.id]
+ );
+ }),
+ (e.getCanGroup = () =>
+ (e.columnDef.enableGrouping ?? !0) &&
+ (t.options.enableGrouping ?? !0) &&
+ (!!e.accessorFn || !!e.columnDef.getGroupingValue)),
+ (e.getIsGrouped = () => t.getState().grouping?.includes(e.id)),
+ (e.getGroupedIndex = () => t.getState().grouping?.indexOf(e.id)),
+ (e.getToggleGroupingHandler = () => {
+ let t = e.getCanGroup();
+ return () => {
+ t && e.toggleGrouping();
+ };
+ }),
+ (e.getAutoAggregationFn = () => {
+ let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
+ if (typeof n == `number`) return z.sum;
+ if (Object.prototype.toString.call(n) === `[object Date]`)
+ return z.extent;
+ }),
+ (e.getAggregationFn = () => {
+ if (!e) throw Error();
+ return A(e.columnDef.aggregationFn)
+ ? e.columnDef.aggregationFn
+ : e.columnDef.aggregationFn === `auto`
+ ? e.getAutoAggregationFn()
+ : (t.options.aggregationFns?.[e.columnDef.aggregationFn] ??
+ z[e.columnDef.aggregationFn]);
+ }));
+ },
+ createTable: (e) => {
+ ((e.setGrouping = (t) =>
+ e.options.onGroupingChange == null
+ ? void 0
+ : e.options.onGroupingChange(t)),
+ (e.resetGrouping = (t) => {
+ e.setGrouping(t ? [] : (e.initialState?.grouping ?? []));
+ }),
+ (e.getPreGroupedRowModel = () => e.getFilteredRowModel()),
+ (e.getGroupedRowModel = () => (
+ !e._getGroupedRowModel &&
+ e.options.getGroupedRowModel &&
+ (e._getGroupedRowModel = e.options.getGroupedRowModel(e)),
+ e.options.manualGrouping || !e._getGroupedRowModel
+ ? e.getPreGroupedRowModel()
+ : e._getGroupedRowModel()
+ )));
+ },
+ createRow: (e, t) => {
+ ((e.getIsGrouped = () => !!e.groupingColumnId),
+ (e.getGroupingValue = (n) => {
+ if (e._groupingValuesCache.hasOwnProperty(n))
+ return e._groupingValuesCache[n];
+ let r = t.getColumn(n);
+ return r != null && r.columnDef.getGroupingValue
+ ? ((e._groupingValuesCache[n] = r.columnDef.getGroupingValue(
+ e.original
+ )),
+ e._groupingValuesCache[n])
+ : e.getValue(n);
+ }),
+ (e._groupingValuesCache = {}));
+ },
+ createCell: (e, t, n, r) => {
+ ((e.getIsGrouped = () => t.getIsGrouped() && t.id === n.groupingColumnId),
+ (e.getIsPlaceholder = () => !e.getIsGrouped() && t.getIsGrouped()),
+ (e.getIsAggregated = () => {
+ var t;
+ return (
+ !e.getIsGrouped() &&
+ !e.getIsPlaceholder() &&
+ !!((t = n.subRows) != null && t.length)
+ );
+ }));
+ },
+ };
+function Ae(e, t, n) {
+ if (!(t != null && t.length) || !n) return e;
+ let r = e.filter((e) => !t.includes(e.id));
+ return n === `remove`
+ ? r
+ : [...t.map((t) => e.find((e) => e.id === t)).filter(Boolean), ...r];
+}
+var je = {
+ getInitialState: (e) => ({columnOrder: [], ...e}),
+ getDefaultOptions: (e) => ({onColumnOrderChange: k(`columnOrder`, e)}),
+ createColumn: (e, t) => {
+ ((e.getIndex = M(
+ (e) => [W(t, e)],
+ (t) => t.findIndex((t) => t.id === e.id),
+ N(t.options, `debugColumns`, `getIndex`)
+ )),
+ (e.getIsFirstColumn = (n) => W(t, n)[0]?.id === e.id),
+ (e.getIsLastColumn = (n) => {
+ let r = W(t, n);
+ return r[r.length - 1]?.id === e.id;
+ }));
+ },
+ createTable: (e) => {
+ ((e.setColumnOrder = (t) =>
+ e.options.onColumnOrderChange == null
+ ? void 0
+ : e.options.onColumnOrderChange(t)),
+ (e.resetColumnOrder = (t) => {
+ e.setColumnOrder(t ? [] : (e.initialState.columnOrder ?? []));
+ }),
+ (e._getOrderColumnsFn = M(
+ () => [
+ e.getState().columnOrder,
+ e.getState().grouping,
+ e.options.groupedColumnMode,
+ ],
+ (e, t, n) => (r) => {
+ let i = [];
+ if (!(e != null && e.length)) i = r;
+ else {
+ let t = [...e],
+ n = [...r];
+ for (; n.length && t.length; ) {
+ let e = t.shift(),
+ r = n.findIndex((t) => t.id === e);
+ r > -1 && i.push(n.splice(r, 1)[0]);
+ }
+ i = [...i, ...n];
+ }
+ return Ae(i, t, n);
+ },
+ N(e.options, `debugTable`, `_getOrderColumnsFn`)
+ )));
+ },
+ },
+ Me = () => ({left: [], right: []}),
+ Ne = {
+ getInitialState: (e) => ({columnPinning: Me(), ...e}),
+ getDefaultOptions: (e) => ({onColumnPinningChange: k(`columnPinning`, e)}),
+ createColumn: (e, t) => {
+ ((e.pin = (n) => {
+ let r = e
+ .getLeafColumns()
+ .map((e) => e.id)
+ .filter(Boolean);
+ t.setColumnPinning((e) =>
+ n === `right`
+ ? {
+ left: (e?.left ?? []).filter(
+ (e) => !(r != null && r.includes(e))
+ ),
+ right: [
+ ...(e?.right ?? []).filter(
+ (e) => !(r != null && r.includes(e))
+ ),
+ ...r,
+ ],
+ }
+ : n === `left`
+ ? {
+ left: [
+ ...(e?.left ?? []).filter(
+ (e) => !(r != null && r.includes(e))
+ ),
+ ...r,
+ ],
+ right: (e?.right ?? []).filter(
+ (e) => !(r != null && r.includes(e))
+ ),
+ }
+ : {
+ left: (e?.left ?? []).filter(
+ (e) => !(r != null && r.includes(e))
+ ),
+ right: (e?.right ?? []).filter(
+ (e) => !(r != null && r.includes(e))
+ ),
+ }
+ );
+ }),
+ (e.getCanPin = () =>
+ e
+ .getLeafColumns()
+ .some(
+ (e) =>
+ (e.columnDef.enablePinning ?? !0) &&
+ (t.options.enableColumnPinning ?? t.options.enablePinning ?? !0)
+ )),
+ (e.getIsPinned = () => {
+ let n = e.getLeafColumns().map((e) => e.id),
+ {left: r, right: i} = t.getState().columnPinning,
+ a = n.some((e) => r?.includes(e)),
+ o = n.some((e) => i?.includes(e));
+ return a ? `left` : o ? `right` : !1;
+ }),
+ (e.getPinnedIndex = () => {
+ var n;
+ let r = e.getIsPinned();
+ return r
+ ? (((n = t.getState().columnPinning) == null || (n = n[r]) == null
+ ? void 0
+ : n.indexOf(e.id)) ?? -1)
+ : 0;
+ }));
+ },
+ createRow: (e, t) => {
+ ((e.getCenterVisibleCells = M(
+ () => [
+ e._getAllVisibleCells(),
+ t.getState().columnPinning.left,
+ t.getState().columnPinning.right,
+ ],
+ (e, t, n) => {
+ let r = [...(t ?? []), ...(n ?? [])];
+ return e.filter((e) => !r.includes(e.column.id));
+ },
+ N(t.options, `debugRows`, `getCenterVisibleCells`)
+ )),
+ (e.getLeftVisibleCells = M(
+ () => [e._getAllVisibleCells(), t.getState().columnPinning.left],
+ (e, t) =>
+ (t ?? [])
+ .map((t) => e.find((e) => e.column.id === t))
+ .filter(Boolean)
+ .map((e) => ({...e, position: `left`})),
+ N(t.options, `debugRows`, `getLeftVisibleCells`)
+ )),
+ (e.getRightVisibleCells = M(
+ () => [e._getAllVisibleCells(), t.getState().columnPinning.right],
+ (e, t) =>
+ (t ?? [])
+ .map((t) => e.find((e) => e.column.id === t))
+ .filter(Boolean)
+ .map((e) => ({...e, position: `right`})),
+ N(t.options, `debugRows`, `getRightVisibleCells`)
+ )));
+ },
+ createTable: (e) => {
+ ((e.setColumnPinning = (t) =>
+ e.options.onColumnPinningChange == null
+ ? void 0
+ : e.options.onColumnPinningChange(t)),
+ (e.resetColumnPinning = (t) =>
+ e.setColumnPinning(
+ t ? Me() : (e.initialState?.columnPinning ?? Me())
+ )),
+ (e.getIsSomeColumnsPinned = (t) => {
+ let n = e.getState().columnPinning;
+ return t ? !!n[t]?.length : !!(n.left?.length || n.right?.length);
+ }),
+ (e.getLeftLeafColumns = M(
+ () => [e.getAllLeafColumns(), e.getState().columnPinning.left],
+ (e, t) =>
+ (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean),
+ N(e.options, `debugColumns`, `getLeftLeafColumns`)
+ )),
+ (e.getRightLeafColumns = M(
+ () => [e.getAllLeafColumns(), e.getState().columnPinning.right],
+ (e, t) =>
+ (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean),
+ N(e.options, `debugColumns`, `getRightLeafColumns`)
+ )),
+ (e.getCenterLeafColumns = M(
+ () => [
+ e.getAllLeafColumns(),
+ e.getState().columnPinning.left,
+ e.getState().columnPinning.right,
+ ],
+ (e, t, n) => {
+ let r = [...(t ?? []), ...(n ?? [])];
+ return e.filter((e) => !r.includes(e.id));
+ },
+ N(e.options, `debugColumns`, `getCenterLeafColumns`)
+ )));
+ },
+ };
+function Pe(e) {
+ return e || (typeof document < `u` ? document : null);
+}
+var B = {size: 150, minSize: 20, maxSize: 2 ** 53 - 1},
+ V = () => ({
+ startOffset: null,
+ startSize: null,
+ deltaOffset: null,
+ deltaPercentage: null,
+ isResizingColumn: !1,
+ columnSizingStart: [],
+ }),
+ Fe = {
+ getDefaultColumnDef: () => B,
+ getInitialState: (e) => ({columnSizing: {}, columnSizingInfo: V(), ...e}),
+ getDefaultOptions: (e) => ({
+ columnResizeMode: `onEnd`,
+ columnResizeDirection: `ltr`,
+ onColumnSizingChange: k(`columnSizing`, e),
+ onColumnSizingInfoChange: k(`columnSizingInfo`, e),
+ }),
+ createColumn: (e, t) => {
+ ((e.getSize = () => {
+ let n = t.getState().columnSizing[e.id];
+ return Math.min(
+ Math.max(
+ e.columnDef.minSize ?? B.minSize,
+ n ?? e.columnDef.size ?? B.size
+ ),
+ e.columnDef.maxSize ?? B.maxSize
+ );
+ }),
+ (e.getStart = M(
+ (e) => [e, W(t, e), t.getState().columnSizing],
+ (t, n) =>
+ n.slice(0, e.getIndex(t)).reduce((e, t) => e + t.getSize(), 0),
+ N(t.options, `debugColumns`, `getStart`)
+ )),
+ (e.getAfter = M(
+ (e) => [e, W(t, e), t.getState().columnSizing],
+ (t, n) =>
+ n.slice(e.getIndex(t) + 1).reduce((e, t) => e + t.getSize(), 0),
+ N(t.options, `debugColumns`, `getAfter`)
+ )),
+ (e.resetSize = () => {
+ t.setColumnSizing((t) => {
+ let {[e.id]: n, ...r} = t;
+ return r;
+ });
+ }),
+ (e.getCanResize = () =>
+ (e.columnDef.enableResizing ?? !0) &&
+ (t.options.enableColumnResizing ?? !0)),
+ (e.getIsResizing = () =>
+ t.getState().columnSizingInfo.isResizingColumn === e.id));
+ },
+ createHeader: (e, t) => {
+ ((e.getSize = () => {
+ let t = 0,
+ n = (e) => {
+ e.subHeaders.length
+ ? e.subHeaders.forEach(n)
+ : (t += e.column.getSize() ?? 0);
+ };
+ return (n(e), t);
+ }),
+ (e.getStart = () => {
+ if (e.index > 0) {
+ let t = e.headerGroup.headers[e.index - 1];
+ return t.getStart() + t.getSize();
+ }
+ return 0;
+ }),
+ (e.getResizeHandler = (n) => {
+ let r = t.getColumn(e.column.id),
+ i = r?.getCanResize();
+ return (a) => {
+ if (
+ !r ||
+ !i ||
+ (a.persist == null || a.persist(),
+ U(a) && a.touches && a.touches.length > 1)
+ )
+ return;
+ let o = e.getSize(),
+ s = e
+ ? e
+ .getLeafHeaders()
+ .map((e) => [e.column.id, e.column.getSize()])
+ : [[r.id, r.getSize()]],
+ c = U(a) ? Math.round(a.touches[0].clientX) : a.clientX,
+ l = {},
+ u = (e, n) => {
+ typeof n == `number` &&
+ (t.setColumnSizingInfo((e) => {
+ let r = t.options.columnResizeDirection === `rtl` ? -1 : 1,
+ i = (n - (e?.startOffset ?? 0)) * r,
+ a = Math.max(i / (e?.startSize ?? 0), -0.999999);
+ return (
+ e.columnSizingStart.forEach((e) => {
+ let [t, n] = e;
+ l[t] = Math.round(Math.max(n + n * a, 0) * 100) / 100;
+ }),
+ {...e, deltaOffset: i, deltaPercentage: a}
+ );
+ }),
+ (t.options.columnResizeMode === `onChange` || e === `end`) &&
+ t.setColumnSizing((e) => ({...e, ...l})));
+ },
+ d = (e) => u(`move`, e),
+ f = (e) => {
+ (u(`end`, e),
+ t.setColumnSizingInfo((e) => ({
+ ...e,
+ isResizingColumn: !1,
+ startOffset: null,
+ startSize: null,
+ deltaOffset: null,
+ deltaPercentage: null,
+ columnSizingStart: [],
+ })));
+ },
+ p = Pe(n),
+ m = {
+ moveHandler: (e) => d(e.clientX),
+ upHandler: (e) => {
+ (p?.removeEventListener(`mousemove`, m.moveHandler),
+ p?.removeEventListener(`mouseup`, m.upHandler),
+ f(e.clientX));
+ },
+ },
+ h = {
+ moveHandler: (e) => (
+ e.cancelable && (e.preventDefault(), e.stopPropagation()),
+ d(e.touches[0].clientX),
+ !1
+ ),
+ upHandler: (e) => {
+ (p?.removeEventListener(`touchmove`, h.moveHandler),
+ p?.removeEventListener(`touchend`, h.upHandler),
+ e.cancelable && (e.preventDefault(), e.stopPropagation()),
+ f(e.touches[0]?.clientX));
+ },
+ },
+ g = Ie() ? {passive: !1} : !1;
+ (U(a)
+ ? (p?.addEventListener(`touchmove`, h.moveHandler, g),
+ p?.addEventListener(`touchend`, h.upHandler, g))
+ : (p?.addEventListener(`mousemove`, m.moveHandler, g),
+ p?.addEventListener(`mouseup`, m.upHandler, g)),
+ t.setColumnSizingInfo((e) => ({
+ ...e,
+ startOffset: c,
+ startSize: o,
+ deltaOffset: 0,
+ deltaPercentage: 0,
+ columnSizingStart: s,
+ isResizingColumn: r.id,
+ })));
+ };
+ }));
+ },
+ createTable: (e) => {
+ ((e.setColumnSizing = (t) =>
+ e.options.onColumnSizingChange == null
+ ? void 0
+ : e.options.onColumnSizingChange(t)),
+ (e.setColumnSizingInfo = (t) =>
+ e.options.onColumnSizingInfoChange == null
+ ? void 0
+ : e.options.onColumnSizingInfoChange(t)),
+ (e.resetColumnSizing = (t) => {
+ e.setColumnSizing(t ? {} : (e.initialState.columnSizing ?? {}));
+ }),
+ (e.resetHeaderSizeInfo = (t) => {
+ e.setColumnSizingInfo(
+ t ? V() : (e.initialState.columnSizingInfo ?? V())
+ );
+ }),
+ (e.getTotalSize = () =>
+ e
+ .getHeaderGroups()[0]
+ ?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0),
+ (e.getLeftTotalSize = () =>
+ e
+ .getLeftHeaderGroups()[0]
+ ?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0),
+ (e.getCenterTotalSize = () =>
+ e
+ .getCenterHeaderGroups()[0]
+ ?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0),
+ (e.getRightTotalSize = () =>
+ e
+ .getRightHeaderGroups()[0]
+ ?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0));
+ },
+ },
+ H = null;
+function Ie() {
+ if (typeof H == `boolean`) return H;
+ let e = !1;
+ try {
+ let t = {
+ get passive() {
+ return ((e = !0), !1);
+ },
+ },
+ n = () => {};
+ (window.addEventListener(`test`, n, t),
+ window.removeEventListener(`test`, n));
+ } catch {
+ e = !1;
+ }
+ return ((H = e), H);
+}
+function U(e) {
+ return e.type === `touchstart`;
+}
+var Le = {
+ getInitialState: (e) => ({columnVisibility: {}, ...e}),
+ getDefaultOptions: (e) => ({
+ onColumnVisibilityChange: k(`columnVisibility`, e),
+ }),
+ createColumn: (e, t) => {
+ ((e.toggleVisibility = (n) => {
+ e.getCanHide() &&
+ t.setColumnVisibility((t) => ({...t, [e.id]: n ?? !e.getIsVisible()}));
+ }),
+ (e.getIsVisible = () => {
+ let n = e.columns;
+ return (
+ (n.length
+ ? n.some((e) => e.getIsVisible())
+ : t.getState().columnVisibility?.[e.id]) ?? !0
+ );
+ }),
+ (e.getCanHide = () =>
+ (e.columnDef.enableHiding ?? !0) && (t.options.enableHiding ?? !0)),
+ (e.getToggleVisibilityHandler = () => (t) => {
+ e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
+ }));
+ },
+ createRow: (e, t) => {
+ ((e._getAllVisibleCells = M(
+ () => [e.getAllCells(), t.getState().columnVisibility],
+ (e) => e.filter((e) => e.column.getIsVisible()),
+ N(t.options, `debugRows`, `_getAllVisibleCells`)
+ )),
+ (e.getVisibleCells = M(
+ () => [
+ e.getLeftVisibleCells(),
+ e.getCenterVisibleCells(),
+ e.getRightVisibleCells(),
+ ],
+ (e, t, n) => [...e, ...t, ...n],
+ N(t.options, `debugRows`, `getVisibleCells`)
+ )));
+ },
+ createTable: (e) => {
+ let t = (t, n) =>
+ M(
+ () => [
+ n(),
+ n()
+ .filter((e) => e.getIsVisible())
+ .map((e) => e.id)
+ .join(`_`),
+ ],
+ (e) =>
+ e.filter((e) => (e.getIsVisible == null ? void 0 : e.getIsVisible())),
+ N(e.options, `debugColumns`, t)
+ );
+ ((e.getVisibleFlatColumns = t(`getVisibleFlatColumns`, () =>
+ e.getAllFlatColumns()
+ )),
+ (e.getVisibleLeafColumns = t(`getVisibleLeafColumns`, () =>
+ e.getAllLeafColumns()
+ )),
+ (e.getLeftVisibleLeafColumns = t(`getLeftVisibleLeafColumns`, () =>
+ e.getLeftLeafColumns()
+ )),
+ (e.getRightVisibleLeafColumns = t(`getRightVisibleLeafColumns`, () =>
+ e.getRightLeafColumns()
+ )),
+ (e.getCenterVisibleLeafColumns = t(`getCenterVisibleLeafColumns`, () =>
+ e.getCenterLeafColumns()
+ )),
+ (e.setColumnVisibility = (t) =>
+ e.options.onColumnVisibilityChange == null
+ ? void 0
+ : e.options.onColumnVisibilityChange(t)),
+ (e.resetColumnVisibility = (t) => {
+ e.setColumnVisibility(t ? {} : (e.initialState.columnVisibility ?? {}));
+ }),
+ (e.toggleAllColumnsVisible = (t) => {
+ ((t ??= !e.getIsAllColumnsVisible()),
+ e.setColumnVisibility(
+ e.getAllLeafColumns().reduce(
+ (e, n) => ({
+ ...e,
+ [n.id]: t || !(n.getCanHide != null && n.getCanHide()),
+ }),
+ {}
+ )
+ ));
+ }),
+ (e.getIsAllColumnsVisible = () =>
+ !e
+ .getAllLeafColumns()
+ .some((e) => !(e.getIsVisible != null && e.getIsVisible()))),
+ (e.getIsSomeColumnsVisible = () =>
+ e
+ .getAllLeafColumns()
+ .some((e) => (e.getIsVisible == null ? void 0 : e.getIsVisible()))),
+ (e.getToggleAllColumnsVisibilityHandler = () => (t) => {
+ e.toggleAllColumnsVisible(t.target?.checked);
+ }));
+ },
+};
+function W(e, t) {
+ return t
+ ? t === `center`
+ ? e.getCenterVisibleLeafColumns()
+ : t === `left`
+ ? e.getLeftVisibleLeafColumns()
+ : e.getRightVisibleLeafColumns()
+ : e.getVisibleLeafColumns();
+}
+var Re = {
+ createTable: (e) => {
+ ((e._getGlobalFacetedRowModel =
+ e.options.getFacetedRowModel &&
+ e.options.getFacetedRowModel(e, `__global__`)),
+ (e.getGlobalFacetedRowModel = () =>
+ e.options.manualFiltering || !e._getGlobalFacetedRowModel
+ ? e.getPreFilteredRowModel()
+ : e._getGlobalFacetedRowModel()),
+ (e._getGlobalFacetedUniqueValues =
+ e.options.getFacetedUniqueValues &&
+ e.options.getFacetedUniqueValues(e, `__global__`)),
+ (e.getGlobalFacetedUniqueValues = () =>
+ e._getGlobalFacetedUniqueValues
+ ? e._getGlobalFacetedUniqueValues()
+ : new Map()),
+ (e._getGlobalFacetedMinMaxValues =
+ e.options.getFacetedMinMaxValues &&
+ e.options.getFacetedMinMaxValues(e, `__global__`)),
+ (e.getGlobalFacetedMinMaxValues = () => {
+ if (e._getGlobalFacetedMinMaxValues)
+ return e._getGlobalFacetedMinMaxValues();
+ }));
+ },
+ },
+ ze = {
+ getInitialState: (e) => ({globalFilter: void 0, ...e}),
+ getDefaultOptions: (e) => ({
+ onGlobalFilterChange: k(`globalFilter`, e),
+ globalFilterFn: `auto`,
+ getColumnCanGlobalFilter: (t) => {
+ var n;
+ let r =
+ (n = e.getCoreRowModel().flatRows[0]) == null ||
+ (n = n._getAllCellsByColumnId()[t.id]) == null
+ ? void 0
+ : n.getValue();
+ return typeof r == `string` || typeof r == `number`;
+ },
+ }),
+ createColumn: (e, t) => {
+ e.getCanGlobalFilter = () =>
+ (e.columnDef.enableGlobalFilter ?? !0) &&
+ (t.options.enableGlobalFilter ?? !0) &&
+ (t.options.enableFilters ?? !0) &&
+ ((t.options.getColumnCanGlobalFilter == null
+ ? void 0
+ : t.options.getColumnCanGlobalFilter(e)) ??
+ !0) &&
+ !!e.accessorFn;
+ },
+ createTable: (e) => {
+ ((e.getGlobalAutoFilterFn = () => L.includesString),
+ (e.getGlobalFilterFn = () => {
+ let {globalFilterFn: t} = e.options;
+ return A(t)
+ ? t
+ : t === `auto`
+ ? e.getGlobalAutoFilterFn()
+ : (e.options.filterFns?.[t] ?? L[t]);
+ }),
+ (e.setGlobalFilter = (t) => {
+ e.options.onGlobalFilterChange == null ||
+ e.options.onGlobalFilterChange(t);
+ }),
+ (e.resetGlobalFilter = (t) => {
+ e.setGlobalFilter(t ? void 0 : e.initialState.globalFilter);
+ }));
+ },
+ },
+ Be = {
+ getInitialState: (e) => ({expanded: {}, ...e}),
+ getDefaultOptions: (e) => ({
+ onExpandedChange: k(`expanded`, e),
+ paginateExpandedRows: !0,
+ }),
+ createTable: (e) => {
+ let t = !1,
+ n = !1;
+ ((e._autoResetExpanded = () => {
+ if (!t) {
+ e._queue(() => {
+ t = !0;
+ });
+ return;
+ }
+ if (
+ e.options.autoResetAll ??
+ e.options.autoResetExpanded ??
+ !e.options.manualExpanding
+ ) {
+ if (n) return;
+ ((n = !0),
+ e._queue(() => {
+ (e.resetExpanded(), (n = !1));
+ }));
+ }
+ }),
+ (e.setExpanded = (t) =>
+ e.options.onExpandedChange == null
+ ? void 0
+ : e.options.onExpandedChange(t)),
+ (e.toggleAllRowsExpanded = (t) => {
+ (t ?? !e.getIsAllRowsExpanded())
+ ? e.setExpanded(!0)
+ : e.setExpanded({});
+ }),
+ (e.resetExpanded = (t) => {
+ e.setExpanded(t ? {} : (e.initialState?.expanded ?? {}));
+ }),
+ (e.getCanSomeRowsExpand = () =>
+ e.getPrePaginationRowModel().flatRows.some((e) => e.getCanExpand())),
+ (e.getToggleAllRowsExpandedHandler = () => (t) => {
+ (t.persist == null || t.persist(), e.toggleAllRowsExpanded());
+ }),
+ (e.getIsSomeRowsExpanded = () => {
+ let t = e.getState().expanded;
+ return t === !0 || Object.values(t).some(Boolean);
+ }),
+ (e.getIsAllRowsExpanded = () => {
+ let t = e.getState().expanded;
+ return typeof t == `boolean`
+ ? t === !0
+ : !(
+ !Object.keys(t).length ||
+ e.getRowModel().flatRows.some((e) => !e.getIsExpanded())
+ );
+ }),
+ (e.getExpandedDepth = () => {
+ let t = 0;
+ return (
+ (e.getState().expanded === !0
+ ? Object.keys(e.getRowModel().rowsById)
+ : Object.keys(e.getState().expanded)
+ ).forEach((e) => {
+ let n = e.split(`.`);
+ t = Math.max(t, n.length);
+ }),
+ t
+ );
+ }),
+ (e.getPreExpandedRowModel = () => e.getSortedRowModel()),
+ (e.getExpandedRowModel = () => (
+ !e._getExpandedRowModel &&
+ e.options.getExpandedRowModel &&
+ (e._getExpandedRowModel = e.options.getExpandedRowModel(e)),
+ e.options.manualExpanding || !e._getExpandedRowModel
+ ? e.getPreExpandedRowModel()
+ : e._getExpandedRowModel()
+ )));
+ },
+ createRow: (e, t) => {
+ ((e.toggleExpanded = (n) => {
+ t.setExpanded((r) => {
+ let i = r === !0 ? !0 : !!(r != null && r[e.id]),
+ a = {};
+ if (
+ (r === !0
+ ? Object.keys(t.getRowModel().rowsById).forEach((e) => {
+ a[e] = !0;
+ })
+ : (a = r),
+ (n ??= !i),
+ !i && n)
+ )
+ return {...a, [e.id]: !0};
+ if (i && !n) {
+ let {[e.id]: t, ...n} = a;
+ return n;
+ }
+ return r;
+ });
+ }),
+ (e.getIsExpanded = () => {
+ let n = t.getState().expanded;
+ return !!(
+ (t.options.getIsRowExpanded == null
+ ? void 0
+ : t.options.getIsRowExpanded(e)) ??
+ (n === !0 || n?.[e.id])
+ );
+ }),
+ (e.getCanExpand = () => {
+ var n;
+ return (
+ (t.options.getRowCanExpand == null
+ ? void 0
+ : t.options.getRowCanExpand(e)) ??
+ ((t.options.enableExpanding ?? !0) &&
+ !!((n = e.subRows) != null && n.length))
+ );
+ }),
+ (e.getIsAllParentsExpanded = () => {
+ let n = !0,
+ r = e;
+ for (; n && r.parentId; )
+ ((r = t.getRow(r.parentId, !0)), (n = r.getIsExpanded()));
+ return n;
+ }),
+ (e.getToggleExpandedHandler = () => {
+ let t = e.getCanExpand();
+ return () => {
+ t && e.toggleExpanded();
+ };
+ }));
+ },
+ },
+ G = 0,
+ K = 10,
+ q = () => ({pageIndex: G, pageSize: K}),
+ Ve = {
+ getInitialState: (e) => ({...e, pagination: {...q(), ...e?.pagination}}),
+ getDefaultOptions: (e) => ({onPaginationChange: k(`pagination`, e)}),
+ createTable: (e) => {
+ let t = !1,
+ n = !1;
+ ((e._autoResetPageIndex = () => {
+ if (!t) {
+ e._queue(() => {
+ t = !0;
+ });
+ return;
+ }
+ if (
+ e.options.autoResetAll ??
+ e.options.autoResetPageIndex ??
+ !e.options.manualPagination
+ ) {
+ if (n) return;
+ ((n = !0),
+ e._queue(() => {
+ (e.resetPageIndex(), (n = !1));
+ }));
+ }
+ }),
+ (e.setPagination = (t) =>
+ e.options.onPaginationChange == null
+ ? void 0
+ : e.options.onPaginationChange((e) => O(t, e))),
+ (e.resetPagination = (t) => {
+ e.setPagination(t ? q() : (e.initialState.pagination ?? q()));
+ }),
+ (e.setPageIndex = (t) => {
+ e.setPagination((n) => {
+ let r = O(t, n.pageIndex),
+ i =
+ e.options.pageCount === void 0 || e.options.pageCount === -1
+ ? 2 ** 53 - 1
+ : e.options.pageCount - 1;
+ return ((r = Math.max(0, Math.min(r, i))), {...n, pageIndex: r});
+ });
+ }),
+ (e.resetPageIndex = (t) => {
+ var n;
+ e.setPageIndex(
+ t
+ ? G
+ : (((n = e.initialState) == null || (n = n.pagination) == null
+ ? void 0
+ : n.pageIndex) ?? G)
+ );
+ }),
+ (e.resetPageSize = (t) => {
+ var n;
+ e.setPageSize(
+ t
+ ? K
+ : (((n = e.initialState) == null || (n = n.pagination) == null
+ ? void 0
+ : n.pageSize) ?? K)
+ );
+ }),
+ (e.setPageSize = (t) => {
+ e.setPagination((e) => {
+ let n = Math.max(1, O(t, e.pageSize)),
+ r = e.pageSize * e.pageIndex,
+ i = Math.floor(r / n);
+ return {...e, pageIndex: i, pageSize: n};
+ });
+ }),
+ (e.setPageCount = (t) =>
+ e.setPagination((n) => {
+ let r = O(t, e.options.pageCount ?? -1);
+ return (
+ typeof r == `number` && (r = Math.max(-1, r)),
+ {...n, pageCount: r}
+ );
+ })),
+ (e.getPageOptions = M(
+ () => [e.getPageCount()],
+ (e) => {
+ let t = [];
+ return (
+ e && e > 0 && (t = [...Array(e)].fill(null).map((e, t) => t)),
+ t
+ );
+ },
+ N(e.options, `debugTable`, `getPageOptions`)
+ )),
+ (e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0),
+ (e.getCanNextPage = () => {
+ let {pageIndex: t} = e.getState().pagination,
+ n = e.getPageCount();
+ return n === -1 ? !0 : n === 0 ? !1 : t < n - 1;
+ }),
+ (e.previousPage = () => e.setPageIndex((e) => e - 1)),
+ (e.nextPage = () => e.setPageIndex((e) => e + 1)),
+ (e.firstPage = () => e.setPageIndex(0)),
+ (e.lastPage = () => e.setPageIndex(e.getPageCount() - 1)),
+ (e.getPrePaginationRowModel = () => e.getExpandedRowModel()),
+ (e.getPaginationRowModel = () => (
+ !e._getPaginationRowModel &&
+ e.options.getPaginationRowModel &&
+ (e._getPaginationRowModel = e.options.getPaginationRowModel(e)),
+ e.options.manualPagination || !e._getPaginationRowModel
+ ? e.getPrePaginationRowModel()
+ : e._getPaginationRowModel()
+ )),
+ (e.getPageCount = () =>
+ e.options.pageCount ??
+ Math.ceil(e.getRowCount() / e.getState().pagination.pageSize)),
+ (e.getRowCount = () =>
+ e.options.rowCount ?? e.getPrePaginationRowModel().rows.length));
+ },
+ },
+ J = () => ({top: [], bottom: []}),
+ He = {
+ getInitialState: (e) => ({rowPinning: J(), ...e}),
+ getDefaultOptions: (e) => ({onRowPinningChange: k(`rowPinning`, e)}),
+ createRow: (e, t) => {
+ ((e.pin = (n, r, i) => {
+ let a = r
+ ? e.getLeafRows().map((e) => {
+ let {id: t} = e;
+ return t;
+ })
+ : [],
+ o = i
+ ? e.getParentRows().map((e) => {
+ let {id: t} = e;
+ return t;
+ })
+ : [],
+ s = new Set([...o, e.id, ...a]);
+ t.setRowPinning((e) =>
+ n === `bottom`
+ ? {
+ top: (e?.top ?? []).filter((e) => !(s != null && s.has(e))),
+ bottom: [
+ ...(e?.bottom ?? []).filter((e) => !(s != null && s.has(e))),
+ ...Array.from(s),
+ ],
+ }
+ : n === `top`
+ ? {
+ top: [
+ ...(e?.top ?? []).filter((e) => !(s != null && s.has(e))),
+ ...Array.from(s),
+ ],
+ bottom: (e?.bottom ?? []).filter(
+ (e) => !(s != null && s.has(e))
+ ),
+ }
+ : {
+ top: (e?.top ?? []).filter((e) => !(s != null && s.has(e))),
+ bottom: (e?.bottom ?? []).filter(
+ (e) => !(s != null && s.has(e))
+ ),
+ }
+ );
+ }),
+ (e.getCanPin = () => {
+ let {enableRowPinning: n, enablePinning: r} = t.options;
+ return typeof n == `function` ? n(e) : (n ?? r ?? !0);
+ }),
+ (e.getIsPinned = () => {
+ let n = [e.id],
+ {top: r, bottom: i} = t.getState().rowPinning,
+ a = n.some((e) => r?.includes(e)),
+ o = n.some((e) => i?.includes(e));
+ return a ? `top` : o ? `bottom` : !1;
+ }),
+ (e.getPinnedIndex = () => {
+ let n = e.getIsPinned();
+ return n
+ ? ((n === `top` ? t.getTopRows() : t.getBottomRows())
+ ?.map((e) => {
+ let {id: t} = e;
+ return t;
+ })
+ ?.indexOf(e.id) ?? -1)
+ : -1;
+ }));
+ },
+ createTable: (e) => {
+ ((e.setRowPinning = (t) =>
+ e.options.onRowPinningChange == null
+ ? void 0
+ : e.options.onRowPinningChange(t)),
+ (e.resetRowPinning = (t) =>
+ e.setRowPinning(t ? J() : (e.initialState?.rowPinning ?? J()))),
+ (e.getIsSomeRowsPinned = (t) => {
+ let n = e.getState().rowPinning;
+ return t ? !!n[t]?.length : !!(n.top?.length || n.bottom?.length);
+ }),
+ (e._getPinnedRows = (t, n, r) =>
+ ((e.options.keepPinnedRows ?? !0)
+ ? (n ?? []).map((t) => {
+ let n = e.getRow(t, !0);
+ return n.getIsAllParentsExpanded() ? n : null;
+ })
+ : (n ?? []).map((e) => t.find((t) => t.id === e))
+ )
+ .filter(Boolean)
+ .map((e) => ({...e, position: r}))),
+ (e.getTopRows = M(
+ () => [e.getRowModel().rows, e.getState().rowPinning.top],
+ (t, n) => e._getPinnedRows(t, n, `top`),
+ N(e.options, `debugRows`, `getTopRows`)
+ )),
+ (e.getBottomRows = M(
+ () => [e.getRowModel().rows, e.getState().rowPinning.bottom],
+ (t, n) => e._getPinnedRows(t, n, `bottom`),
+ N(e.options, `debugRows`, `getBottomRows`)
+ )),
+ (e.getCenterRows = M(
+ () => [
+ e.getRowModel().rows,
+ e.getState().rowPinning.top,
+ e.getState().rowPinning.bottom,
+ ],
+ (e, t, n) => {
+ let r = new Set([...(t ?? []), ...(n ?? [])]);
+ return e.filter((e) => !r.has(e.id));
+ },
+ N(e.options, `debugRows`, `getCenterRows`)
+ )));
+ },
+ },
+ Ue = {
+ getInitialState: (e) => ({rowSelection: {}, ...e}),
+ getDefaultOptions: (e) => ({
+ onRowSelectionChange: k(`rowSelection`, e),
+ enableRowSelection: !0,
+ enableMultiRowSelection: !0,
+ enableSubRowSelection: !0,
+ }),
+ createTable: (e) => {
+ ((e.setRowSelection = (t) =>
+ e.options.onRowSelectionChange == null
+ ? void 0
+ : e.options.onRowSelectionChange(t)),
+ (e.resetRowSelection = (t) =>
+ e.setRowSelection(t ? {} : (e.initialState.rowSelection ?? {}))),
+ (e.toggleAllRowsSelected = (t) => {
+ e.setRowSelection((n) => {
+ t = t === void 0 ? !e.getIsAllRowsSelected() : t;
+ let r = {...n},
+ i = e.getPreGroupedRowModel().flatRows;
+ return (
+ t
+ ? i.forEach((e) => {
+ e.getCanSelect() && (r[e.id] = !0);
+ })
+ : i.forEach((e) => {
+ delete r[e.id];
+ }),
+ r
+ );
+ });
+ }),
+ (e.toggleAllPageRowsSelected = (t) =>
+ e.setRowSelection((n) => {
+ let r = t === void 0 ? !e.getIsAllPageRowsSelected() : t,
+ i = {...n};
+ return (
+ e.getRowModel().rows.forEach((t) => {
+ We(i, t.id, r, !0, e);
+ }),
+ i
+ );
+ })),
+ (e.getPreSelectedRowModel = () => e.getCoreRowModel()),
+ (e.getSelectedRowModel = M(
+ () => [e.getState().rowSelection, e.getCoreRowModel()],
+ (t, n) =>
+ Object.keys(t).length
+ ? Ge(e, n)
+ : {rows: [], flatRows: [], rowsById: {}},
+ N(e.options, `debugTable`, `getSelectedRowModel`)
+ )),
+ (e.getFilteredSelectedRowModel = M(
+ () => [e.getState().rowSelection, e.getFilteredRowModel()],
+ (t, n) =>
+ Object.keys(t).length
+ ? Ge(e, n)
+ : {rows: [], flatRows: [], rowsById: {}},
+ N(e.options, `debugTable`, `getFilteredSelectedRowModel`)
+ )),
+ (e.getGroupedSelectedRowModel = M(
+ () => [e.getState().rowSelection, e.getSortedRowModel()],
+ (t, n) =>
+ Object.keys(t).length
+ ? Ge(e, n)
+ : {rows: [], flatRows: [], rowsById: {}},
+ N(e.options, `debugTable`, `getGroupedSelectedRowModel`)
+ )),
+ (e.getIsAllRowsSelected = () => {
+ let t = e.getFilteredRowModel().flatRows,
+ {rowSelection: n} = e.getState(),
+ r = !!(t.length && Object.keys(n).length);
+ return (
+ r && t.some((e) => e.getCanSelect() && !n[e.id]) && (r = !1),
+ r
+ );
+ }),
+ (e.getIsAllPageRowsSelected = () => {
+ let t = e
+ .getPaginationRowModel()
+ .flatRows.filter((e) => e.getCanSelect()),
+ {rowSelection: n} = e.getState(),
+ r = !!t.length;
+ return (r && t.some((e) => !n[e.id]) && (r = !1), r);
+ }),
+ (e.getIsSomeRowsSelected = () => {
+ let t = Object.keys(e.getState().rowSelection ?? {}).length;
+ return t > 0 && t < e.getFilteredRowModel().flatRows.length;
+ }),
+ (e.getIsSomePageRowsSelected = () => {
+ let t = e.getPaginationRowModel().flatRows;
+ return e.getIsAllPageRowsSelected()
+ ? !1
+ : t
+ .filter((e) => e.getCanSelect())
+ .some((e) => e.getIsSelected() || e.getIsSomeSelected());
+ }),
+ (e.getToggleAllRowsSelectedHandler = () => (t) => {
+ e.toggleAllRowsSelected(t.target.checked);
+ }),
+ (e.getToggleAllPageRowsSelectedHandler = () => (t) => {
+ e.toggleAllPageRowsSelected(t.target.checked);
+ }));
+ },
+ createRow: (e, t) => {
+ ((e.toggleSelected = (n, r) => {
+ let i = e.getIsSelected();
+ t.setRowSelection((a) => {
+ if (((n = n === void 0 ? !i : n), e.getCanSelect() && i === n))
+ return a;
+ let o = {...a};
+ return (We(o, e.id, n, r?.selectChildren ?? !0, t), o);
+ });
+ }),
+ (e.getIsSelected = () => {
+ let {rowSelection: n} = t.getState();
+ return Ke(e, n);
+ }),
+ (e.getIsSomeSelected = () => {
+ let {rowSelection: n} = t.getState();
+ return qe(e, n) === `some`;
+ }),
+ (e.getIsAllSubRowsSelected = () => {
+ let {rowSelection: n} = t.getState();
+ return qe(e, n) === `all`;
+ }),
+ (e.getCanSelect = () =>
+ typeof t.options.enableRowSelection == `function`
+ ? t.options.enableRowSelection(e)
+ : (t.options.enableRowSelection ?? !0)),
+ (e.getCanSelectSubRows = () =>
+ typeof t.options.enableSubRowSelection == `function`
+ ? t.options.enableSubRowSelection(e)
+ : (t.options.enableSubRowSelection ?? !0)),
+ (e.getCanMultiSelect = () =>
+ typeof t.options.enableMultiRowSelection == `function`
+ ? t.options.enableMultiRowSelection(e)
+ : (t.options.enableMultiRowSelection ?? !0)),
+ (e.getToggleSelectedHandler = () => {
+ let t = e.getCanSelect();
+ return (n) => {
+ t && e.toggleSelected(n.target?.checked);
+ };
+ }));
+ },
+ },
+ We = (e, t, n, r, i) => {
+ var a;
+ let o = i.getRow(t, !0);
+ (n
+ ? (o.getCanMultiSelect() || Object.keys(e).forEach((t) => delete e[t]),
+ o.getCanSelect() && (e[t] = !0))
+ : delete e[t],
+ r &&
+ (a = o.subRows) != null &&
+ a.length &&
+ o.getCanSelectSubRows() &&
+ o.subRows.forEach((t) => We(e, t.id, n, r, i)));
+ };
+function Ge(e, t) {
+ let n = e.getState().rowSelection,
+ r = [],
+ i = {},
+ a = function (e, t) {
+ return e
+ .map((e) => {
+ var t;
+ let o = Ke(e, n);
+ if (
+ (o && (r.push(e), (i[e.id] = e)),
+ (t = e.subRows) != null &&
+ t.length &&
+ (e = {...e, subRows: a(e.subRows)}),
+ o)
+ )
+ return e;
+ })
+ .filter(Boolean);
+ };
+ return {rows: a(t.rows), flatRows: r, rowsById: i};
+}
+function Ke(e, t) {
+ return t[e.id] ?? !1;
+}
+function qe(e, t, n) {
+ var r;
+ if (!((r = e.subRows) != null && r.length)) return !1;
+ let i = !0,
+ a = !1;
+ return (
+ e.subRows.forEach((e) => {
+ if (
+ !(a && !i) &&
+ (e.getCanSelect() && (Ke(e, t) ? (a = !0) : (i = !1)),
+ e.subRows && e.subRows.length)
+ ) {
+ let n = qe(e, t);
+ n === `all` ? (a = !0) : (n === `some` && (a = !0), (i = !1));
+ }
+ }),
+ i ? `all` : a ? `some` : !1
+ );
+}
+var Je = /([0-9]+)/gm,
+ Ye = (e, t, n) =>
+ nt(Y(e.getValue(n)).toLowerCase(), Y(t.getValue(n)).toLowerCase()),
+ Xe = (e, t, n) => nt(Y(e.getValue(n)), Y(t.getValue(n))),
+ Ze = (e, t, n) =>
+ tt(Y(e.getValue(n)).toLowerCase(), Y(t.getValue(n)).toLowerCase()),
+ Qe = (e, t, n) => tt(Y(e.getValue(n)), Y(t.getValue(n))),
+ $e = (e, t, n) => {
+ let r = e.getValue(n),
+ i = t.getValue(n);
+ return r > i ? 1 : r < i ? -1 : 0;
+ },
+ et = (e, t, n) => tt(e.getValue(n), t.getValue(n));
+function tt(e, t) {
+ return e === t ? 0 : e > t ? 1 : -1;
+}
+function Y(e) {
+ return typeof e == `number`
+ ? isNaN(e) || e === 1 / 0 || e === -1 / 0
+ ? ``
+ : String(e)
+ : typeof e == `string`
+ ? e
+ : ``;
+}
+function nt(e, t) {
+ let n = e.split(Je).filter(Boolean),
+ r = t.split(Je).filter(Boolean);
+ for (; n.length && r.length; ) {
+ let e = n.shift(),
+ t = r.shift(),
+ i = parseInt(e, 10),
+ a = parseInt(t, 10),
+ o = [i, a].sort();
+ if (isNaN(o[0])) {
+ if (e > t) return 1;
+ if (t > e) return -1;
+ continue;
+ }
+ if (isNaN(o[1])) return isNaN(i) ? -1 : 1;
+ if (i > a) return 1;
+ if (a > i) return -1;
+ }
+ return n.length - r.length;
+}
+var X = {
+ alphanumeric: Ye,
+ alphanumericCaseSensitive: Xe,
+ text: Ze,
+ textCaseSensitive: Qe,
+ datetime: $e,
+ basic: et,
+ },
+ rt = [
+ ge,
+ Le,
+ je,
+ Ne,
+ ve,
+ De,
+ Re,
+ ze,
+ {
+ getInitialState: (e) => ({sorting: [], ...e}),
+ getDefaultColumnDef: () => ({sortingFn: `auto`, sortUndefined: 1}),
+ getDefaultOptions: (e) => ({
+ onSortingChange: k(`sorting`, e),
+ isMultiSortEvent: (e) => e.shiftKey,
+ }),
+ createColumn: (e, t) => {
+ ((e.getAutoSortingFn = () => {
+ let n = t.getFilteredRowModel().flatRows.slice(10),
+ r = !1;
+ for (let t of n) {
+ let n = t?.getValue(e.id);
+ if (Object.prototype.toString.call(n) === `[object Date]`)
+ return X.datetime;
+ if (typeof n == `string` && ((r = !0), n.split(Je).length > 1))
+ return X.alphanumeric;
+ }
+ return r ? X.text : X.basic;
+ }),
+ (e.getAutoSortDir = () =>
+ typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id) ==
+ `string`
+ ? `asc`
+ : `desc`),
+ (e.getSortingFn = () => {
+ if (!e) throw Error();
+ return A(e.columnDef.sortingFn)
+ ? e.columnDef.sortingFn
+ : e.columnDef.sortingFn === `auto`
+ ? e.getAutoSortingFn()
+ : (t.options.sortingFns?.[e.columnDef.sortingFn] ??
+ X[e.columnDef.sortingFn]);
+ }),
+ (e.toggleSorting = (n, r) => {
+ let i = e.getNextSortingOrder(),
+ a = n != null;
+ t.setSorting((o) => {
+ let s = o?.find((t) => t.id === e.id),
+ c = o?.findIndex((t) => t.id === e.id),
+ l = [],
+ u,
+ d = a ? n : i === `desc`;
+ return (
+ (u =
+ o != null && o.length && e.getCanMultiSort() && r
+ ? s
+ ? `toggle`
+ : `add`
+ : o != null && o.length && c !== o.length - 1
+ ? `replace`
+ : s
+ ? `toggle`
+ : `replace`),
+ u === `toggle` && (a || i || (u = `remove`)),
+ u === `add`
+ ? ((l = [...o, {id: e.id, desc: d}]),
+ l.splice(
+ 0,
+ l.length - (t.options.maxMultiSortColCount ?? 2 ** 53 - 1)
+ ))
+ : (l =
+ u === `toggle`
+ ? o.map((t) => (t.id === e.id ? {...t, desc: d} : t))
+ : u === `remove`
+ ? o.filter((t) => t.id !== e.id)
+ : [{id: e.id, desc: d}]),
+ l
+ );
+ });
+ }),
+ (e.getFirstSortDir = () =>
+ (e.columnDef.sortDescFirst ??
+ t.options.sortDescFirst ??
+ e.getAutoSortDir() === `desc`)
+ ? `desc`
+ : `asc`),
+ (e.getNextSortingOrder = (n) => {
+ let r = e.getFirstSortDir(),
+ i = e.getIsSorted();
+ return i
+ ? i !== r &&
+ (t.options.enableSortingRemoval ?? !0) &&
+ (!n || (t.options.enableMultiRemove ?? !0))
+ ? !1
+ : i === `desc`
+ ? `asc`
+ : `desc`
+ : r;
+ }),
+ (e.getCanSort = () =>
+ (e.columnDef.enableSorting ?? !0) &&
+ (t.options.enableSorting ?? !0) &&
+ !!e.accessorFn),
+ (e.getCanMultiSort = () =>
+ e.columnDef.enableMultiSort ??
+ t.options.enableMultiSort ??
+ !!e.accessorFn),
+ (e.getIsSorted = () => {
+ let n = t.getState().sorting?.find((t) => t.id === e.id);
+ return n ? (n.desc ? `desc` : `asc`) : !1;
+ }),
+ (e.getSortIndex = () =>
+ t.getState().sorting?.findIndex((t) => t.id === e.id) ?? -1),
+ (e.clearSorting = () => {
+ t.setSorting((t) =>
+ t != null && t.length ? t.filter((t) => t.id !== e.id) : []
+ );
+ }),
+ (e.getToggleSortingHandler = () => {
+ let n = e.getCanSort();
+ return (r) => {
+ n &&
+ (r.persist == null || r.persist(),
+ e.toggleSorting == null ||
+ e.toggleSorting(
+ void 0,
+ e.getCanMultiSort()
+ ? t.options.isMultiSortEvent == null
+ ? void 0
+ : t.options.isMultiSortEvent(r)
+ : !1
+ ));
+ };
+ }));
+ },
+ createTable: (e) => {
+ ((e.setSorting = (t) =>
+ e.options.onSortingChange == null
+ ? void 0
+ : e.options.onSortingChange(t)),
+ (e.resetSorting = (t) => {
+ e.setSorting(t ? [] : (e.initialState?.sorting ?? []));
+ }),
+ (e.getPreSortedRowModel = () => e.getGroupedRowModel()),
+ (e.getSortedRowModel = () => (
+ !e._getSortedRowModel &&
+ e.options.getSortedRowModel &&
+ (e._getSortedRowModel = e.options.getSortedRowModel(e)),
+ e.options.manualSorting || !e._getSortedRowModel
+ ? e.getPreSortedRowModel()
+ : e._getSortedRowModel()
+ )));
+ },
+ },
+ ke,
+ Be,
+ Ve,
+ He,
+ Ue,
+ Fe,
+ ];
+function it(e) {
+ let t = [...rt, ...(e._features ?? [])],
+ n = {_features: t},
+ r = n._features.reduce(
+ (e, t) =>
+ Object.assign(
+ e,
+ t.getDefaultOptions == null ? void 0 : t.getDefaultOptions(n)
+ ),
+ {}
+ ),
+ i = (e) =>
+ n.options.mergeOptions ? n.options.mergeOptions(r, e) : {...r, ...e},
+ a = {...(e.initialState ?? {})};
+ n._features.forEach((e) => {
+ a = (e.getInitialState == null ? void 0 : e.getInitialState(a)) ?? a;
+ });
+ let o = [],
+ s = !1,
+ c = {
+ _features: t,
+ options: {...r, ...e},
+ initialState: a,
+ _queue: (e) => {
+ (o.push(e),
+ s ||
+ ((s = !0),
+ Promise.resolve()
+ .then(() => {
+ for (; o.length; ) o.shift()();
+ s = !1;
+ })
+ .catch((e) =>
+ setTimeout(() => {
+ throw e;
+ })
+ )));
+ },
+ reset: () => {
+ n.setState(n.initialState);
+ },
+ setOptions: (e) => {
+ n.options = i(O(e, n.options));
+ },
+ getState: () => n.options.state,
+ setState: (e) => {
+ n.options.onStateChange == null || n.options.onStateChange(e);
+ },
+ _getRowId: (e, t, r) =>
+ (n.options.getRowId == null ? void 0 : n.options.getRowId(e, t, r)) ??
+ `${r ? [r.id, t].join(`.`) : t}`,
+ getCoreRowModel: () => (
+ (n._getCoreRowModel ||= n.options.getCoreRowModel(n)),
+ n._getCoreRowModel()
+ ),
+ getRowModel: () => n.getPaginationRowModel(),
+ getRow: (e, t) => {
+ let r = (t ? n.getPrePaginationRowModel() : n.getRowModel()).rowsById[
+ e
+ ];
+ if (!r && ((r = n.getCoreRowModel().rowsById[e]), !r)) throw Error();
+ return r;
+ },
+ _getDefaultColumnDef: M(
+ () => [n.options.defaultColumn],
+ (e) => (
+ (e ??= {}),
+ {
+ header: (e) => {
+ let t = e.header.column.columnDef;
+ return t.accessorKey ? t.accessorKey : t.accessorFn ? t.id : null;
+ },
+ cell: (e) => {
+ var t;
+ return (
+ ((t = e.renderValue()) == null || t.toString == null
+ ? void 0
+ : t.toString()) ?? null
+ );
+ },
+ ...n._features.reduce(
+ (e, t) =>
+ Object.assign(
+ e,
+ t.getDefaultColumnDef == null
+ ? void 0
+ : t.getDefaultColumnDef()
+ ),
+ {}
+ ),
+ ...e,
+ }
+ ),
+ N(e, `debugColumns`, `_getDefaultColumnDef`)
+ ),
+ _getColumnDefs: () => n.options.columns,
+ getAllColumns: M(
+ () => [n._getColumnDefs()],
+ (e) => {
+ let t = function (e, r, i) {
+ return (
+ i === void 0 && (i = 0),
+ e.map((e) => {
+ let a = me(n, e, i, r),
+ o = e;
+ return (
+ (a.columns = o.columns ? t(o.columns, a, i + 1) : []),
+ a
+ );
+ })
+ );
+ };
+ return t(e);
+ },
+ N(e, `debugColumns`, `getAllColumns`)
+ ),
+ getAllFlatColumns: M(
+ () => [n.getAllColumns()],
+ (e) => e.flatMap((e) => e.getFlatColumns()),
+ N(e, `debugColumns`, `getAllFlatColumns`)
+ ),
+ _getAllFlatColumnsById: M(
+ () => [n.getAllFlatColumns()],
+ (e) => e.reduce((e, t) => ((e[t.id] = t), e), {}),
+ N(e, `debugColumns`, `getAllFlatColumnsById`)
+ ),
+ getAllLeafColumns: M(
+ () => [n.getAllColumns(), n._getOrderColumnsFn()],
+ (e, t) => t(e.flatMap((e) => e.getLeafColumns())),
+ N(e, `debugColumns`, `getAllLeafColumns`)
+ ),
+ getColumn: (e) => n._getAllFlatColumnsById()[e],
+ };
+ Object.assign(n, c);
+ for (let e = 0; e < n._features.length; e++) {
+ let t = n._features[e];
+ t == null || t.createTable == null || t.createTable(n);
+ }
+ return n;
+}
+function at() {
+ return (e) =>
+ M(
+ () => [e.options.data],
+ (t) => {
+ let n = {rows: [], flatRows: [], rowsById: {}},
+ r = function (t, i, a) {
+ i === void 0 && (i = 0);
+ let o = [];
+ for (let c = 0; c < t.length; c++) {
+ let l = _e(e, e._getRowId(t[c], c, a), t[c], c, i, void 0, a?.id);
+ if (
+ (n.flatRows.push(l),
+ (n.rowsById[l.id] = l),
+ o.push(l),
+ e.options.getSubRows)
+ ) {
+ var s;
+ ((l.originalSubRows = e.options.getSubRows(t[c], c)),
+ (s = l.originalSubRows) != null &&
+ s.length &&
+ (l.subRows = r(l.originalSubRows, i + 1, l)));
+ }
+ }
+ return o;
+ };
+ return ((n.rows = r(t)), n);
+ },
+ N(e.options, `debugTable`, `getRowModel`, () => e._autoResetPageIndex())
+ );
+}
+function Z() {
+ return !0;
+}
+var ot = Symbol(`merge-proxy`),
+ st = {
+ get(e, t, n) {
+ return t === ot ? n : e.get(t);
+ },
+ has(e, t) {
+ return e.has(t);
+ },
+ set: Z,
+ deleteProperty: Z,
+ getOwnPropertyDescriptor(e, t) {
+ return {
+ configurable: !0,
+ enumerable: !0,
+ get() {
+ return e.get(t);
+ },
+ set: Z,
+ deleteProperty: Z,
+ };
+ },
+ ownKeys(e) {
+ return e.keys();
+ },
+ };
+function ct(e) {
+ return `value` in e ? e.value : e;
+}
+function Q() {
+ var e = [...arguments];
+ return new Proxy(
+ {
+ get(t) {
+ for (let n = e.length - 1; n >= 0; n--) {
+ let r = ct(e[n])[t];
+ if (r !== void 0) return r;
+ }
+ },
+ has(t) {
+ for (let n = e.length - 1; n >= 0; n--) if (t in ct(e[n])) return !0;
+ return !1;
+ },
+ keys() {
+ let t = [];
+ for (let n = 0; n < e.length; n++) t.push(...Object.keys(ct(e[n])));
+ return [...Array.from(new Set(t))];
+ },
+ },
+ st
+ );
+}
+var lt = n({
+ props: [`render`, `props`],
+ setup: (e) => () =>
+ typeof e.render == `function` || typeof e.render == `object`
+ ? re(e.render, e.props)
+ : e.render,
+});
+function ut(e) {
+ return Q(e, {data: b(e.data)});
+}
+function dt(e) {
+ let t = ne(e.data),
+ n = it(
+ Q(
+ {
+ state: {},
+ onStateChange: () => {},
+ renderFallbackValue: null,
+ mergeOptions(e, n) {
+ return t ? {...e, ...n} : Q(e, n);
+ },
+ },
+ t ? ut(e) : e
+ )
+ );
+ if (t) {
+ let t = oe(e.data);
+ i(
+ t,
+ () => {
+ n.setState((e) => ({...e, data: t.value}));
+ },
+ {immediate: !0}
+ );
+ }
+ let r = y(n.initialState);
+ return (
+ h(() => {
+ n.setOptions((n) => {
+ let i = new Proxy({}, {get: (e, t) => r.value[t]});
+ return Q(n, t ? ut(e) : e, {
+ state: Q(i, e.state ?? {}),
+ onStateChange: (t) => {
+ (t instanceof Function ? (r.value = t(r.value)) : (r.value = t),
+ e.onStateChange == null || e.onStateChange(t));
+ },
+ });
+ });
+ }),
+ n
+ );
+}
+function ft(e) {
+ let t = y(new Map()),
+ n = y(new Map()),
+ o = y(new Map()),
+ c = null,
+ {
+ registerItem: l,
+ getDragState: u,
+ getDropState: d,
+ setupMonitor: f,
+ } = se({onReorder: e.onReorder, axis: `vertical`});
+ function p(e, n) {
+ e ? t.value.set(n, e) : t.value.delete(n);
+ }
+ function m(e, t) {
+ e ? n.value.set(t, e) : n.value.delete(t);
+ }
+ function h() {
+ e.enabled() &&
+ (o.value.forEach((e) => e()),
+ o.value.clear(),
+ e.getRowIds().forEach((e, r) => {
+ let i = String(e),
+ a = t.value.get(i),
+ s = n.value.get(i);
+ if (a) {
+ let e = l(a, s ?? null, i, r);
+ o.value.set(i, e);
+ }
+ }));
+ }
+ return (
+ i(
+ () => e.getRowIds(),
+ () => {
+ s(h);
+ },
+ {deep: !0}
+ ),
+ r(() => {
+ ((c = f()), s(h));
+ }),
+ a(() => {
+ (o.value.forEach((e) => e()), c?.());
+ }),
+ {
+ setRowRef: p,
+ setHandleRef: m,
+ getDragState: u,
+ getDropState: d,
+ refreshRegistrations: h,
+ }
+ );
+}
+var $ = {Relaxed: `relaxed`, Compact: `compact`, Spacious: `spacious`},
+ pt = [`aria-describedby`],
+ mt = ae(
+ n({
+ __name: `ColumnHeaderTitle`,
+ props: {isSortable: {type: Boolean, default: !1}, sortInstructionsId: {}},
+ emits: [`sortColumn`],
+ setup(e) {
+ return (t, n) =>
+ e.isSortable
+ ? (l(),
+ T(
+ `button`,
+ {
+ key: 0,
+ type: `button`,
+ onClick: (n[0] ||= (e) => t.$emit(`sortColumn`, e)),
+ 'aria-describedby': e.sortInstructionsId,
+ },
+ [f(t.$slots, `default`, {}, void 0, !0)],
+ 8,
+ pt
+ ))
+ : f(t.$slots, `default`, {key: 1}, void 0, !0);
+ },
+ }),
+ [[`__scopeId`, `data-v-17ae0c60`]]
+ ),
+ ht = n({
+ __name: `Text`,
+ props: {as: {default: `div`}, template: {}, params: {}},
+ setup(t) {
+ let n = t,
+ r = _(() => e(n.template, n.params));
+ return (e, n) => (
+ l(),
+ E(d(t.as), o(e.$attrs, {innerHTML: r.value}), null, 16, [`innerHTML`])
+ );
+ },
+ }),
+ gt = {class: `cp-table-wrapper`},
+ _t = {key: 0, class: `cp-table-header`},
+ vt = {class: `sr-only`},
+ yt = {key: 0, class: `cell cell--header`},
+ bt = [`colSpan`, `id`, `aria-sort`],
+ xt = {key: 1, name: `arrow-up-arrow-down`},
+ St = {key: 2, name: `asc`},
+ Ct = {key: 3, name: `desc`},
+ wt = {key: 0},
+ Tt = {key: 0},
+ Et = {
+ key: 1,
+ style: {
+ '--table-template-columns': `1fr`,
+ '--_cell-spacing-inline': `0`,
+ '--_cell-spacing-block': `0`,
+ },
+ },
+ Dt = {key: 1, class: `cp-table-footer`},
+ Ot = {class: `flex gap-1`},
+ kt = [`disabled`],
+ At = [`label`],
+ jt = {class: `flex items-center gap-1 mx-2`},
+ Mt = [`label`],
+ Nt = [`disabled`],
+ Pt = [`label`],
+ Ft = {class: `flex gap-2 items-center`},
+ It = ae(
+ n({
+ __name: `AdminTable`,
+ props: {
+ table: {},
+ title: {},
+ reorderable: {type: Boolean, default: !1},
+ selectable: {type: Boolean, default: !0},
+ readOnly: {type: Boolean},
+ layout: {default: `auto`},
+ spacing: {},
+ from: {},
+ to: {},
+ total: {},
+ enableAdjustPageSize: {type: Boolean, default: !1},
+ pageSizeOptions: {default: () => [50, 100, 250]},
+ },
+ emits: [`reorder`],
+ setup(n, {emit: r}) {
+ let i = n,
+ a = ie(),
+ o = _(() => i.readOnly ?? a.props.readOnly),
+ s = r,
+ {
+ setRowRef: h,
+ setHandleRef: y,
+ getDragState: ne,
+ getDropState: re,
+ } = ft({
+ getRowIds: () => i.table.getRowModel().rows.map((e) => e.id),
+ onReorder: (e, t) => {
+ s(`reorder`, e, t);
+ },
+ enabled: () => !i.readOnly && i.reorderable,
+ });
+ function ae(e) {
+ let t = re(e);
+ return t.type === `is-over` ? t.closestEdge : null;
+ }
+ let oe = `column-sort-instructions-${p()}`,
+ se = _(() => (i.title ? `${i.title}, ` : null)),
+ D = _({
+ get() {
+ return i.table.getState().pagination.pageIndex + 1;
+ },
+ set(e) {
+ e && i.table.setPageIndex(parseInt(e) - 1);
+ },
+ }),
+ O = _({
+ get() {
+ return i.table.getState().pagination.pageSize;
+ },
+ set(e) {
+ e && i.table.setPageSize(parseInt(e));
+ },
+ }),
+ k = _(() => i.table.getPageCount() > 1),
+ A = _(() => i.enableAdjustPageSize),
+ j = _(() => i.from && i.to && i.total),
+ fe = _(() => k.value || A.value || j.value);
+ function M(e) {
+ return e ? (typeof e == `string` ? {[e]: !0} : e) : {};
+ }
+ function N(e) {
+ if (e.getCanSort())
+ return e.getIsSorted()
+ ? e.getIsSorted() === `asc`
+ ? `ascending`
+ : `descending`
+ : `none`;
+ }
+ let pe = _(() => {
+ let e = i.table.getAllColumns().filter((e) => e.getIsVisible()),
+ t = e.length;
+ i.reorderable && (t += 1);
+ let n = {'--table-column-count': t},
+ r = e.reduce(
+ (e, t) => (
+ e.push(t.columnDef.meta?.trackSize ?? `minmax(0, 1fr)`),
+ e
+ ),
+ []
+ );
+ return (
+ i.reorderable && r.unshift(`44px`),
+ (n[`--table-template-columns`] = r.join(` `)),
+ n
+ );
+ });
+ function me(e) {
+ return e === 0
+ ? `first`
+ : e === i.table.getRowModel().rows.length - 1
+ ? `last`
+ : `middle`;
+ }
+ return (r, i) => (
+ l(),
+ T(`div`, gt, [
+ r.$slots[`table-header`]
+ ? (l(),
+ T(`div`, _t, [f(r.$slots, `table-header`, {}, void 0, !0)]))
+ : v(``, !0),
+ C(
+ `table`,
+ {
+ class: c({
+ 'cp-table': !0,
+ 'cp-table--grid': !1,
+ 'cp-table--compact': n.spacing === b($).Compact,
+ 'cp-table--relaxed': n.spacing === b($).Relaxed,
+ 'cp-table--spacious': n.spacing === b($).Spacious,
+ 'cp-table--auto': n.layout === `auto`,
+ }),
+ style: ee(pe.value),
+ },
+ [
+ C(`caption`, vt, [
+ w(S(se.value) + ` `, 1),
+ C(
+ `span`,
+ {id: oe},
+ S(b(e)(`Column headers with buttons are sortable`)),
+ 1
+ ),
+ ]),
+ C(`thead`, null, [
+ (l(!0),
+ T(
+ x,
+ null,
+ t(
+ n.table.getHeaderGroups(),
+ (e) => (
+ l(),
+ T(`tr`, {key: e.id}, [
+ !o.value && n.reorderable
+ ? (l(),
+ T(`th`, yt, [
+ ...(i[4] ||= [
+ C(`span`, {class: `sr-only`}, `Reorder`, -1),
+ ]),
+ ]))
+ : v(``, !0),
+ (l(!0),
+ T(
+ x,
+ null,
+ t(
+ e.headers,
+ (e) => (
+ l(),
+ T(
+ `th`,
+ {
+ key: e.id,
+ colSpan: e.colSpan,
+ id: `header-${e.id}`,
+ class: c({
+ 'cp-table-cell': !0,
+ 'cp-table-cell--header': !0,
+ 'cursor-pointer select-none':
+ e.column.getCanSort(),
+ }),
+ scope: `col`,
+ 'aria-sort': N(e.column),
+ },
+ [
+ C(
+ `div`,
+ {
+ class: c([
+ `flex gap-1 items-center`,
+ {
+ 'sr-only':
+ e.column.columnDef.meta
+ ?.headerSrOnly,
+ ...M(
+ e.column.columnDef.meta
+ ?.columnClass
+ ),
+ ...M(
+ e.column.columnDef.meta
+ ?.headerClass
+ ),
+ },
+ ]),
+ },
+ [
+ u(
+ mt,
+ {
+ 'is-sortable':
+ e.column.getCanSort(),
+ 'sort-instructions-id': oe,
+ onSortColumn: (t) =>
+ e.column.getToggleSortingHandler()?.(
+ t
+ ),
+ },
+ {
+ default: m(() => [
+ e.isPlaceholder
+ ? v(``, !0)
+ : (l(),
+ E(
+ b(lt),
+ {
+ key: 0,
+ render:
+ e.column.columnDef
+ .header,
+ props: e.getContext(),
+ },
+ null,
+ 8,
+ [`render`, `props`]
+ )),
+ (i[5] ||= w(`\xA0`, -1)),
+ e.column.getCanSort() &&
+ !e.column.getIsSorted()
+ ? (l(), T(`craft-icon`, xt))
+ : e.column.getIsSorted() ===
+ `asc`
+ ? (l(), T(`craft-icon`, St))
+ : e.column.getIsSorted() ===
+ `desc`
+ ? (l(), T(`craft-icon`, Ct))
+ : v(``, !0),
+ ]),
+ _: 2,
+ },
+ 1032,
+ [`is-sortable`, `onSortColumn`]
+ ),
+ e.column.columnDef.meta?.headerTip
+ ? (l(),
+ T(
+ `craft-info-icon`,
+ wt,
+ S(
+ e.column.columnDef.meta
+ .headerTip
+ ),
+ 1
+ ))
+ : v(``, !0),
+ ],
+ 2
+ ),
+ ],
+ 10,
+ bt
+ )
+ )
+ ),
+ 128
+ )),
+ ])
+ )
+ ),
+ 128
+ )),
+ ]),
+ C(`tbody`, null, [
+ n.table.getRowModel().rows.length > 0
+ ? (l(!0),
+ T(
+ x,
+ {key: 0},
+ t(
+ n.table.getRowModel().rows,
+ (e) => (
+ l(),
+ T(
+ `tr`,
+ {
+ key: e.id,
+ ref_for: !0,
+ ref: (t) => b(h)(t, e.id),
+ class: c({
+ row: !0,
+ 'cp-table-row': !0,
+ 'row--dragging':
+ !o.value &&
+ b(ne)(e.id).type === `is-dragging`,
+ }),
+ },
+ [
+ n.reorderable && !o.value
+ ? (l(),
+ T(`td`, Tt, [
+ C(`div`, null, [
+ u(
+ le,
+ {
+ 'onClick:up': (t) =>
+ s(
+ `reorder`,
+ e.index,
+ e.index - 1
+ ),
+ 'onClick:down': (t) =>
+ s(
+ `reorder`,
+ e.index,
+ e.index + 1
+ ),
+ position: me(e.index),
+ ref_for: !0,
+ ref: (t) => b(y)(t?.$el, e.id),
+ },
+ null,
+ 8,
+ [
+ `onClick:up`,
+ `onClick:down`,
+ `position`,
+ ]
+ ),
+ ]),
+ u(ce, {edge: ae(e.id)}, null, 8, [
+ `edge`,
+ ]),
+ ]))
+ : v(``, !0),
+ (l(!0),
+ T(
+ x,
+ null,
+ t(
+ e.getVisibleCells(),
+ (e) => (
+ l(),
+ E(
+ d(
+ e.column.columnDef.meta?.cellTag ??
+ `td`
+ ),
+ {
+ key: e.id,
+ class: c({
+ 'cp-table-cell': !0,
+ 'cp-table-cell--wrap':
+ e.column.columnDef.meta?.wrap,
+ ...M(
+ e.column.columnDef.meta
+ ?.columnClass
+ ),
+ ...M(
+ e.column.columnDef.meta?.cellClass
+ ),
+ }),
+ },
+ {
+ default: m(() => [
+ u(
+ b(lt),
+ {
+ render: e.column.columnDef.cell,
+ props: e.getContext(),
+ },
+ null,
+ 8,
+ [`render`, `props`]
+ ),
+ ]),
+ _: 2,
+ },
+ 1032,
+ [`class`]
+ )
+ )
+ ),
+ 128
+ )),
+ ],
+ 2
+ )
+ )
+ ),
+ 128
+ ))
+ : (l(),
+ T(`tr`, Et, [
+ C(`td`, null, [
+ f(
+ r.$slots,
+ `empty-row`,
+ {},
+ () => [
+ u(
+ ue,
+ {label: b(e)(`No results`), icon: `empty-set`},
+ null,
+ 8,
+ [`label`]
+ ),
+ ],
+ !0
+ ),
+ ]),
+ ])),
+ ]),
+ ],
+ 6
+ ),
+ fe.value
+ ? (l(),
+ T(`div`, Dt, [
+ C(`div`, null, [
+ j.value
+ ? (l(),
+ E(
+ ht,
+ {
+ key: 0,
+ template: `{from} – {to} of {total, plural, =1{# item} other{# items}}`,
+ params: {
+ from: n.from ?? 0,
+ to: n.to ?? 0,
+ total: n.total ?? 0,
+ },
+ },
+ null,
+ 8,
+ [`params`]
+ ))
+ : v(``, !0),
+ ]),
+ C(`div`, Ot, [
+ k.value
+ ? (l(),
+ T(
+ x,
+ {key: 0},
+ [
+ C(
+ `craft-button`,
+ {
+ type: `button`,
+ onClick: (i[0] ||= (e) =>
+ n.table.previousPage()),
+ disabled: !n.table.getCanPreviousPage(),
+ icon: ``,
+ size: `small`,
+ },
+ [
+ C(
+ `craft-icon`,
+ {
+ name: `chevron-left`,
+ label: b(e)(`Previous page`),
+ },
+ null,
+ 8,
+ At
+ ),
+ ],
+ 8,
+ kt
+ ),
+ C(`div`, jt, [
+ (i[6] ||= w(` Page `, -1)),
+ g(
+ C(
+ `craft-input`,
+ {
+ type: `text`,
+ 'onUpdate:modelValue': (i[1] ||= (e) =>
+ (D.value = e)),
+ maxlength: `3`,
+ label: b(e)(`Current page`),
+ 'label-sr-only': ``,
+ center: ``,
+ size: `small`,
+ },
+ null,
+ 8,
+ Mt
+ ),
+ [[te, D.value]]
+ ),
+ w(` of ` + S(n.table.getPageCount()), 1),
+ ]),
+ C(
+ `craft-button`,
+ {
+ type: `button`,
+ onClick: (i[2] ||= (e) => n.table.nextPage()),
+ disabled: !n.table.getCanNextPage(),
+ size: `small`,
+ icon: ``,
+ },
+ [
+ C(
+ `craft-icon`,
+ {
+ name: `chevron-right`,
+ label: b(e)(`Next page`),
+ },
+ null,
+ 8,
+ Pt
+ ),
+ ],
+ 8,
+ Nt
+ ),
+ ],
+ 64
+ ))
+ : v(``, !0),
+ ]),
+ C(`div`, Ft, [
+ A.value
+ ? (l(),
+ T(
+ x,
+ {key: 0},
+ [
+ w(S(b(e)(`Items per page:`)) + ` `, 1),
+ u(
+ de,
+ {
+ small: ``,
+ options: n.pageSizeOptions,
+ modelValue: O.value,
+ 'onUpdate:modelValue': (i[3] ||= (e) =>
+ (O.value = e)),
+ class: `w-auto`,
+ },
+ null,
+ 8,
+ [`options`, `modelValue`]
+ ),
+ ],
+ 64
+ ))
+ : v(``, !0),
+ ]),
+ ]))
+ : v(``, !0),
+ ])
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-c912c4d0`]]
+ );
+export {D as a, dt as i, ht as n, at as o, $ as r, It as t};
diff --git a/resources/build/assets/AdminTable-Btn1QZAv.css b/resources/build/assets/AdminTable-Btn1QZAv.css
new file mode 100644
index 00000000000..3f6f6960b39
--- /dev/null
+++ b/resources/build/assets/AdminTable-Btn1QZAv.css
@@ -0,0 +1,35 @@
+button[data-v-17ae0c60] {
+ all: unset;
+}
+button[data-v-17ae0c60]:after {
+ content: '';
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+.cp-table-wrapper[data-v-c912c4d0] {
+ overflow: auto clip;
+}
+[data-v-c912c4d0] .cell,
+[data-v-c912c4d0] .cell--header {
+ white-space: nowrap;
+}
+[data-v-c912c4d0] .cell--header[aria-sort]:hover,
+[data-v-c912c4d0] .cell--header[aria-sort]:focus-within {
+ background-color: var(--c-color-neutral-fill-loud);
+ color: var(--c-color-neutral-on-loud);
+}
+[data-v-c912c4d0] .cell--wrap {
+ white-space: normal;
+}
+[data-v-c912c4d0] .cell--drag-handle {
+ width: 40px;
+ padding-inline: var(--c-spacing-sm);
+ position: relative;
+ overflow: visible;
+}
+[data-v-c912c4d0] .row--dragging {
+ opacity: 0.4;
+}
diff --git a/resources/build/assets/AppLayout-BXGMFlSp.js b/resources/build/assets/AppLayout-BXGMFlSp.js
new file mode 100644
index 00000000000..db86e685715
--- /dev/null
+++ b/resources/build/assets/AppLayout-BXGMFlSp.js
@@ -0,0 +1,1418 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {n as t, t as n} from './cp-npqTfNqh.js';
+import {
+ B as r,
+ E as i,
+ F as a,
+ J as o,
+ N as s,
+ P as c,
+ Q as l,
+ R as u,
+ T as d,
+ U as f,
+ V as p,
+ X as m,
+ _ as h,
+ a as ee,
+ b as g,
+ ct as te,
+ d as ne,
+ ht as _,
+ l as v,
+ m as y,
+ ot as re,
+ p as ie,
+ q as ae,
+ t as b,
+ tt as x,
+ v as S,
+ w as C,
+ x as w,
+ y as T,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {
+ a as oe,
+ i as E,
+ n as se,
+ o as D,
+ r as O,
+ s as k,
+ t as ce,
+} from './InlineFlash-DnK6Yp2V.js';
+import {i as A, n as j, r as M, t as N} from './wayfinder-V597ZF_3.js';
+import {r as le} from './dist-BSfJDNP3.js';
+import {t as P} from './LoginController-DVCyoRyw.js';
+var F = {class: `system-info__icon`},
+ ue = [`innerHTML`],
+ de = {class: `system-info__name`},
+ fe = b(
+ i({
+ __name: `SystemInfo`,
+ setup(e) {
+ let t = A(),
+ n = h(() => t.system),
+ r = h(() => t.site),
+ i = h(() => (r.value.url ? `a` : `div`));
+ return (e, t) => (
+ u(),
+ T(
+ f(i.value),
+ {
+ class: `system-info`,
+ href: r.value.url,
+ target: r.value.url ? `_blank` : null,
+ },
+ {
+ default: m(() => [
+ S(`div`, F, [
+ S(`span`, {innerHTML: n.value.icon}, null, 8, ue),
+ ]),
+ S(`div`, de, x(n.value.name), 1),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`, `target`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-35b1fc9e`]]
+ ),
+ pe = [`icon`, `href`, `active`, `indicator`],
+ me = {key: 0, slot: `subnav`},
+ he = [`active`, `href`, `indicator`],
+ ge = [`name`],
+ _e = {key: 1, class: `nav-indicator`, slot: `icon`},
+ ve = [`.displayed-job`, `.has-reserved-jobs`, `.has-waiting-jobs`],
+ ye = b(
+ i({
+ __name: `MainNav`,
+ setup(e) {
+ let t = v(),
+ {nav: n} = A(),
+ i = h(() => t.props.queue);
+ return (e, t) => (
+ u(),
+ w(`craft-nav-list`, null, [
+ (u(!0),
+ w(
+ y,
+ null,
+ r(
+ _(n),
+ (e) => (
+ u(),
+ w(
+ `craft-nav-item`,
+ {
+ key: e.url,
+ icon: e.icon,
+ href: e.url,
+ active: e.sel,
+ indicator: !!e.badgeCount,
+ },
+ [
+ C(x(e.label) + ` `, 1),
+ e.subnav
+ ? (u(),
+ w(
+ y,
+ {key: 0},
+ [
+ e.subnav
+ ? (u(),
+ w(`craft-nav-list`, me, [
+ (u(!0),
+ w(
+ y,
+ null,
+ r(
+ e.subnav,
+ (e) => (
+ u(),
+ w(
+ `craft-nav-item`,
+ {
+ key: e.url,
+ active: e.sel,
+ href: e.url,
+ indicator: !!e.badgeCount,
+ },
+ [
+ e.icon
+ ? (u(),
+ w(
+ `craft-icon`,
+ {
+ key: 0,
+ name: e.icon,
+ slot: `icon`,
+ },
+ null,
+ 8,
+ ge
+ ))
+ : (u(), w(`span`, _e)),
+ C(` ` + x(e.label), 1),
+ ],
+ 8,
+ he
+ )
+ )
+ ),
+ 128
+ )),
+ ]))
+ : g(``, !0),
+ ],
+ 64
+ ))
+ : g(``, !0),
+ ],
+ 8,
+ pe
+ )
+ )
+ ),
+ 128
+ )),
+ S(
+ `cp-queue-indicator`,
+ {
+ '.displayed-job': i.value.displayedJob,
+ '.has-reserved-jobs': i.value.hasReservedJobs,
+ '.has-waiting-jobs': i.value.hasWaitingJobs,
+ },
+ null,
+ 40,
+ ve
+ ),
+ ])
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-37e522d3`]]
+ ),
+ be = {
+ class: `flex flex-col items-center justify-center py-4 px-2 text-muted gap-1`,
+ },
+ xe = {lang: `en`, class: `flex items-center gap-2`},
+ Se = [`href`],
+ Ce = {'aria-hidden': `true`},
+ we = {class: `sr-only`},
+ Te = b(
+ i({
+ __name: `EditionInfo`,
+ setup(e) {
+ let {app: t, cpUrl: n} = A(),
+ r = h(() => `${t.edition.name} Edition`);
+ return (e, i) => (
+ u(),
+ w(`div`, be, [
+ S(`div`, xe, ` Craft CMS ` + x(_(t).version), 1),
+ S(
+ `a`,
+ {
+ href: `${_(n)}/plugin-store/upgrade-craft`,
+ class: `edition-logo`,
+ },
+ [
+ S(`span`, Ce, x(_(t).edition.name), 1),
+ S(`span`, we, x(r.value), 1),
+ ],
+ 8,
+ Se
+ ),
+ ])
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-1a273d1c`]]
+ ),
+ Ee = {},
+ De = {class: `dev-mode`};
+function Oe(e, t) {
+ return (
+ u(),
+ w(`div`, De, [
+ ...(t[0] ||= [
+ S(
+ `div`,
+ {
+ class: `inline-flex py-1 px-2 bg-slate-900 text-slate-100 font-mono text-xs rounded-lg`,
+ },
+ ` Dev Mode is enabled `,
+ -1
+ ),
+ ]),
+ ])
+ );
+}
+var ke = b(Ee, [
+ [`render`, Oe],
+ [`__scopeId`, `data-v-2f910133`],
+ ]),
+ Ae = [`data-visibility`, `data-mode`, `aria-label`],
+ je = {class: `cp-sidebar__header`},
+ Me = {key: 0, class: `sidebar-header`},
+ Ne = [`label`],
+ Pe = {class: `cp-sidebar__body`},
+ Fe = {class: `cp-sidebar__footer`},
+ Ie = b(
+ i({
+ __name: `CpSidebar`,
+ props: {mode: {default: `floating`}, visibility: {default: `hidden`}},
+ emits: [`close`, `dock`],
+ setup(t, {emit: n}) {
+ let r = n,
+ i = h(() => t.mode === `floating`);
+ return (
+ o(
+ () => t.visibility,
+ async (e) => {
+ i.value &&
+ e === `visible` &&
+ (await c(),
+ document
+ .querySelector(`.cp-sidebar`)
+ .querySelector(
+ `button, [href], [tabindex]:not([tabindex="-1"])`
+ )
+ ?.focus());
+ }
+ ),
+ (n, i) => (
+ u(),
+ w(
+ `nav`,
+ {
+ class: `cp-sidebar`,
+ 'data-visibility': t.visibility,
+ 'data-mode': t.mode,
+ 'aria-label': _(e)(`Primary`),
+ },
+ [
+ t.visibility === `visible`
+ ? (u(),
+ w(
+ y,
+ {key: 0},
+ [
+ S(`div`, je, [
+ t.mode === `docked`
+ ? g(``, !0)
+ : (u(),
+ w(`div`, Me, [
+ d(fe),
+ (i[1] ||= S(
+ `div`,
+ {class: `ml-auto`},
+ null,
+ -1
+ )),
+ S(
+ `craft-button`,
+ {
+ size: `small`,
+ icon: ``,
+ onClick: (i[0] ||= (e) => r(`close`)),
+ type: `button`,
+ },
+ [
+ S(
+ `craft-icon`,
+ {
+ name: `x`,
+ style: {'font-size': `0.7em`},
+ label: _(e)(`Close`),
+ },
+ null,
+ 8,
+ Ne
+ ),
+ ]
+ ),
+ ])),
+ ]),
+ S(`div`, Pe, [d(ye)]),
+ S(`div`, Fe, [d(Te), d(ke)]),
+ ],
+ 64
+ ))
+ : g(``, !0),
+ ],
+ 8,
+ Ae
+ )
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-f97f612e`]]
+ ),
+ Le = [`aria-label`],
+ Re = {class: `breadcrumbs`},
+ ze = {key: 2, class: `separator`},
+ Be = b(
+ i({
+ __name: `Breadcrumbs`,
+ props: {items: {}, separator: {default: `/`}},
+ setup(t) {
+ return (n, i) => (
+ u(),
+ w(
+ `nav`,
+ {'aria-label': _(e)(`Breadcrumbs`)},
+ [
+ S(`ul`, Re, [
+ (u(!0),
+ w(
+ y,
+ null,
+ r(
+ t.items,
+ (e, n) => (
+ u(),
+ w(
+ `li`,
+ {
+ key: n,
+ class: l({
+ 'breadcrumb-item': !0,
+ 'breadcrumb-item--active': n === t.items.length - 1,
+ }),
+ },
+ [
+ e.url
+ ? (u(),
+ T(
+ k,
+ {key: 0, href: e.url},
+ {default: m(() => [C(x(e.label), 1)]), _: 2},
+ 1032,
+ [`href`]
+ ))
+ : (u(), w(y, {key: 1}, [C(x(e.label), 1)], 64)),
+ n < t.items.length - 1
+ ? (u(), w(`span`, ze, x(t.separator), 1))
+ : g(``, !0),
+ ],
+ 2
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ],
+ 8,
+ Le
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-7d9b5414`]]
+ ),
+ Ve = {key: 0, id: `global-live-region`, class: `sr-only`, role: `status`},
+ He = i({
+ __name: `LiveRegion`,
+ setup(e) {
+ let {announcement: t} = O();
+ return (e, n) => (
+ u(),
+ T(E, null, {
+ default: m(() => [
+ _(t) ? (u(), w(`div`, Ve, x(_(t)), 1)) : g(``, !0),
+ ]),
+ _: 1,
+ })
+ );
+ },
+ });
+function Ue(e) {
+ let r = v(),
+ i = h(() => e || r.props),
+ s = [],
+ c = () => {
+ for (; s.length; ) s.pop()?.();
+ };
+ return (
+ i.value &&
+ o(
+ () => ({headHtml: i.value.headHtml, bodyHtml: i.value.bodyHtml}),
+ async (e) => {
+ (c(),
+ e.headHtml && s.push(await t(e.headHtml)),
+ e.bodyHtml && s.push(await n(e.bodyHtml)));
+ },
+ {immediate: !0}
+ ),
+ a(c),
+ {appendHead: t, appendBody: n}
+ );
+}
+var We = {
+ type: `button`,
+ slot: `invoker`,
+ icon: ``,
+ size: `small`,
+ variant: `inherit`,
+ appearance: `plain`,
+ },
+ Ge = [`name`, `label`],
+ Ke = {slot: `content`, class: `m-sm`},
+ qe = {key: 0, class: `m-0`},
+ Je = [`href`],
+ Ye = [`onClick`],
+ I = b(
+ i({
+ __name: `ActionMenu`,
+ props: {
+ icon: {default: `ellipsis`},
+ label: {default: e(`Actions`)},
+ actions: {},
+ },
+ setup(e) {
+ let t = e,
+ n = h(() =>
+ t.actions.map((e) =>
+ e.type === `hr` || e.type === `display`
+ ? e
+ : `href` in e
+ ? {...e, label: e.label ?? ``, type: e.type ?? `link`}
+ : {
+ ...e,
+ label: e.label ?? ``,
+ type:
+ e.type ?? (`href` in e && e.href ? `link` : `button`),
+ }
+ )
+ ),
+ i = h(() =>
+ [...n.value].sort(
+ (e, t) =>
+ (`variant` in e && e.variant === `danger`) -
+ +(`variant` in t && t.variant === `danger`)
+ )
+ );
+ function a(e) {
+ if (e.type === `hr` || e.type === `display`) return {};
+ let t = {...e};
+ return (delete t.onClick, t);
+ }
+ function o(e, t) {
+ `onClick` in e && e.onClick?.(t);
+ }
+ return (t, n) => (
+ u(),
+ w(`craft-action-menu`, null, [
+ p(
+ t.$slots,
+ `invoker`,
+ {label: e.label, attributes: {slot: `invoker`}},
+ () => [
+ S(`craft-button`, We, [
+ S(`craft-icon`, {name: e.icon, label: e.label}, null, 8, Ge),
+ ]),
+ ],
+ !0
+ ),
+ S(`div`, Ke, [
+ (u(!0),
+ w(
+ y,
+ null,
+ r(
+ i.value,
+ (e, t) => (
+ u(),
+ w(
+ y,
+ {key: t},
+ [
+ e.type === `hr`
+ ? (u(), w(`hr`, qe))
+ : e.type === `display`
+ ? (u(), T(f(e.is), {key: 1}))
+ : e.type === `link`
+ ? (u(),
+ w(
+ `craft-action-item`,
+ s({key: 2, ref_for: !0}, a(e), {
+ href: e.href,
+ }),
+ x(e.label),
+ 17,
+ Je
+ ))
+ : (u(),
+ w(
+ `craft-action-item`,
+ s(
+ {key: 3, onClick: (t) => o(e, t)},
+ {ref_for: !0},
+ a(e)
+ ),
+ x(e.label),
+ 17,
+ Ye
+ )),
+ ],
+ 64
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ])
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-f186ebb5`]]
+ ),
+ Xe = {variant: `danger`, icon: `triangle-exclamation`, class: `mb-3`},
+ Ze = {slot: `title`, class: `font-bold`},
+ Qe = i({
+ __name: `ErrorSummary`,
+ props: {errors: {}},
+ setup(t) {
+ return (n, i) => (
+ u(),
+ w(`craft-callout`, Xe, [
+ S(`div`, Ze, x(_(e)(`Could not save settings`)), 1),
+ S(`ul`, null, [
+ (u(!0),
+ w(
+ y,
+ null,
+ r(t.errors, (e, t) => (u(), w(`li`, {key: t}, x(e), 1))),
+ 128
+ )),
+ ]),
+ ])
+ );
+ },
+ }),
+ $e = {
+ appearance: `fill`,
+ rounded: `start`,
+ class: `border border-b-neutral-border-quiet`,
+ },
+ et = i({
+ __name: `CalloutReadOnly`,
+ setup(t) {
+ return (t, n) => (
+ u(),
+ w(`craft-callout`, $e, [
+ (n[0] ||= S(
+ `craft-icon`,
+ {slot: `icon`, name: `custom-icons/gear-slash`},
+ null,
+ -1
+ )),
+ p(t.$slots, `default`, {}, () => [
+ C(
+ x(
+ _(e)(
+ `Changes to these settings arenʼt permitted in this environment.`
+ )
+ ),
+ 1
+ ),
+ ]),
+ ])
+ );
+ },
+ }),
+ L = (e) => ({url: L.url(e), method: `post`});
+((L.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/save-permissions`,
+}),
+ (L.url = (e) => L.definition.url + j(e)),
+ (L.post = (e) => ({url: L.url(e), method: `post`})));
+var R = (e) => ({url: R.url(e), method: `get`});
+((R.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/myaccount/permissions`,
+}),
+ (R.url = (e) => R.definition.url + j(e)),
+ (R.get = (e) => ({url: R.url(e), method: `get`})),
+ (R.head = (e) => ({url: R.url(e), method: `head`})));
+var z = (e, t) => ({url: z.url(e, t), method: `get`});
+((z.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/users/{userId}/permissions`,
+}),
+ (z.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {userId: e}),
+ Array.isArray(e) && (e = {userId: e[0]}),
+ (e = N(e)));
+ let n = {userId: e.userId};
+ return (
+ z.definition.url
+ .replace(`{userId}`, n.userId.toString())
+ .replace(/\/+$/, ``) + j(t)
+ );
+ }),
+ (z.get = (e, t) => ({url: z.url(e, t), method: `get`})),
+ (z.head = (e, t) => ({url: z.url(e, t), method: `head`})));
+var tt = {
+ store: L,
+ index: {
+ '/admin/myaccount/permissions': R,
+ '/admin/users/{userId}/permissions': z,
+ },
+ },
+ B = (e) => ({url: B.url(e), method: `post`});
+((B.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/save-preferences`,
+}),
+ (B.url = (e) => B.definition.url + j(e)),
+ (B.post = (e) => ({url: B.url(e), method: `post`})));
+var V = (e) => ({url: V.url(e), method: `get`});
+((V.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/myaccount/preferences`,
+}),
+ (V.url = (e) => V.definition.url + j(e)),
+ (V.get = (e) => ({url: V.url(e), method: `get`})),
+ (V.head = (e) => ({url: V.url(e), method: `head`})));
+var nt = {store: B, index: V},
+ H = (e) => ({url: H.url(e), method: `get`});
+((H.definition = {methods: [`get`, `head`], url: `/admin/myaccount`}),
+ (H.url = (e) => H.definition.url + j(e)),
+ (H.get = (e) => ({url: H.url(e), method: `get`})),
+ (H.head = (e) => ({url: H.url(e), method: `head`})));
+var U = (e, t) => ({url: U.url(e, t), method: `get`});
+((U.definition = {methods: [`get`, `head`], url: `/admin/users/{userId}`}),
+ (U.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {userId: e}),
+ Array.isArray(e) && (e = {userId: e[0]}),
+ (e = N(e)));
+ let n = {userId: e.userId};
+ return (
+ U.definition.url
+ .replace(`{userId}`, n.userId.toString())
+ .replace(/\/+$/, ``) + j(t)
+ );
+ }),
+ (U.get = (e, t) => ({url: U.url(e, t), method: `get`})),
+ (U.head = (e, t) => ({url: U.url(e, t), method: `head`})));
+var rt = {'/admin/myaccount': H, '/admin/users/{userId}': U},
+ W = (e) => ({url: W.url(e), method: `get`});
+((W.definition = {methods: [`get`, `head`], url: `/admin/users/new`}),
+ (W.url = (e) => W.definition.url + j(e)),
+ (W.get = (e) => ({url: W.url(e), method: `get`})),
+ (W.head = (e) => ({url: W.url(e), method: `head`})));
+var G = (e, t) => ({url: G.url(e, t), method: `get`});
+((G.definition = {methods: [`get`, `head`], url: `/admin/users/{slug?}`}),
+ (G.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {slug: e}),
+ Array.isArray(e) && (e = {slug: e[0]}),
+ (e = N(e)),
+ M(e, [`slug`]));
+ let n = {slug: e?.slug};
+ return (
+ G.definition.url
+ .replace(`{slug?}`, n.slug?.toString() ?? ``)
+ .replace(/\/+$/, ``) + j(t)
+ );
+ }),
+ (G.get = (e, t) => ({url: G.url(e, t), method: `get`})),
+ (G.head = (e, t) => ({url: G.url(e, t), method: `head`})));
+var it = {edit: rt, create: W, index: G},
+ at = [`innerHTML`],
+ ot = b(
+ i({
+ __name: `UserThumbnail`,
+ props: {size: {default: `sm`}},
+ setup(e) {
+ let {currentUser: t} = A(),
+ n = {sm: `size-7`, md: `size-10`},
+ r = e,
+ i = h(() => n[r.size]);
+ return (e, n) =>
+ _(t)?.thumbHtml
+ ? (u(),
+ w(
+ `div`,
+ {
+ key: 0,
+ innerHTML: _(t)?.thumbHtml,
+ 'data-color': `white`,
+ class: l({
+ 'user-thumbnail': !0,
+ 'rounded-full': !0,
+ [i.value]: !0,
+ }),
+ },
+ null,
+ 10,
+ at
+ ))
+ : g(``, !0);
+ },
+ }),
+ [[`__scopeId`, `data-v-162a57d0`]]
+ ),
+ st = [`href`],
+ ct = {class: `flex items-center gap-3`},
+ lt = {class: `font-bold`},
+ ut = {key: 0, class: `text-xs`},
+ dt = i({
+ __name: `CurrentUser`,
+ setup(e) {
+ let {currentUser: t} = A(),
+ n = h(() => (t.name === t.username ? t.username : t.name)),
+ r = h(() => (t.username === t.name ? t.email : t.username));
+ return (e, t) => (
+ u(),
+ w(
+ `craft-action-item`,
+ {href: _(it).edit[`/admin/myaccount`]().url},
+ [
+ S(`div`, ct, [
+ d(ot, {size: `md`}),
+ S(`div`, null, [
+ S(`div`, lt, x(n.value), 1),
+ r.value === n.value
+ ? g(``, !0)
+ : (u(), w(`div`, ut, x(r.value), 1)),
+ ]),
+ ]),
+ ],
+ 8,
+ st
+ )
+ );
+ },
+ }),
+ K = (e) => ({url: K.url(e), method: `post`});
+((K.definition = {
+ methods: [`post`],
+ url: `/actions/users/send-password-reset-email`,
+}),
+ (K.url = (e) => K.definition.url + j(e)),
+ (K.post = (e) => ({url: K.url(e), method: `post`})));
+var q = (e) => ({url: q.url(e), method: `post`});
+((q.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/send-password-reset-email`,
+}),
+ (q.url = (e) => q.definition.url + j(e)),
+ (q.post = (e) => ({url: q.url(e), method: `post`})));
+var ft = {
+ '/actions/users/send-password-reset-email': K,
+ '/admin/actions/users/send-password-reset-email': q,
+ },
+ J = (e) => ({url: J.url(e), method: `post`});
+((J.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/save-password`,
+}),
+ (J.url = (e) => J.definition.url + j(e)),
+ (J.post = (e) => ({url: J.url(e), method: `post`})));
+var Y = (e) => ({url: Y.url(e), method: `post`});
+((Y.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/get-password-reset-url`,
+}),
+ (Y.url = (e) => Y.definition.url + j(e)),
+ (Y.post = (e) => ({url: Y.url(e), method: `post`})));
+var X = (e) => ({url: X.url(e), method: `post`});
+((X.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/require-password-reset`,
+}),
+ (X.url = (e) => X.definition.url + j(e)),
+ (X.post = (e) => ({url: X.url(e), method: `post`})));
+var Z = (e) => ({url: Z.url(e), method: `post`});
+((Z.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/remove-password-reset-requirement`,
+}),
+ (Z.url = (e) => Z.definition.url + j(e)),
+ (Z.post = (e) => ({url: Z.url(e), method: `post`})));
+var Q = (e) => ({url: Q.url(e), method: `post`});
+((Q.definition = {
+ methods: [`post`],
+ url: `/admin/actions/users/verify-password`,
+}),
+ (Q.url = (e) => Q.definition.url + j(e)),
+ (Q.post = (e) => ({url: Q.url(e), method: `post`})));
+var $ = (e) => ({url: $.url(e), method: `get`});
+(($.definition = {methods: [`get`, `head`], url: `/admin/myaccount/password`}),
+ ($.url = (e) => $.definition.url + j(e)),
+ ($.get = (e) => ({url: $.url(e), method: `get`})),
+ ($.head = (e) => ({url: $.url(e), method: `head`})));
+var pt = {
+ sendPasswordResetEmail: ft,
+ store: J,
+ passwordResetUrl: Y,
+ requireReset: X,
+ removeResetRequirement: Z,
+ verifyPassword: Q,
+ index: $,
+ },
+ mt = {
+ slot: `invoker`,
+ type: `button`,
+ 'aria-label': `User menu`,
+ appearance: `none`,
+ },
+ ht = b(
+ i({
+ __name: `UserMenu`,
+ setup(t) {
+ let {currentUser: n} = A(),
+ r = h(() => [
+ {type: `display`, is: dt},
+ {type: `hr`},
+ {href: it.edit[`/admin/myaccount`]().url, label: e(`Profile`)},
+ {
+ href: tt.index[`/admin/myaccount/permissions`]().url,
+ label: e(`Permissions`),
+ },
+ {href: nt.index().url, label: e(`Preferences`)},
+ {href: pt.index().url, label: e(`Password & Verification`)},
+ {type: `hr`},
+ {href: P.logout().url, variant: `danger`, label: e(`Sign out`)},
+ ]);
+ return (e, t) => (
+ u(),
+ T(
+ I,
+ {actions: r.value, label: _(n).username},
+ {invoker: m(() => [S(`craft-button`, mt, [d(ot)])]), _: 1},
+ 8,
+ [`actions`, `label`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-95363afd`]]
+ ),
+ gt = {key: 0, variant: `danger`, rounded: `none`},
+ _t = {key: 1, variant: `success`, rounded: `none`},
+ vt = i({
+ __name: `FlashMessages`,
+ setup(e) {
+ let {messages: t} = D(),
+ {announce: n} = O(),
+ r = v(),
+ i = h(() => r.props.flash?.error ?? t.value.error ?? null),
+ a = h(() => r.props.flash?.success ?? t.value.success ?? null);
+ return (
+ o(a, (e) => n(e)),
+ o(i, (e) => n(e)),
+ (e, t) => (
+ u(),
+ w(`div`, null, [
+ i.value ? (u(), w(`craft-callout`, gt, x(i.value), 1)) : g(``, !0),
+ a.value ? (u(), w(`craft-callout`, _t, x(a.value), 1)) : g(``, !0),
+ ])
+ )
+ );
+ },
+ }),
+ yt = {class: `cp`},
+ bt = {class: `cp__header`},
+ xt = [`href`],
+ St = {class: `flex gap-2 p-2`},
+ Ct = [`name`, `label`],
+ wt = {icon: ``, appearance: `plain`, type: `button`},
+ Tt = [`label`],
+ Et = {class: `cp__sidebar`},
+ Dt = {class: `cp__main`},
+ Ot = {key: 0, class: `px-4 py-2 border-b border-b-neutral-border-quiet`},
+ kt = {id: `main`, tabindex: `-1`},
+ At = {class: `index-grid index-grid--header`},
+ jt = {class: `index-grid__aside`},
+ Mt = {class: `text-xl`},
+ Nt = {class: `index-grid__main`},
+ Pt = {key: 0, class: `flex items-center justify-end gap-2`},
+ Ft = [`loading`],
+ It = {slot: `invoker`, variant: `accent`, type: `button`, icon: ``},
+ Lt = [`label`],
+ Rt = {class: `cp__footer`},
+ zt = {
+ key: 0,
+ class: `fixed bottom-2 right-2 flex gap-2 justify-end items-center p-2`,
+ },
+ Bt = {class: `bg-blue-50 border border-blue-500 py-1 px-4 rounded`},
+ Vt = [`label`],
+ Ht = [`label`],
+ Ut = b(
+ i({
+ __name: `AppLayout`,
+ props: {
+ title: {},
+ debug: {},
+ fullWidth: {type: Boolean, default: !1},
+ form: {default: null},
+ formActions: {},
+ formAdditionalActions: {},
+ additionalSkipLinks: {},
+ },
+ emits: [`save`],
+ setup(t, {emit: n}) {
+ ne((e) => ({v8776187c: me.value}));
+ let i = n,
+ a = t,
+ s = v(),
+ {errorFlash: c, successFlash: b} = se(),
+ C = h(() => s.props.crumbs ?? null),
+ E = h(() => [
+ {label: e(`Skip to main section`), url: `#main`},
+ ...(a.additionalSkipLinks ?? []),
+ ]),
+ D = h(() => s.props.readOnly),
+ k = ae(`sidebarToggle`),
+ {announcement: A, announce: j} = O();
+ (o(b, (e) => j(e)), o(c, (e) => j(e)), Ue());
+ let M = re({sidebar: {mode: `floating`, visibility: `hidden`}}),
+ N = le(`(min-width: 1024px)`),
+ P = te(!1),
+ F = h(() => a.title?.trim() ?? s.props.title);
+ o(
+ N,
+ (e) => {
+ e
+ ? ((M.sidebar.mode = `docked`),
+ (M.sidebar.visibility = `visible`))
+ : ((M.sidebar.mode = `floating`),
+ (M.sidebar.visibility = `hidden`));
+ },
+ {immediate: !0}
+ );
+ function ue() {
+ M.sidebar.visibility === `visible`
+ ? (M.sidebar.visibility = `hidden`)
+ : (M.sidebar.visibility = `visible`);
+ }
+ function de() {
+ ((M.sidebar.visibility = `hidden`), k.value.focus());
+ }
+ let pe = h(() => (M.sidebar.visibility === `visible` ? `x` : `bars`)),
+ me = h(() =>
+ M.sidebar.mode === `docked`
+ ? M.sidebar.visibility === `visible`
+ ? `var(--global-sidebar-width)`
+ : `0`
+ : `auto`
+ );
+ return (n, a) => (
+ u(),
+ w(
+ y,
+ null,
+ [
+ d(_(ee), {title: F.value}, null, 8, [`title`]),
+ d(He, {debug: !0}),
+ S(`div`, yt, [
+ S(`header`, bt, [
+ (u(!0),
+ w(
+ y,
+ null,
+ r(
+ E.value,
+ (e) => (
+ u(),
+ w(
+ `a`,
+ {
+ key: e.url,
+ href: e.url,
+ class: `skip-link skip-link--global`,
+ },
+ x(e.label),
+ 9,
+ xt
+ )
+ )
+ ),
+ 128
+ )),
+ S(`div`, St, [
+ _(N)
+ ? g(``, !0)
+ : (u(),
+ w(
+ `craft-button`,
+ {
+ key: 0,
+ icon: ``,
+ type: `button`,
+ appearance: `plain`,
+ onClick: ue,
+ ref_key: `sidebarToggle`,
+ ref: k,
+ },
+ [
+ S(
+ `craft-icon`,
+ {name: pe.value, label: _(e)(`Toggle menu`)},
+ null,
+ 8,
+ Ct
+ ),
+ ],
+ 512
+ )),
+ _(N) ? (u(), T(fe, {key: 1})) : g(``, !0),
+ (a[3] ||= S(`div`, {class: `ml-auto`}, null, -1)),
+ S(`craft-button`, wt, [
+ S(
+ `craft-icon`,
+ {name: `search`, label: _(e)(`Search`)},
+ null,
+ 8,
+ Tt
+ ),
+ ]),
+ d(ht),
+ ]),
+ d(vt),
+ ]),
+ S(`div`, Et, [
+ d(
+ Ie,
+ {
+ mode: M.sidebar.mode,
+ visibility: M.sidebar.visibility,
+ onClose: de,
+ },
+ null,
+ 8,
+ [`mode`, `visibility`]
+ ),
+ ]),
+ S(`div`, Dt, [
+ p(
+ n.$slots,
+ `main`,
+ {},
+ () => [
+ p(
+ n.$slots,
+ `breadcrumbs`,
+ {},
+ () => [
+ C.value
+ ? (u(),
+ w(`div`, Ot, [
+ d(Be, {items: C.value}, null, 8, [`items`]),
+ ]))
+ : g(``, !0),
+ ],
+ !0
+ ),
+ S(`main`, kt, [
+ (u(),
+ T(
+ f(t.form ? `form` : `div`),
+ {
+ method: `post`,
+ onSubmit: (a[0] ||= ie(
+ (e) => i(`save`),
+ [`prevent`]
+ )),
+ },
+ {
+ default: m(() => [
+ p(
+ n.$slots,
+ `header`,
+ {},
+ () => [
+ S(
+ `div`,
+ {
+ class: l({
+ container: !0,
+ 'container--full': t.fullWidth,
+ }),
+ },
+ [
+ S(`div`, At, [
+ S(`div`, jt, [
+ p(
+ n.$slots,
+ `title`,
+ {},
+ () => [S(`h1`, Mt, x(F.value), 1)],
+ !0
+ ),
+ p(
+ n.$slots,
+ `title-badge`,
+ {},
+ void 0,
+ !0
+ ),
+ ]),
+ S(`div`, Nt, [
+ p(
+ n.$slots,
+ `actions`,
+ {},
+ () => [
+ t.form
+ ? (u(),
+ w(
+ y,
+ {key: 0},
+ [
+ d(
+ ce,
+ {
+ 'is-active':
+ t.form
+ .recentlySuccessful ||
+ t.form.hasErrors,
+ },
+ null,
+ 8,
+ [`is-active`]
+ ),
+ D.value
+ ? g(``, !0)
+ : (u(),
+ w(`div`, Pt, [
+ S(
+ `craft-button-group`,
+ null,
+ [
+ S(
+ `craft-button`,
+ {
+ type: `submit`,
+ variant: `accent`,
+ loading:
+ t.form
+ .processing,
+ },
+ x(
+ _(e)(`Save`)
+ ),
+ 9,
+ Ft
+ ),
+ d(
+ I,
+ {
+ icon: `chevron-down`,
+ actions: [
+ {
+ label:
+ _(e)(
+ `Save and continue editing`
+ ),
+ onClick:
+ () =>
+ i(
+ `save`,
+ {
+ redirect:
+ !1,
+ }
+ ),
+ shortcut: `S`,
+ },
+ ...(t.formActions ??
+ []),
+ ],
+ },
+ {
+ invoker: m(
+ ({
+ label:
+ e,
+ }) => [
+ S(
+ `craft-button`,
+ It,
+ [
+ S(
+ `craft-icon`,
+ {
+ name: `chevron-down`,
+ label:
+ e,
+ },
+ null,
+ 8,
+ Lt
+ ),
+ ]
+ ),
+ ]
+ ),
+ _: 1,
+ },
+ 8,
+ [`actions`]
+ ),
+ ]
+ ),
+ t
+ .formAdditionalActions
+ ?.length
+ ? (u(),
+ T(
+ I,
+ {
+ key: 0,
+ actions:
+ t.formAdditionalActions,
+ },
+ null,
+ 8,
+ [`actions`]
+ ))
+ : g(``, !0),
+ ])),
+ ],
+ 64
+ ))
+ : g(``, !0),
+ ],
+ !0
+ ),
+ ]),
+ ]),
+ ],
+ 2
+ ),
+ ],
+ !0
+ ),
+ S(
+ `div`,
+ {
+ class: l({
+ container: !0,
+ 'container--full': t.fullWidth,
+ }),
+ },
+ [
+ t.form && t.form.hasErrors
+ ? (u(),
+ T(
+ Qe,
+ {key: 0, errors: t.form.errors},
+ null,
+ 8,
+ [`errors`]
+ ))
+ : g(``, !0),
+ D.value ? (u(), T(et, {key: 1})) : g(``, !0),
+ p(n.$slots, `default`, {}, void 0, !0),
+ ],
+ 2
+ ),
+ ]),
+ _: 3,
+ },
+ 32
+ )),
+ ]),
+ ],
+ !0
+ ),
+ ]),
+ S(`div`, Rt, [
+ S(`footer`, null, [
+ S(
+ `div`,
+ {
+ class: l({
+ container: !0,
+ 'container--full': t.fullWidth,
+ }),
+ },
+ [p(n.$slots, `footer`, {}, void 0, !0)],
+ 2
+ ),
+ ]),
+ ]),
+ ]),
+ t.debug
+ ? (u(),
+ w(`div`, zt, [
+ S(`div`, Bt, x(_(A) ?? `No announcement`), 1),
+ S(`div`, null, [
+ P.value
+ ? (u(),
+ T(
+ oe,
+ {
+ key: 0,
+ data: t.debug,
+ class: `max-h-[50vh] max-w-[600px] overflow-scroll absolute transform -translate-full`,
+ },
+ null,
+ 8,
+ [`data`]
+ ))
+ : g(``, !0),
+ P.value
+ ? (u(),
+ w(
+ `craft-button`,
+ {
+ key: 1,
+ icon: ``,
+ type: `button`,
+ onClick: (a[1] ||= (e) => (P.value = !1)),
+ },
+ [
+ S(
+ `craft-icon`,
+ {label: _(e)(`Close Debug panel`), name: `x`},
+ null,
+ 8,
+ Vt
+ ),
+ ]
+ ))
+ : (u(),
+ w(
+ `craft-button`,
+ {
+ key: 2,
+ type: `button`,
+ onClick: (a[2] ||= (e) => (P.value = !0)),
+ icon: ``,
+ },
+ [
+ S(
+ `craft-icon`,
+ {
+ name: `code`,
+ label: _(e)(`Show debug variables`),
+ },
+ null,
+ 8,
+ Ht
+ ),
+ ]
+ )),
+ ]),
+ ]))
+ : g(``, !0),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-f0a51610`]]
+ );
+export {et as n, I as r, Ut as t};
diff --git a/resources/build/assets/Badge-B_Mkh-0t.js b/resources/build/assets/Badge-B_Mkh-0t.js
new file mode 100644
index 00000000000..36be40151fb
--- /dev/null
+++ b/resources/build/assets/Badge-B_Mkh-0t.js
@@ -0,0 +1,37 @@
+import {
+ E as e,
+ R as t,
+ V as n,
+ _ as r,
+ v as i,
+ x as a,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var o = [`variant`],
+ s = [`variant`],
+ c = e({
+ __name: `Badge`,
+ props: {variant: {default: `default`}},
+ setup(e) {
+ let c = e,
+ l = r(() => (c.variant === `default` ? `empty` : c.variant));
+ return (r, c) => (
+ t(),
+ a(
+ `craft-callout`,
+ {
+ variant: e.variant,
+ size: `small`,
+ class: `items-center`,
+ inline: ``,
+ },
+ [
+ i(`craft-indicator`, {slot: `icon`, variant: l.value}, null, 8, s),
+ i(`span`, null, [n(r.$slots, `default`)]),
+ ],
+ 8,
+ o
+ )
+ );
+ },
+ });
+export {c as t};
diff --git a/resources/build/assets/CheckboxGroup-tx-Aecav.js b/resources/build/assets/CheckboxGroup-tx-Aecav.js
new file mode 100644
index 00000000000..9a623310667
--- /dev/null
+++ b/resources/build/assets/CheckboxGroup-tx-Aecav.js
@@ -0,0 +1,154 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ R as r,
+ V as i,
+ b as a,
+ ht as o,
+ m as s,
+ tt as c,
+ v as l,
+ w as u,
+ x as d,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var f = [`name`, `label`, `.modelValue`, `disabled`],
+ p = [`label`],
+ m = [`.choiceValue`, `.checked`, `.disabled`],
+ h = {slot: `label`},
+ g = [`innerHTML`],
+ _ = [`.choiceValue`, `.checked`, `.disabled`],
+ v = {slot: `label`},
+ y = [`innerHTML`],
+ b = n({
+ __name: `CheckboxGroup`,
+ props: {
+ name: {},
+ label: {},
+ disabled: {type: Boolean},
+ modelValue: {},
+ options: {},
+ allowSelectAll: {type: Boolean, default: !1},
+ },
+ emits: [`update:modelValue`],
+ setup(n, {emit: b}) {
+ let x = b;
+ function S(e) {
+ let t = e.target;
+ x(`update:modelValue`, t.modelValue);
+ }
+ return (b, x) => (
+ r(),
+ d(
+ `craft-checkbox-group`,
+ {
+ name: n.name,
+ label: n.label,
+ '.modelValue': n.modelValue,
+ onModelValueChanged: S,
+ disabled: n.disabled,
+ },
+ [
+ n.allowSelectAll
+ ? (r(),
+ d(
+ `craft-checkbox-indeterminate`,
+ {key: 0, label: o(e)(`All`)},
+ [
+ (r(!0),
+ d(
+ s,
+ null,
+ t(
+ n.options,
+ (e) => (
+ r(),
+ d(
+ `craft-checkbox`,
+ {
+ key: e.value,
+ '.choiceValue': e.value,
+ '.checked': e.checked,
+ '.disabled': e.disabled,
+ },
+ [
+ l(`label`, h, [
+ i(b.$slots, `label`, {option: e}, () => [
+ u(c(e.label), 1),
+ ]),
+ ]),
+ e.info
+ ? (r(),
+ d(
+ `div`,
+ {
+ key: 0,
+ slot: `help-text`,
+ innerHTML: e.info,
+ },
+ null,
+ 8,
+ g
+ ))
+ : a(``, !0),
+ ],
+ 40,
+ m
+ )
+ )
+ ),
+ 128
+ )),
+ ],
+ 8,
+ p
+ ))
+ : (r(!0),
+ d(
+ s,
+ {key: 1},
+ t(
+ n.options,
+ (e) => (
+ r(),
+ d(
+ `craft-checkbox`,
+ {
+ key: e.value,
+ '.choiceValue': e.value,
+ '.checked': e.checked,
+ '.disabled': e.disabled,
+ },
+ [
+ l(`label`, v, [
+ i(b.$slots, `label`, {option: e}, () => [
+ u(c(e.label), 1),
+ ]),
+ ]),
+ e.info
+ ? (r(),
+ d(
+ `div`,
+ {key: 0, slot: `help-text`, innerHTML: e.info},
+ null,
+ 8,
+ y
+ ))
+ : a(``, !0),
+ ],
+ 40,
+ _
+ )
+ )
+ ),
+ 128
+ )),
+ ],
+ 40,
+ f
+ )
+ );
+ },
+ });
+export {b as t};
diff --git a/resources/build/assets/CpGlobalSidebar-bdcF6kou.js b/resources/build/assets/CpGlobalSidebar-bdcF6kou.js
new file mode 100644
index 00000000000..9755fb0e032
--- /dev/null
+++ b/resources/build/assets/CpGlobalSidebar-bdcF6kou.js
@@ -0,0 +1,51 @@
+import {n as e} from './rolldown-runtime-DXc-PV0M.js';
+import {t} from './lit-BpPOIUnZ.js';
+import {a as n, n as r, o as i, r as a} from './decorators-BOwDFZC2.js';
+import {t as o} from './decorate-CxrcuNn9.js';
+var s = e({}),
+ c = class extends t {
+ constructor(...e) {
+ (super(...e), (this.state = Craft.getCookie(`sidebar`) ?? `expanded`));
+ }
+ connectedCallback() {
+ (super.connectedCallback(),
+ this.trigger &&
+ (this.trigger.addEventListener(`open`, this.expand.bind(this)),
+ this.trigger.addEventListener(`close`, this.collapse.bind(this))),
+ this.state === `expanded` ? this.expand() : this.collapse());
+ }
+ disconnectedCallback() {
+ (super.disconnectedCallback(),
+ this.trigger &&
+ (this.trigger.removeEventListener(`open`, this.expand.bind(this)),
+ this.trigger.removeEventListener(`close`, this.collapse.bind(this))),
+ (this.state = `expanded`));
+ }
+ itemHasTooltip(e) {
+ return e.querySelector(`craft-tooltip`);
+ }
+ createTooltips() {
+ this.items?.forEach((e) => e.setAttribute(`icon-only`, !0));
+ }
+ destroyTooltips() {
+ this.items?.forEach((e) => e.removeAttribute(`icon-only`));
+ }
+ expand() {
+ (document.body.setAttribute(`data-sidebar`, `expanded`),
+ Craft.setCookie(`sidebar`, `expanded`),
+ this.destroyTooltips());
+ }
+ collapse() {
+ (document.body.setAttribute(`data-sidebar`, `collapsed`),
+ Craft.setCookie(`sidebar`, `collapsed`),
+ this.createTooltips());
+ }
+ createRenderRoot() {
+ return this;
+ }
+ };
+(o([r(`craft-nav-item`)], c.prototype, `items`, void 0),
+ o([a(`#sidebar-trigger`)], c.prototype, `trigger`, void 0),
+ o([n({reflect: !0})], c.prototype, `state`, void 0),
+ (c = o([i(`cp-global-sidebar`)], c)));
+export {s as t};
diff --git a/resources/build/assets/CpQueueIndicator-DlQrK62s.js b/resources/build/assets/CpQueueIndicator-DlQrK62s.js
new file mode 100644
index 00000000000..936f487939d
--- /dev/null
+++ b/resources/build/assets/CpQueueIndicator-DlQrK62s.js
@@ -0,0 +1,123 @@
+import {n as e} from './rolldown-runtime-DXc-PV0M.js';
+import {m as t} from './cp-npqTfNqh.js';
+import {c as n, f as r, r as i, t as a} from './lit-BpPOIUnZ.js';
+import {a as o, o as s} from './decorators-BOwDFZC2.js';
+import {t as c} from './decorate-CxrcuNn9.js';
+var l = {Pending: 1, Reserved: 2, Done: 3, Failed: 4, Delayed: 5, Cancelled: 6},
+ u = e({default: () => f}),
+ d = class extends a {
+ constructor(...e) {
+ (super(...e),
+ (this.displayedJob = null),
+ (this.hasReservedJobs = !1),
+ (this.hasWaitingJobs = !1),
+ (this.#e = t.getInstance()),
+ (this.#t = (e) => {
+ this.displayedJob = e.detail.displayedJob;
+ }));
+ }
+ static {
+ this.styles = r`
+ :host {
+ display: contents;
+ }
+
+ :host(:not([visible])) {
+ display: none;
+ }
+
+ .progress-label {
+ font-size: 0.85em;
+ opacity: 0.7;
+ }
+ `;
+ }
+ #e;
+ connectedCallback() {
+ (super.connectedCallback(),
+ (this.displayedJob ||= this.#e.displayedJob),
+ this.#e.addEventListener(`job-update`, this.#t),
+ this.#r(),
+ this.#n());
+ }
+ disconnectedCallback() {
+ (super.disconnectedCallback(),
+ this.#e.removeEventListener(`job-update`, this.#t));
+ }
+ update(e) {
+ (super.update(e),
+ (e.has(`hasReservedJobs`) || e.has(`hasWaitingJobs`)) && this.#n(),
+ e.has(`displayedJob`) && this.#r());
+ }
+ #t;
+ #n() {
+ this.hasReservedJobs
+ ? this.#e.startTracking()
+ : this.hasWaitingJobs && this.#e.runQueue();
+ }
+ #r() {
+ this.displayedJob
+ ? this.setAttribute(`visible`, ``)
+ : this.removeAttribute(`visible`);
+ }
+ get #i() {
+ return this.displayedJob
+ ? this.displayedJob.status.value === l.Failed
+ ? 100
+ : (this.displayedJob.progress ?? 0)
+ : 0;
+ }
+ get #a() {
+ return this.displayedJob?.status.value === l.Failed;
+ }
+ get #o() {
+ return this.#e.canAccessQueueManager
+ ? null
+ : window.Craft.getCpUrl(`utilities/queue-manager`);
+ }
+ render() {
+ return this.displayedJob
+ ? n`
+
+
+
+ ${this.displayedJob.description}
+ ${
+ this.displayedJob.progressLabel
+ ? n`${this.displayedJob.progressLabel} `
+ : i
+ }
+
+
+ `
+ : i;
+ }
+ };
+(c(
+ [o({type: Object, attribute: `displayed-job`})],
+ d.prototype,
+ `displayedJob`,
+ void 0
+),
+ c(
+ [o({type: Boolean, attribute: `has-reserved-jobs`})],
+ d.prototype,
+ `hasReservedJobs`,
+ void 0
+ ),
+ c(
+ [o({type: Boolean, attribute: `has-waiting-jobs`})],
+ d.prototype,
+ `hasWaitingJobs`,
+ void 0
+ ),
+ (d = c([s(`cp-queue-indicator`)], d)));
+var f = d;
+export {u as t};
diff --git a/resources/build/assets/CraftCombobox-NlyOETnv.js b/resources/build/assets/CraftCombobox-NlyOETnv.js
new file mode 100644
index 00000000000..3eecaac7f88
--- /dev/null
+++ b/resources/build/assets/CraftCombobox-NlyOETnv.js
@@ -0,0 +1,132 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ $ as t,
+ B as n,
+ E as r,
+ G as i,
+ K as a,
+ M as o,
+ N as s,
+ O as c,
+ R as l,
+ S as u,
+ T as d,
+ V as f,
+ X as p,
+ _ as m,
+ b as h,
+ ht as g,
+ tt as _,
+ v,
+ w as y,
+ x as b,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as x} from './InputCombobox-BGX5z3XZ.js';
+var S = [
+ `label`,
+ `id`,
+ `name`,
+ `disabled`,
+ `has-feedback-for`,
+ `require-options-match`,
+ ],
+ C = {slot: `after`},
+ w = {
+ key: 0,
+ variant: `info`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `lightbulb`,
+ },
+ T = {
+ href: `https://craftcms.com/docs/5.x/configure.html#control-panel-settings`,
+ },
+ E = {slot: `feedback`},
+ D = {key: 0, class: `error-list`},
+ O = r({
+ __name: `CraftCombobox`,
+ props: o(
+ {
+ label: {},
+ id: {},
+ name: {},
+ disabled: {type: Boolean},
+ options: {},
+ callouts: {},
+ error: {},
+ requireOptionMatch: {type: Boolean},
+ },
+ {modelValue: {type: [String, Number, Boolean]}, modelModifiers: {}}
+ ),
+ emits: [`update:modelValue`],
+ setup(r) {
+ let o = i(r, `modelValue`),
+ O = a(),
+ k = m(() => {
+ let {default: e, ...t} = O;
+ return t;
+ });
+ return (i, a) => (
+ l(),
+ b(
+ `craft-input`,
+ s(
+ {
+ label: r.label,
+ id: r.id,
+ name: r.name,
+ disabled: r.disabled,
+ 'has-feedback-for': r.error ? `error` : ``,
+ 'require-options-match': r.requireOptionMatch,
+ },
+ i.$attrs
+ ),
+ [
+ d(
+ x,
+ {
+ slot: `input`,
+ modelValue: o.value,
+ 'onUpdate:modelValue': (a[0] ||= (e) => (o.value = e)),
+ options: r.options,
+ label: r.label,
+ },
+ u({_: 2}, [
+ n(k.value, (e, n) => ({
+ name: n,
+ fn: p((e) => [f(i.$slots, n, t(c(e || {})))]),
+ })),
+ ]),
+ 1032,
+ [`modelValue`, `options`, `label`]
+ ),
+ v(`div`, C, [
+ f(i.$slots, `after`, {}, () => [
+ r.callouts?.includes(`envVars`)
+ ? (l(),
+ b(`craft-callout`, w, [
+ y(
+ _(
+ g(e)(`This can begin with an environment variable.`)
+ ) + ` `,
+ 1
+ ),
+ v(`a`, T, _(g(e)(`Learn more`)), 1),
+ ]))
+ : h(``, !0),
+ ]),
+ ]),
+ v(`div`, E, [
+ r.error
+ ? (l(), b(`ul`, D, [v(`li`, null, _(r.error), 1)]))
+ : h(``, !0),
+ ]),
+ ],
+ 16,
+ S
+ )
+ );
+ },
+ });
+export {O as t};
diff --git a/resources/build/assets/CraftInput-B2G9EaE3.js b/resources/build/assets/CraftInput-B2G9EaE3.js
new file mode 100644
index 00000000000..88875c5346f
--- /dev/null
+++ b/resources/build/assets/CraftInput-B2G9EaE3.js
@@ -0,0 +1,46 @@
+import {
+ E as e,
+ G as t,
+ M as n,
+ R as r,
+ V as i,
+ b as a,
+ tt as o,
+ v as s,
+ x as c,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var l = [`.modelValue`, `has-feedback-for`],
+ u = {slot: `feedback`},
+ d = {key: 0, class: `error-list`},
+ f = e({
+ name: `CraftInput`,
+ __name: `CraftInput`,
+ props: n({error: {}}, {modelValue: {}, modelModifiers: {}}),
+ emits: [`update:modelValue`],
+ setup(e) {
+ let n = t(e, `modelValue`);
+ return (t, f) => (
+ r(),
+ c(
+ `craft-input`,
+ {
+ '.modelValue': n.value,
+ onModelValueChanged: (f[0] ||= (e) =>
+ (n.value = e.target?.modelValue)),
+ 'has-feedback-for': e.error ? `error` : ``,
+ },
+ [
+ i(t.$slots, `default`),
+ s(`div`, u, [
+ e.error
+ ? (r(), c(`ul`, d, [s(`li`, null, o(e.error), 1)]))
+ : a(``, !0),
+ ]),
+ ],
+ 40,
+ l
+ )
+ );
+ },
+ });
+export {f as t};
diff --git a/resources/build/assets/CraftInputHandle-ByI6zEIo.js b/resources/build/assets/CraftInputHandle-ByI6zEIo.js
new file mode 100644
index 00000000000..b37a42cdb0b
--- /dev/null
+++ b/resources/build/assets/CraftInputHandle-ByI6zEIo.js
@@ -0,0 +1,46 @@
+import {
+ E as e,
+ G as t,
+ M as n,
+ R as r,
+ V as i,
+ b as a,
+ tt as o,
+ v as s,
+ x as c,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var l = [`.modelValue`, `has-feedback-for`],
+ u = {slot: `feedback`},
+ d = {key: 0, class: `error-list`},
+ f = e({
+ name: `CraftInputHandle`,
+ __name: `CraftInputHandle`,
+ props: n({error: {}}, {modelValue: {}, modelModifiers: {}}),
+ emits: [`update:modelValue`],
+ setup(e) {
+ let n = t(e, `modelValue`);
+ return (t, f) => (
+ r(),
+ c(
+ `craft-input-handle`,
+ {
+ '.modelValue': n.value,
+ onModelValueChanged: (f[0] ||= (e) =>
+ (n.value = e.target?.modelValue)),
+ 'has-feedback-for': e.error ? `error` : ``,
+ },
+ [
+ i(t.$slots, `default`),
+ s(`div`, u, [
+ e.error
+ ? (r(), c(`ul`, d, [s(`li`, null, o(e.error), 1)]))
+ : a(``, !0),
+ ]),
+ ],
+ 40,
+ l
+ )
+ );
+ },
+ });
+export {f as t};
diff --git a/resources/build/assets/CraftTextarea-BNsSoX8c.js b/resources/build/assets/CraftTextarea-BNsSoX8c.js
new file mode 100644
index 00000000000..e360f801b5d
--- /dev/null
+++ b/resources/build/assets/CraftTextarea-BNsSoX8c.js
@@ -0,0 +1,80 @@
+import {
+ E as e,
+ G as t,
+ M as n,
+ R as r,
+ V as i,
+ b as a,
+ tt as o,
+ v as s,
+ x as c,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var l = [`.checked`, `has-feedback-for`],
+ u = {slot: `feedback`},
+ d = {key: 0, class: `error-list`},
+ f = e({
+ name: `CraftCheckbox`,
+ __name: `CraftCheckbox`,
+ props: n({error: {}}, {modelValue: {type: Boolean}, modelModifiers: {}}),
+ emits: [`update:modelValue`],
+ setup(e) {
+ let n = t(e, `modelValue`);
+ return (t, f) => (
+ r(),
+ c(
+ `craft-checkbox`,
+ {
+ '.checked': n.value,
+ onModelValueChanged: (f[0] ||= (e) =>
+ (n.value = e.target?.checked)),
+ 'has-feedback-for': e.error ? `error` : ``,
+ },
+ [
+ i(t.$slots, `default`),
+ s(`div`, u, [
+ e.error
+ ? (r(), c(`ul`, d, [s(`li`, null, o(e.error), 1)]))
+ : a(``, !0),
+ ]),
+ ],
+ 40,
+ l
+ )
+ );
+ },
+ }),
+ p = [`.modelValue`, `has-feedback-for`],
+ m = {slot: `feedback`},
+ h = {key: 0, class: `error-list`},
+ g = e({
+ name: `CraftTextarea`,
+ __name: `CraftTextarea`,
+ props: n({error: {}}, {modelValue: {}, modelModifiers: {}}),
+ emits: [`update:modelValue`],
+ setup(e) {
+ let n = t(e, `modelValue`);
+ return (t, l) => (
+ r(),
+ c(
+ `craft-textarea`,
+ {
+ '.modelValue': n.value,
+ onModelValueChanged: (l[0] ||= (e) =>
+ (n.value = e.target?.modelValue)),
+ 'has-feedback-for': e.error ? `error` : ``,
+ },
+ [
+ i(t.$slots, `default`),
+ s(`div`, m, [
+ e.error
+ ? (r(), c(`ul`, h, [s(`li`, null, o(e.error), 1)]))
+ : a(``, !0),
+ ]),
+ ],
+ 40,
+ p
+ )
+ );
+ },
+ });
+export {f as n, g as t};
diff --git a/resources/build/assets/DeleteButton-BLk4eDvl.js b/resources/build/assets/DeleteButton-BLk4eDvl.js
new file mode 100644
index 00000000000..7151936955d
--- /dev/null
+++ b/resources/build/assets/DeleteButton-BLk4eDvl.js
@@ -0,0 +1,36 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {
+ E as t,
+ N as n,
+ R as r,
+ v as i,
+ x as a,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var o = [`name`, `label`],
+ s = t({
+ __name: `DeleteButton`,
+ props: {label: {default: e(`Delete item`)}, icon: {default: `x`}},
+ emits: [`click`],
+ setup(e, {emit: t}) {
+ let s = t;
+ return (t, c) => (
+ r(),
+ a(
+ `craft-button`,
+ n(
+ {
+ type: `button`,
+ onClick: (c[0] ||= (e) => s(`click`)),
+ size: `small`,
+ appearance: `plain`,
+ variant: `danger`,
+ },
+ t.$attrs
+ ),
+ [i(`craft-icon`, {name: e.icon, label: e.label}, null, 8, o)],
+ 16
+ )
+ );
+ },
+ });
+export {s as t};
diff --git a/resources/build/assets/DeleteSiteModal-BN07_W_D.js b/resources/build/assets/DeleteSiteModal-BN07_W_D.js
new file mode 100644
index 00000000000..6b063975df6
--- /dev/null
+++ b/resources/build/assets/DeleteSiteModal-BN07_W_D.js
@@ -0,0 +1,259 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ R as r,
+ X as i,
+ _ as a,
+ b as o,
+ ht as s,
+ l as c,
+ m as l,
+ r as u,
+ s as d,
+ tt as f,
+ v as p,
+ x as m,
+ y as h,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {n as g, t as _} from './wayfinder-V597ZF_3.js';
+import {t as v} from './ModalForm-ZyQ-Rf8C.js';
+var y = (e) => ({url: y.url(e), method: `get`});
+((y.definition = {methods: [`get`, `head`], url: `/admin/settings/sites`}),
+ (y.url = (e) => y.definition.url + g(e)),
+ (y.get = (e) => ({url: y.url(e), method: `get`})),
+ (y.head = (e) => ({url: y.url(e), method: `head`})));
+var b = (e) => ({url: b.url(e), method: `get`});
+((b.definition = {methods: [`get`, `head`], url: `/admin/settings/sites/new`}),
+ (b.url = (e) => b.definition.url + g(e)),
+ (b.get = (e) => ({url: b.url(e), method: `get`})),
+ (b.head = (e) => ({url: b.url(e), method: `head`})));
+var x = (e) => ({url: x.url(e), method: `post`});
+((x.definition = {methods: [`post`], url: `/admin/settings/sites/reorder`}),
+ (x.url = (e) => x.definition.url + g(e)),
+ (x.post = (e) => ({url: x.url(e), method: `post`})));
+var S = (e) => ({url: S.url(e), method: `post`});
+((S.definition = {methods: [`post`], url: `/admin/settings/sites`}),
+ (S.url = (e) => S.definition.url + g(e)),
+ (S.post = (e) => ({url: S.url(e), method: `post`})));
+var C = (e, t) => ({url: C.url(e, t), method: `delete`});
+((C.definition = {methods: [`delete`], url: `/admin/settings/sites/{site}`}),
+ (C.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {site: e}),
+ Array.isArray(e) && (e = {site: e[0]}),
+ (e = _(e)));
+ let n = {site: e.site};
+ return (
+ C.definition.url
+ .replace(`{site}`, n.site.toString())
+ .replace(/\/+$/, ``) + g(t)
+ );
+ }),
+ (C.delete = (e, t) => ({url: C.url(e, t), method: `delete`})));
+var w = (e, t) => ({url: w.url(e, t), method: `get`});
+((w.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/sites/{site}`,
+}),
+ (w.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {site: e}),
+ typeof e == `object` &&
+ !Array.isArray(e) &&
+ `id` in e &&
+ (e = {site: e.id}),
+ Array.isArray(e) && (e = {site: e[0]}),
+ (e = _(e)));
+ let n = {site: typeof e.site == `object` ? e.site.id : e.site};
+ return (
+ w.definition.url
+ .replace(`{site}`, n.site.toString())
+ .replace(/\/+$/, ``) + g(t)
+ );
+ }),
+ (w.get = (e, t) => ({url: w.url(e, t), method: `get`})),
+ (w.head = (e, t) => ({url: w.url(e, t), method: `head`})));
+var T = {class: `grid gap-3`},
+ E = [`label`, `help-text`, `.modelValue`],
+ D = [`label`, `checked`],
+ O = [`label`, `checked`],
+ k = [`label`],
+ A = [`label`, `.modelValue`],
+ j = {slot: `input`},
+ M = {value: ``},
+ N = [`selected`, `value`],
+ P = {slot: `feedback`},
+ F = {key: 0, class: `error-list`},
+ I = n({
+ __name: `DeleteSiteModal`,
+ props: {open: {type: Boolean, default: !1}, site: {}},
+ emits: [`close`],
+ setup(n, {emit: g}) {
+ let _ = g,
+ y = n,
+ b = c(),
+ x = a(() =>
+ b.props.transferContentOptions
+ ? b.props.transferContentOptions.filter((e) => e.id !== y.site.id)
+ : []
+ ),
+ S = d({
+ id: y.site.id,
+ contentDestination: `transfer`,
+ transferContentTo: null,
+ });
+ async function w() {
+ I();
+ }
+ function I() {
+ S.clearErrors().delete(C(y.site.id).url, {
+ onSuccess: () => {
+ (_(`close`), S.reset());
+ },
+ });
+ }
+ function L() {
+ (_(`close`), S.clearErrors(), S.reset());
+ }
+ return (a, c) => (
+ r(),
+ h(
+ v,
+ {
+ title: s(e)(`Delete {site}`, {site: n.site.name}),
+ 'is-active': n.open,
+ onClose: L,
+ onSubmit: w,
+ loading: s(S).processing,
+ 'submit-label': s(e)(`Delete`),
+ },
+ {
+ default: i(() => [
+ p(`div`, T, [
+ p(
+ `craft-radio-group`,
+ {
+ name: `contentDestination`,
+ label: s(e)(`Content Destination`),
+ 'help-text': s(e)(
+ `What do you want to do with any content that is only available in {siteName}?`,
+ {siteName: n.site.name}
+ ),
+ '.modelValue': s(S).contentDestination,
+ onModelValueChanged: (c[0] ||= (e) =>
+ (s(S).contentDestination = e.target.modelValue)),
+ },
+ [
+ p(
+ `craft-radio`,
+ {
+ label: s(e)(`Transfer it`),
+ '.choiceValue': `transfer`,
+ checked: s(S).contentDestination === `transfer`,
+ },
+ null,
+ 40,
+ D
+ ),
+ p(
+ `craft-radio`,
+ {
+ label: s(e)(`Delete it`),
+ '.choiceValue': `delete`,
+ checked: s(S).contentDestination === `delete`,
+ },
+ null,
+ 40,
+ O
+ ),
+ ],
+ 40,
+ E
+ ),
+ s(S).contentDestination === `transfer`
+ ? (r(),
+ h(
+ s(u),
+ {key: 0, data: `transferContentOptions`},
+ {
+ fallback: i(() => [
+ p(
+ `craft-input`,
+ {disabled: ``, label: s(e)(`Transfer content to`)},
+ null,
+ 8,
+ k
+ ),
+ ]),
+ default: i(() => [
+ p(
+ `craft-select`,
+ {
+ label: s(e)(`Transfer content to`),
+ id: `transfer-to`,
+ name: `transferContentTo`,
+ '.modelValue': s(S).transferContentTo,
+ onModelValueChanged: (c[1] ||= (e) =>
+ (s(S).transferContentTo = e.target.modelValue)),
+ },
+ [
+ p(`select`, j, [
+ p(`option`, M, f(s(e)(`Select site`)), 1),
+ (r(!0),
+ m(
+ l,
+ null,
+ t(
+ x.value,
+ (e) => (
+ r(),
+ m(
+ `option`,
+ {
+ key: e.id,
+ selected:
+ e.id === s(S).transferContentTo,
+ value: e.id,
+ },
+ f(e.name),
+ 9,
+ N
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ p(`div`, P, [
+ s(S).errors?.transferContentTo
+ ? (r(),
+ m(`ul`, F, [
+ p(
+ `li`,
+ null,
+ f(s(S).errors.transferContentTo),
+ 1
+ ),
+ ]))
+ : o(``, !0),
+ ]),
+ ],
+ 40,
+ A
+ ),
+ ]),
+ _: 1,
+ }
+ ))
+ : o(``, !0),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `is-active`, `loading`, `submit-label`]
+ )
+ );
+ },
+ });
+export {S as a, x as i, b as n, w as r, I as t};
diff --git a/resources/build/assets/DynamicHtmlRenderer-tRw5R4gl.js b/resources/build/assets/DynamicHtmlRenderer-tRw5R4gl.js
new file mode 100644
index 00000000000..aac2383d913
--- /dev/null
+++ b/resources/build/assets/DynamicHtmlRenderer-tRw5R4gl.js
@@ -0,0 +1,18 @@
+import {
+ E as e,
+ R as t,
+ U as n,
+ _ as r,
+ b as i,
+ y as a,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var o = e({
+ __name: `DynamicHtmlRenderer`,
+ props: {html: {}},
+ setup(o) {
+ let s = o,
+ c = r(() => e({template: s.html}));
+ return (e, r) => (o.html ? (t(), a(n(c.value), {key: 0})) : i(``, !0));
+ },
+});
+export {o as t};
diff --git a/resources/build/assets/Edit-ClqiDVzJ.js b/resources/build/assets/Edit-ClqiDVzJ.js
new file mode 100644
index 00000000000..21aceee60f9
--- /dev/null
+++ b/resources/build/assets/Edit-ClqiDVzJ.js
@@ -0,0 +1,629 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ G as r,
+ I as i,
+ J as a,
+ M as o,
+ P as s,
+ Q as c,
+ R as l,
+ T as u,
+ V as d,
+ X as f,
+ _ as p,
+ b as m,
+ et as h,
+ gt as g,
+ ht as _,
+ m as v,
+ p as y,
+ q as b,
+ s as x,
+ t as S,
+ tt as C,
+ ut as w,
+ v as T,
+ x as E,
+ y as D,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as O} from './Select-uUcGssK_.js';
+import {t as k} from './Pane-CJi1MPPH.js';
+import {t as A} from './AppLayout-BXGMFlSp.js';
+import {t as j} from './CraftCombobox-NlyOETnv.js';
+import {t as M} from './useSettingsSave-D5LL4sJi.js';
+import {a as N, o as P} from './RoutesController-u0nRHqnp.js';
+var F = [
+ `data-mixed-input-index`,
+ `aria-pressed`,
+ `disabled`,
+ `onClick`,
+ `onFocus`,
+ `onKeydown`,
+ ],
+ I = [
+ `value`,
+ `data-mixed-input-index`,
+ `aria-label`,
+ `disabled`,
+ `onInput`,
+ `onFocus`,
+ `onClick`,
+ `onKeyup`,
+ `onKeydown`,
+ ],
+ L = 20,
+ R = S(
+ n({
+ __name: `MixedInput`,
+ props: o(
+ {
+ disabled: {type: Boolean, default: !1},
+ invalid: {type: Boolean, default: !1},
+ ariaLabel: {default: () => e(`Input`)},
+ },
+ {modelValue: {required: !0}, modelModifiers: {}}
+ ),
+ emits: [`update:modelValue`],
+ setup(e, {expose: n}) {
+ let o = r(e, `modelValue`),
+ u = b(`root`),
+ f = b(`textMeasure`),
+ p = w(null),
+ m = w(null),
+ g = w({});
+ function _(e) {
+ return Array.isArray(e);
+ }
+ function x(e) {
+ return g.value[e] ?? `${L}px`;
+ }
+ function S(e) {
+ let t = f.value;
+ return t
+ ? ((t.textContent = e),
+ Math.ceil(t.getBoundingClientRect().width + L))
+ : L;
+ }
+ function D() {
+ let e = {};
+ (o.value.forEach((t, n) => {
+ typeof t == `string` && (e[n] = `${S(t)}px`);
+ }),
+ (g.value = e));
+ }
+ function O(e) {
+ return (
+ u.value?.querySelector(`[data-mixed-input-index="${e}"]`) ?? null
+ );
+ }
+ function k(e) {
+ return e.ctrlKey || e.metaKey;
+ }
+ function A(e) {
+ return e.currentTarget;
+ }
+ function j(e, t) {
+ let n = A(e);
+ ((m.value = null),
+ (p.value = {
+ index: t,
+ selectionStart: n.selectionStart ?? n.value.length,
+ selectionEnd: n.selectionEnd ?? n.value.length,
+ }));
+ }
+ function M(e) {
+ let t = [],
+ n = !1;
+ return (
+ e.forEach((e) => {
+ let r = t[t.length - 1];
+ if (typeof e == `string`) {
+ typeof r == `string`
+ ? ((t[t.length - 1] = r + e), (n = !0))
+ : t.push(e);
+ return;
+ }
+ (typeof r != `string` && (t.push(``), (n = !0)), t.push(e));
+ }),
+ (t.length === 0 || typeof t[t.length - 1] != `string`) &&
+ (t.push(``), (n = !0)),
+ {parts: t, changed: n || t.length !== e.length}
+ );
+ }
+ function N() {
+ let e = M(o.value);
+ e.changed && (o.value = e.parts);
+ }
+ function P(e, t) {
+ return t === `start`
+ ? 0
+ : t === `end` || t === void 0
+ ? e.value.length
+ : t;
+ }
+ function R(e, t) {
+ s(() => {
+ let n = O(e);
+ if (n)
+ if ((n.focus(), n instanceof HTMLInputElement)) {
+ let r = P(n, t);
+ (n.setSelectionRange(r, r),
+ (p.value = {index: e, selectionStart: r, selectionEnd: r}),
+ (m.value = null));
+ } else ((p.value = null), (m.value = e));
+ });
+ }
+ function z(e) {
+ e <= 0 || R(e - 1, `end`);
+ }
+ function B(e) {
+ e >= o.value.length - 1 || R(e + 1, `start`);
+ }
+ function V() {
+ (N(), R(0, `start`));
+ }
+ function H() {
+ (N(), R(o.value.length - 1, `end`));
+ }
+ function U(e, t) {
+ let n = [...o.value];
+ ((n[e] = t), (o.value = n));
+ }
+ function W(e, t) {
+ U(t, A(e).value);
+ }
+ function G(e) {
+ let t = p.value,
+ n = m.value;
+ if (((m.value = null), t && typeof o.value[t.index] == `string`)) {
+ let n = [...o.value],
+ r = n[t.index],
+ i = r.slice(0, t.selectionStart),
+ a = r.slice(t.selectionEnd);
+ (n.splice(t.index, 1, i, [e.label, e.value], a),
+ (o.value = n),
+ (p.value = {
+ index: t.index + 2,
+ selectionStart: 0,
+ selectionEnd: 0,
+ }),
+ R(t.index + 1));
+ return;
+ }
+ if (n !== null) {
+ let t = [...o.value];
+ (t.splice(n + 1, 0, ``, [e.label, e.value]),
+ (o.value = t),
+ R(n + 2));
+ return;
+ }
+ let r = [...o.value];
+ (r.push([e.label, e.value], ``),
+ (p.value = {
+ index: r.length - 1,
+ selectionStart: 0,
+ selectionEnd: 0,
+ }),
+ (o.value = r),
+ R(r.length - 2));
+ }
+ function K(e) {
+ let t = [...o.value];
+ (t.splice(e, 1), (m.value = null));
+ let n = t[e - 1],
+ r = t[e];
+ if (typeof n == `string` && typeof r == `string`) {
+ let i = n.length;
+ (t.splice(e - 1, 2, n + r), (o.value = t), R(e - 1, i));
+ return;
+ }
+ ((o.value = t.length ? t : [``]),
+ R(Math.max(0, Math.min(e - 1, o.value.length - 1))));
+ }
+ function q(e) {
+ ((m.value = e), (p.value = null));
+ }
+ function J(e, t) {
+ switch (e.key) {
+ case `ArrowLeft`:
+ (e.preventDefault(), k(e) ? V() : z(t));
+ return;
+ case `ArrowRight`:
+ (e.preventDefault(), k(e) ? H() : B(t));
+ return;
+ case `Backspace`:
+ case `Delete`:
+ (e.preventDefault(), K(t));
+ return;
+ }
+ }
+ function Y(e, t) {
+ let n = A(e),
+ r = n.selectionStart ?? 0,
+ i = n.selectionEnd ?? n.value.length;
+ switch (e.key) {
+ case `ArrowLeft`:
+ if (k(e)) {
+ (e.preventDefault(), V());
+ return;
+ }
+ r === 0 && i === 0 && (e.preventDefault(), z(t));
+ return;
+ case `ArrowRight`:
+ if (k(e)) {
+ (e.preventDefault(), H());
+ return;
+ }
+ r === n.value.length &&
+ i === n.value.length &&
+ (e.preventDefault(), B(t));
+ return;
+ case `Backspace`:
+ case `Delete`:
+ r === 0 && i === 0 && (e.preventDefault(), z(t));
+ return;
+ }
+ }
+ return (
+ a(
+ o,
+ () => {
+ (N(), s(D));
+ },
+ {immediate: !0}
+ ),
+ i(D),
+ n({addToken: G}),
+ (n, r) => (
+ l(),
+ E(
+ `div`,
+ {
+ ref_key: `root`,
+ ref: u,
+ class: `mixed-input`,
+ tabindex: `0`,
+ onFocus: y(H, [`self`]),
+ },
+ [
+ T(
+ `div`,
+ {
+ class: c({
+ 'mixed-input__editor': !0,
+ 'mixed-input__editor--error': e.invalid,
+ }),
+ },
+ [
+ (l(!0),
+ E(
+ v,
+ null,
+ t(
+ o.value,
+ (t, n) => (
+ l(),
+ E(
+ v,
+ {key: n},
+ [
+ _(t)
+ ? (l(),
+ E(
+ `button`,
+ {
+ key: 0,
+ class: c({
+ 'mixed-input__token': !0,
+ 'mixed-input__token--editable': !0,
+ 'mixed-input__token--selected':
+ m.value === n,
+ }),
+ type: `button`,
+ 'data-mixed-input-index': n,
+ 'aria-pressed': m.value === n,
+ disabled: e.disabled,
+ onClick: (e) => q(n),
+ onFocus: (e) => q(n),
+ onKeydown: (e) => J(e, n),
+ },
+ C(t[0]),
+ 43,
+ F
+ ))
+ : (l(),
+ E(
+ `input`,
+ {
+ key: 1,
+ value: t,
+ type: `text`,
+ class: c({
+ 'mixed-input__text': !0,
+ 'mixed-input__text--last':
+ n === o.value.length - 1,
+ }),
+ dir: `ltr`,
+ 'data-mixed-input-index': n,
+ style: h({width: x(n)}),
+ 'aria-label': e.ariaLabel,
+ disabled: e.disabled,
+ onInput: (e) => W(e, n),
+ onFocus: (e) => j(e, n),
+ onClick: (e) => j(e, n),
+ onKeyup: (e) => j(e, n),
+ onKeydown: (e) => Y(e, n),
+ },
+ null,
+ 46,
+ I
+ )),
+ ],
+ 64
+ )
+ )
+ ),
+ 128
+ )),
+ T(
+ `span`,
+ {
+ ref_key: `textMeasure`,
+ ref: f,
+ class: `mixed-input__text mixed-input__text-measure`,
+ 'aria-hidden': `true`,
+ },
+ null,
+ 512
+ ),
+ ],
+ 2
+ ),
+ d(n.$slots, `error`, {}, void 0, !0),
+ ],
+ 544
+ )
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-1a51f925`]]
+ ),
+ z = {class: `route-form`},
+ B = {class: `route-uri-field`},
+ V = [`label`, `has-feedback-for`],
+ H = {slot: `feedback`},
+ U = {key: 0, class: `error-list`},
+ W = {class: `route-token-picker`},
+ G = [`disabled`, `onMousedown`, `onClick`],
+ K = S(
+ n({
+ __name: `Edit`,
+ props: {
+ title: {},
+ route: {},
+ tokens: {},
+ sites: {},
+ isMultiSite: {type: Boolean},
+ readOnly: {type: Boolean},
+ actionMenuItems: {},
+ errors: {},
+ templateOptions: {},
+ },
+ setup(n) {
+ let r = n,
+ i = w(null),
+ a = x({
+ uriParts: r.route.uriParts,
+ template: r.route.template,
+ siteUid: r.route.siteUid ?? ``,
+ }),
+ o = p(() => (r.actionMenuItems ?? []).flatMap(b)),
+ {save: s} = M(a, () => (r.route.uid ? P(r.route.uid) : N()), {
+ transform: (e) => ({
+ ...e,
+ uriParts: h(),
+ siteUid: e.siteUid || null,
+ }),
+ });
+ function c(e) {
+ i.value?.addToken(e);
+ }
+ function d(e, t) {
+ e.detail === 0 && c(t);
+ }
+ function h() {
+ let e = [...a.uriParts];
+ return (
+ typeof e[0] == `string` && (e[0] = e[0].replace(/^\/+/, ``)),
+ e.filter((e) => (typeof e == `string` ? e !== `` : !0))
+ );
+ }
+ function b(e) {
+ if (e.type === `hr`) return [{type: `hr`}];
+ if (e.type === `group`) return (e.items ?? []).flatMap(b);
+ let t = {
+ label: e.label ?? ``,
+ icon: e.icon,
+ variant: e.destructive ? `danger` : void 0,
+ };
+ return e.type === `link` && e.url
+ ? [{...t, type: `link`, href: e.url}]
+ : [{...t, onClick: () => S(e)}];
+ }
+ function S(e) {
+ let t = e.attributes?.data ?? {};
+ t[`route-delete-action`] && F(String(t[`route-delete-url`] ?? ``));
+ }
+ function F(t) {
+ !r.route.uid ||
+ !t ||
+ (confirm(e(`Are you sure you want to delete this route?`)) &&
+ g.delete(t, {preserveScroll: !0}));
+ }
+ return (r, p) => (
+ l(),
+ D(
+ A,
+ {
+ title: n.title,
+ form: _(a),
+ 'form-additional-actions': o.value,
+ onSave: _(s),
+ },
+ {
+ default: f(() => [
+ u(
+ k,
+ {appearance: `raised`},
+ {
+ default: f(() => [
+ T(`div`, z, [
+ n.isMultiSite
+ ? (l(),
+ D(
+ O,
+ {
+ key: 0,
+ label: _(e)(`Site`),
+ class: `route-site-select`,
+ id: `route-site`,
+ name: `siteUid`,
+ modelValue: _(a).siteUid,
+ 'onUpdate:modelValue': (p[0] ||= (e) =>
+ (_(a).siteUid = e)),
+ options: n.sites,
+ disabled: _(a).processing || n.readOnly,
+ 'aria-label': _(e)(`Site`),
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `modelValue`,
+ `options`,
+ `disabled`,
+ `aria-label`,
+ ]
+ ))
+ : m(``, !0),
+ T(`div`, B, [
+ T(
+ `craft-input`,
+ {
+ label: _(e)(`If the URI looks like this`),
+ 'has-feedback-for': _(a).errors.uriParts
+ ? `error`
+ : ``,
+ },
+ [
+ u(
+ R,
+ {
+ slot: `input`,
+ ref_key: `mixedInput`,
+ ref: i,
+ modelValue: _(a).uriParts,
+ 'onUpdate:modelValue': (p[1] ||= (e) =>
+ (_(a).uriParts = e)),
+ class: `route-uri-input`,
+ invalid: !!_(a).errors.uriParts,
+ disabled: _(a).processing || n.readOnly,
+ 'aria-label': _(e)(`URI`),
+ },
+ null,
+ 8,
+ [
+ `modelValue`,
+ `invalid`,
+ `disabled`,
+ `aria-label`,
+ ]
+ ),
+ T(`div`, H, [
+ _(a).errors.uriParts
+ ? (l(),
+ E(`ul`, U, [
+ T(`li`, null, C(_(a).errors.uriParts), 1),
+ ]))
+ : m(``, !0),
+ ]),
+ ],
+ 8,
+ V
+ ),
+ T(`div`, W, [
+ T(`h3`, null, C(_(e)(`Add a token`)), 1),
+ (l(!0),
+ E(
+ v,
+ null,
+ t(
+ n.tokens,
+ (e) => (
+ l(),
+ E(
+ `button`,
+ {
+ key: e.label,
+ type: `button`,
+ class: `route-token route-token--button`,
+ disabled: _(a).processing || n.readOnly,
+ onMousedown: y((t) => c(e), [`prevent`]),
+ onClick: (t) => d(t, e),
+ },
+ C(e.label),
+ 41,
+ G
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ u(
+ j,
+ {
+ label: _(e)(`Load this template`),
+ id: `route-template`,
+ name: `template`,
+ modelValue: _(a).template,
+ 'onUpdate:modelValue': (p[2] ||= (e) =>
+ (_(a).template = e)),
+ dir: `ltr`,
+ disabled: _(a).processing || n.readOnly,
+ error: _(a).errors.template,
+ required: ``,
+ options: n.templateOptions,
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `modelValue`,
+ `disabled`,
+ `error`,
+ `options`,
+ ]
+ ),
+ ]),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `form`, `form-additional-actions`, `onSave`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-c6c1aa89`]]
+ );
+export {K as default};
diff --git a/resources/build/assets/Email-BHA2yC88.js b/resources/build/assets/Email-BHA2yC88.js
new file mode 100644
index 00000000000..4085fa4522f
--- /dev/null
+++ b/resources/build/assets/Email-BHA2yC88.js
@@ -0,0 +1,437 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ _ as a,
+ b as o,
+ ht as s,
+ l as c,
+ m as l,
+ s as u,
+ tt as d,
+ v as f,
+ x as p,
+ y as m,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as h} from './AdminTable-32qWVDq-.js';
+import {t as g} from './Pane-CJi1MPPH.js';
+import {t as _} from './InlineFlash-DnK6Yp2V.js';
+import {n as v} from './wayfinder-V597ZF_3.js';
+import {t as y} from './CraftInput-B2G9EaE3.js';
+import {t as b} from './AppLayout-BXGMFlSp.js';
+import {t as x} from './CraftCombobox-NlyOETnv.js';
+import {t as S} from './useEditableTable-DGQ7vq0w.js';
+import {t as C} from './useSettingsSave-D5LL4sJi.js';
+var w = t({
+ __name: `SiteOverridesTable`,
+ props: {sites: {}, modelValue: {}},
+ emits: [`update:modelValue`],
+ setup(t, {emit: o}) {
+ let l = o,
+ u = t,
+ d = c(),
+ f = a(() => d.props.envSuggestions),
+ p = a(() => d.props.templateSuggestions);
+ function _(e) {
+ return u.sites.find((t) => t.uid === e)?.name ?? e;
+ }
+ let {table: v} = S({
+ data: () => u.modelValue,
+ key: `uid`,
+ name: `siteOverrides`,
+ onChange: (e) => l(`update:modelValue`, e),
+ columns: ({columnHelper: t}) => [
+ t.display({
+ id: `name`,
+ header: e(`Site`),
+ cell: ({row: e}) => _(e.original.uid),
+ meta: {cellTag: `th`},
+ }),
+ t.autocomplete(`fromEmail`, {
+ header: e(`System Email Address`),
+ class: `font-mono text-xs !px-[var(--_cell-spacing-inline)]`,
+ options: f.value,
+ }),
+ t.autocomplete(`fromName`, {
+ header: e(`Sender Name`),
+ class: `font-mono text-xs !px-[var(--_cell-spacing-inline)]`,
+ options: f.value,
+ }),
+ t.autocomplete(`replyToEmail`, {
+ header: e(`Reply-To Address`),
+ class: `font-mono text-xs !px-[var(--_cell-spacing-inline)]`,
+ options: f.value,
+ }),
+ t.autocomplete(`template`, {
+ header: e(`HTML Email Template`),
+ class: `font-mono text-xs !px-[var(--_cell-spacing-inline)]`,
+ options: p.value,
+ }),
+ ],
+ });
+ return (e, t) => (
+ n(),
+ m(
+ g,
+ {padding: 0, appearance: `raised`},
+ {
+ default: i(() => [
+ r(h, {table: s(v), reorderable: !1}, null, 8, [`table`]),
+ ]),
+ _: 1,
+ }
+ )
+ );
+ },
+ }),
+ T = (e) => ({url: T.url(e), method: `get`});
+((T.definition = {methods: [`get`, `head`], url: `/admin/settings/email`}),
+ (T.url = (e) => T.definition.url + v(e)),
+ (T.get = (e) => ({url: T.url(e), method: `get`})),
+ (T.head = (e) => ({url: T.url(e), method: `head`})));
+var E = (e) => ({url: E.url(e), method: `post`});
+((E.definition = {methods: [`post`], url: `/admin/settings/email`}),
+ (E.url = (e) => E.definition.url + v(e)),
+ (E.post = (e) => ({url: E.url(e), method: `post`})));
+var D = (e) => ({url: D.url(e), method: `post`});
+((D.definition = {methods: [`post`], url: `/admin/settings/email/test`}),
+ (D.url = (e) => D.definition.url + v(e)),
+ (D.post = (e) => ({url: D.url(e), method: `post`})),
+ Object.assign(T, T),
+ Object.assign(E, E),
+ Object.assign(D, D));
+var O = {class: `grid gap-3`},
+ k = {class: `grid gap-3`},
+ A = {class: `mb-4`},
+ j = {class: `text-base`},
+ M = {class: `text-sm text-neutral-text-quiet`},
+ N = {class: `mb-3`},
+ P = {class: `grid gap-3`},
+ F = {class: `flex gap-2 items-center`},
+ I = [`loading`],
+ L = t({
+ __name: `Email`,
+ props: {
+ readOnly: {type: Boolean},
+ emailConfig: {},
+ mailerOptions: {},
+ envSuggestions: {},
+ templateSuggestions: {},
+ sites: {},
+ defaultToEmail: {},
+ redirectUrl: {},
+ },
+ setup(t) {
+ let c = t,
+ h = a(() => c.sites.length > 1),
+ v = {};
+ for (let e of c.sites) {
+ let t = c.emailConfig.siteOverrides?.[e.uid] ?? {};
+ v[e.uid] = {
+ uid: e.uid,
+ fromEmail: t.fromEmail ?? ``,
+ fromName: t.fromName ?? ``,
+ replyToEmail: t.replyToEmail ?? ``,
+ template: t.template ?? ``,
+ };
+ }
+ let S = u({
+ fromEmail: c.emailConfig.fromEmail ?? ``,
+ fromName: c.emailConfig.fromName ?? ``,
+ replyToEmail: c.emailConfig.replyToEmail ?? ``,
+ mailer: c.emailConfig.mailer ?? ``,
+ template: c.emailConfig.template ?? ``,
+ siteOverrides: v,
+ }),
+ T = u({to: c.defaultToEmail}),
+ {save: L} = C(S, E);
+ function R() {
+ T.clearErrors().submit(D(), {
+ onSuccess: () => {
+ T.reset();
+ },
+ });
+ }
+ return (a, c) => (
+ n(),
+ m(
+ b,
+ {title: s(e)(`Email Settings`), form: s(S), onSave: s(L)},
+ {
+ default: i(() => [
+ f(`div`, O, [
+ r(
+ g,
+ {appearance: `raised`},
+ {
+ default: i(() => [
+ f(`div`, k, [
+ r(
+ x,
+ {
+ label: s(e)(`System Email Address`),
+ 'help-text': s(e)(
+ `The email address Craft CMS will use when sending email.`
+ ),
+ id: `fromEmail`,
+ name: `fromEmail`,
+ modelValue: s(S).fromEmail,
+ 'onUpdate:modelValue': (c[0] ||= (e) =>
+ (s(S).fromEmail = e)),
+ error: s(S).errors?.fromEmail,
+ options: t.envSuggestions,
+ disabled: t.readOnly,
+ 'require-option-match': !1,
+ 'show-all-on-empty': ``,
+ callouts: [`envVars`],
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `error`,
+ `options`,
+ `disabled`,
+ ]
+ ),
+ r(
+ x,
+ {
+ label: s(e)(`Sender Name`),
+ 'help-text': s(e)(
+ `The “From” name Craft CMS will use when sending email.`
+ ),
+ id: `fromName`,
+ name: `fromName`,
+ modelValue: s(S).fromName,
+ 'onUpdate:modelValue': (c[1] ||= (e) =>
+ (s(S).fromName = e)),
+ error: s(S).errors?.fromName,
+ disabled: t.readOnly,
+ 'require-option-match': !1,
+ 'show-all-on-empty': ``,
+ options: t.envSuggestions,
+ callouts: [`envVars`],
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `error`,
+ `disabled`,
+ `options`,
+ ]
+ ),
+ r(
+ x,
+ {
+ label: s(e)(`Reply-To Address`),
+ 'help-text': s(e)(
+ `The Reply-To email address Craft CMS should use when sending email.`
+ ),
+ id: `replyToEmail`,
+ name: `replyToEmail`,
+ modelValue: s(S).replyToEmail,
+ 'onUpdate:modelValue': (c[2] ||= (e) =>
+ (s(S).replyToEmail = e)),
+ error: s(S).errors?.replyToEmail,
+ disabled: t.readOnly,
+ 'require-option-match': !1,
+ options: t.envSuggestions,
+ 'show-all-on-empty': ``,
+ callouts: [`envVars`],
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `error`,
+ `disabled`,
+ `options`,
+ ]
+ ),
+ r(
+ x,
+ {
+ label: s(e)(`HTML Email Template`),
+ 'help-text': s(e)(
+ `The template Craft CMS will use for HTML emails. Leave blank to use the default template.`
+ ),
+ id: `template`,
+ name: `template`,
+ modelValue: s(S).template,
+ 'onUpdate:modelValue': (c[3] ||= (e) =>
+ (s(S).template = e)),
+ error: s(S).errors?.template,
+ disabled: t.readOnly,
+ 'require-option-match': !1,
+ 'show-all-on-empty': ``,
+ options: [
+ ...(t.templateSuggestions ?? []),
+ ...(t.envSuggestions ?? []),
+ ],
+ callouts: [`envVars`],
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `error`,
+ `disabled`,
+ `options`,
+ ]
+ ),
+ ]),
+ h.value
+ ? (n(),
+ p(
+ l,
+ {key: 0},
+ [
+ (c[7] ||= f(`hr`, {class: `my-6`}, null, -1)),
+ f(`div`, null, [
+ f(`div`, A, [
+ f(`h2`, j, d(s(e)(`Site Overrides`)), 1),
+ f(
+ `p`,
+ M,
+ d(
+ s(e)(
+ `Override the default email settings on a per-site basis. Blank values will use the defaults above.`
+ )
+ ),
+ 1
+ ),
+ ]),
+ r(
+ w,
+ {
+ modelValue: s(S).siteOverrides,
+ 'onUpdate:modelValue': (c[4] ||= (e) =>
+ (s(S).siteOverrides = e)),
+ sites: t.sites,
+ },
+ null,
+ 8,
+ [`modelValue`, `sites`]
+ ),
+ ]),
+ ],
+ 64
+ ))
+ : o(``, !0),
+ (c[8] ||= f(`hr`, {class: `my-6`}, null, -1)),
+ f(`div`, null, [
+ r(
+ x,
+ {
+ label: s(e)(`Mailer`),
+ 'help-text': s(e)(
+ `How should Craft CMS send the emails?`
+ ),
+ id: `mailer`,
+ name: `mailer`,
+ modelValue: s(S).mailer,
+ 'onUpdate:modelValue': (c[5] ||= (e) =>
+ (s(S).mailer = e)),
+ error: s(S).errors?.mailer,
+ disabled: t.readOnly,
+ 'require-option-match': !1,
+ 'show-all-on-empty': ``,
+ options: [
+ ...t.mailerOptions.map((e) => ({
+ ...e,
+ value: e.value ?? ``,
+ })),
+ ...(t.envSuggestions ?? []),
+ ],
+ callouts: [`envVars`],
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `error`,
+ `disabled`,
+ `options`,
+ ]
+ ),
+ ]),
+ ]),
+ _: 1,
+ }
+ ),
+ r(
+ g,
+ {appearance: `raised`},
+ {
+ default: i(() => [
+ f(`h2`, N, d(s(e)(`Send a test email`)), 1),
+ f(`div`, P, [
+ r(
+ y,
+ {
+ label: s(e)(`To`),
+ modelValue: s(T).to,
+ 'onUpdate:modelValue': (c[6] ||= (e) =>
+ (s(T).to = e)),
+ name: `to`,
+ error: s(T).errors.to,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ f(`div`, F, [
+ f(
+ `craft-button`,
+ {
+ type: `button`,
+ variant: `primary`,
+ loading: s(T).processing,
+ onClick: R,
+ },
+ d(s(e)(`Test`)),
+ 9,
+ I
+ ),
+ r(
+ _,
+ {
+ 'is-active':
+ s(T).recentlySuccessful || s(T).hasErrors,
+ },
+ null,
+ 8,
+ [`is-active`]
+ ),
+ ]),
+ ]),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `form`, `onSave`]
+ )
+ );
+ },
+ });
+export {L as default};
diff --git a/resources/build/assets/Empty-D0VMu5kQ.js b/resources/build/assets/Empty-D0VMu5kQ.js
new file mode 100644
index 00000000000..867394aa03b
--- /dev/null
+++ b/resources/build/assets/Empty-D0VMu5kQ.js
@@ -0,0 +1,1737 @@
+import {t as e} from './rolldown-runtime-DXc-PV0M.js';
+import {l as t} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as n,
+ N as r,
+ Q as i,
+ R as a,
+ V as o,
+ b as s,
+ ht as c,
+ ot as l,
+ t as u,
+ tt as d,
+ v as f,
+ x as p,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+function m(e) {
+ if (Array.isArray(e)) return e;
+}
+function h(e, t) {
+ var n =
+ e == null
+ ? null
+ : (typeof Symbol < `u` && e[Symbol.iterator]) || e[`@@iterator`];
+ if (n != null) {
+ var r,
+ i,
+ a,
+ o,
+ s = [],
+ c = !0,
+ l = !1;
+ try {
+ if (((a = (n = n.call(e)).next), t === 0)) {
+ if (Object(n) !== n) return;
+ c = !1;
+ } else
+ for (
+ ;
+ !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t);
+ c = !0
+ );
+ } catch (e) {
+ ((l = !0), (i = e));
+ } finally {
+ try {
+ if (!c && n.return != null && ((o = n.return()), Object(o) !== o))
+ return;
+ } finally {
+ if (l) throw i;
+ }
+ }
+ return s;
+ }
+}
+function g(e, t) {
+ (t == null || t > e.length) && (t = e.length);
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
+ return r;
+}
+function _(e, t) {
+ if (e) {
+ if (typeof e == `string`) return g(e, t);
+ var n = {}.toString.call(e).slice(8, -1);
+ return (
+ n === `Object` && e.constructor && (n = e.constructor.name),
+ n === `Map` || n === `Set`
+ ? Array.from(e)
+ : n === `Arguments` ||
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
+ ? g(e, t)
+ : void 0
+ );
+ }
+}
+function v() {
+ throw TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
+}
+function y(e, t) {
+ return m(e) || h(e, t) || _(e, t) || v();
+}
+var b = e((e) => {
+ (Object.defineProperty(e, `__esModule`, {value: !0}), (e.bind = void 0));
+ function t(e, t) {
+ var n = t.type,
+ r = t.listener,
+ i = t.options;
+ return (
+ e.addEventListener(n, r, i),
+ function () {
+ e.removeEventListener(n, r, i);
+ }
+ );
+ }
+ e.bind = t;
+ }),
+ ee = e((e) => {
+ var t =
+ (e && e.__assign) ||
+ function () {
+ return (
+ (t =
+ Object.assign ||
+ function (e) {
+ for (var t, n = 1, r = arguments.length; n < r; n++)
+ for (var i in ((t = arguments[n]), t))
+ Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
+ return e;
+ }),
+ t.apply(this, arguments)
+ );
+ };
+ (Object.defineProperty(e, `__esModule`, {value: !0}), (e.bindAll = void 0));
+ var n = b();
+ function r(e) {
+ if (e !== void 0) return typeof e == `boolean` ? {capture: e} : e;
+ }
+ function i(e, n) {
+ return n == null
+ ? e
+ : t(t({}, e), {options: t(t({}, r(n)), r(e.options))});
+ }
+ function a(e, t, r) {
+ var a = t.map(function (t) {
+ var a = i(t, r);
+ return (0, n.bind)(e, a);
+ });
+ return function () {
+ a.forEach(function (e) {
+ return e();
+ });
+ };
+ }
+ e.bindAll = a;
+ }),
+ x = e((e) => {
+ (Object.defineProperty(e, `__esModule`, {value: !0}),
+ (e.bindAll = e.bind = void 0));
+ var t = b();
+ Object.defineProperty(e, `bind`, {
+ enumerable: !0,
+ get: function () {
+ return t.bind;
+ },
+ });
+ var n = ee();
+ Object.defineProperty(e, `bindAll`, {
+ enumerable: !0,
+ get: function () {
+ return n.bindAll;
+ },
+ });
+ })(),
+ te = `data-pdnd-honey-pot`;
+function S(e) {
+ return e instanceof Element && e.hasAttribute(`data-pdnd-honey-pot`);
+}
+function ne(e) {
+ var t = y(document.elementsFromPoint(e.x, e.y), 2),
+ n = t[0],
+ r = t[1];
+ return n ? (S(n) ? (r ?? null) : n) : null;
+}
+function C(e) {
+ '@babel/helpers - typeof';
+ return (
+ (C =
+ typeof Symbol == `function` && typeof Symbol.iterator == `symbol`
+ ? function (e) {
+ return typeof e;
+ }
+ : function (e) {
+ return e &&
+ typeof Symbol == `function` &&
+ e.constructor === Symbol &&
+ e !== Symbol.prototype
+ ? `symbol`
+ : typeof e;
+ }),
+ C(e)
+ );
+}
+function re(e, t) {
+ if (C(e) != `object` || !e) return e;
+ var n = e[Symbol.toPrimitive];
+ if (n !== void 0) {
+ var r = n.call(e, t || `default`);
+ if (C(r) != `object`) return r;
+ throw TypeError(`@@toPrimitive must return a primitive value.`);
+ }
+ return (t === `string` ? String : Number)(e);
+}
+function ie(e) {
+ var t = re(e, `string`);
+ return C(t) == `symbol` ? t : t + ``;
+}
+function w(e, t, n) {
+ return (
+ (t = ie(t)) in e
+ ? Object.defineProperty(e, t, {
+ value: n,
+ enumerable: !0,
+ configurable: !0,
+ writable: !0,
+ })
+ : (e[t] = n),
+ e
+ );
+}
+var T = 2147483647,
+ E = {
+ inset: `unset`,
+ border: `none`,
+ padding: 0,
+ margin: 0,
+ overflow: `visible`,
+ color: `inherit`,
+ background: `transparent`,
+ };
+function D(e) {
+ var t = null;
+ return function () {
+ if (!t) {
+ var n = [...arguments];
+ t = {result: e.apply(this, n)};
+ }
+ return t.result;
+ };
+}
+var O = D(function () {
+ return (
+ typeof HTMLElement < `u` &&
+ typeof HTMLElement.prototype.showPopover == `function`
+ );
+});
+function k(e, t) {
+ var n = Object.keys(e);
+ if (Object.getOwnPropertySymbols) {
+ var r = Object.getOwnPropertySymbols(e);
+ (t &&
+ (r = r.filter(function (t) {
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
+ })),
+ n.push.apply(n, r));
+ }
+ return n;
+}
+function A(e) {
+ for (var t = 1; t < arguments.length; t++) {
+ var n = arguments[t] == null ? {} : arguments[t];
+ t % 2
+ ? k(Object(n), !0).forEach(function (t) {
+ w(e, t, n[t]);
+ })
+ : Object.getOwnPropertyDescriptors
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
+ : k(Object(n)).forEach(function (t) {
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
+ });
+ }
+ return e;
+}
+var j = 2,
+ ae = j / 2;
+function oe(e) {
+ return {x: Math.floor(e.x), y: Math.floor(e.y)};
+}
+function se(e) {
+ return {x: e.x - ae, y: e.y - ae};
+}
+function ce(e) {
+ return {x: Math.max(e.x, 0), y: Math.max(e.y, 0)};
+}
+function le(e) {
+ return {
+ x: Math.min(e.x, window.innerWidth - j),
+ y: Math.min(e.y, window.innerHeight - j),
+ };
+}
+function ue(e) {
+ var t = e.client,
+ n = le(ce(se(oe(t))));
+ return DOMRect.fromRect({x: n.x, y: n.y, width: j, height: j});
+}
+function M(e) {
+ var t = e.clientRect;
+ return {
+ left: `${t.left}px`,
+ top: `${t.top}px`,
+ width: `${t.width}px`,
+ height: `${t.height}px`,
+ };
+}
+function de(e) {
+ var t = e.client,
+ n = e.clientRect;
+ return (
+ t.x >= n.x && t.x <= n.x + n.width && t.y >= n.y && t.y <= n.y + n.height
+ );
+}
+function fe(e) {
+ var t = e.initial,
+ n = document.createElement(`div`);
+ (n.setAttribute(te, `true`), O() && n.setAttribute(`popover`, `manual`));
+ var r = ue({client: t});
+ (Object.assign(
+ n.style,
+ A(
+ A({position: `fixed`}, O() ? E : {zIndex: T}),
+ {},
+ {
+ backgroundColor: `transparent`,
+ padding: 0,
+ margin: 0,
+ boxSizing: `border-box`,
+ pointerEvents: `auto`,
+ },
+ M({clientRect: r})
+ )
+ ),
+ document.body.appendChild(n),
+ O() && n.showPopover());
+ var i = (0, x.bind)(window, {
+ type: `pointermove`,
+ listener: function (e) {
+ ((r = ue({client: {x: e.clientX, y: e.clientY}})),
+ Object.assign(n.style, M({clientRect: r})));
+ },
+ options: {capture: !0},
+ });
+ return function (e) {
+ var t = e.current;
+ if ((i(), de({client: t, clientRect: r}))) {
+ n.remove();
+ return;
+ }
+ function a() {
+ (o(), n.remove());
+ }
+ var o = (0, x.bindAll)(
+ window,
+ [
+ {type: `pointerdown`, listener: a},
+ {type: `pointermove`, listener: a},
+ {type: `focusin`, listener: a},
+ {type: `focusout`, listener: a},
+ {type: `dragstart`, listener: a},
+ {type: `dragenter`, listener: a},
+ {type: `dragover`, listener: a},
+ ],
+ {capture: !0}
+ );
+ };
+}
+function pe() {
+ var e = null;
+ function t() {
+ return (
+ (e = null),
+ (0, x.bind)(window, {
+ type: `pointermove`,
+ listener: function (t) {
+ e = {x: t.clientX, y: t.clientY};
+ },
+ options: {capture: !0},
+ })
+ );
+ }
+ function n() {
+ var t = null;
+ return function (n) {
+ var r = n.eventName,
+ i = n.payload;
+ if (r === `onDragStart`) {
+ var a = i.location.initial.input;
+ t = fe({initial: e ?? {x: a.clientX, y: a.clientY}});
+ }
+ if (r === `onDrop`) {
+ var o,
+ s = i.location.current.input;
+ ((o = t) == null || o({current: {x: s.clientX, y: s.clientY}}),
+ (t = null),
+ (e = null));
+ }
+ };
+ }
+ return {bindEvents: t, getOnPostDispatch: n};
+}
+function me(e) {
+ if (Array.isArray(e)) return g(e);
+}
+function he(e) {
+ if (
+ (typeof Symbol < `u` && e[Symbol.iterator] != null) ||
+ e[`@@iterator`] != null
+ )
+ return Array.from(e);
+}
+function ge() {
+ throw TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
+}
+function N(e) {
+ return me(e) || he(e) || _(e) || ge();
+}
+var _e = D(function () {
+ return navigator.userAgent.includes(`Firefox`);
+ }),
+ P = D(function () {
+ var e = navigator.userAgent;
+ return e.includes(`AppleWebKit`) && !e.includes(`Chrome`);
+ }),
+ F = {
+ isLeavingWindow: Symbol(`leaving`),
+ isEnteringWindow: Symbol(`entering`),
+ };
+function ve(e) {
+ var t = e.dragLeave;
+ return P() ? t.hasOwnProperty(F.isLeavingWindow) : !1;
+}
+(function () {
+ if (typeof window > `u` || !P()) return;
+ function e() {
+ return {enterCount: 0, isOverWindow: !1};
+ }
+ var t = e();
+ function n() {
+ t = e();
+ }
+ (0, x.bindAll)(
+ window,
+ [
+ {
+ type: `dragstart`,
+ listener: function () {
+ ((t.enterCount = 0), (t.isOverWindow = !0));
+ },
+ },
+ {type: `drop`, listener: n},
+ {type: `dragend`, listener: n},
+ {
+ type: `dragenter`,
+ listener: function (e) {
+ (!t.isOverWindow &&
+ t.enterCount === 0 &&
+ (e[F.isEnteringWindow] = !0),
+ (t.isOverWindow = !0),
+ t.enterCount++);
+ },
+ },
+ {
+ type: `dragleave`,
+ listener: function (e) {
+ (t.enterCount--,
+ t.isOverWindow &&
+ t.enterCount === 0 &&
+ ((e[F.isLeavingWindow] = !0), (t.isOverWindow = !1)));
+ },
+ },
+ ],
+ {capture: !0}
+ );
+})();
+function ye(e) {
+ return `nodeName` in e;
+}
+function be(e) {
+ return ye(e) && e.ownerDocument !== document;
+}
+function xe(e) {
+ var t = e.dragLeave,
+ n = t.type,
+ r = t.relatedTarget;
+ return n === `dragleave`
+ ? P()
+ ? ve({dragLeave: t})
+ : r == null
+ ? !0
+ : _e()
+ ? be(r)
+ : r instanceof HTMLIFrameElement
+ : !1;
+}
+function Se(e) {
+ var t = e.onDragEnd;
+ return [
+ {
+ type: `pointermove`,
+ listener: (function () {
+ var e = 0;
+ return function () {
+ if (e < 20) {
+ e++;
+ return;
+ }
+ t();
+ };
+ })(),
+ },
+ {type: `pointerdown`, listener: t},
+ ];
+}
+function I(e) {
+ return {
+ altKey: e.altKey,
+ button: e.button,
+ buttons: e.buttons,
+ ctrlKey: e.ctrlKey,
+ metaKey: e.metaKey,
+ shiftKey: e.shiftKey,
+ clientX: e.clientX,
+ clientY: e.clientY,
+ pageX: e.pageX,
+ pageY: e.pageY,
+ };
+}
+var L = (function (e) {
+ var t = [],
+ n = null,
+ r = function () {
+ ((t = [...arguments]),
+ !n &&
+ (n = requestAnimationFrame(function () {
+ ((n = null), e.apply(void 0, t));
+ })));
+ };
+ return (
+ (r.cancel = function () {
+ n &&= (cancelAnimationFrame(n), null);
+ }),
+ r
+ );
+ })(function (e) {
+ return e();
+ }),
+ R = (function () {
+ var e = null;
+ function t(t) {
+ e = {
+ frameId: requestAnimationFrame(function () {
+ ((e = null), t());
+ }),
+ fn: t,
+ };
+ }
+ function n() {
+ e &&= (cancelAnimationFrame(e.frameId), e.fn(), null);
+ }
+ return {schedule: t, flush: n};
+ })();
+function Ce(e) {
+ var t = e.source,
+ n = e.initial,
+ r = e.dispatchEvent,
+ i = {dropTargets: []};
+ function a(e) {
+ (r(e), (i = {dropTargets: e.payload.location.current.dropTargets}));
+ }
+ return {
+ start: function (e) {
+ var r = e.nativeSetDragImage,
+ o = {current: n, previous: i, initial: n};
+ (a({
+ eventName: `onGenerateDragPreview`,
+ payload: {source: t, location: o, nativeSetDragImage: r},
+ }),
+ R.schedule(function () {
+ a({eventName: `onDragStart`, payload: {source: t, location: o}});
+ }));
+ },
+ dragUpdate: function (e) {
+ var r = e.current;
+ (R.flush(),
+ L.cancel(),
+ a({
+ eventName: `onDropTargetChange`,
+ payload: {source: t, location: {initial: n, previous: i, current: r}},
+ }));
+ },
+ drag: function (e) {
+ var r = e.current;
+ L(function () {
+ (R.flush(),
+ a({
+ eventName: `onDrag`,
+ payload: {
+ source: t,
+ location: {initial: n, previous: i, current: r},
+ },
+ }));
+ });
+ },
+ drop: function (e) {
+ var r = e.current,
+ o = e.updatedSourcePayload;
+ (R.flush(),
+ L.cancel(),
+ a({
+ eventName: `onDrop`,
+ payload: {
+ source: o ?? t,
+ location: {current: r, previous: i, initial: n},
+ },
+ }));
+ },
+ };
+}
+var z = {isActive: !1};
+function B() {
+ return !z.isActive;
+}
+function we(e) {
+ return e.dataTransfer
+ ? e.dataTransfer.setDragImage.bind(e.dataTransfer)
+ : null;
+}
+function Te(e) {
+ var t = e.current,
+ n = e.next;
+ if (t.length !== n.length) return !0;
+ for (var r = 0; r < t.length; r++)
+ if (t[r].element !== n[r].element) return !0;
+ return !1;
+}
+function Ee(e) {
+ var t = e.event,
+ n = e.dragType,
+ r = e.getDropTargetsOver,
+ i = e.dispatchEvent;
+ if (!B()) return;
+ var a = De({event: t, dragType: n, getDropTargetsOver: r});
+ z.isActive = !0;
+ var o = {current: a};
+ V({event: t, current: a.dropTargets});
+ var s = Ce({source: n.payload, dispatchEvent: i, initial: a});
+ function c(e) {
+ var t = Te({current: o.current.dropTargets, next: e.dropTargets});
+ ((o.current = e), t && s.dragUpdate({current: o.current}));
+ }
+ function l(e) {
+ var t = I(e),
+ i = r({
+ target: S(e.target) ? ne({x: t.clientX, y: t.clientY}) : e.target,
+ input: t,
+ source: n.payload,
+ current: o.current.dropTargets,
+ });
+ (i.length && (e.preventDefault(), V({event: e, current: i})),
+ c({dropTargets: i, input: t}));
+ }
+ function u() {
+ (o.current.dropTargets.length &&
+ c({dropTargets: [], input: o.current.input}),
+ s.drop({current: o.current, updatedSourcePayload: null}),
+ d());
+ }
+ function d() {
+ ((z.isActive = !1), f());
+ }
+ var f = (0, x.bindAll)(
+ window,
+ [
+ {
+ type: `dragover`,
+ listener: function (e) {
+ (l(e), s.drag({current: o.current}));
+ },
+ },
+ {type: `dragenter`, listener: l},
+ {
+ type: `dragleave`,
+ listener: function (e) {
+ xe({dragLeave: e}) &&
+ (c({input: o.current.input, dropTargets: []}),
+ n.startedFrom === `external` && u());
+ },
+ },
+ {
+ type: `drop`,
+ listener: function (e) {
+ if (
+ ((o.current = {dropTargets: o.current.dropTargets, input: I(e)}),
+ !o.current.dropTargets.length)
+ ) {
+ u();
+ return;
+ }
+ (e.preventDefault(),
+ V({event: e, current: o.current.dropTargets}),
+ s.drop({
+ current: o.current,
+ updatedSourcePayload:
+ n.type === `external` ? n.getDropPayload(e) : null,
+ }),
+ d());
+ },
+ },
+ {
+ type: `dragend`,
+ listener: function (e) {
+ ((o.current = {dropTargets: o.current.dropTargets, input: I(e)}),
+ u());
+ },
+ },
+ ].concat(N(Se({onDragEnd: u}))),
+ {capture: !0}
+ );
+ s.start({nativeSetDragImage: we(t)});
+}
+function V(e) {
+ var t = e.event,
+ n = e.current[0]?.dropEffect;
+ n != null && t.dataTransfer && (t.dataTransfer.dropEffect = n);
+}
+function De(e) {
+ var t = e.event,
+ n = e.dragType,
+ r = e.getDropTargetsOver,
+ i = I(t);
+ return n.startedFrom === `external`
+ ? {input: i, dropTargets: []}
+ : {
+ input: i,
+ dropTargets: r({
+ input: i,
+ source: n.payload,
+ target: t.target,
+ current: [],
+ }),
+ };
+}
+var H = {canStart: B, start: Ee},
+ U = new Map();
+function Oe(e) {
+ var t = e.typeKey,
+ n = e.mount,
+ r = U.get(t);
+ if (r) return (r.usageCount++, r);
+ var i = {typeKey: t, unmount: n(), usageCount: 1};
+ return (U.set(t, i), i);
+}
+function ke(e) {
+ var t = Oe(e);
+ return function () {
+ (t.usageCount--, !(t.usageCount > 0) && (t.unmount(), U.delete(e.typeKey)));
+ };
+}
+function W() {
+ var e = [...arguments];
+ return function () {
+ e.forEach(function (e) {
+ return e();
+ });
+ };
+}
+function G(e, t) {
+ var n = t.attribute,
+ r = t.value;
+ return (
+ e.setAttribute(n, r),
+ function () {
+ return e.removeAttribute(n);
+ }
+ );
+}
+function Ae(e, t) {
+ var n = Object.keys(e);
+ if (Object.getOwnPropertySymbols) {
+ var r = Object.getOwnPropertySymbols(e);
+ (t &&
+ (r = r.filter(function (t) {
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
+ })),
+ n.push.apply(n, r));
+ }
+ return n;
+}
+function K(e) {
+ for (var t = 1; t < arguments.length; t++) {
+ var n = arguments[t] == null ? {} : arguments[t];
+ t % 2
+ ? Ae(Object(n), !0).forEach(function (t) {
+ w(e, t, n[t]);
+ })
+ : Object.getOwnPropertyDescriptors
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
+ : Ae(Object(n)).forEach(function (t) {
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
+ });
+ }
+ return e;
+}
+function q(e, t) {
+ var n = (typeof Symbol < `u` && e[Symbol.iterator]) || e[`@@iterator`];
+ if (!n) {
+ if (
+ Array.isArray(e) ||
+ (n = je(e)) ||
+ (t && e && typeof e.length == `number`)
+ ) {
+ n && (e = n);
+ var r = 0,
+ i = function () {};
+ return {
+ s: i,
+ n: function () {
+ return r >= e.length ? {done: !0} : {done: !1, value: e[r++]};
+ },
+ e: function (e) {
+ throw e;
+ },
+ f: i,
+ };
+ }
+ throw TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
+ }
+ var a,
+ o = !0,
+ s = !1;
+ return {
+ s: function () {
+ n = n.call(e);
+ },
+ n: function () {
+ var e = n.next();
+ return ((o = e.done), e);
+ },
+ e: function (e) {
+ ((s = !0), (a = e));
+ },
+ f: function () {
+ try {
+ o || n.return == null || n.return();
+ } finally {
+ if (s) throw a;
+ }
+ },
+ };
+}
+function je(e, t) {
+ if (e) {
+ if (typeof e == `string`) return Me(e, t);
+ var n = {}.toString.call(e).slice(8, -1);
+ return (
+ n === `Object` && e.constructor && (n = e.constructor.name),
+ n === `Map` || n === `Set`
+ ? Array.from(e)
+ : n === `Arguments` ||
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
+ ? Me(e, t)
+ : void 0
+ );
+ }
+}
+function Me(e, t) {
+ (t == null || t > e.length) && (t = e.length);
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
+ return r;
+}
+function J(e) {
+ return e.slice(0).reverse();
+}
+function Ne(e) {
+ var t = e.typeKey,
+ n = e.defaultDropEffect,
+ r = new WeakMap(),
+ i = `data-drop-target-for-${t}`,
+ a = `[${i}]`;
+ function o(e) {
+ return (
+ r.set(e.element, e),
+ function () {
+ return r.delete(e.element);
+ }
+ );
+ }
+ function s(e) {
+ return D(W(G(e.element, {attribute: i, value: `true`}), o(e)));
+ }
+ function c(e) {
+ var t = e.source,
+ i = e.target,
+ o = e.input,
+ s = e.result,
+ l = s === void 0 ? [] : s;
+ if (i == null) return l;
+ if (!(i instanceof Element))
+ return i instanceof Node
+ ? c({source: t, target: i.parentElement, input: o, result: l})
+ : l;
+ var u = i.closest(a);
+ if (u == null) return l;
+ var d = r.get(u);
+ if (d == null) return l;
+ var f = {input: o, source: t, element: d.element};
+ if (d.canDrop && !d.canDrop(f))
+ return c({
+ source: t,
+ target: d.element.parentElement,
+ input: o,
+ result: l,
+ });
+ var p = d.getData?.call(d, f) ?? {},
+ m = d.getDropEffect?.call(d, f) ?? n,
+ h = {
+ data: p,
+ element: d.element,
+ dropEffect: m,
+ isActiveDueToStickiness: !1,
+ };
+ return c({
+ source: t,
+ target: d.element.parentElement,
+ input: o,
+ result: [].concat(N(l), [h]),
+ });
+ }
+ function l(e) {
+ var t = e.eventName,
+ n = e.payload,
+ i = q(n.location.current.dropTargets),
+ a;
+ try {
+ for (i.s(); !(a = i.n()).done; ) {
+ var o,
+ s = a.value,
+ c = r.get(s.element),
+ l = K(K({}, n), {}, {self: s});
+ c == null || (o = c[t]) == null || o.call(c, l);
+ }
+ } catch (e) {
+ i.e(e);
+ } finally {
+ i.f();
+ }
+ }
+ var u = {
+ onGenerateDragPreview: l,
+ onDrag: l,
+ onDragStart: l,
+ onDrop: l,
+ onDropTargetChange: function (e) {
+ var t = e.payload,
+ n = new Set(
+ t.location.current.dropTargets.map(function (e) {
+ return e.element;
+ })
+ ),
+ i = new Set(),
+ a = q(t.location.previous.dropTargets),
+ o;
+ try {
+ for (a.s(); !(o = a.n()).done; ) {
+ var s,
+ c = o.value;
+ i.add(c.element);
+ var l = r.get(c.element),
+ u = n.has(c.element),
+ d = K(K({}, t), {}, {self: c});
+ if (
+ (l == null || (s = l.onDropTargetChange) == null || s.call(l, d),
+ !u)
+ ) {
+ var f;
+ l == null || (f = l.onDragLeave) == null || f.call(l, d);
+ }
+ }
+ } catch (e) {
+ a.e(e);
+ } finally {
+ a.f();
+ }
+ var p = q(t.location.current.dropTargets),
+ m;
+ try {
+ for (p.s(); !(m = p.n()).done; ) {
+ var h,
+ g,
+ _ = m.value;
+ if (!i.has(_.element)) {
+ var v = K(K({}, t), {}, {self: _}),
+ y = r.get(_.element);
+ (y == null || (h = y.onDropTargetChange) == null || h.call(y, v),
+ y == null || (g = y.onDragEnter) == null || g.call(y, v));
+ }
+ }
+ } catch (e) {
+ p.e(e);
+ } finally {
+ p.f();
+ }
+ },
+ };
+ function d(e) {
+ u[e.eventName](e);
+ }
+ function f(e) {
+ var t = e.source,
+ n = e.target,
+ i = e.input,
+ a = e.current,
+ o = c({source: t, target: n, input: i});
+ if (o.length >= a.length) return o;
+ for (var s = J(a), l = J(o), u = [], d = 0; d < s.length; d++) {
+ var f,
+ p = s[d],
+ m = l[d];
+ if (m != null) {
+ u.push(m);
+ continue;
+ }
+ var h = u[d - 1],
+ g = s[d - 1];
+ if (h?.element !== g?.element) break;
+ var _ = r.get(p.element);
+ if (!_) break;
+ var v = {input: i, source: t, element: _.element};
+ if (
+ (_.canDrop && !_.canDrop(v)) ||
+ !((f = _.getIsSticky) != null && f.call(_, v))
+ )
+ break;
+ u.push(K(K({}, p), {}, {isActiveDueToStickiness: !0}));
+ }
+ return J(u);
+ }
+ return {dropTargetForConsumers: s, getIsOver: f, dispatchEvent: d};
+}
+function Pe(e, t) {
+ var n = (typeof Symbol < `u` && e[Symbol.iterator]) || e[`@@iterator`];
+ if (!n) {
+ if (
+ Array.isArray(e) ||
+ (n = Fe(e)) ||
+ (t && e && typeof e.length == `number`)
+ ) {
+ n && (e = n);
+ var r = 0,
+ i = function () {};
+ return {
+ s: i,
+ n: function () {
+ return r >= e.length ? {done: !0} : {done: !1, value: e[r++]};
+ },
+ e: function (e) {
+ throw e;
+ },
+ f: i,
+ };
+ }
+ throw TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
+ }
+ var a,
+ o = !0,
+ s = !1;
+ return {
+ s: function () {
+ n = n.call(e);
+ },
+ n: function () {
+ var e = n.next();
+ return ((o = e.done), e);
+ },
+ e: function (e) {
+ ((s = !0), (a = e));
+ },
+ f: function () {
+ try {
+ o || n.return == null || n.return();
+ } finally {
+ if (s) throw a;
+ }
+ },
+ };
+}
+function Fe(e, t) {
+ if (e) {
+ if (typeof e == `string`) return Ie(e, t);
+ var n = {}.toString.call(e).slice(8, -1);
+ return (
+ n === `Object` && e.constructor && (n = e.constructor.name),
+ n === `Map` || n === `Set`
+ ? Array.from(e)
+ : n === `Arguments` ||
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
+ ? Ie(e, t)
+ : void 0
+ );
+ }
+}
+function Ie(e, t) {
+ (t == null || t > e.length) && (t = e.length);
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
+ return r;
+}
+function Le(e, t) {
+ var n = Object.keys(e);
+ if (Object.getOwnPropertySymbols) {
+ var r = Object.getOwnPropertySymbols(e);
+ (t &&
+ (r = r.filter(function (t) {
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
+ })),
+ n.push.apply(n, r));
+ }
+ return n;
+}
+function Re(e) {
+ for (var t = 1; t < arguments.length; t++) {
+ var n = arguments[t] == null ? {} : arguments[t];
+ t % 2
+ ? Le(Object(n), !0).forEach(function (t) {
+ w(e, t, n[t]);
+ })
+ : Object.getOwnPropertyDescriptors
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
+ : Le(Object(n)).forEach(function (t) {
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
+ });
+ }
+ return e;
+}
+function ze() {
+ var e = new Set(),
+ t = null;
+ function n(e) {
+ t && (!e.canMonitor || e.canMonitor(t.canMonitorArgs)) && t.active.add(e);
+ }
+ function r(r) {
+ var i = Re({}, r);
+ (e.add(i), n(i));
+ function a() {
+ (e.delete(i), t && t.active.delete(i));
+ }
+ return D(a);
+ }
+ function i(r) {
+ var i = r.eventName,
+ a = r.payload;
+ if (i === `onGenerateDragPreview`) {
+ t = {
+ canMonitorArgs: {initial: a.location.initial, source: a.source},
+ active: new Set(),
+ };
+ var o = Pe(e),
+ s;
+ try {
+ for (o.s(); !(s = o.n()).done; ) {
+ var c = s.value;
+ n(c);
+ }
+ } catch (e) {
+ o.e(e);
+ } finally {
+ o.f();
+ }
+ }
+ if (t) {
+ for (var l = Array.from(t.active), u = 0, d = l; u < d.length; u++) {
+ var f = d[u];
+ if (t.active.has(f)) {
+ var p;
+ (p = f[i]) == null || p.call(f, a);
+ }
+ }
+ i === `onDrop` && (t.active.clear(), (t = null));
+ }
+ }
+ return {dispatchEvent: i, monitorForConsumers: r};
+}
+function Be(e) {
+ var t = e.typeKey,
+ n = e.mount,
+ r = e.dispatchEventToSource,
+ i = e.onPostDispatch,
+ a = e.defaultDropEffect,
+ o = ze(),
+ s = Ne({typeKey: t, defaultDropEffect: a});
+ function c(e) {
+ (r?.(e), s.dispatchEvent(e), o.dispatchEvent(e), i?.(e));
+ }
+ function l(e) {
+ var t = e.event,
+ n = e.dragType;
+ H.start({
+ event: t,
+ dragType: n,
+ getDropTargetsOver: s.getIsOver,
+ dispatchEvent: c,
+ });
+ }
+ function u() {
+ function e() {
+ return n({canStart: H.canStart, start: l});
+ }
+ return ke({typeKey: t, mount: e});
+ }
+ return {
+ registerUsage: u,
+ dropTarget: s.dropTargetForConsumers,
+ monitor: o.monitorForConsumers,
+ };
+}
+var Ve = D(function () {
+ return navigator.userAgent.toLocaleLowerCase().includes(`android`);
+ }),
+ He = `pdnd:android-fallback`,
+ Ue = `text/plain`,
+ We = `application/vnd.pdnd`,
+ Y = new WeakMap();
+function Ge(e) {
+ return (
+ Y.set(e.element, e),
+ function () {
+ Y.delete(e.element);
+ }
+ );
+}
+var Ke = pe(),
+ X = Be({
+ typeKey: `element`,
+ defaultDropEffect: `move`,
+ mount: function (e) {
+ return W(
+ Ke.bindEvents(),
+ (0, x.bind)(document, {
+ type: `dragstart`,
+ listener: function (t) {
+ if (e.canStart(t) && !t.defaultPrevented && t.dataTransfer) {
+ var n = t.target;
+ if (n instanceof HTMLElement) {
+ var r = Y.get(n);
+ if (r) {
+ var i = I(t),
+ a = {
+ element: r.element,
+ dragHandle: r.dragHandle ?? null,
+ input: i,
+ };
+ if (r.canDrag && !r.canDrag(a)) {
+ t.preventDefault();
+ return;
+ }
+ if (r.dragHandle) {
+ var o = ne({x: i.clientX, y: i.clientY});
+ if (!r.dragHandle.contains(o)) {
+ t.preventDefault();
+ return;
+ }
+ }
+ var s = r.getInitialDataForExternal?.call(r, a) ?? null;
+ if (s)
+ for (var c = 0, l = Object.entries(s); c < l.length; c++) {
+ var u = y(l[c], 2),
+ d = u[0],
+ f = u[1];
+ t.dataTransfer.setData(d, f ?? ``);
+ }
+ (Ve() &&
+ !t.dataTransfer.types.includes(`text/plain`) &&
+ !t.dataTransfer.types.includes(`text/uri-list`) &&
+ t.dataTransfer.setData(Ue, He),
+ t.dataTransfer.setData(We, ``));
+ var p = {
+ type: `element`,
+ payload: {
+ element: r.element,
+ dragHandle: r.dragHandle ?? null,
+ data: r.getInitialData?.call(r, a) ?? {},
+ },
+ startedFrom: `internal`,
+ };
+ e.start({event: t, dragType: p});
+ }
+ }
+ }
+ },
+ })
+ );
+ },
+ dispatchEventToSource: function (e) {
+ var t,
+ n,
+ r = e.eventName,
+ i = e.payload;
+ (t = Y.get(i.source.element)) == null ||
+ (n = t[r]) == null ||
+ n.call(t, i);
+ },
+ onPostDispatch: Ke.getOnPostDispatch(),
+ }),
+ qe = X.dropTarget,
+ Je = X.monitor;
+function Ye(e) {
+ return D(
+ W(
+ X.registerUsage(),
+ Ge(e),
+ G(e.element, {attribute: `draggable`, value: `true`})
+ )
+ );
+}
+function Xe(e, t) {
+ var n = Object.keys(e);
+ if (Object.getOwnPropertySymbols) {
+ var r = Object.getOwnPropertySymbols(e);
+ (t &&
+ (r = r.filter(function (t) {
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
+ })),
+ n.push.apply(n, r));
+ }
+ return n;
+}
+function Ze(e) {
+ for (var t = 1; t < arguments.length; t++) {
+ var n = arguments[t] == null ? {} : arguments[t];
+ t % 2
+ ? Xe(Object(n), !0).forEach(function (t) {
+ w(e, t, n[t]);
+ })
+ : Object.getOwnPropertyDescriptors
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
+ : Xe(Object(n)).forEach(function (t) {
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
+ });
+ }
+ return e;
+}
+var Qe = {
+ top: function (e, t) {
+ return Math.abs(t.y - e.top);
+ },
+ right: function (e, t) {
+ return Math.abs(e.right - t.x);
+ },
+ bottom: function (e, t) {
+ return Math.abs(e.bottom - t.y);
+ },
+ left: function (e, t) {
+ return Math.abs(t.x - e.left);
+ },
+ },
+ $e = Symbol(`closestEdge`);
+function et(e, t) {
+ var n = t.element,
+ r = t.input,
+ i = t.allowedEdges,
+ a = {x: r.clientX, y: r.clientY},
+ o = n.getBoundingClientRect(),
+ s =
+ i
+ .map(function (e) {
+ return {edge: e, value: Qe[e](o, a)};
+ })
+ .sort(function (e, t) {
+ return e.value - t.value;
+ })[0]?.edge ?? null;
+ return Ze(Ze({}, e), {}, w({}, $e, s));
+}
+function Z(e) {
+ return e[$e] ?? null;
+}
+function tt(e) {
+ var t = e.element,
+ n = e.input;
+ return function (e) {
+ var r = e.container,
+ i = t.getBoundingClientRect(),
+ a = r.getBoundingClientRect();
+ return {
+ x: Math.min(n.clientX - i.x, a.width),
+ y: Math.min(n.clientY - i.y, a.height),
+ };
+ };
+}
+function nt(e, t) {
+ var n = Object.keys(e);
+ if (Object.getOwnPropertySymbols) {
+ var r = Object.getOwnPropertySymbols(e);
+ (t &&
+ (r = r.filter(function (t) {
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
+ })),
+ n.push.apply(n, r));
+ }
+ return n;
+}
+function rt(e) {
+ for (var t = 1; t < arguments.length; t++) {
+ var n = arguments[t] == null ? {} : arguments[t];
+ t % 2
+ ? nt(Object(n), !0).forEach(function (t) {
+ w(e, t, n[t]);
+ })
+ : Object.getOwnPropertyDescriptors
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
+ : nt(Object(n)).forEach(function (t) {
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
+ });
+ }
+ return e;
+}
+function it() {
+ return {x: 0, y: 0};
+}
+function at(e) {
+ var t = e.render,
+ n = e.nativeSetDragImage,
+ r = e.getOffset,
+ i = r === void 0 ? it : r,
+ a = document.createElement(`div`);
+ (O() && a.setAttribute(`popover`, `manual`),
+ Object.assign(
+ a.style,
+ rt(
+ rt({position: `fixed`}, O() ? E : {zIndex: T}),
+ {},
+ {top: 0, left: 0, pointerEvents: `none`}
+ )
+ ),
+ document.body.append(a),
+ O() && a.showPopover());
+ var o = t({container: a});
+ queueMicrotask(function () {
+ var e = i({container: a});
+ if (P()) {
+ var t = a.getBoundingClientRect();
+ if (t.width === 0) return;
+ a.style.left = `-${t.width - 1e-4}px`;
+ }
+ n?.(a, e.x, e.y);
+ });
+ function s() {
+ (c(), o?.(), document.body.removeChild(a));
+ }
+ var c = Je({onDragStart: s, onDrop: s});
+}
+function ot(e) {
+ var t = e.startIndex,
+ n = e.closestEdgeOfTarget,
+ r = e.indexOfTarget,
+ i = e.axis;
+ if (t === -1 || r === -1 || t === r) return t;
+ if (n == null) return r;
+ var a =
+ (i === `vertical` && n === `bottom`) ||
+ (i === `horizontal` && n === `right`);
+ return t < r ? (a ? r : r - 1) : a ? r + 1 : r;
+}
+var Q = {type: `idle`},
+ $ = {type: `idle`};
+function st(e) {
+ let t = Symbol(`drag-instance`),
+ n = Symbol(`drag-item`),
+ r = e.axis ?? `vertical`,
+ i =
+ e.allowedEdges ??
+ (r === `vertical` ? [`top`, `bottom`] : [`left`, `right`]);
+ function a(e, r, i) {
+ return {[n]: !0, id: e, index: r, instanceId: t, rect: i};
+ }
+ function o(e) {
+ return e[n] === !0;
+ }
+ let s = l({}),
+ c = l({});
+ function u(e, t) {
+ s[String(e)] = t;
+ }
+ function d(e, t) {
+ c[String(e)] = t;
+ }
+ function f(e) {
+ return s[String(e)] ?? Q;
+ }
+ function p(e) {
+ return c[String(e)] ?? $;
+ }
+ function m(e, n, r, l) {
+ let f = n ?? e,
+ m = String(r);
+ return (
+ m in s || (s[m] = Q),
+ m in c || (c[m] = $),
+ W(
+ Ye({
+ element: f,
+ getInitialData: () => a(r, l, e.getBoundingClientRect()),
+ onGenerateDragPreview({nativeSetDragImage: t, location: n}) {
+ let r = e.getBoundingClientRect();
+ at({
+ getOffset: tt({element: e, input: n.current.input}),
+ render({container: t}) {
+ let n = e.cloneNode(!0);
+ return (
+ (n.style.width = `${r.width}px`),
+ (n.style.height = `${r.height}px`),
+ t.appendChild(n),
+ () => n.remove()
+ );
+ },
+ nativeSetDragImage: t,
+ });
+ },
+ onDragStart() {
+ u(r, {type: `is-dragging`});
+ },
+ onDrop() {
+ u(r, Q);
+ },
+ }),
+ qe({
+ element: e,
+ getIsSticky: () => !0,
+ canDrop({source: e}) {
+ return o(e.data) && e.data.instanceId === t;
+ },
+ getData({input: t}) {
+ return et(a(r, l, e.getBoundingClientRect()), {
+ element: e,
+ input: t,
+ allowedEdges: i,
+ });
+ },
+ onDragEnter({source: e, self: t}) {
+ if (!o(e.data) || e.data.id === r) return;
+ let n = Z(t.data);
+ n &&
+ d(r, {
+ type: `is-over`,
+ closestEdge: n,
+ draggingRect: e.data.rect,
+ });
+ },
+ onDrag({source: e, self: t}) {
+ if (!o(e.data) || e.data.id === r) return;
+ let n = Z(t.data);
+ if (!n) return;
+ let i = p(r);
+ (i.type === `is-over` && i.closestEdge === n) ||
+ d(r, {
+ type: `is-over`,
+ closestEdge: n,
+ draggingRect: e.data.rect,
+ });
+ },
+ onDragLeave({source: e}) {
+ if (o(e.data)) {
+ if (e.data.id === r) {
+ u(r, {type: `is-dragging-and-left-self`});
+ return;
+ }
+ d(r, $);
+ }
+ },
+ onDrop() {
+ d(r, $);
+ },
+ })
+ )
+ );
+ }
+ function h() {
+ return Je({
+ canMonitor({source: e}) {
+ return o(e.data) && e.data.instanceId === t;
+ },
+ onDrop({location: t, source: n}) {
+ let i = t.current.dropTargets[0];
+ if (!i) return;
+ let a = n.data,
+ s = i.data;
+ if (!o(a) || !o(s)) return;
+ let c = a.index,
+ l = s.index,
+ u = ot({
+ startIndex: c,
+ closestEdgeOfTarget: Z(s),
+ indexOfTarget: l,
+ axis: r,
+ });
+ u !== c && e.onReorder(c, u);
+ },
+ });
+ }
+ return {registerItem: m, getDragState: f, getDropState: p, setupMonitor: h};
+}
+var ct = [`label`],
+ lt = {slot: `content`},
+ ut = [`disabled`],
+ dt = [`disabled`],
+ ft = u(
+ n({
+ __name: `ReorderButton`,
+ props: {label: {default: t(`Reorder`)}, position: {default: `middle`}},
+ emits: [`click:up`, `click:down`],
+ setup(e, {emit: n}) {
+ let i = n;
+ return (n, o) => (
+ a(),
+ p(`craft-action-menu`, null, [
+ f(
+ `craft-button`,
+ r(
+ {
+ slot: `invoker`,
+ type: `button`,
+ icon: ``,
+ size: `small`,
+ appearance: `plain`,
+ },
+ n.$attrs
+ ),
+ [
+ f(
+ `craft-icon`,
+ {name: `custom-icons/grip-dots`, label: e.label},
+ null,
+ 8,
+ ct
+ ),
+ ],
+ 16
+ ),
+ f(`div`, lt, [
+ f(
+ `craft-action-item`,
+ {
+ icon: `arrow-up`,
+ onClick: (o[0] ||= (e) => i(`click:up`)),
+ disabled: e.position === `first`,
+ },
+ d(c(t)(`Move up`)),
+ 9,
+ ut
+ ),
+ f(
+ `craft-action-item`,
+ {
+ icon: `arrow-down`,
+ onClick: (o[1] ||= (e) => i(`click:down`)),
+ disabled: e.position === `last`,
+ },
+ d(c(t)(`Move down`)),
+ 9,
+ dt
+ ),
+ ]),
+ ])
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-7c438f5a`]]
+ ),
+ pt = u(
+ n({
+ __name: `DropIndicator`,
+ props: {
+ edge: {},
+ contained: {type: Boolean},
+ inline: {type: Boolean},
+ visible: {type: Boolean},
+ },
+ setup(e) {
+ return (t, n) =>
+ e.edge || e.inline
+ ? (a(),
+ p(
+ `div`,
+ {
+ key: 0,
+ class: i({
+ 'drop-indicator': !0,
+ 'drop-indicator--contained': e.contained,
+ 'drop-indicator--top': e.edge === `top`,
+ 'drop-indicator--bottom': e.edge === `bottom`,
+ 'drop-indicator--left': e.edge === `left`,
+ 'drop-indicator--right': e.edge === `right`,
+ 'drop-indicator--horizontal':
+ !e.edge || [`top`, `bottom`].includes(e.edge),
+ 'drop-indicator--vertical':
+ e.edge && [`left`, `right`].includes(e.edge),
+ 'drop-indicator--inline': e.inline,
+ 'drop-indicator--active': e.visible,
+ }),
+ },
+ null,
+ 2
+ ))
+ : s(``, !0);
+ },
+ }),
+ [[`__scopeId`, `data-v-b40db0b5`]]
+ ),
+ mt = {class: `py-20 w-full`},
+ ht = {
+ class: `w-[60ch] mx-auto text-center grid gap-3 justify-items-center text-gray-500`,
+ },
+ gt = [`name`],
+ _t = {class: `text-lg`},
+ vt = n({
+ __name: `Empty`,
+ props: {icon: {}, label: {}},
+ setup(e) {
+ return (t, n) => (
+ a(),
+ p(`div`, mt, [
+ f(`div`, ht, [
+ o(t.$slots, `graphic`, {}, () => [
+ e.icon
+ ? (a(),
+ p(
+ `craft-icon`,
+ {
+ key: 0,
+ name: e.icon,
+ style: {'font-size': `calc(48rem / 16)`},
+ },
+ null,
+ 8,
+ gt
+ ))
+ : s(``, !0),
+ ]),
+ o(t.$slots, `content`, {}, () => [f(`p`, _t, d(e.label), 1)]),
+ o(t.$slots, `default`),
+ ]),
+ ])
+ );
+ },
+ });
+export {st as i, pt as n, ft as r, vt as t};
diff --git a/resources/build/assets/EntryTypes-CKViChIe.js b/resources/build/assets/EntryTypes-CKViChIe.js
new file mode 100644
index 00000000000..373a5795b6b
--- /dev/null
+++ b/resources/build/assets/EntryTypes-CKViChIe.js
@@ -0,0 +1,188 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ _ as a,
+ ct as o,
+ gt as s,
+ ht as c,
+ k as l,
+ tt as u,
+ w as d,
+ y as f,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as p, o as m, r as h, t as g} from './AdminTable-32qWVDq-.js';
+import {t as _} from './Empty-D0VMu5kQ.js';
+import {t as v} from './Pane-CJi1MPPH.js';
+import {s as y} from './InlineFlash-DnK6Yp2V.js';
+import {t as b} from './DeleteButton-BLk4eDvl.js';
+import {t as x} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as S} from './DynamicHtmlRenderer-tRw5R4gl.js';
+import {t as C} from './AppLayout-BXGMFlSp.js';
+import {i as w, n as T, r as E} from './EntryTypesController-BmQTZRaT.js';
+import {n as D, r as O, t as k} from './useServerSort-DgkJYi_Z.js';
+var A = t({
+ __name: `EntryTypes`,
+ props: {
+ title: {},
+ pagination: {},
+ sort: {},
+ searchTerm: {},
+ data: {},
+ readOnly: {type: Boolean},
+ },
+ setup(t) {
+ let A = t;
+ function j(t) {
+ confirm(
+ e(
+ `Are you sure you want to delete “{name}” and all entries of that type?`,
+ {name: t.title}
+ )
+ ) && s.delete(E(t.id));
+ }
+ let M = o(A.searchTerm ?? ``),
+ N = a(() => A.data),
+ P = x(),
+ F = a(() => ({name: !0, handle: !0, usages: !0, actions: !A.readOnly})),
+ I = a(() => [
+ P.display({
+ id: `name`,
+ header: e(`Entry Type`),
+ cell: ({row: e}) => l(S, {html: e.original.chip}),
+ }),
+ P.accessor(`handle`, {
+ header: e(`Handle`),
+ meta: {cellClass: `justify-center`},
+ cell: ({getValue: e}) => l(`craft-copy-attribute`, {value: e()}, e()),
+ }),
+ P.accessor(`usages`, {
+ header: e(`Usages`),
+ cell: ({getValue: e}) => l(S, {html: e()}),
+ }),
+ P.actions(({row: e}) => [l(b, {onClick: () => j(e.original)})]),
+ ]),
+ {paginationState: L, paginationConfig: R} = O({
+ initialState: A.pagination,
+ onChange: ({query: e}) => {
+ s.visit(w({query: e}), {
+ only: [`data`, `pagination`],
+ preserveScroll: !0,
+ });
+ },
+ }),
+ {sortingState: z, sortingConfig: B} = k({
+ initialState: A.sort,
+ onChange: ({query: e}) => {
+ s.visit(w({query: e}), {only: [`data`, `sort`], preserveScroll: !0});
+ },
+ }),
+ V = p({
+ get data() {
+ return N.value;
+ },
+ get columns() {
+ return I.value;
+ },
+ state: {
+ get pagination() {
+ return L.value;
+ },
+ get sorting() {
+ return z.value;
+ },
+ get columnVisibility() {
+ return F.value;
+ },
+ },
+ getCoreRowModel: m(),
+ ...R,
+ ...B,
+ });
+ return (a, o) => (
+ n(),
+ f(
+ C,
+ {title: t.title},
+ {
+ actions: i(() => [
+ r(
+ y,
+ {
+ appearance: `button`,
+ href: c(T)[`/admin/settings/entry-types/new`]().url,
+ variant: `accent`,
+ inertia: !1,
+ icon: `plus`,
+ },
+ {default: i(() => [d(u(c(e)(`New entry type`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ default: i(() => [
+ r(
+ v,
+ {padding: 0, appearance: `raised`},
+ {
+ default: i(() => [
+ r(
+ g,
+ {
+ spacing: c(h).Relaxed,
+ table: c(V),
+ reorderable: !1,
+ from: t.pagination.from,
+ to: t.pagination.to,
+ total: t.pagination.total,
+ 'enable-adjust-page-size': !0,
+ },
+ {
+ 'empty-row': i(() => [
+ r(
+ _,
+ {
+ icon: `light/files`,
+ label: c(e)(`No entry types exist yet.`),
+ },
+ null,
+ 8,
+ [`label`]
+ ),
+ ]),
+ 'search-form': i(() => [
+ r(
+ D,
+ {
+ action: c(w)(),
+ modelValue: M.value,
+ 'onUpdate:modelValue': (o[0] ||= (e) =>
+ (M.value = e)),
+ },
+ null,
+ 8,
+ [`action`, `modelValue`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`spacing`, `table`, `from`, `to`, `total`]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`]
+ )
+ );
+ },
+});
+export {A as default};
diff --git a/resources/build/assets/EntryTypesController-BmQTZRaT.js b/resources/build/assets/EntryTypesController-BmQTZRaT.js
new file mode 100644
index 00000000000..ec3f270f1a5
--- /dev/null
+++ b/resources/build/assets/EntryTypesController-BmQTZRaT.js
@@ -0,0 +1,129 @@
+import {n as e, r as t, t as n} from './wayfinder-V597ZF_3.js';
+var r = (e) => ({url: r.url(e), method: `get`});
+((r.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/actions/entry-types/table-data`,
+}),
+ (r.url = (t) => r.definition.url + e(t)),
+ (r.get = (e) => ({url: r.url(e), method: `get`})),
+ (r.head = (e) => ({url: r.url(e), method: `head`})));
+var i = (e, t) => ({url: i.url(e, t), method: `get`});
+((i.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/actions/entry-types/edit/{entryType?}`,
+}),
+ (i.url = (r, a) => {
+ ((typeof r == `string` || typeof r == `number`) && (r = {entryType: r}),
+ typeof r == `object` &&
+ !Array.isArray(r) &&
+ `id` in r &&
+ (r = {entryType: r.id}),
+ Array.isArray(r) && (r = {entryType: r[0]}),
+ (r = n(r)),
+ t(r, [`entryType`]));
+ let o = {
+ entryType:
+ typeof r?.entryType == `object` ? r.entryType.id : r?.entryType,
+ };
+ return (
+ i.definition.url
+ .replace(`{entryType?}`, o.entryType?.toString() ?? ``)
+ .replace(/\/+$/, ``) + e(a)
+ );
+ }),
+ (i.get = (e, t) => ({url: i.url(e, t), method: `get`})),
+ (i.head = (e, t) => ({url: i.url(e, t), method: `head`})));
+var a = (e, t) => ({url: a.url(e, t), method: `get`});
+((a.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/entry-types/{entryType}`,
+}),
+ (a.url = (t, r) => {
+ ((typeof t == `string` || typeof t == `number`) && (t = {entryType: t}),
+ typeof t == `object` &&
+ !Array.isArray(t) &&
+ `id` in t &&
+ (t = {entryType: t.id}),
+ Array.isArray(t) && (t = {entryType: t[0]}),
+ (t = n(t)));
+ let i = {
+ entryType: typeof t.entryType == `object` ? t.entryType.id : t.entryType,
+ };
+ return (
+ a.definition.url
+ .replace(`{entryType}`, i.entryType.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (a.get = (e, t) => ({url: a.url(e, t), method: `get`})),
+ (a.head = (e, t) => ({url: a.url(e, t), method: `head`})));
+var o = (e) => ({url: o.url(e), method: `get`});
+((o.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/actions/entry-types/new`,
+}),
+ (o.url = (t) => o.definition.url + e(t)),
+ (o.get = (e) => ({url: o.url(e), method: `get`})),
+ (o.head = (e) => ({url: o.url(e), method: `head`})));
+var s = (e) => ({url: s.url(e), method: `get`});
+((s.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/entry-types/new`,
+}),
+ (s.url = (t) => s.definition.url + e(t)),
+ (s.get = (e) => ({url: s.url(e), method: `get`})),
+ (s.head = (e) => ({url: s.url(e), method: `head`})));
+var c = {
+ '/admin/actions/entry-types/new': o,
+ '/admin/settings/entry-types/new': s,
+ },
+ l = (e) => ({url: l.url(e), method: `post`});
+((l.definition = {methods: [`post`], url: `/admin/actions/entry-types/save`}),
+ (l.url = (t) => l.definition.url + e(t)),
+ (l.post = (e) => ({url: l.url(e), method: `post`})));
+var u = (e) => ({url: u.url(e), method: `post`});
+((u.definition = {
+ methods: [`post`],
+ url: `/admin/actions/entry-types/render-override-settings`,
+}),
+ (u.url = (t) => u.definition.url + e(t)),
+ (u.post = (e) => ({url: u.url(e), method: `post`})));
+var d = (e) => ({url: d.url(e), method: `post`});
+((d.definition = {
+ methods: [`post`],
+ url: `/admin/actions/entry-types/apply-override-settings`,
+}),
+ (d.url = (t) => d.definition.url + e(t)),
+ (d.post = (e) => ({url: d.url(e), method: `post`})));
+var f = (e) => ({url: f.url(e), method: `get`});
+((f.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/entry-types`,
+}),
+ (f.url = (t) => f.definition.url + e(t)),
+ (f.get = (e) => ({url: f.url(e), method: `get`})),
+ (f.head = (e) => ({url: f.url(e), method: `head`})));
+var p = (e, t) => ({url: p.url(e, t), method: `delete`});
+((p.definition = {
+ methods: [`delete`],
+ url: `/admin/settings/entry-types/{entryType}`,
+}),
+ (p.url = (t, r) => {
+ ((typeof t == `string` || typeof t == `number`) && (t = {entryType: t}),
+ typeof t == `object` &&
+ !Array.isArray(t) &&
+ `id` in t &&
+ (t = {entryType: t.id}),
+ Array.isArray(t) && (t = {entryType: t[0]}),
+ (t = n(t)));
+ let i = {
+ entryType: typeof t.entryType == `object` ? t.entryType.id : t.entryType,
+ };
+ return (
+ p.definition.url
+ .replace(`{entryType}`, i.entryType.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (p.delete = (e, t) => ({url: p.url(e, t), method: `delete`})));
+export {u as a, f as i, c as n, p as r, d as t};
diff --git a/resources/build/assets/Fields-B8SKKjui.js b/resources/build/assets/Fields-B8SKKjui.js
new file mode 100644
index 00000000000..e78c09fa021
--- /dev/null
+++ b/resources/build/assets/Fields-B8SKKjui.js
@@ -0,0 +1,330 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ _ as a,
+ ct as o,
+ gt as s,
+ ht as c,
+ k as l,
+ tt as u,
+ w as d,
+ y as f,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {a as p, i as m, o as h, t as g} from './AdminTable-32qWVDq-.js';
+import {t as _} from './Empty-D0VMu5kQ.js';
+import {t as v} from './Pane-CJi1MPPH.js';
+import {s as y} from './InlineFlash-DnK6Yp2V.js';
+import {n as b, t as x} from './wayfinder-V597ZF_3.js';
+import {t as S} from './DeleteButton-BLk4eDvl.js';
+import {t as C} from './AppLayout-BXGMFlSp.js';
+import {n as w, r as T, t as E} from './useServerSort-DgkJYi_Z.js';
+var D = (e) => ({url: D.url(e), method: `get`});
+((D.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/actions/fields/edit-field`,
+}),
+ (D.url = (e) => D.definition.url + b(e)),
+ (D.get = (e) => ({url: D.url(e), method: `get`})),
+ (D.head = (e) => ({url: D.url(e), method: `head`})));
+var O = (e, t) => ({url: O.url(e, t), method: `get`});
+((O.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/fields/edit/{fieldId}`,
+}),
+ (O.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {fieldId: e}),
+ Array.isArray(e) && (e = {fieldId: e[0]}),
+ (e = x(e)));
+ let n = {fieldId: e.fieldId};
+ return (
+ O.definition.url
+ .replace(`{fieldId}`, n.fieldId.toString())
+ .replace(/\/+$/, ``) + b(t)
+ );
+ }),
+ (O.get = (e, t) => ({url: O.url(e, t), method: `get`})),
+ (O.head = (e, t) => ({url: O.url(e, t), method: `head`})));
+var k = (e) => ({url: k.url(e), method: `post`});
+((k.definition = {
+ methods: [`post`],
+ url: `/admin/actions/fields/render-settings`,
+}),
+ (k.url = (e) => k.definition.url + b(e)),
+ (k.post = (e) => ({url: k.url(e), method: `post`})));
+var A = (e) => ({url: A.url(e), method: `post`});
+((A.definition = {methods: [`post`], url: `/admin/actions/fields/save-field`}),
+ (A.url = (e) => A.definition.url + b(e)),
+ (A.post = (e) => ({url: A.url(e), method: `post`})));
+var j = (e) => ({url: j.url(e), method: `post`});
+((j.definition = {
+ methods: [`post`],
+ url: `/admin/actions/fields/render-layout-component-settings`,
+}),
+ (j.url = (e) => j.definition.url + b(e)),
+ (j.post = (e) => ({url: j.url(e), method: `post`})));
+var M = (e) => ({url: M.url(e), method: `post`});
+((M.definition = {
+ methods: [`post`],
+ url: `/admin/actions/fields/apply-layout-tab-settings`,
+}),
+ (M.url = (e) => M.definition.url + b(e)),
+ (M.post = (e) => ({url: M.url(e), method: `post`})));
+var N = (e) => ({url: N.url(e), method: `post`});
+((N.definition = {
+ methods: [`post`],
+ url: `/admin/actions/fields/apply-layout-element-settings`,
+}),
+ (N.url = (e) => N.definition.url + b(e)),
+ (N.post = (e) => ({url: N.url(e), method: `post`})));
+var P = (e) => ({url: P.url(e), method: `post`});
+((P.definition = {
+ methods: [`post`],
+ url: `/admin/actions/fields/render-card-preview`,
+}),
+ (P.url = (e) => P.definition.url + b(e)),
+ (P.post = (e) => ({url: P.url(e), method: `post`})));
+var F = (e) => ({url: F.url(e), method: `get`});
+((F.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/actions/fields/table-data`,
+}),
+ (F.url = (e) => F.definition.url + b(e)),
+ (F.get = (e) => ({url: F.url(e), method: `get`})),
+ (F.head = (e) => ({url: F.url(e), method: `head`})));
+var I = (e) => ({url: I.url(e), method: `get`});
+((I.definition = {methods: [`get`, `head`], url: `/admin/settings/fields`}),
+ (I.url = (e) => I.definition.url + b(e)),
+ (I.get = (e) => ({url: I.url(e), method: `get`})),
+ (I.head = (e) => ({url: I.url(e), method: `head`})));
+var L = (e) => ({url: L.url(e), method: `get`});
+((L.definition = {methods: [`get`, `head`], url: `/admin/settings/fields/new`}),
+ (L.url = (e) => L.definition.url + b(e)),
+ (L.get = (e) => ({url: L.url(e), method: `get`})),
+ (L.head = (e) => ({url: L.url(e), method: `head`})));
+var R = (e, t) => ({url: R.url(e, t), method: `delete`});
+((R.definition = {
+ methods: [`delete`],
+ url: `/admin/settings/fields/{fieldId}`,
+}),
+ (R.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {fieldId: e}),
+ Array.isArray(e) && (e = {fieldId: e[0]}),
+ (e = x(e)));
+ let n = {fieldId: e.fieldId};
+ return (
+ R.definition.url
+ .replace(`{fieldId}`, n.fieldId.toString())
+ .replace(/\/+$/, ``) + b(t)
+ );
+ }),
+ (R.delete = (e, t) => ({url: R.url(e, t), method: `delete`})));
+var z = t({
+ __name: `Fields`,
+ props: {
+ title: {},
+ readOnly: {type: Boolean},
+ data: {},
+ sort: {},
+ searchTerm: {},
+ pagination: {},
+ isMultiSite: {type: Boolean},
+ },
+ setup(t) {
+ let b = t;
+ function x(t) {
+ confirm(
+ e(`Are you sure you want to delete “{name}”?`, {name: t.title})
+ ) && s.delete(R({fieldId: t.id}));
+ }
+ let D = o(b.searchTerm ?? ``),
+ O = p(),
+ k = a(() => ({
+ name: !0,
+ searchable: !0,
+ translatable: b.isMultiSite,
+ handle: !0,
+ type: !0,
+ usages: !0,
+ actions: !b.readOnly,
+ })),
+ A = o([
+ O.accessor(`title`, {
+ header: e(`Name`),
+ meta: {trackSize: `1.5fr`},
+ cell: ({row: e, getValue: t}) =>
+ l(y, {href: e.original.url, inertia: !1, class: `font-bold`}, t),
+ }),
+ O.accessor(`searchable`, {
+ header: e(`Searchable`),
+ meta: {trackSize: `34px`, headerSrOnly: !0},
+ enableSorting: !1,
+ cell: ({row: t}) => {
+ if (t.original.searchable)
+ return l(`craft-icon`, {
+ appearance: `badge`,
+ name: `magnifying-glass`,
+ label: e(`This field’s values are used as search keywords.`),
+ });
+ },
+ }),
+ O.accessor(`translatable`, {
+ header: e(`Translatable`),
+ meta: {trackSize: `34px`, headerSrOnly: !0},
+ enableSorting: !1,
+ cell: ({getValue: e}) => {
+ if (e())
+ return l(`craft-icon`, {
+ appearance: `badge`,
+ name: `custom-icons/language`,
+ label: e(),
+ });
+ },
+ }),
+ O.accessor(`handle`, {
+ header: e(`Handle`),
+ cell: ({getValue: e}) => l(`craft-copy-attribute`, {value: e()}, e),
+ }),
+ O.display({
+ id: `type`,
+ header: e(`Type`),
+ cell: ({row: t}) =>
+ t.original.type.isMissing
+ ? e(`Missing`)
+ : l(`div`, {class: `flex items-center gap-2`}, [
+ l(`craft-icon`, t.original.type.icon),
+ l(`span`, t.original.type.label),
+ ]),
+ }),
+ O.accessor(`usages`, {header: e(`Used by`)}),
+ O.display({
+ id: `actions`,
+ meta: {trackSize: `60px`},
+ cell: ({row: e}) =>
+ l(`div`, {class: `self-end flex justify-end`}, [
+ l(S, {onClick: () => x(e.original)}),
+ ]),
+ }),
+ ]),
+ {paginationState: j, paginationConfig: M} = T({
+ initialState: b.pagination,
+ onChange: ({query: e}) => {
+ s.visit(I({query: e}), {
+ only: [`data`, `pagination`],
+ preserveScroll: !0,
+ });
+ },
+ }),
+ {sortingState: N, sortingConfig: P} = E({
+ initialState: b.sort,
+ onChange: ({query: e}) => {
+ s.visit(I({query: e}), {only: [`data`, `sort`], preserveScroll: !0});
+ },
+ }),
+ F = m({
+ get data() {
+ return b.data;
+ },
+ get columns() {
+ return A.value;
+ },
+ state: {
+ get pagination() {
+ return j.value;
+ },
+ get columnVisibility() {
+ return k.value;
+ },
+ get sorting() {
+ return N.value;
+ },
+ },
+ getCoreRowModel: h(),
+ ...M,
+ ...P,
+ });
+ return (a, o) => (
+ n(),
+ f(
+ C,
+ {title: t.title},
+ {
+ actions: i(() => [
+ r(
+ y,
+ {
+ inertia: !1,
+ appearance: `button`,
+ variant: `accent`,
+ href: c(L)(),
+ icon: `plus`,
+ },
+ {default: i(() => [d(u(c(e)(`New field`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ default: i(() => [
+ r(
+ v,
+ {padding: 0, appearance: `raised`},
+ {
+ default: i(() => [
+ r(
+ g,
+ {
+ table: c(F),
+ reorderable: !1,
+ from: t.pagination.from,
+ to: t.pagination.to,
+ total: t.pagination.total,
+ 'enable-adjust-page-size': !0,
+ },
+ {
+ 'empty-row': i(() => [
+ r(
+ _,
+ {
+ icon: `light/pen-to-square`,
+ label: c(e)(`No fields exist yet.`),
+ },
+ null,
+ 8,
+ [`label`]
+ ),
+ ]),
+ 'search-form': i(() => [
+ r(
+ w,
+ {
+ modelValue: D.value,
+ 'onUpdate:modelValue': (o[0] ||= (e) =>
+ (D.value = e)),
+ },
+ null,
+ 8,
+ [`modelValue`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`, `from`, `to`, `total`]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`]
+ )
+ );
+ },
+});
+export {z as default};
diff --git a/resources/build/assets/Filesystems-bLjk6NKr.js b/resources/build/assets/Filesystems-bLjk6NKr.js
new file mode 100644
index 00000000000..a2f98023129
--- /dev/null
+++ b/resources/build/assets/Filesystems-bLjk6NKr.js
@@ -0,0 +1,243 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ _ as a,
+ ct as o,
+ gt as s,
+ ht as c,
+ k as l,
+ tt as u,
+ w as d,
+ y as f,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as p, o as m, t as h} from './AdminTable-32qWVDq-.js';
+import {t as g} from './Empty-D0VMu5kQ.js';
+import {t as _} from './Pane-CJi1MPPH.js';
+import {s as v} from './InlineFlash-DnK6Yp2V.js';
+import {n as y, t as b} from './wayfinder-V597ZF_3.js';
+import {t as x} from './DeleteButton-BLk4eDvl.js';
+import {t as S} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as C} from './AppLayout-BXGMFlSp.js';
+var w = (e) => ({url: w.url(e), method: `get`});
+((w.definition = {methods: [`get`, `head`], url: `/admin/actions/fs/edit`}),
+ (w.url = (e) => w.definition.url + y(e)),
+ (w.get = (e) => ({url: w.url(e), method: `get`})),
+ (w.head = (e) => ({url: w.url(e), method: `head`})));
+var T = (e, t) => ({url: T.url(e, t), method: `get`});
+((T.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/filesystems/{handle}`,
+}),
+ (T.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {handle: e}),
+ Array.isArray(e) && (e = {handle: e[0]}),
+ (e = b(e)));
+ let n = {handle: e.handle};
+ return (
+ T.definition.url
+ .replace(`{handle}`, n.handle.toString())
+ .replace(/\/+$/, ``) + y(t)
+ );
+ }),
+ (T.get = (e, t) => ({url: T.url(e, t), method: `get`})),
+ (T.head = (e, t) => ({url: T.url(e, t), method: `head`})));
+var E = (e, t) => ({url: E.url(e, t), method: `get`});
+((E.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/filesystems/{handle}/edit`,
+}),
+ (E.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {handle: e}),
+ Array.isArray(e) && (e = {handle: e[0]}),
+ (e = b(e)));
+ let n = {handle: e.handle};
+ return (
+ E.definition.url
+ .replace(`{handle}`, n.handle.toString())
+ .replace(/\/+$/, ``) + y(t)
+ );
+ }),
+ (E.get = (e, t) => ({url: E.url(e, t), method: `get`})),
+ (E.head = (e, t) => ({url: E.url(e, t), method: `head`})));
+var D = {
+ '/admin/actions/fs/edit': w,
+ '/admin/settings/filesystems/{handle}': T,
+ '/admin/settings/filesystems/{handle}/edit': E,
+ },
+ O = (e) => ({url: O.url(e), method: `post`});
+((O.definition = {methods: [`post`], url: `/admin/actions/fs/save`}),
+ (O.url = (e) => O.definition.url + y(e)),
+ (O.post = (e) => ({url: O.url(e), method: `post`})));
+var k = (e, t) => ({url: k.url(e, t), method: `post`});
+((k.definition = {
+ methods: [`post`],
+ url: `/admin/settings/filesystems/{handle}`,
+}),
+ (k.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {handle: e}),
+ Array.isArray(e) && (e = {handle: e[0]}),
+ (e = b(e)));
+ let n = {handle: e.handle};
+ return (
+ k.definition.url
+ .replace(`{handle}`, n.handle.toString())
+ .replace(/\/+$/, ``) + y(t)
+ );
+ }),
+ (k.post = (e, t) => ({url: k.url(e, t), method: `post`})));
+var A = (e) => ({url: A.url(e), method: `get`});
+((A.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/filesystems`,
+}),
+ (A.url = (e) => A.definition.url + y(e)),
+ (A.get = (e) => ({url: A.url(e), method: `get`})),
+ (A.head = (e) => ({url: A.url(e), method: `head`})));
+var j = (e) => ({url: j.url(e), method: `get`});
+((j.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/filesystems/new`,
+}),
+ (j.url = (e) => j.definition.url + y(e)),
+ (j.get = (e) => ({url: j.url(e), method: `get`})),
+ (j.head = (e) => ({url: j.url(e), method: `head`})));
+var M = (e, t) => ({url: M.url(e, t), method: `delete`});
+((M.definition = {
+ methods: [`delete`],
+ url: `/admin/settings/filesystems/{handle}`,
+}),
+ (M.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {handle: e}),
+ Array.isArray(e) && (e = {handle: e[0]}),
+ (e = b(e)));
+ let n = {handle: e.handle};
+ return (
+ M.definition.url
+ .replace(`{handle}`, n.handle.toString())
+ .replace(/\/+$/, ``) + y(t)
+ );
+ }),
+ (M.delete = (e, t) => ({url: M.url(e, t), method: `delete`})));
+var N = t({
+ __name: `Filesystems`,
+ props: {filesystems: {}, readOnly: {type: Boolean}},
+ setup(t) {
+ let y = t;
+ function b(t) {
+ confirm(e(`Are you sure you want to delete “{name}”`, {name: t.name})) &&
+ s.delete(M(t.handle));
+ }
+ let w = S(),
+ T = a(() => ({name: !0, handle: !0, type: !0, actions: !y.readOnly})),
+ E = o([
+ w.link(`name`, {
+ header: e(`Name`),
+ props: ({row: e}) => ({
+ href: D[`/admin/settings/filesystems/{handle}/edit`]({
+ handle: e.original.handle,
+ }).url,
+ inertia: !1,
+ }),
+ }),
+ w.handle(`handle`),
+ w.accessor(`type`, {
+ header: e(`Type`),
+ cell: ({row: e, getValue: t}) =>
+ e.original.missing ? l(`span`, {class: `c-color-error`}, t()) : t(),
+ }),
+ w.actions(({row: e}) => [l(x, {onClick: () => b(e.original)})]),
+ ]),
+ O = p({
+ get data() {
+ return y.filesystems;
+ },
+ get columns() {
+ return E.value;
+ },
+ state: {
+ get columnVisibility() {
+ return T.value;
+ },
+ },
+ enableSorting: !1,
+ getCoreRowModel: m(),
+ });
+ return (t, a) => (
+ n(),
+ f(C, null, {
+ actions: i(() => [
+ r(
+ v,
+ {
+ variant: `accent`,
+ appearance: `button`,
+ href: c(j)().url,
+ inertia: !1,
+ },
+ {default: i(() => [d(u(c(e)(`New filesystem`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ default: i(() => [
+ r(
+ _,
+ {padding: 0, appearance: `raised`},
+ {
+ default: i(() => [
+ r(
+ h,
+ {table: c(O), reorderable: !1},
+ {
+ 'empty-row': i(() => [
+ r(
+ g,
+ {
+ label: c(e)(`No filesystems exist yet.`),
+ icon: `light/folder-open`,
+ },
+ {
+ default: i(() => [
+ r(
+ v,
+ {
+ appearance: `button`,
+ href: c(j)().url,
+ inertia: !1,
+ },
+ {
+ default: i(() => [
+ d(u(c(e)(`New filesystem`)), 1),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ })
+ );
+ },
+});
+export {N as default};
diff --git a/resources/build/assets/General-DdwcLjLf.js b/resources/build/assets/General-DdwcLjLf.js
new file mode 100644
index 00000000000..70f1236c70e
--- /dev/null
+++ b/resources/build/assets/General-DdwcLjLf.js
@@ -0,0 +1,294 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ _ as a,
+ ht as o,
+ s,
+ t as c,
+ tt as l,
+ v as u,
+ w as d,
+ y as f,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as p} from './Pane-CJi1MPPH.js';
+import {i as m, n as h} from './wayfinder-V597ZF_3.js';
+import {t as g} from './CraftInput-B2G9EaE3.js';
+import {t as _} from './AppLayout-BXGMFlSp.js';
+import {t as v} from './CraftCombobox-NlyOETnv.js';
+import {t as y} from './useSettingsSave-D5LL4sJi.js';
+import {t as b} from './transformBooleanOptions-BLp8ecwx.js';
+var x = (e) => ({url: x.url(e), method: `get`});
+((x.definition = {methods: [`get`, `head`], url: `/admin/settings/general`}),
+ (x.url = (e) => x.definition.url + h(e)),
+ (x.get = (e) => ({url: x.url(e), method: `get`})),
+ (x.head = (e) => ({url: x.url(e), method: `head`})));
+var S = (e) => ({url: S.url(e), method: `post`});
+((S.definition = {methods: [`post`], url: `/admin/settings/general`}),
+ (S.url = (e) => S.definition.url + h(e)),
+ (S.post = (e) => ({url: S.url(e), method: `post`})));
+var C = {class: `grid gap-3`},
+ w = {variant: `info`, appearance: `plain`, class: `p-0`, icon: `lightbulb`},
+ T = {
+ href: `https://craftcms.com/docs/5.x/configure.html#control-panel-settings`,
+ },
+ E = [`innerHTML`],
+ D = [`innerHTML`],
+ O = c(
+ t({
+ __name: `General`,
+ props: {
+ system: {},
+ nameSuggestions: {default: () => []},
+ timezoneOptions: {default: () => []},
+ systemStatusOptions: {default: () => []},
+ flash: {},
+ errors: {},
+ },
+ setup(t) {
+ let c = t,
+ h = a(() => c.errors),
+ {readOnly: x} = m(),
+ O = s({
+ name: c.system.name ?? ``,
+ live: c.system.live,
+ retryDuration: c.system.retryDuration,
+ timeZone: c.system.timeZone,
+ }),
+ {save: k} = y(O, S),
+ A = a(() =>
+ b(c.systemStatusOptions, {
+ trueLabel: e(`Online`),
+ falseLabel: e(`Offline`),
+ })
+ ),
+ j = a(() => [
+ {
+ value: `1`,
+ label: e(`Online`),
+ data: {indicator: {variant: `success`}},
+ },
+ {
+ value: `0`,
+ label: e(`Offline`),
+ data: {indicator: {variant: `empty`}},
+ },
+ ...A.value,
+ ]);
+ return (a, s) => (
+ n(),
+ f(
+ _,
+ {title: o(e)(`General Settings`), form: o(O), onSave: o(k)},
+ {
+ default: i(() => [
+ r(
+ p,
+ {appearance: `raised`},
+ {
+ default: i(() => [
+ u(`div`, C, [
+ r(
+ v,
+ {
+ label: o(e)(`System Name`),
+ id: `name`,
+ name: `name`,
+ modelValue: o(O).name,
+ 'onUpdate:modelValue': (s[0] ||= (e) =>
+ (o(O).name = e)),
+ 'has-feedback-for': h.value?.name ? `error` : ``,
+ disabled: o(x),
+ 'require-option-match': !1,
+ 'show-all-on-empty': ``,
+ options: t.nameSuggestions,
+ error: h.value?.name,
+ },
+ {
+ after: i(() => [
+ u(`craft-callout`, w, [
+ d(
+ l(
+ o(e)(
+ `This can begin with an environment variable.`
+ )
+ ) + ` `,
+ 1
+ ),
+ u(`a`, T, l(o(e)(`Learn more`)), 1),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [
+ `label`,
+ `modelValue`,
+ `has-feedback-for`,
+ `disabled`,
+ `options`,
+ `error`,
+ ]
+ ),
+ r(
+ v,
+ {
+ label: o(e)(`System Status`),
+ id: `live`,
+ name: `live`,
+ modelValue: o(O).live,
+ 'onUpdate:modelValue': (s[1] ||= (e) =>
+ (o(O).live = e)),
+ error: h.value?.live,
+ disabled: o(x),
+ 'show-all-on-empty': ``,
+ options: j.value,
+ },
+ {
+ after: i(() => [
+ u(
+ `craft-callout`,
+ {
+ variant: `info`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `lightbulb`,
+ innerHTML: o(e)(
+ `This can be set to an environment variable with a boolean value ({examples})`,
+ {
+ examples: `yes/no/true/false/on/off/0/1`,
+ }
+ ),
+ },
+ null,
+ 8,
+ E
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [
+ `label`,
+ `modelValue`,
+ `error`,
+ `disabled`,
+ `options`,
+ ]
+ ),
+ r(
+ g,
+ {
+ label: o(e)(`Retry Duration`),
+ id: `retry-duration`,
+ name: `retryDuration`,
+ modelValue: o(O).retryDuration,
+ 'onUpdate:modelValue': (s[2] ||= (e) =>
+ (o(O).retryDuration = e)),
+ error: h.value?.retryDuration,
+ inputmode: `numeric`,
+ maxlength: `4`,
+ disabled: o(x),
+ },
+ {
+ default: i(() => [
+ u(
+ `div`,
+ {
+ slot: `help-text`,
+ innerHTML: o(e)(
+ `The number of seconds that the Retry-After HTTP header should be set to for 503 responses when the system is offline.`
+ ),
+ },
+ null,
+ 8,
+ D
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`, `modelValue`, `error`, `disabled`]
+ ),
+ r(
+ v,
+ {
+ label: o(e)(`Time Zone`),
+ id: `time-zone`,
+ name: `timeZone`,
+ modelValue: o(O).timeZone,
+ 'onUpdate:modelValue': (s[3] ||= (e) =>
+ (o(O).timeZone = e)),
+ error: h.value?.timeZone,
+ disabled: o(x),
+ 'show-all-on-empty': ``,
+ options: t.timezoneOptions,
+ },
+ {
+ item: i(({item: e}) => [
+ d(
+ l(e.label) +
+ l(e.data?.hint ? ` — ${e.data.hint}` : ``),
+ 1
+ ),
+ ]),
+ after: i(() => [
+ ...(s[4] ||= [
+ u(
+ `craft-callout`,
+ {
+ variant: `info`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `lightbulb`,
+ },
+ [
+ d(
+ ` This can be set to an environment variable with a value of a `
+ ),
+ u(
+ `a`,
+ {
+ href: `https://www.php.net/manual/en/timezones.php`,
+ rel: `noopener`,
+ target: `_blank`,
+ },
+ `supported time zone`
+ ),
+ d(`. `),
+ ],
+ -1
+ ),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [
+ `label`,
+ `modelValue`,
+ `error`,
+ `disabled`,
+ `options`,
+ ]
+ ),
+ ]),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `form`, `onSave`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-743087f9`]]
+ );
+export {O as default};
diff --git a/resources/build/assets/ImageTransforms-CyIMshUF.js b/resources/build/assets/ImageTransforms-CyIMshUF.js
new file mode 100644
index 00000000000..f788b5d94d4
--- /dev/null
+++ b/resources/build/assets/ImageTransforms-CyIMshUF.js
@@ -0,0 +1,182 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {r as t} from './cp-npqTfNqh.js';
+import {
+ B as n,
+ E as r,
+ R as i,
+ T as a,
+ X as o,
+ _ as s,
+ ct as c,
+ gt as l,
+ ht as u,
+ k as d,
+ m as f,
+ tt as p,
+ v as m,
+ w as h,
+ x as g,
+ y as _,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as v, o as y, t as b} from './AdminTable-32qWVDq-.js';
+import {t as x} from './Empty-D0VMu5kQ.js';
+import {s as S} from './InlineFlash-DnK6Yp2V.js';
+import {t as C} from './DeleteButton-BLk4eDvl.js';
+import {t as w} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as T} from './IndexLayout-dNU8P7d2.js';
+import {c as E, i as D, o as O, s as k} from './VolumesController-CeQEFyKw.js';
+var A = r({
+ __name: `ImageTransforms`,
+ props: {transforms: {}},
+ setup(r) {
+ function A(t) {
+ confirm(
+ e(`Are you sure you want to delete the “{name}” transform?`, {
+ name: t.name,
+ })
+ ) && l.delete(k(t.id));
+ }
+ let j = r,
+ M = c({name: !0, handle: !0}),
+ N = w(),
+ P = c([
+ N.link(`name`, {header: e(`Name`)}),
+ N.handle(`handle`),
+ N.accessor(`mode`, {header: e(`Mode`)}),
+ N.display({
+ id: `dimensions`,
+ header: e(`Dimensions`),
+ cell: ({row: e}) =>
+ `${e.original.width ?? `Auto`} x ${e.original.height ?? `Auto`}`,
+ }),
+ N.accessor(`interlace`, {
+ header: e(`Interlace`),
+ cell: ({row: e}) =>
+ e.original.interlace ? t(e.original.interlace) : `None`,
+ }),
+ N.accessor(`format`, {
+ header: e(`Format`),
+ cell: ({row: e}) =>
+ e.original.format ? t(e.original.format) : `Auto`,
+ }),
+ N.actions(({row: e}) => [d(C, {onClick: () => A(e.original)})]),
+ ]),
+ F = v({
+ get data() {
+ return j.transforms;
+ },
+ get columns() {
+ return P.value;
+ },
+ enableSorting: !1,
+ getCoreRowModel: y(),
+ state: {
+ get columnVisibility() {
+ return M.value;
+ },
+ },
+ }),
+ I = s(() => ({
+ volumes: {label: e(`Volumes`), url: D().url},
+ transforms: {label: e(`Image Transforms`), url: E().url, active: !0},
+ }));
+ return (t, r) => (
+ i(),
+ _(T, null, {
+ actions: o(() => [
+ a(
+ S,
+ {
+ appearance: `button`,
+ inertia: !1,
+ href: u(O)().url,
+ variant: `accent`,
+ icon: `plus`,
+ },
+ {default: o(() => [h(p(u(e)(`New image transform`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ 'interior-nav': o(() => [
+ m(`craft-nav-list`, null, [
+ (i(!0),
+ g(
+ f,
+ null,
+ n(
+ I.value,
+ (e, t) => (
+ i(),
+ _(
+ S,
+ {
+ key: t,
+ as: `craft-nav-item`,
+ active: e.active ?? !1,
+ href: e.url,
+ block: ``,
+ flush: ``,
+ inertia: e.inertia ?? !0,
+ },
+ {default: o(() => [h(p(e.label), 1)]), _: 2},
+ 1032,
+ [`active`, `href`, `inertia`]
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ default: o(() => [
+ a(
+ b,
+ {table: u(F)},
+ {
+ 'empty-row': o(() => [
+ a(
+ x,
+ {
+ label: u(e)(`No image transforms exist yet.`),
+ icon: `image`,
+ },
+ {
+ default: o(() => [
+ a(
+ S,
+ {
+ appearance: `button`,
+ inertia: !1,
+ href: u(O)().url,
+ variant: `neutral`,
+ icon: `plus`,
+ },
+ {
+ default: o(() => [
+ h(p(u(e)(`New image transform`)), 1),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`]
+ ),
+ ]),
+ _: 1,
+ })
+ );
+ },
+});
+export {A as default};
diff --git a/resources/build/assets/Index-CJg_nklC.js b/resources/build/assets/Index-CJg_nklC.js
new file mode 100644
index 00000000000..26baf13d219
--- /dev/null
+++ b/resources/build/assets/Index-CJg_nklC.js
@@ -0,0 +1,595 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {d as t, r as n} from './cp-npqTfNqh.js';
+import {
+ B as r,
+ E as i,
+ G as a,
+ M as o,
+ Q as s,
+ R as c,
+ T as l,
+ V as u,
+ X as d,
+ Z as f,
+ _ as p,
+ b as m,
+ ct as h,
+ et as g,
+ f as _,
+ ht as v,
+ m as y,
+ o as b,
+ s as x,
+ tt as S,
+ v as C,
+ w,
+ x as T,
+ y as E,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as ee, o as D, t as O} from './AdminTable-32qWVDq-.js';
+import {t as k} from './Select-uUcGssK_.js';
+import {i as A, n as j, r as M, t as N} from './wayfinder-V597ZF_3.js';
+import {a as P} from './dist-BSfJDNP3.js';
+import {t as F} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as I} from './CheckboxGroup-tx-Aecav.js';
+import {t as L} from './CraftInput-B2G9EaE3.js';
+import {t as R} from './IndexLayout-dNU8P7d2.js';
+var z = (e, t) => ({url: z.url(e, t), method: `get`});
+((z.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/content/{page}/{sectionHandle?}`,
+}),
+ (z.url = (e, t) => {
+ (Array.isArray(e) && (e = {page: e[0], sectionHandle: e[1]}),
+ (e = N(e)),
+ M(e, [`sectionHandle`]));
+ let n = {page: e.page, sectionHandle: e.sectionHandle};
+ return (
+ z.definition.url
+ .replace(`{page}`, n.page.toString())
+ .replace(`{sectionHandle?}`, n.sectionHandle?.toString() ?? ``)
+ .replace(/\/+$/, ``) + j(t)
+ );
+ }),
+ (z.get = (e, t) => ({url: z.url(e, t), method: `get`})),
+ (z.head = (e, t) => ({url: z.url(e, t), method: `head`})),
+ Object.assign(z, z));
+var B = i({
+ __name: `ElementSources`,
+ props: {sources: {}, activeSource: {default: null}},
+ setup(e) {
+ let {site: t} = A();
+ return (n, i) => (
+ c(),
+ T(
+ y,
+ null,
+ [
+ C(`craft-nav-list`, null, [
+ (c(!0),
+ T(
+ y,
+ null,
+ r(
+ e.sources,
+ (n, r) => (
+ c(),
+ T(
+ y,
+ {key: n.key},
+ [
+ n.type === `heading`
+ ? (c(), T(y, {key: 0}, [w(S(n.heading), 1)], 64))
+ : (c(),
+ E(
+ v(b),
+ {
+ key: 1,
+ as: `craft-nav-item`,
+ href: v(z)(
+ {page: `entries`},
+ {query: {source: n.key, site: v(t)?.handle}}
+ ),
+ 'preserve-state': ``,
+ active: n.key === e.activeSource,
+ },
+ {default: d(() => [w(S(n.label), 1)]), _: 2},
+ 1032,
+ [`href`, `active`]
+ )),
+ ],
+ 64
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ (i[0] ||= C(`ul`, null, null, -1)),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ V = [`.modelValue`, `has-feedback-for`],
+ H = [`.choiceValue`],
+ te = {slot: `feedback`},
+ U = {key: 0, class: `error-list`},
+ W = i({
+ name: `CraftSelectRich`,
+ __name: `CraftSelectRich`,
+ props: o({error: {}, options: {}}, {modelValue: {}, modelModifiers: {}}),
+ emits: [`update:modelValue`],
+ setup(e) {
+ let t = a(e, `modelValue`);
+ return (n, i) => (
+ c(),
+ T(
+ `craft-select-rich`,
+ {
+ '.modelValue': t.value,
+ onModelValueChanged: (i[0] ||= (e) =>
+ (t.value = e.target?.modelValue)),
+ 'has-feedback-for': e.error ? `error` : ``,
+ },
+ [
+ (c(!0),
+ T(
+ y,
+ null,
+ r(
+ e.options,
+ (e) => (
+ c(),
+ T(
+ `craft-option`,
+ {key: e.value, '.choiceValue': String(e.value)},
+ [
+ u(n.$slots, `option`, {option: e}, () => [
+ w(S(e.label), 1),
+ ]),
+ ],
+ 40,
+ H
+ )
+ )
+ ),
+ 128
+ )),
+ C(`div`, te, [
+ e.error
+ ? (c(), T(`ul`, U, [C(`li`, null, S(e.error), 1)]))
+ : m(``, !0),
+ ]),
+ ],
+ 40,
+ V
+ )
+ );
+ },
+ }),
+ G = [`variant`],
+ K = i({
+ __name: `ElementStatus`,
+ props: {label: {}, value: {}, mode: {default: `inline`}, color: {}},
+ setup(e) {
+ let t = e,
+ r = p(() => {
+ if (t.color || t.color?.value) return `custom`;
+ switch (t.value) {
+ case `live`:
+ case `on`:
+ case `success`:
+ case `enabled`:
+ return `success`;
+ case `off`:
+ case `suspended`:
+ case `expired`:
+ case `danger`:
+ case `red`:
+ return `danger`;
+ case `pending`:
+ case `warning`:
+ return `warning`;
+ case `info`:
+ return `info`;
+ case `disabled`:
+ return `empty`;
+ default:
+ return `custom`;
+ }
+ }),
+ i = p(() =>
+ t.value
+ ? {}
+ : {
+ '--background': `transparent linear-gradient(60deg, #184cef, #e5422b) border-box`,
+ }
+ ),
+ a = p(() => t.label ?? n(t.value));
+ return (t, n) => (
+ c(),
+ T(
+ `div`,
+ {
+ class: s({
+ 'inline-flex border': !0,
+ 'gap-2 border-transparent': e.mode === `inline`,
+ [`bg-${r.value}-fill-quiet border-${r.value}-border-quiet`]:
+ e.mode === `badge`,
+ 'gap-1 px-1.5 py-0.5 rounded-full text-xs': e.mode === `badge`,
+ }),
+ },
+ [
+ C(
+ `craft-indicator`,
+ {variant: r.value, style: g(i.value)},
+ null,
+ 12,
+ G
+ ),
+ w(` ` + S(a.value), 1),
+ ],
+ 2
+ )
+ );
+ },
+ });
+function q(e) {
+ return `Craft-${Craft.systemUid}.${e}`;
+}
+function J(e, t, n = localStorage, r) {
+ return P(q(e), t, n, r);
+}
+function Y(e, t, n) {
+ return J(e, t, localStorage, n);
+}
+var X = {'aria-labelledby': `source-heading`},
+ Z = {id: `source-heading`, class: `sr-only`},
+ Q = {class: `flex gap-2 items-center`},
+ ne = {
+ type: `button`,
+ slot: `suffix`,
+ icon: ``,
+ size: `small`,
+ appearance: `plain`,
+ },
+ re = [`label`],
+ ie = [`appearance`, `icon`, `aria-label`, `active`, `value`],
+ ae = [`appearance`],
+ oe = {slot: `content`},
+ $ = {class: `p-2`},
+ se = {class: `flex items-end gap-2`},
+ ce = [`appearance`, `active`],
+ le = [`appearance`, `active`],
+ ue = {class: `p-2`},
+ de = [`loading`],
+ fe = i({
+ __name: `Index`,
+ props: {
+ elementType: {},
+ elementDisplayName: {},
+ elementPluralDisplayName: {},
+ context: {default: `index`},
+ canHaveDrafts: {type: Boolean, default: !1},
+ criteria: {default: Craft.defaultIndexCriteria},
+ page: {default: null},
+ sources: {},
+ source: {},
+ contentHtml: {},
+ search: {},
+ status: {},
+ viewMode: {},
+ statusOptions: {},
+ sectionHandle: {},
+ viewState: {},
+ elements: {},
+ tableColumns: {},
+ viewModes: {},
+ baseSortOptions: {},
+ pagination: {},
+ sort: {},
+ },
+ setup(n) {
+ let i = n,
+ a = {
+ inlineEditing: !1,
+ mode: `table`,
+ tableColumns: [`title`, `dateCreated`],
+ nestedInputNamespace: null,
+ showHeaderColumn: !0,
+ order: `dateCreated`,
+ sort: `desc`,
+ static: !1,
+ ...i.viewState,
+ },
+ o = Y(`elementindex.${i.elementType}.${i.context}`, a),
+ s = x({
+ search: i.search ?? ``,
+ status: i.status,
+ viewMode: o.value.mode ?? i.viewMode ?? `table`,
+ });
+ function u() {
+ s.submit(z({page: i.page, sectionHandle: i.sectionHandle}));
+ }
+ let m = F(),
+ g = p(() => [
+ m.html(`title`, {header: e(`Entry`)}),
+ ...Object.entries(i.tableColumns)
+ .filter(([e]) => o.value.tableColumns?.includes(e))
+ .map(([e, t]) => m.html(e, {header: t.label})),
+ ]),
+ b = p(() => [
+ {label: e(`Entry`), value: `title`, disabled: !0},
+ ...Object.entries(i.tableColumns).map(([e, t]) => ({
+ label: t.label,
+ value: e,
+ })),
+ ]),
+ w = h({}),
+ A = ee({
+ get data() {
+ return i.elements;
+ },
+ get columns() {
+ return g.value;
+ },
+ state: {
+ get columnOrder() {
+ return [`title`, `dateCreated`];
+ },
+ get columnVisibility() {
+ return w.value;
+ },
+ },
+ getCoreRowModel: D(),
+ });
+ return (i, a) => (
+ c(),
+ E(R, null, {
+ 'interior-nav': d(() => [
+ C(`nav`, X, [
+ C(`h2`, Z, S(v(e)(`Sources`)), 1),
+ l(
+ B,
+ {sources: n.sources, 'active-source': n.source?.key},
+ null,
+ 8,
+ [`sources`, `active-source`]
+ ),
+ ]),
+ (a[7] ||= C(`div`, {id: `source-actions`}, null, -1)),
+ ]),
+ default: d(() => [
+ l(
+ O,
+ {table: v(A)},
+ {
+ 'table-header': d(() => [
+ C(
+ `form`,
+ {onSubmit: u, class: `w-full`},
+ [
+ C(`div`, Q, [
+ C(`div`, null, [
+ l(
+ W,
+ {
+ modelValue: v(s).status,
+ 'onUpdate:modelValue': (a[0] ||= (e) =>
+ (v(s).status = e)),
+ options: n.statusOptions,
+ label: v(e)(`Status`),
+ 'label-sr-only': ``,
+ },
+ {
+ option: d(({option: e}) => [
+ l(
+ K,
+ {label: e.label, value: e.value},
+ null,
+ 8,
+ [`label`, `value`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`modelValue`, `options`, `label`]
+ ),
+ ]),
+ l(
+ L,
+ {
+ class: `flex-1`,
+ name: `search`,
+ label: v(e)(`Search term`),
+ modelValue: v(s).search,
+ 'onUpdate:modelValue': (a[1] ||= (e) =>
+ (v(s).search = e)),
+ 'label-sr-only': ``,
+ },
+ {
+ default: d(() => [
+ C(`craft-button`, ne, [
+ C(
+ `craft-icon`,
+ {
+ name: `filter`,
+ label: v(e)(`Filter results`),
+ },
+ null,
+ 8,
+ re
+ ),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`, `modelValue`]
+ ),
+ f(
+ C(
+ `craft-button-group`,
+ {
+ 'onUpdate:modelValue': (a[2] ||= (e) =>
+ (v(s).viewMode = e)),
+ name: `viewMode`,
+ onChange: (a[3] ||= (e) =>
+ (v(s).viewMode = e.detail.value)),
+ },
+ [
+ (c(!0),
+ T(
+ y,
+ null,
+ r(
+ n.viewModes,
+ (e) => (
+ c(),
+ T(
+ `craft-button`,
+ {
+ key: e.type,
+ type: `button`,
+ appearance: v(t).Fill,
+ icon: e.icon,
+ 'aria-label': e.title,
+ active: v(s).viewMode === e.type,
+ value: e.type,
+ },
+ null,
+ 8,
+ ie
+ )
+ )
+ ),
+ 128
+ )),
+ ],
+ 544
+ ),
+ [[_, v(s).viewMode]]
+ ),
+ C(`craft-action-menu`, null, [
+ C(
+ `craft-button`,
+ {
+ type: `button`,
+ slot: `invoker`,
+ icon: `sliders`,
+ appearance: v(t).Fill,
+ },
+ S(v(e)(`View`)),
+ 9,
+ ae
+ ),
+ C(`div`, oe, [
+ C(`div`, $, [
+ C(`div`, se, [
+ l(
+ k,
+ {
+ label: v(e)(`Sort by`),
+ name: `viewState[order]`,
+ modelValue: v(o).order,
+ 'onUpdate:modelValue': (a[4] ||= (e) =>
+ (v(o).order = e)),
+ options: b.value,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `options`]
+ ),
+ f(
+ C(
+ `craft-button-group`,
+ {
+ name: `viewState[sort]`,
+ 'onUpdate:modelValue': (a[5] ||= (e) =>
+ (v(o).sort = e)),
+ },
+ [
+ C(
+ `craft-button`,
+ {
+ type: `button`,
+ icon: `asc`,
+ value: `asc`,
+ 'aria-label': `t('Sort ascending')`,
+ appearance: v(t).Fill,
+ active: v(o).sort === `asc`,
+ },
+ null,
+ 8,
+ ce
+ ),
+ C(
+ `craft-button`,
+ {
+ type: `button`,
+ icon: `desc`,
+ 'aria-label': `t('Sort descending')`,
+ value: `desc`,
+ appearance: v(t).Fill,
+ active: v(o).sort === `desc`,
+ },
+ null,
+ 8,
+ le
+ ),
+ ],
+ 512
+ ),
+ [[_, v(o).sort]]
+ ),
+ ]),
+ ]),
+ C(`div`, ue, [
+ l(
+ I,
+ {
+ label: v(e)(`Table Columns`),
+ name: `viewState[tableColumns]`,
+ modelValue: v(o).tableColumns,
+ 'onUpdate:modelValue': (a[6] ||= (e) =>
+ (v(o).tableColumns = e)),
+ options: b.value,
+ 'allow-select-all': ``,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `options`]
+ ),
+ ]),
+ (a[8] ||= C(`div`, {class: `p-2`}, null, -1)),
+ ]),
+ ]),
+ C(`div`, null, [
+ C(
+ `craft-button`,
+ {type: `submit`, loading: v(s).processing},
+ S(v(e)(`Update`)),
+ 9,
+ de
+ ),
+ ]),
+ ]),
+ ],
+ 32
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`]
+ ),
+ ]),
+ _: 1,
+ })
+ );
+ },
+ });
+export {fe as default};
diff --git a/resources/build/assets/Index-CJhWjC1C.js b/resources/build/assets/Index-CJhWjC1C.js
new file mode 100644
index 00000000000..6e837a4c108
--- /dev/null
+++ b/resources/build/assets/Index-CJhWjC1C.js
@@ -0,0 +1,329 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ Q as r,
+ R as i,
+ T as a,
+ X as o,
+ b as s,
+ gt as c,
+ ht as l,
+ m as u,
+ o as d,
+ p as f,
+ t as p,
+ tt as m,
+ v as h,
+ w as g,
+ x as _,
+ y as v,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {n as y, r as b, t as x} from './Empty-D0VMu5kQ.js';
+import {t as S} from './Pane-CJi1MPPH.js';
+import {t as C} from './AppLayout-BXGMFlSp.js';
+import {t as w} from './useReorderableItems-CU0T2zos.js';
+import {i as T, n as E, r as D, t as O} from './RoutesController-u0nRHqnp.js';
+var k = {key: 0, type: `button`, variant: `primary`},
+ A = {key: 0, class: `empty-routes`},
+ j = {key: 1, class: `routes-list`},
+ M = {key: 0, class: `route__site`},
+ N = {class: `route-site`},
+ P = [`innerHTML`],
+ F = [`label`],
+ I = {class: `route__icon`},
+ L = [`label`],
+ R = {class: `route__template`},
+ z = [`label`],
+ B = [`onClick`],
+ V = [`label`],
+ H = p(
+ n({
+ __name: `Index`,
+ props: {
+ title: {},
+ routes: {},
+ isMultiSite: {type: Boolean},
+ readOnly: {type: Boolean},
+ },
+ setup(n) {
+ let p = n,
+ {
+ setItemRef: H,
+ setHandleRef: U,
+ getDragState: W,
+ getDropState: G,
+ getRowPosition: K,
+ } = w({
+ getItemIds: () => p.routes.map((e) => e.uid),
+ enabled: () => !p.readOnly && p.routes.length > 1,
+ onReorder: Y,
+ });
+ function q(e) {
+ let t = G(e);
+ return t.type === `is-over` ? t.closestEdge : null;
+ }
+ function J(e, t, n) {
+ let r = [...e],
+ [i] = r.splice(t, 1);
+ return (r.splice(n, 0, i), r);
+ }
+ function Y(e, t) {
+ let n = J(p.routes, e, t);
+ c.optimistic(() => ({routes: n})).post(
+ T(),
+ {routeUids: n.map((e) => e.uid)},
+ {preserveScroll: !0, preserveState: !0}
+ );
+ }
+ function X(t) {
+ confirm(e(`Are you sure you want to delete this route?`)) &&
+ c.delete(E(t.uid));
+ }
+ return (c, p) => (
+ i(),
+ v(
+ C,
+ {title: n.title},
+ {
+ actions: o(() => [
+ a(
+ l(d),
+ {href: l(O)()},
+ {
+ default: o(() => [
+ n.readOnly
+ ? s(``, !0)
+ : (i(),
+ _(`craft-button`, k, [
+ (p[1] ||= h(
+ `craft-icon`,
+ {name: `plus`, slot: `prefix`},
+ null,
+ -1
+ )),
+ g(` ` + m(l(e)(`New route`)), 1),
+ ])),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ ),
+ ]),
+ default: o(() => [
+ n.routes.length === 0
+ ? (i(),
+ _(`div`, A, [
+ a(
+ S,
+ {appearance: `raised`},
+ {
+ default: o(() => [
+ a(
+ x,
+ {label: l(e)(`No routes exist yet.`)},
+ null,
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]))
+ : (i(),
+ _(`div`, j, [
+ (i(!0),
+ _(
+ u,
+ null,
+ t(
+ n.routes,
+ (t, c) => (
+ i(),
+ _(
+ `div`,
+ {
+ key: t.uid,
+ ref_for: !0,
+ ref: (e) => l(H)(e, t.uid),
+ class: r({
+ route: !0,
+ 'route--readonly': n.readOnly,
+ 'route--dragging':
+ !n.readOnly &&
+ l(W)(t.uid).type === `is-dragging`,
+ }),
+ },
+ [
+ n.isMultiSite
+ ? (i(),
+ _(`div`, M, [
+ h(`div`, N, m(t.siteName), 1),
+ ]))
+ : s(``, !0),
+ a(
+ l(d),
+ {href: l(D)(t.uid), class: `route__parts`},
+ {
+ default: o(() => [
+ h(`div`, null, [
+ t.uriDisplayHtml
+ ? (i(),
+ _(
+ `span`,
+ {
+ key: 0,
+ innerHTML: t.uriDisplayHtml,
+ },
+ null,
+ 8,
+ P
+ ))
+ : (i(),
+ _(
+ `craft-icon`,
+ {
+ key: 1,
+ name: `home`,
+ label: l(e)(`Home`),
+ },
+ null,
+ 8,
+ F
+ )),
+ ]),
+ ]),
+ _: 2,
+ },
+ 1032,
+ [`href`]
+ ),
+ h(`div`, I, [
+ h(
+ `craft-icon`,
+ {
+ name: `arrow-right`,
+ label: l(e)(`Resolves to`),
+ },
+ null,
+ 8,
+ L
+ ),
+ ]),
+ h(`div`, R, [
+ (p[2] ||= h(
+ `craft-icon`,
+ {name: `template`},
+ null,
+ -1
+ )),
+ h(`span`, null, m(t.template), 1),
+ ]),
+ n.readOnly
+ ? s(``, !0)
+ : (i(),
+ _(
+ `div`,
+ {
+ key: 1,
+ class: `route__actions`,
+ onClick: (p[0] ||= f(() => {}, [
+ `stop`,
+ ])),
+ },
+ [
+ a(
+ l(d),
+ {
+ as: `craft-button`,
+ size: `small`,
+ appearance: `plain`,
+ href: l(D)(t.uid),
+ },
+ {
+ default: o(() => [
+ h(
+ `craft-icon`,
+ {
+ name: `pencil`,
+ label: l(e)(`Edit`),
+ },
+ null,
+ 8,
+ z
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ ),
+ a(
+ b,
+ {
+ ref_for: !0,
+ ref: (e) => l(U)(e, t.uid),
+ position: l(K)(c),
+ 'onClick:up': (e) => Y(c, c - 1),
+ 'onClick:down': (e) => Y(c, c + 1),
+ },
+ null,
+ 8,
+ [
+ `position`,
+ `onClick:up`,
+ `onClick:down`,
+ ]
+ ),
+ h(
+ `craft-button`,
+ {
+ onClick: (e) => X(t),
+ variant: `danger`,
+ size: `small`,
+ appearance: `plain`,
+ icon: ``,
+ },
+ [
+ h(
+ `craft-icon`,
+ {
+ name: `trash`,
+ label: l(e)(`Delete`),
+ },
+ null,
+ 8,
+ V
+ ),
+ ],
+ 8,
+ B
+ ),
+ ]
+ )),
+ a(y, {contained: ``, edge: q(t.uid)}, null, 8, [
+ `edge`,
+ ]),
+ ],
+ 2
+ )
+ )
+ ),
+ 128
+ )),
+ ])),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-110bbaf6`]]
+ );
+export {H as default};
diff --git a/resources/build/assets/Index-Dq5CF89L.js b/resources/build/assets/Index-Dq5CF89L.js
new file mode 100644
index 00000000000..a1eb83bd460
--- /dev/null
+++ b/resources/build/assets/Index-Dq5CF89L.js
@@ -0,0 +1,296 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {h as t} from './cp-npqTfNqh.js';
+import {
+ B as n,
+ E as r,
+ I as i,
+ J as a,
+ R as o,
+ T as s,
+ _ as c,
+ a as l,
+ b as u,
+ ct as d,
+ ht as f,
+ m as p,
+ t as m,
+ tt as h,
+ v as g,
+ x as _,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+function v(n, r) {
+ let i = d({...r}),
+ a = d(!1),
+ o = c(() => !!i.value.error),
+ s = c(() => !!i.value.finished);
+ async function l(e) {
+ a.value = !0;
+ let r;
+ try {
+ r = await t.post(
+ `/admin/actions/${n}/${e}`,
+ {data: i.value.data},
+ {
+ headers: {
+ 'Content-Type': `application/json`,
+ Accept: `application/json`,
+ },
+ }
+ );
+ } catch (e) {
+ p(e);
+ } finally {
+ a.value = !1;
+ }
+ r && u(r.data);
+ }
+ function u(e) {
+ (e.data && (i.value.data = e.data),
+ (i.value = {
+ ...i.value,
+ status: e.status,
+ error: e.error,
+ errorDetails: e.errorDetails,
+ options: e.options,
+ finished: e.finished,
+ returnUrl: e.returnUrl ?? i.value.returnUrl,
+ nextAction: e.nextAction,
+ }),
+ e.nextAction && l(e.nextAction));
+ }
+ function f(e) {
+ e.nextAction &&
+ ((i.value.error = void 0),
+ (i.value.errorDetails = void 0),
+ (i.value.options = void 0),
+ e.status && (i.value.status = e.status),
+ e.data && (i.value.data = e.data),
+ l(e.nextAction));
+ }
+ function p(r) {
+ let a = r.response?.data?.message || r.message || `Unknown error`,
+ o = r.response?.statusText || `Error`;
+ ((i.value.error = e(`A fatal error has occurred:`)),
+ (i.value.errorDetails = `${e(`Status:`)} ${o}\n\n${e(`Response:`)} ${a}`),
+ (i.value.options = [
+ {
+ label: e(`Troubleshoot`),
+ url: `https://craftcms.com/knowledge-base/failed-updates`,
+ },
+ {label: e(`Send for help`), email: `support@craftcms.com`},
+ ]),
+ t
+ .post(
+ `/admin/actions/${n}/finish`,
+ {data: i.value.data},
+ {
+ headers: {
+ 'Content-Type': `application/json`,
+ Accept: `application/json`,
+ },
+ }
+ )
+ .catch(() => {}));
+ }
+ function m(e) {
+ let t = encodeURIComponent(e.subject || `Craft update failure`),
+ n = `Describe what happened here.`;
+ return (
+ i.value.errorDetails &&
+ (n +=
+ `
+
+-----------------------------------------------------------
+
+` + i.value.errorDetails),
+ `mailto:${e.email}?subject=${t}&body=${encodeURIComponent(n)}`
+ );
+ }
+ return {
+ state: i,
+ isLoading: a,
+ hasError: o,
+ isFinished: s,
+ executeAction: l,
+ handleOptionClick: f,
+ getEmailLink: m,
+ };
+}
+var y = {class: `updater`},
+ b = {class: `updater-graphic`},
+ x = {key: 0, visible: !0, class: `spinner`},
+ S = {key: 1, name: `circle-check`, class: `icon-success`},
+ C = {key: 2, name: `alert-circle`, class: `icon-error`},
+ w = {class: `updater-status`},
+ T = [`innerHTML`],
+ E = {key: 0, class: `error-details`, tabindex: `0`},
+ D = [`innerHTML`],
+ O = [`innerHTML`],
+ k = {key: 0, class: `updater-options`},
+ A = [`href`, `target`],
+ j = [`onClick`, `variant`],
+ M = m(
+ r({
+ __name: `Index`,
+ props: {title: {}, initialState: {}, actionPrefix: {}, returnUrl: {}},
+ setup(e) {
+ let t = e,
+ {
+ state: r,
+ isLoading: c,
+ hasError: d,
+ isFinished: m,
+ executeAction: M,
+ handleOptionClick: N,
+ getEmailLink: P,
+ } = v(t.actionPrefix, t.initialState);
+ function F(e) {
+ return e
+ .replace(/\n{2,}/g, ``)
+ .replace(/\n/g, ` `)
+ .replace(/`(.*?)`/g, `$1`);
+ }
+ function I() {
+ setTimeout(() => {
+ window.location.href =
+ r.value.returnUrl || t.returnUrl || `/admin/dashboard`;
+ }, 750);
+ }
+ function L(e) {
+ return !!(e.url || e.email);
+ }
+ function R(e) {
+ return e.url ? e.url : e.email ? P(e) : `#`;
+ }
+ return (
+ i(() => {
+ t.initialState.nextAction && M(t.initialState.nextAction);
+ }),
+ a(m, (e) => {
+ e && I();
+ }),
+ (t, i) => (
+ o(),
+ _(
+ p,
+ null,
+ [
+ s(f(l), {title: e.title}, null, 8, [`title`]),
+ g(`div`, y, [
+ g(`div`, b, [
+ f(c) && !f(d)
+ ? (o(), _(`craft-spinner`, x))
+ : f(m)
+ ? (o(), _(`craft-icon`, S))
+ : f(d)
+ ? (o(), _(`craft-icon`, C))
+ : u(``, !0),
+ ]),
+ g(`div`, w, [
+ f(r).error
+ ? (o(),
+ _(
+ p,
+ {key: 0},
+ [
+ g(
+ `p`,
+ {
+ class: `error-message`,
+ innerHTML: F(f(r).error),
+ },
+ null,
+ 8,
+ T
+ ),
+ f(r).errorDetails
+ ? (o(),
+ _(`div`, E, [
+ g(
+ `p`,
+ {innerHTML: F(f(r).errorDetails)},
+ null,
+ 8,
+ D
+ ),
+ ]))
+ : u(``, !0),
+ ],
+ 64
+ ))
+ : f(r).status
+ ? (o(),
+ _(
+ `p`,
+ {key: 1, innerHTML: F(f(r).status)},
+ null,
+ 8,
+ O
+ ))
+ : u(``, !0),
+ ]),
+ f(r).options && !f(c)
+ ? (o(),
+ _(`div`, k, [
+ (o(!0),
+ _(
+ p,
+ null,
+ n(
+ f(r).options,
+ (e) => (
+ o(),
+ _(
+ p,
+ {key: e.label},
+ [
+ L(e)
+ ? (o(),
+ _(
+ `a`,
+ {
+ key: 0,
+ href: R(e),
+ target: e.url ? `_blank` : void 0,
+ class: `btn big`,
+ },
+ h(e.label),
+ 9,
+ A
+ ))
+ : (o(),
+ _(
+ `craft-button`,
+ {
+ key: 1,
+ type: `button`,
+ onClick: (t) => f(N)(e),
+ variant: e.submit
+ ? `accent`
+ : `neutral`,
+ size: `lg`,
+ },
+ h(e.label),
+ 9,
+ j
+ )),
+ ],
+ 64
+ )
+ )
+ ),
+ 128
+ )),
+ ]))
+ : u(``, !0),
+ ]),
+ ],
+ 64
+ )
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-7292fbed`]]
+ );
+export {M as default};
diff --git a/resources/build/assets/Index-GgOaN13Z.js b/resources/build/assets/Index-GgOaN13Z.js
new file mode 100644
index 00000000000..c8b51770847
--- /dev/null
+++ b/resources/build/assets/Index-GgOaN13Z.js
@@ -0,0 +1,168 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ R as r,
+ T as i,
+ X as a,
+ b as o,
+ ht as s,
+ m as c,
+ t as l,
+ tt as u,
+ v as d,
+ w as f,
+ x as p,
+ y as m,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {s as h} from './InlineFlash-DnK6Yp2V.js';
+import {n as g} from './wayfinder-V597ZF_3.js';
+import {n as _, t as v} from './AppLayout-BXGMFlSp.js';
+var y = (e) => ({url: y.url(e), method: `get`});
+((y.definition = {methods: [`get`, `head`], url: `/admin/settings`}),
+ (y.url = (e) => y.definition.url + g(e)),
+ (y.get = (e) => ({url: y.url(e), method: `get`})),
+ (y.head = (e) => ({url: y.url(e), method: `head`})));
+var b = {class: `py-3`},
+ x = {class: `grid gap-6`},
+ S = [`id`],
+ C = [`aria-labelledby`],
+ w = {class: `settings-grid`},
+ T = {class: `settings-content`},
+ E = {class: `settings-icon`},
+ D = [`name`],
+ O = [`innerHTML`],
+ k = {class: `sr-only`},
+ A = l(
+ n({
+ __name: `Index`,
+ props: {readOnly: {type: Boolean}, settings: {}},
+ setup(n) {
+ return (l, g) => (
+ r(),
+ m(
+ v,
+ {title: s(e)(`Settings`)},
+ {
+ default: a(() => [
+ d(`div`, b, [
+ n.readOnly ? (r(), m(_, {key: 0})) : o(``, !0),
+ d(`div`, x, [
+ (r(!0),
+ p(
+ c,
+ null,
+ t(
+ n.settings,
+ (n, l, m) => (
+ r(),
+ p(`div`, {key: l}, [
+ d(
+ `h2`,
+ {
+ id: `category-heading-${m}`,
+ class: `mb-2 text-lg leading-tight`,
+ },
+ u(l),
+ 9,
+ S
+ ),
+ d(
+ `nav`,
+ {'aria-labelledby': `category-heading-${m}`},
+ [
+ d(`ul`, w, [
+ (r(!0),
+ p(
+ c,
+ null,
+ t(
+ n,
+ (t, n) => (
+ r(),
+ p(`li`, {key: n}, [
+ i(
+ h,
+ {
+ href:
+ t.url || `${s(y)().url}/${n}`,
+ class: `settings-item`,
+ },
+ {
+ default: a(() => [
+ d(`div`, T, [
+ d(`div`, E, [
+ t.iconName
+ ? (r(),
+ p(
+ `craft-icon`,
+ {
+ key: 0,
+ name: t.iconName,
+ style: {
+ 'font-size': `calc(40rem / 16)`,
+ },
+ },
+ null,
+ 8,
+ D
+ ))
+ : t.icon
+ ? (r(),
+ p(
+ `div`,
+ {
+ key: 1,
+ innerHTML: t.icon,
+ class: `w-[40px] h-[40px] inline-block align-self-center`,
+ },
+ null,
+ 8,
+ O
+ ))
+ : o(``, !0),
+ ]),
+ f(` ` + u(t.label), 1),
+ d(
+ `span`,
+ k,
+ ` - ` + u(s(e)(`Settings`)),
+ 1
+ ),
+ ]),
+ ]),
+ _: 2,
+ },
+ 1032,
+ [`href`]
+ ),
+ ])
+ )
+ ),
+ 128
+ )),
+ ]),
+ ],
+ 8,
+ C
+ ),
+ ])
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-69ae9923`]]
+ );
+export {A as default};
diff --git a/resources/build/assets/IndexLayout-dNU8P7d2.js b/resources/build/assets/IndexLayout-dNU8P7d2.js
new file mode 100644
index 00000000000..41e26ca378d
--- /dev/null
+++ b/resources/build/assets/IndexLayout-dNU8P7d2.js
@@ -0,0 +1,174 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ $ as t,
+ B as n,
+ E as r,
+ J as i,
+ K as a,
+ O as o,
+ R as s,
+ S as c,
+ V as l,
+ X as u,
+ _ as d,
+ b as f,
+ ct as p,
+ et as m,
+ ht as h,
+ t as g,
+ tt as _,
+ v,
+ w as y,
+ x as b,
+ y as x,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {r as S} from './dist-BSfJDNP3.js';
+import {t as C} from './AppLayout-BXGMFlSp.js';
+var w = {class: `index-grid`},
+ T = [`aria-label`],
+ E = [`aria-expanded`],
+ D = [`name`],
+ O = {key: 1, id: `nav-container`},
+ k = {
+ id: `content-pane`,
+ class: `bg-white border border-neutral-border-quiet rounded-sm shadow-sm @container`,
+ tabindex: `-1`,
+ },
+ A = g(
+ r({
+ __name: `IndexLayout`,
+ props: {
+ title: {},
+ debug: {},
+ fullWidth: {type: Boolean},
+ form: {},
+ formActions: {},
+ formAdditionalActions: {},
+ additionalSkipLinks: {},
+ },
+ setup(r) {
+ let g = a(),
+ A = S(`(min-width: 768px)`),
+ j = p(`expanded`),
+ M = d(() => {
+ let {default: e, ...t} = g;
+ return t;
+ }),
+ N = d(() =>
+ j.value === `expanded` ? e(`Hide sidebar`) : e(`Show sidebar`)
+ );
+ function P() {
+ j.value = j.value === `expanded` ? `collapsed` : `expanded`;
+ }
+ let F = [
+ {label: e(`Skip to secondary navigation`), url: `#secondary-nav`},
+ {label: e(`Skip to content`), url: `#content-pane`},
+ ];
+ return (
+ i(
+ A,
+ (e) => {
+ j.value = e ? `expanded` : `collapsed`;
+ },
+ {immediate: !0}
+ ),
+ (i, a) => (
+ s(),
+ x(
+ C,
+ {
+ 'full-width': !0,
+ title: r.title,
+ debug: r.debug,
+ 'additional-skip-links': F,
+ },
+ c(
+ {
+ default: u(() => [
+ v(`div`, w, [
+ v(
+ `nav`,
+ {
+ id: `secondary-nav`,
+ 'aria-label': h(e)(`Secondary`),
+ tabindex: `-1`,
+ },
+ [
+ h(A)
+ ? f(``, !0)
+ : (s(),
+ b(
+ `craft-button`,
+ {
+ key: 0,
+ type: `button`,
+ 'aria-controls': `nav-container`,
+ 'aria-expanded': j.value === `expanded`,
+ onClick: P,
+ align: `start`,
+ class: `text-sm py-0 min-h-0`,
+ },
+ [
+ v(
+ `craft-icon`,
+ {
+ slot: `suffix`,
+ name:
+ j.value === `expanded`
+ ? `chevron-up`
+ : `chevron-down`,
+ style: m({
+ fontSize: `0.8em`,
+ position: `relative`,
+ insetBlockStart:
+ j.value === `expanded` ? `1px` : 0,
+ }),
+ },
+ null,
+ 12,
+ D
+ ),
+ y(` ` + _(N.value), 1),
+ ],
+ 8,
+ E
+ )),
+ j.value === `expanded`
+ ? (s(),
+ b(`div`, O, [
+ l(
+ i.$slots,
+ `interior-nav`,
+ {state: j.value},
+ void 0,
+ !0
+ ),
+ ]))
+ : f(``, !0),
+ ],
+ 8,
+ T
+ ),
+ v(`div`, k, [l(i.$slots, `default`, {}, void 0, !0)]),
+ ]),
+ ]),
+ _: 2,
+ },
+ [
+ n(M.value, (e, n) => ({
+ name: n,
+ fn: u((e) => [l(i.$slots, n, t(o(e || {})), void 0, !0)]),
+ })),
+ ]
+ ),
+ 1032,
+ [`title`, `debug`]
+ )
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-e8e3a455`]]
+ );
+export {A as t};
diff --git a/resources/build/assets/InlineFlash-DnK6Yp2V.js b/resources/build/assets/InlineFlash-DnK6Yp2V.js
new file mode 100644
index 00000000000..5ac8d640c47
--- /dev/null
+++ b/resources/build/assets/InlineFlash-DnK6Yp2V.js
@@ -0,0 +1,244 @@
+import {
+ $ as e,
+ E as t,
+ O as n,
+ Q as r,
+ R as i,
+ V as a,
+ X as o,
+ _ as s,
+ b as c,
+ ct as l,
+ ht as u,
+ l as d,
+ o as f,
+ t as p,
+ tt as m,
+ u as h,
+ v as g,
+ x as _,
+ y as v,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var y = {class: `flex gap-1 items-center`},
+ b = [`name`],
+ x = [`href`],
+ S = {class: `flex gap-1 items-center`},
+ C = [`name`],
+ w = p(
+ t({
+ __name: `CpLink`,
+ props: {
+ as: {},
+ onClick: {},
+ component: {},
+ data: {},
+ method: {},
+ replace: {type: Boolean},
+ preserveScroll: {type: [Boolean, String, Function]},
+ preserveState: {type: [Boolean, String, Function]},
+ preserveUrl: {type: Boolean},
+ only: {},
+ except: {},
+ headers: {},
+ queryStringArrayFormat: {},
+ async: {type: Boolean},
+ viewTransition: {type: [Boolean, Function]},
+ onCancelToken: {},
+ onBefore: {},
+ onBeforeUpdate: {},
+ onStart: {},
+ onProgress: {},
+ onFinish: {},
+ onCancel: {},
+ onSuccess: {},
+ onError: {},
+ onHttpException: {},
+ onNetworkError: {},
+ onFlash: {},
+ onPrefetched: {},
+ onPrefetching: {},
+ href: {},
+ instant: {type: Boolean},
+ pageProps: {},
+ prefetch: {type: [Boolean, String, Array]},
+ cacheFor: {},
+ cacheTags: {},
+ variant: {default: `neutral`},
+ size: {default: `medium`},
+ appearance: {default: `inline`},
+ icon: {},
+ block: {type: Boolean, default: !1},
+ inertia: {type: Boolean, default: !0},
+ },
+ setup(e) {
+ let t = e,
+ n = s(() => ({
+ block: t.block,
+ 'inline-flex': !t.block,
+ 'cp-link': !0,
+ 'cp-link--zero': t.size === `zero`,
+ 'cp-link--small': t.size === `small`,
+ 'cp-link--medium': t.size === `medium`,
+ 'cp-link--large': t.size === `large`,
+ 'cp-link--inline': t.appearance === `inline`,
+ 'cp-link--button': t.appearance === `button`,
+ 'cp-link--default': t.variant === `neutral`,
+ 'cp-link--primary': t.variant === `accent`,
+ 'cp-link--danger': t.variant === `danger`,
+ })),
+ l = s(() => (typeof t.href == `string` ? t.href : t.href?.url));
+ return (t, s) =>
+ e.inertia
+ ? (i(),
+ v(
+ u(f),
+ {
+ key: 0,
+ as: e.as,
+ href: e.href,
+ class: r(n.value),
+ variant: e.variant,
+ size: e.size,
+ },
+ {
+ default: o(() => [
+ g(`div`, y, [
+ e.icon
+ ? (i(),
+ _(`craft-icon`, {key: 0, name: e.icon}, null, 8, b))
+ : c(``, !0),
+ a(t.$slots, `default`, {}, void 0, !0),
+ ]),
+ ]),
+ _: 3,
+ },
+ 8,
+ [`as`, `href`, `class`, `variant`, `size`]
+ ))
+ : (i(),
+ _(
+ `a`,
+ {key: 1, href: l.value, class: r(n.value)},
+ [
+ g(`div`, S, [
+ e.icon
+ ? (i(),
+ _(`craft-icon`, {key: 0, name: e.icon}, null, 8, C))
+ : c(``, !0),
+ a(t.$slots, `default`, {}, void 0, !0),
+ ]),
+ ],
+ 10,
+ x
+ ));
+ },
+ }),
+ [[`__scopeId`, `data-v-13b79a59`]]
+ ),
+ T = l({success: null, error: null});
+function E(e = {duration: 2e3}) {
+ e.initialMessages && (T.value = u(e.initialMessages));
+ function t(e, t, n = {}) {
+ let {duration: r = n.duration ?? 5e3} = n;
+ ((T.value[e] = t),
+ r !== -1 &&
+ setTimeout(() => {
+ T.value[e] = null;
+ }, r));
+ }
+ function n(e) {
+ T.value[e] = null;
+ }
+ function r() {
+ T.value = {success: null, error: null};
+ }
+ return {flash: t, clear: n, clearAll: r, messages: T};
+}
+var D = p(
+ t({
+ __name: `VarDump`,
+ props: {data: {}},
+ setup(t) {
+ return (r, a) => (
+ i(),
+ _(`pre`, e(n(r.$attrs)), m(JSON.stringify(t.data, null, 2)), 17)
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-9d6b32cd`]]
+ ),
+ O = {};
+function k(e, t) {
+ return (
+ i(),
+ v(
+ h,
+ {name: `fade`},
+ {default: o(() => [a(e.$slots, `default`, {}, void 0, !0)]), _: 3}
+ )
+ );
+}
+var A = p(O, [
+ [`render`, k],
+ [`__scopeId`, `data-v-472cd7f2`],
+ ]),
+ j = l(null),
+ M = l(null);
+function N(e = {}) {
+ function t(t) {
+ t &&
+ (M.value !== null && clearTimeout(M.value),
+ (j.value = t),
+ (M.value = setTimeout(() => {
+ j.value = null;
+ }, e.timeout || 5e3)));
+ }
+ return {announcement: j, announce: t};
+}
+function P() {
+ let e = d(),
+ t = s(() => e.props.flash);
+ return {
+ flash: t,
+ successFlash: s(() => t.value.success),
+ errorFlash: s(() => t.value.error),
+ };
+}
+var F = {
+ key: 0,
+ variant: `success`,
+ appearance: `plain`,
+ icon: `circle-check`,
+ inline: ``,
+ class: `p-0`,
+ },
+ I = {
+ key: 1,
+ variant: `danger`,
+ appearance: `plain`,
+ icon: `triangle-exclamation`,
+ inline: ``,
+ class: `p-0`,
+ },
+ L = t({
+ __name: `InlineFlash`,
+ props: {isActive: {type: Boolean, default: !1}},
+ setup(e) {
+ let {successFlash: t, errorFlash: n} = P();
+ return (r, a) => (
+ i(),
+ v(A, null, {
+ default: o(() => [
+ e.isActive && u(t)
+ ? (i(), _(`craft-callout`, F, m(u(t)), 1))
+ : c(``, !0),
+ e.isActive && u(n)
+ ? (i(), _(`craft-callout`, I, m(u(n)), 1))
+ : c(``, !0),
+ ]),
+ _: 1,
+ })
+ );
+ },
+ });
+export {D as a, A as i, P as n, E as o, N as r, w as s, L as t};
diff --git a/resources/build/assets/InputCombobox-BGX5z3XZ.js b/resources/build/assets/InputCombobox-BGX5z3XZ.js
new file mode 100644
index 00000000000..52b7a0f2154
--- /dev/null
+++ b/resources/build/assets/InputCombobox-BGX5z3XZ.js
@@ -0,0 +1,2974 @@
+import {
+ $ as e,
+ B as t,
+ E as n,
+ I as r,
+ J as i,
+ L as a,
+ N as o,
+ P as s,
+ Q as c,
+ R as l,
+ T as u,
+ V as d,
+ X as f,
+ Y as p,
+ _ as m,
+ at as h,
+ b as g,
+ ct as _,
+ dt as v,
+ et as y,
+ g as b,
+ ht as x,
+ j as S,
+ k as C,
+ m as w,
+ mt as T,
+ ot as E,
+ q as D,
+ t as O,
+ tt as k,
+ ut as A,
+ v as j,
+ w as M,
+ x as N,
+ y as ee,
+ z as P,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {
+ a as te,
+ c as F,
+ d as ne,
+ f as I,
+ i as re,
+ l as L,
+ m as R,
+ n as z,
+ o as B,
+ p as V,
+ r as ie,
+ s as ae,
+ t as H,
+ u as U,
+} from './keyboard-BR9KgGR2.js';
+function W(e, t, n) {
+ let r = n.initialDeps ?? [],
+ i,
+ a = !0;
+ function o() {
+ let o;
+ n.key && n.debug?.call(n) && (o = Date.now());
+ let s = e();
+ if (!(s.length !== r.length || s.some((e, t) => r[t] !== e))) return i;
+ r = s;
+ let c;
+ if (
+ (n.key && n.debug?.call(n) && (c = Date.now()),
+ (i = t(...s)),
+ n.key && n.debug?.call(n))
+ ) {
+ let e = Math.round((Date.now() - o) * 100) / 100,
+ t = Math.round((Date.now() - c) * 100) / 100,
+ r = t / 16,
+ i = (e, t) => {
+ for (e = String(e); e.length < t; ) e = ` ` + e;
+ return e;
+ };
+ console.info(
+ `%c⏱ ${i(t, 5)} /${i(e, 5)} ms`,
+ `
+ font-size: .6rem;
+ font-weight: bold;
+ color: hsl(${Math.max(0, Math.min(120 - 120 * r, 120))}deg 100% 31%);`,
+ n?.key
+ );
+ }
+ return (
+ n?.onChange && !(a && n.skipInitialOnChange) && n.onChange(i),
+ (a = !1),
+ i
+ );
+ }
+ return (
+ (o.updateDeps = (e) => {
+ r = e;
+ }),
+ o
+ );
+}
+function oe(e, t) {
+ if (e === void 0) throw Error(`Unexpected undefined${t ? `: ${t}` : ``}`);
+ return e;
+}
+var se = (e, t) => Math.abs(e - t) < 1.01,
+ ce = (e, t, n) => {
+ let r;
+ return function (...i) {
+ (e.clearTimeout(r), (r = e.setTimeout(() => t.apply(this, i), n)));
+ };
+ },
+ le = (e) => {
+ let {offsetWidth: t, offsetHeight: n} = e;
+ return {width: t, height: n};
+ },
+ ue = (e) => e,
+ de = (e) => {
+ let t = Math.max(e.startIndex - e.overscan, 0),
+ n = Math.min(e.endIndex + e.overscan, e.count - 1),
+ r = [];
+ for (let e = t; e <= n; e++) r.push(e);
+ return r;
+ },
+ fe = (e, t) => {
+ let n = e.scrollElement;
+ if (!n) return;
+ let r = e.targetWindow;
+ if (!r) return;
+ let i = (e) => {
+ let {width: n, height: r} = e;
+ t({width: Math.round(n), height: Math.round(r)});
+ };
+ if ((i(le(n)), !r.ResizeObserver)) return () => {};
+ let a = new r.ResizeObserver((t) => {
+ let r = () => {
+ let e = t[0];
+ if (e?.borderBoxSize) {
+ let t = e.borderBoxSize[0];
+ if (t) {
+ i({width: t.inlineSize, height: t.blockSize});
+ return;
+ }
+ }
+ i(le(n));
+ };
+ e.options.useAnimationFrameWithResizeObserver
+ ? requestAnimationFrame(r)
+ : r();
+ });
+ return (
+ a.observe(n, {box: `border-box`}),
+ () => {
+ a.unobserve(n);
+ }
+ );
+ },
+ pe = {passive: !0},
+ me = typeof window > `u` ? !0 : `onscrollend` in window,
+ he = (e, t) => {
+ let n = e.scrollElement;
+ if (!n) return;
+ let r = e.targetWindow;
+ if (!r) return;
+ let i = 0,
+ a =
+ e.options.useScrollendEvent && me
+ ? () => void 0
+ : ce(
+ r,
+ () => {
+ t(i, !1);
+ },
+ e.options.isScrollingResetDelay
+ ),
+ o = (r) => () => {
+ let {horizontal: o, isRtl: s} = e.options;
+ ((i = o ? n.scrollLeft * ((s && -1) || 1) : n.scrollTop), a(), t(i, r));
+ },
+ s = o(!0),
+ c = o(!1);
+ n.addEventListener(`scroll`, s, pe);
+ let l = e.options.useScrollendEvent && me;
+ return (
+ l && n.addEventListener(`scrollend`, c, pe),
+ () => {
+ (n.removeEventListener(`scroll`, s),
+ l && n.removeEventListener(`scrollend`, c));
+ }
+ );
+ },
+ ge = (e, t, n) => {
+ if (t?.borderBoxSize) {
+ let e = t.borderBoxSize[0];
+ if (e)
+ return Math.round(e[n.options.horizontal ? `inlineSize` : `blockSize`]);
+ }
+ return e[n.options.horizontal ? `offsetWidth` : `offsetHeight`];
+ },
+ _e = (e, {adjustments: t = 0, behavior: n}, r) => {
+ var i, a;
+ let o = e + t;
+ (a = (i = r.scrollElement)?.scrollTo) == null ||
+ a.call(i, {[r.options.horizontal ? `left` : `top`]: o, behavior: n});
+ },
+ ve = class {
+ constructor(e) {
+ ((this.unsubs = []),
+ (this.scrollElement = null),
+ (this.targetWindow = null),
+ (this.isScrolling = !1),
+ (this.currentScrollToIndex = null),
+ (this.measurementsCache = []),
+ (this.itemSizeCache = new Map()),
+ (this.laneAssignments = new Map()),
+ (this.pendingMeasuredCacheIndexes = []),
+ (this.prevLanes = void 0),
+ (this.lanesChangedFlag = !1),
+ (this.lanesSettling = !1),
+ (this.scrollRect = null),
+ (this.scrollOffset = null),
+ (this.scrollDirection = null),
+ (this.scrollAdjustments = 0),
+ (this.elementsCache = new Map()),
+ (this.observer = (() => {
+ let e = null,
+ t = () =>
+ e ||
+ (!this.targetWindow || !this.targetWindow.ResizeObserver
+ ? null
+ : (e = new this.targetWindow.ResizeObserver((e) => {
+ e.forEach((e) => {
+ let t = () => {
+ this._measureElement(e.target, e);
+ };
+ this.options.useAnimationFrameWithResizeObserver
+ ? requestAnimationFrame(t)
+ : t();
+ });
+ })));
+ return {
+ disconnect: () => {
+ var n;
+ ((n = t()) == null || n.disconnect(), (e = null));
+ },
+ observe: (e) => t()?.observe(e, {box: `border-box`}),
+ unobserve: (e) => t()?.unobserve(e),
+ };
+ })()),
+ (this.range = null),
+ (this.setOptions = (e) => {
+ (Object.entries(e).forEach(([t, n]) => {
+ n === void 0 && delete e[t];
+ }),
+ (this.options = {
+ debug: !1,
+ initialOffset: 0,
+ overscan: 1,
+ paddingStart: 0,
+ paddingEnd: 0,
+ scrollPaddingStart: 0,
+ scrollPaddingEnd: 0,
+ horizontal: !1,
+ getItemKey: ue,
+ rangeExtractor: de,
+ onChange: () => {},
+ measureElement: ge,
+ initialRect: {width: 0, height: 0},
+ scrollMargin: 0,
+ gap: 0,
+ indexAttribute: `data-index`,
+ initialMeasurementsCache: [],
+ lanes: 1,
+ isScrollingResetDelay: 150,
+ enabled: !0,
+ isRtl: !1,
+ useScrollendEvent: !1,
+ useAnimationFrameWithResizeObserver: !1,
+ ...e,
+ }));
+ }),
+ (this.notify = (e) => {
+ var t, n;
+ (n = (t = this.options).onChange) == null || n.call(t, this, e);
+ }),
+ (this.maybeNotify = W(
+ () => (
+ this.calculateRange(),
+ [
+ this.isScrolling,
+ this.range ? this.range.startIndex : null,
+ this.range ? this.range.endIndex : null,
+ ]
+ ),
+ (e) => {
+ this.notify(e);
+ },
+ {
+ key: !1,
+ debug: () => this.options.debug,
+ initialDeps: [
+ this.isScrolling,
+ this.range ? this.range.startIndex : null,
+ this.range ? this.range.endIndex : null,
+ ],
+ }
+ )),
+ (this.cleanup = () => {
+ (this.unsubs.filter(Boolean).forEach((e) => e()),
+ (this.unsubs = []),
+ this.observer.disconnect(),
+ (this.scrollElement = null),
+ (this.targetWindow = null));
+ }),
+ (this._didMount = () => () => {
+ this.cleanup();
+ }),
+ (this._willUpdate = () => {
+ let e = this.options.enabled ? this.options.getScrollElement() : null;
+ if (this.scrollElement !== e) {
+ if ((this.cleanup(), !e)) {
+ this.maybeNotify();
+ return;
+ }
+ ((this.scrollElement = e),
+ this.scrollElement && `ownerDocument` in this.scrollElement
+ ? (this.targetWindow =
+ this.scrollElement.ownerDocument.defaultView)
+ : (this.targetWindow = this.scrollElement?.window ?? null),
+ this.elementsCache.forEach((e) => {
+ this.observer.observe(e);
+ }),
+ this.unsubs.push(
+ this.options.observeElementRect(this, (e) => {
+ ((this.scrollRect = e), this.maybeNotify());
+ })
+ ),
+ this.unsubs.push(
+ this.options.observeElementOffset(this, (e, t) => {
+ ((this.scrollAdjustments = 0),
+ (this.scrollDirection = t
+ ? this.getScrollOffset() < e
+ ? `forward`
+ : `backward`
+ : null),
+ (this.scrollOffset = e),
+ (this.isScrolling = t),
+ this.maybeNotify());
+ })
+ ),
+ this._scrollToOffset(this.getScrollOffset(), {
+ adjustments: void 0,
+ behavior: void 0,
+ }));
+ }
+ }),
+ (this.getSize = () =>
+ this.options.enabled
+ ? ((this.scrollRect = this.scrollRect ?? this.options.initialRect),
+ this.scrollRect[this.options.horizontal ? `width` : `height`])
+ : ((this.scrollRect = null), 0)),
+ (this.getScrollOffset = () =>
+ this.options.enabled
+ ? ((this.scrollOffset =
+ this.scrollOffset ??
+ (typeof this.options.initialOffset == `function`
+ ? this.options.initialOffset()
+ : this.options.initialOffset)),
+ this.scrollOffset)
+ : ((this.scrollOffset = null), 0)),
+ (this.getFurthestMeasurement = (e, t) => {
+ let n = new Map(),
+ r = new Map();
+ for (let i = t - 1; i >= 0; i--) {
+ let t = e[i];
+ if (n.has(t.lane)) continue;
+ let a = r.get(t.lane);
+ if (
+ (a == null || t.end > a.end
+ ? r.set(t.lane, t)
+ : t.end < a.end && n.set(t.lane, !0),
+ n.size === this.options.lanes)
+ )
+ break;
+ }
+ return r.size === this.options.lanes
+ ? Array.from(r.values()).sort((e, t) =>
+ e.end === t.end ? e.index - t.index : e.end - t.end
+ )[0]
+ : void 0;
+ }),
+ (this.getMeasurementOptions = W(
+ () => [
+ this.options.count,
+ this.options.paddingStart,
+ this.options.scrollMargin,
+ this.options.getItemKey,
+ this.options.enabled,
+ this.options.lanes,
+ ],
+ (e, t, n, r, i, a) => (
+ this.prevLanes !== void 0 &&
+ this.prevLanes !== a &&
+ (this.lanesChangedFlag = !0),
+ (this.prevLanes = a),
+ (this.pendingMeasuredCacheIndexes = []),
+ {
+ count: e,
+ paddingStart: t,
+ scrollMargin: n,
+ getItemKey: r,
+ enabled: i,
+ lanes: a,
+ }
+ ),
+ {key: !1}
+ )),
+ (this.getMeasurements = W(
+ () => [this.getMeasurementOptions(), this.itemSizeCache],
+ (
+ {
+ count: e,
+ paddingStart: t,
+ scrollMargin: n,
+ getItemKey: r,
+ enabled: i,
+ lanes: a,
+ },
+ o
+ ) => {
+ if (!i)
+ return (
+ (this.measurementsCache = []),
+ this.itemSizeCache.clear(),
+ this.laneAssignments.clear(),
+ []
+ );
+ if (this.laneAssignments.size > e)
+ for (let t of this.laneAssignments.keys())
+ t >= e && this.laneAssignments.delete(t);
+ (this.lanesChangedFlag &&
+ ((this.lanesChangedFlag = !1),
+ (this.lanesSettling = !0),
+ (this.measurementsCache = []),
+ this.itemSizeCache.clear(),
+ this.laneAssignments.clear(),
+ (this.pendingMeasuredCacheIndexes = [])),
+ this.measurementsCache.length === 0 &&
+ !this.lanesSettling &&
+ ((this.measurementsCache =
+ this.options.initialMeasurementsCache),
+ this.measurementsCache.forEach((e) => {
+ this.itemSizeCache.set(e.key, e.size);
+ })));
+ let s = this.lanesSettling
+ ? 0
+ : this.pendingMeasuredCacheIndexes.length > 0
+ ? Math.min(...this.pendingMeasuredCacheIndexes)
+ : 0;
+ ((this.pendingMeasuredCacheIndexes = []),
+ this.lanesSettling &&
+ this.measurementsCache.length === e &&
+ (this.lanesSettling = !1));
+ let c = this.measurementsCache.slice(0, s),
+ l = Array(a).fill(void 0);
+ for (let e = 0; e < s; e++) {
+ let t = c[e];
+ t && (l[t.lane] = e);
+ }
+ for (let i = s; i < e; i++) {
+ let e = r(i),
+ a = this.laneAssignments.get(i),
+ s,
+ u;
+ if (a !== void 0 && this.options.lanes > 1) {
+ s = a;
+ let e = l[s],
+ r = e === void 0 ? void 0 : c[e];
+ u = r ? r.end + this.options.gap : t + n;
+ } else {
+ let e =
+ this.options.lanes === 1
+ ? c[i - 1]
+ : this.getFurthestMeasurement(c, i);
+ ((u = e ? e.end + this.options.gap : t + n),
+ (s = e ? e.lane : i % this.options.lanes),
+ this.options.lanes > 1 && this.laneAssignments.set(i, s));
+ }
+ let d = o.get(e),
+ f = typeof d == `number` ? d : this.options.estimateSize(i),
+ p = u + f;
+ ((c[i] = {index: i, start: u, size: f, end: p, key: e, lane: s}),
+ (l[s] = i));
+ }
+ return ((this.measurementsCache = c), c);
+ },
+ {key: !1, debug: () => this.options.debug}
+ )),
+ (this.calculateRange = W(
+ () => [
+ this.getMeasurements(),
+ this.getSize(),
+ this.getScrollOffset(),
+ this.options.lanes,
+ ],
+ (e, t, n, r) =>
+ (this.range =
+ e.length > 0 && t > 0
+ ? be({measurements: e, outerSize: t, scrollOffset: n, lanes: r})
+ : null),
+ {key: !1, debug: () => this.options.debug}
+ )),
+ (this.getVirtualIndexes = W(
+ () => {
+ let e = null,
+ t = null,
+ n = this.calculateRange();
+ return (
+ n && ((e = n.startIndex), (t = n.endIndex)),
+ this.maybeNotify.updateDeps([this.isScrolling, e, t]),
+ [
+ this.options.rangeExtractor,
+ this.options.overscan,
+ this.options.count,
+ e,
+ t,
+ ]
+ );
+ },
+ (e, t, n, r, i) =>
+ r === null || i === null
+ ? []
+ : e({startIndex: r, endIndex: i, overscan: t, count: n}),
+ {key: !1, debug: () => this.options.debug}
+ )),
+ (this.indexFromElement = (e) => {
+ let t = this.options.indexAttribute,
+ n = e.getAttribute(t);
+ return n
+ ? parseInt(n, 10)
+ : (console.warn(
+ `Missing attribute name '${t}={index}' on measured element.`
+ ),
+ -1);
+ }),
+ (this._measureElement = (e, t) => {
+ let n = this.indexFromElement(e),
+ r = this.measurementsCache[n];
+ if (!r) return;
+ let i = r.key,
+ a = this.elementsCache.get(i);
+ (a !== e &&
+ (a && this.observer.unobserve(a),
+ this.observer.observe(e),
+ this.elementsCache.set(i, e)),
+ e.isConnected &&
+ this.resizeItem(n, this.options.measureElement(e, t, this)));
+ }),
+ (this.resizeItem = (e, t) => {
+ let n = this.measurementsCache[e];
+ if (!n) return;
+ let r = t - (this.itemSizeCache.get(n.key) ?? n.size);
+ r !== 0 &&
+ ((this.shouldAdjustScrollPositionOnItemSizeChange === void 0
+ ? n.start < this.getScrollOffset() + this.scrollAdjustments
+ : this.shouldAdjustScrollPositionOnItemSizeChange(n, r, this)) &&
+ this._scrollToOffset(this.getScrollOffset(), {
+ adjustments: (this.scrollAdjustments += r),
+ behavior: void 0,
+ }),
+ this.pendingMeasuredCacheIndexes.push(n.index),
+ (this.itemSizeCache = new Map(this.itemSizeCache.set(n.key, t))),
+ this.notify(!1));
+ }),
+ (this.measureElement = (e) => {
+ if (!e) {
+ this.elementsCache.forEach((e, t) => {
+ e.isConnected ||
+ (this.observer.unobserve(e), this.elementsCache.delete(t));
+ });
+ return;
+ }
+ this._measureElement(e, void 0);
+ }),
+ (this.getVirtualItems = W(
+ () => [this.getVirtualIndexes(), this.getMeasurements()],
+ (e, t) => {
+ let n = [];
+ for (let r = 0, i = e.length; r < i; r++) {
+ let i = t[e[r]];
+ n.push(i);
+ }
+ return n;
+ },
+ {key: !1, debug: () => this.options.debug}
+ )),
+ (this.getVirtualItemForOffset = (e) => {
+ let t = this.getMeasurements();
+ if (t.length !== 0)
+ return oe(t[ye(0, t.length - 1, (e) => oe(t[e]).start, e)]);
+ }),
+ (this.getMaxScrollOffset = () => {
+ if (!this.scrollElement) return 0;
+ if (`scrollHeight` in this.scrollElement)
+ return this.options.horizontal
+ ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth
+ : this.scrollElement.scrollHeight -
+ this.scrollElement.clientHeight;
+ {
+ let e = this.scrollElement.document.documentElement;
+ return this.options.horizontal
+ ? e.scrollWidth - this.scrollElement.innerWidth
+ : e.scrollHeight - this.scrollElement.innerHeight;
+ }
+ }),
+ (this.getOffsetForAlignment = (e, t, n = 0) => {
+ if (!this.scrollElement) return 0;
+ let r = this.getSize(),
+ i = this.getScrollOffset();
+ (t === `auto` && (t = e >= i + r ? `end` : `start`),
+ t === `center` ? (e += (n - r) / 2) : t === `end` && (e -= r));
+ let a = this.getMaxScrollOffset();
+ return Math.max(Math.min(a, e), 0);
+ }),
+ (this.getOffsetForIndex = (e, t = `auto`) => {
+ e = Math.max(0, Math.min(e, this.options.count - 1));
+ let n = this.measurementsCache[e];
+ if (!n) return;
+ let r = this.getSize(),
+ i = this.getScrollOffset();
+ if (t === `auto`)
+ if (n.end >= i + r - this.options.scrollPaddingEnd) t = `end`;
+ else if (n.start <= i + this.options.scrollPaddingStart)
+ t = `start`;
+ else return [i, t];
+ if (t === `end` && e === this.options.count - 1)
+ return [this.getMaxScrollOffset(), t];
+ let a =
+ t === `end`
+ ? n.end + this.options.scrollPaddingEnd
+ : n.start - this.options.scrollPaddingStart;
+ return [this.getOffsetForAlignment(a, t, n.size), t];
+ }),
+ (this.isDynamicMode = () => this.elementsCache.size > 0),
+ (this.scrollToOffset = (e, {align: t = `start`, behavior: n} = {}) => {
+ (n === `smooth` &&
+ this.isDynamicMode() &&
+ console.warn(
+ 'The `smooth` scroll behavior is not fully supported with dynamic size.'
+ ),
+ this._scrollToOffset(this.getOffsetForAlignment(e, t), {
+ adjustments: void 0,
+ behavior: n,
+ }));
+ }),
+ (this.scrollToIndex = (e, {align: t = `auto`, behavior: n} = {}) => {
+ (n === `smooth` &&
+ this.isDynamicMode() &&
+ console.warn(
+ 'The `smooth` scroll behavior is not fully supported with dynamic size.'
+ ),
+ (e = Math.max(0, Math.min(e, this.options.count - 1))),
+ (this.currentScrollToIndex = e));
+ let r = 0,
+ i = (t) => {
+ if (!this.targetWindow) return;
+ let r = this.getOffsetForIndex(e, t);
+ if (!r) {
+ console.warn(`Failed to get offset for index:`, e);
+ return;
+ }
+ let [i, o] = r;
+ (this._scrollToOffset(i, {adjustments: void 0, behavior: n}),
+ this.targetWindow.requestAnimationFrame(() => {
+ let t = () => {
+ if (this.currentScrollToIndex !== e) return;
+ let t = this.getScrollOffset(),
+ n = this.getOffsetForIndex(e, o);
+ if (!n) {
+ console.warn(`Failed to get offset for index:`, e);
+ return;
+ }
+ se(n[0], t) || a(o);
+ };
+ this.isDynamicMode()
+ ? this.targetWindow.requestAnimationFrame(t)
+ : t();
+ }));
+ },
+ a = (t) => {
+ this.targetWindow &&
+ this.currentScrollToIndex === e &&
+ (r++,
+ r < 10
+ ? this.targetWindow.requestAnimationFrame(() => i(t))
+ : console.warn(
+ `Failed to scroll to index ${e} after 10 attempts.`
+ ));
+ };
+ i(t);
+ }),
+ (this.scrollBy = (e, {behavior: t} = {}) => {
+ (t === `smooth` &&
+ this.isDynamicMode() &&
+ console.warn(
+ 'The `smooth` scroll behavior is not fully supported with dynamic size.'
+ ),
+ this._scrollToOffset(this.getScrollOffset() + e, {
+ adjustments: void 0,
+ behavior: t,
+ }));
+ }),
+ (this.getTotalSize = () => {
+ let e = this.getMeasurements(),
+ t;
+ if (e.length === 0) t = this.options.paddingStart;
+ else if (this.options.lanes === 1) t = e[e.length - 1]?.end ?? 0;
+ else {
+ let n = Array(this.options.lanes).fill(null),
+ r = e.length - 1;
+ for (; r >= 0 && n.some((e) => e === null); ) {
+ let t = e[r];
+ (n[t.lane] === null && (n[t.lane] = t.end), r--);
+ }
+ t = Math.max(...n.filter((e) => e !== null));
+ }
+ return Math.max(
+ t - this.options.scrollMargin + this.options.paddingEnd,
+ 0
+ );
+ }),
+ (this._scrollToOffset = (e, {adjustments: t, behavior: n}) => {
+ this.options.scrollToFn(e, {behavior: n, adjustments: t}, this);
+ }),
+ (this.measure = () => {
+ ((this.itemSizeCache = new Map()),
+ (this.laneAssignments = new Map()),
+ this.notify(!1));
+ }),
+ this.setOptions(e));
+ }
+ },
+ ye = (e, t, n, r) => {
+ for (; e <= t; ) {
+ let i = ((e + t) / 2) | 0,
+ a = n(i);
+ if (a < r) e = i + 1;
+ else if (a > r) t = i - 1;
+ else return i;
+ }
+ return e > 0 ? e - 1 : 0;
+ };
+function be({measurements: e, outerSize: t, scrollOffset: n, lanes: r}) {
+ let i = e.length - 1,
+ a = (t) => e[t].start;
+ if (e.length <= r) return {startIndex: 0, endIndex: i};
+ let o = ye(0, i, a, n),
+ s = o;
+ if (r === 1) for (; s < i && e[s].end < n + t; ) s++;
+ else if (r > 1) {
+ let a = Array(r).fill(0);
+ for (; s < i && a.some((e) => e < n + t); ) {
+ let t = e[s];
+ ((a[t.lane] = t.end), s++);
+ }
+ let c = Array(r).fill(n + t);
+ for (; o >= 0 && c.some((e) => e >= n); ) {
+ let t = e[o];
+ ((c[t.lane] = t.start), o--);
+ }
+ ((o = Math.max(0, o - (o % r))), (s = Math.min(i, s + (r - 1 - (s % r)))));
+ }
+ return {startIndex: o, endIndex: s};
+}
+function xe(e) {
+ let t = new ve(x(e)),
+ n = A(t),
+ r = t._didMount();
+ return (
+ i(
+ () => x(e).getScrollElement(),
+ (e) => {
+ e && t._willUpdate();
+ },
+ {immediate: !0}
+ ),
+ i(
+ () => x(e),
+ (e) => {
+ (t.setOptions({
+ ...e,
+ onChange: (t, r) => {
+ var i;
+ (T(n), (i = e.onChange) == null || i.call(e, t, r));
+ },
+ }),
+ t._willUpdate(),
+ T(n));
+ },
+ {immediate: !0}
+ ),
+ h(r),
+ n
+ );
+}
+function Se(e) {
+ return xe(
+ m(() => ({
+ observeElementRect: fe,
+ observeElementOffset: he,
+ scrollToFn: _e,
+ ...x(e),
+ }))
+ );
+}
+function Ce(e, t, n) {
+ let r = _(n?.value),
+ i = m(() => e.value !== void 0);
+ return [
+ m(() => (i.value ? e.value : r.value)),
+ function (e) {
+ return (i.value || (r.value = e), t?.(e));
+ },
+ ];
+}
+function we(e) {
+ typeof queueMicrotask == `function`
+ ? queueMicrotask(e)
+ : Promise.resolve()
+ .then(e)
+ .catch((e) =>
+ setTimeout(() => {
+ throw e;
+ })
+ );
+}
+function G() {
+ let e = [],
+ t = {
+ addEventListener(e, n, r, i) {
+ return (
+ e.addEventListener(n, r, i),
+ t.add(() => e.removeEventListener(n, r, i))
+ );
+ },
+ requestAnimationFrame(...e) {
+ let n = requestAnimationFrame(...e);
+ t.add(() => cancelAnimationFrame(n));
+ },
+ nextFrame(...e) {
+ t.requestAnimationFrame(() => {
+ t.requestAnimationFrame(...e);
+ });
+ },
+ setTimeout(...e) {
+ let n = setTimeout(...e);
+ t.add(() => clearTimeout(n));
+ },
+ microTask(...e) {
+ let n = {current: !0};
+ return (
+ we(() => {
+ n.current && e[0]();
+ }),
+ t.add(() => {
+ n.current = !1;
+ })
+ );
+ },
+ style(e, t, n) {
+ let r = e.style.getPropertyValue(t);
+ return (
+ Object.assign(e.style, {[t]: n}),
+ this.add(() => {
+ Object.assign(e.style, {[t]: r});
+ })
+ );
+ },
+ group(e) {
+ let t = G();
+ return (e(t), this.add(() => t.dispose()));
+ },
+ add(t) {
+ return (
+ e.push(t),
+ () => {
+ let n = e.indexOf(t);
+ if (n >= 0) for (let t of e.splice(n, 1)) t();
+ }
+ );
+ },
+ dispose() {
+ for (let t of e.splice(0)) t();
+ },
+ };
+ return t;
+}
+function Te() {
+ let e = G();
+ return (a(() => e.dispose()), e);
+}
+function Ee() {
+ let e = Te();
+ return (t) => {
+ (e.dispose(), e.nextFrame(t));
+ };
+}
+var De = Object.defineProperty,
+ Oe = (e, t, n) =>
+ t in e
+ ? De(e, t, {enumerable: !0, configurable: !0, writable: !0, value: n})
+ : (e[t] = n),
+ ke = (e, t, n) => (Oe(e, typeof t == `symbol` ? t : t + ``, n), n),
+ K = new (class {
+ constructor() {
+ (ke(this, `current`, this.detect()), ke(this, `currentId`, 0));
+ }
+ set(e) {
+ this.current !== e && ((this.currentId = 0), (this.current = e));
+ }
+ reset() {
+ this.set(this.detect());
+ }
+ nextId() {
+ return ++this.currentId;
+ }
+ get isServer() {
+ return this.current === `server`;
+ }
+ get isClient() {
+ return this.current === `client`;
+ }
+ detect() {
+ return typeof window > `u` || typeof document > `u` ? `server` : `client`;
+ }
+ })();
+function Ae(e) {
+ if (K.isServer) return null;
+ if (e instanceof Node) return e.ownerDocument;
+ if (e != null && e.hasOwnProperty(`value`)) {
+ let t = V(e);
+ if (t) return t.ownerDocument;
+ }
+ return document;
+}
+var je = [
+ `[contentEditable=true]`,
+ `[tabindex]`,
+ `a[href]`,
+ `area[href]`,
+ `button:not([disabled])`,
+ `iframe`,
+ `input:not([disabled])`,
+ `select:not([disabled])`,
+ `textarea:not([disabled])`,
+ ]
+ .map((e) => `${e}:not([tabindex='-1'])`)
+ .join(`,`),
+ Me = ((e) => (
+ (e[(e.First = 1)] = `First`),
+ (e[(e.Previous = 2)] = `Previous`),
+ (e[(e.Next = 4)] = `Next`),
+ (e[(e.Last = 8)] = `Last`),
+ (e[(e.WrapAround = 16)] = `WrapAround`),
+ (e[(e.NoScroll = 32)] = `NoScroll`),
+ e
+ ))(Me || {}),
+ Ne = ((e) => (
+ (e[(e.Error = 0)] = `Error`),
+ (e[(e.Overflow = 1)] = `Overflow`),
+ (e[(e.Success = 2)] = `Success`),
+ (e[(e.Underflow = 3)] = `Underflow`),
+ e
+ ))(Ne || {}),
+ Pe = ((e) => (
+ (e[(e.Previous = -1)] = `Previous`),
+ (e[(e.Next = 1)] = `Next`),
+ e
+ ))(Pe || {}),
+ Fe = ((e) => (
+ (e[(e.Strict = 0)] = `Strict`),
+ (e[(e.Loose = 1)] = `Loose`),
+ e
+ ))(Fe || {});
+function Ie(e, t = 0) {
+ return e === Ae(e)?.body
+ ? !1
+ : I(t, {
+ 0() {
+ return e.matches(je);
+ },
+ 1() {
+ let t = e;
+ for (; t !== null; ) {
+ if (t.matches(je)) return !0;
+ t = t.parentElement;
+ }
+ return !1;
+ },
+ });
+}
+var Le = ((e) => (
+ (e[(e.Keyboard = 0)] = `Keyboard`),
+ (e[(e.Mouse = 1)] = `Mouse`),
+ e
+))(Le || {});
+(typeof window < `u` &&
+ typeof document < `u` &&
+ (document.addEventListener(
+ `keydown`,
+ (e) => {
+ e.metaKey ||
+ e.altKey ||
+ e.ctrlKey ||
+ (document.documentElement.dataset.headlessuiFocusVisible = ``);
+ },
+ !0
+ ),
+ document.addEventListener(
+ `click`,
+ (e) => {
+ e.detail === 1
+ ? delete document.documentElement.dataset.headlessuiFocusVisible
+ : e.detail === 0 &&
+ (document.documentElement.dataset.headlessuiFocusVisible = ``);
+ },
+ !0
+ )),
+ [`textarea`, `input`].join(`,`));
+function Re(e, t = (e) => e) {
+ return e.slice().sort((e, n) => {
+ let r = t(e),
+ i = t(n);
+ if (r === null || i === null) return 0;
+ let a = r.compareDocumentPosition(i);
+ return a & Node.DOCUMENT_POSITION_FOLLOWING
+ ? -1
+ : a & Node.DOCUMENT_POSITION_PRECEDING
+ ? 1
+ : 0;
+ });
+}
+function ze() {
+ return (
+ /iPhone/gi.test(window.navigator.platform) ||
+ (/Mac/gi.test(window.navigator.platform) &&
+ window.navigator.maxTouchPoints > 0)
+ );
+}
+function Be() {
+ return /Android/gi.test(window.navigator.userAgent);
+}
+function Ve() {
+ return ze() || Be();
+}
+function q(e, t, n) {
+ K.isServer ||
+ p((r) => {
+ (document.addEventListener(e, t, n),
+ r(() => document.removeEventListener(e, t, n)));
+ });
+}
+function He(e, t, n) {
+ K.isServer ||
+ p((r) => {
+ (window.addEventListener(e, t, n),
+ r(() => window.removeEventListener(e, t, n)));
+ });
+}
+function Ue(e, t, n = m(() => !0)) {
+ function r(r, i) {
+ if (!n.value || r.defaultPrevented) return;
+ let a = i(r);
+ if (a === null || !a.getRootNode().contains(a)) return;
+ let o = (function e(t) {
+ return typeof t == `function`
+ ? e(t())
+ : Array.isArray(t) || t instanceof Set
+ ? t
+ : [t];
+ })(e);
+ for (let e of o) {
+ if (e === null) continue;
+ let t = e instanceof HTMLElement ? e : V(e);
+ if (
+ (t != null && t.contains(a)) ||
+ (r.composed && r.composedPath().includes(t))
+ )
+ return;
+ }
+ return (
+ !Ie(a, Fe.Loose) && a.tabIndex !== -1 && r.preventDefault(),
+ t(r, a)
+ );
+ }
+ let i = _(null);
+ (q(
+ `pointerdown`,
+ (e) => {
+ n.value && (i.value = e.composedPath?.call(e)?.[0] || e.target);
+ },
+ !0
+ ),
+ q(
+ `mousedown`,
+ (e) => {
+ n.value && (i.value = e.composedPath?.call(e)?.[0] || e.target);
+ },
+ !0
+ ),
+ q(
+ `click`,
+ (e) => {
+ Ve() || (i.value &&= (r(e, () => i.value), null));
+ },
+ !0
+ ),
+ q(
+ `touchend`,
+ (e) => r(e, () => (e.target instanceof HTMLElement ? e.target : null)),
+ !0
+ ),
+ He(
+ `blur`,
+ (e) =>
+ r(e, () =>
+ window.document.activeElement instanceof HTMLIFrameElement
+ ? window.document.activeElement
+ : null
+ ),
+ !0
+ ));
+}
+function We(e) {
+ return [e.screenX, e.screenY];
+}
+function Ge() {
+ let e = _([-1, -1]);
+ return {
+ wasMoved(t) {
+ let n = We(t);
+ return e.value[0] === n[0] && e.value[1] === n[1]
+ ? !1
+ : ((e.value = n), !0);
+ },
+ update(t) {
+ e.value = We(t);
+ },
+ };
+}
+function Ke({container: e, accept: t, walk: n, enabled: r}) {
+ p(() => {
+ let i = e.value;
+ if (!i || (r !== void 0 && !r.value)) return;
+ let a = Ae(e);
+ if (!a) return;
+ let o = Object.assign((e) => t(e), {acceptNode: t}),
+ s = a.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, o, !1);
+ for (; s.nextNode(); ) n(s.currentNode);
+ });
+}
+var qe = ((e) => (
+ (e[(e.None = 1)] = `None`),
+ (e[(e.Focusable = 2)] = `Focusable`),
+ (e[(e.Hidden = 4)] = `Hidden`),
+ e
+ ))(qe || {}),
+ Je = n({
+ name: `Hidden`,
+ props: {
+ as: {type: [Object, String], default: `div`},
+ features: {type: Number, default: 1},
+ },
+ setup(e, {slots: t, attrs: n}) {
+ return () => {
+ let {features: r, ...i} = e;
+ return B({
+ ourProps: {
+ 'aria-hidden': (r & 2) == 2 ? !0 : (i[`aria-hidden`] ?? void 0),
+ hidden: (r & 4) == 4 ? !0 : void 0,
+ style: {
+ position: `fixed`,
+ top: 1,
+ left: 1,
+ width: 1,
+ height: 0,
+ padding: 0,
+ margin: -1,
+ overflow: `hidden`,
+ clip: `rect(0, 0, 0, 0)`,
+ whiteSpace: `nowrap`,
+ borderWidth: `0`,
+ ...((r & 4) == 4 && (r & 2) != 2 && {display: `none`}),
+ },
+ },
+ theirProps: i,
+ slot: {},
+ attrs: n,
+ slots: t,
+ name: `Hidden`,
+ });
+ };
+ },
+ }),
+ Ye = ((e) => ((e[(e.Left = 0)] = `Left`), (e[(e.Right = 2)] = `Right`), e))(
+ Ye || {}
+ );
+function Xe(e) {
+ function t() {
+ document.readyState !== `loading` &&
+ (e(), document.removeEventListener(`DOMContentLoaded`, t));
+ }
+ typeof window < `u` &&
+ typeof document < `u` &&
+ (document.addEventListener(`DOMContentLoaded`, t), t());
+}
+var J = [];
+Xe(() => {
+ function e(e) {
+ e.target instanceof HTMLElement &&
+ e.target !== document.body &&
+ J[0] !== e.target &&
+ (J.unshift(e.target),
+ (J = J.filter((e) => e != null && e.isConnected)),
+ J.splice(10));
+ }
+ (window.addEventListener(`click`, e, {capture: !0}),
+ window.addEventListener(`mousedown`, e, {capture: !0}),
+ window.addEventListener(`focus`, e, {capture: !0}),
+ document.body.addEventListener(`click`, e, {capture: !0}),
+ document.body.addEventListener(`mousedown`, e, {capture: !0}),
+ document.body.addEventListener(`focus`, e, {capture: !0}));
+});
+function Ze(e) {
+ throw Error(`Unexpected object: ` + e);
+}
+var Y = ((e) => (
+ (e[(e.First = 0)] = `First`),
+ (e[(e.Previous = 1)] = `Previous`),
+ (e[(e.Next = 2)] = `Next`),
+ (e[(e.Last = 3)] = `Last`),
+ (e[(e.Specific = 4)] = `Specific`),
+ (e[(e.Nothing = 5)] = `Nothing`),
+ e
+))(Y || {});
+function Qe(e, t) {
+ let n = t.resolveItems();
+ if (n.length <= 0) return null;
+ let r = t.resolveActiveIndex(),
+ i = r ?? -1;
+ switch (e.focus) {
+ case 0:
+ for (let e = 0; e < n.length; ++e)
+ if (!t.resolveDisabled(n[e], e, n)) return e;
+ return r;
+ case 1:
+ i === -1 && (i = n.length);
+ for (let e = i - 1; e >= 0; --e)
+ if (!t.resolveDisabled(n[e], e, n)) return e;
+ return r;
+ case 2:
+ for (let e = i + 1; e < n.length; ++e)
+ if (!t.resolveDisabled(n[e], e, n)) return e;
+ return r;
+ case 3:
+ for (let e = n.length - 1; e >= 0; --e)
+ if (!t.resolveDisabled(n[e], e, n)) return e;
+ return r;
+ case 4:
+ for (let r = 0; r < n.length; ++r)
+ if (t.resolveId(n[r], r, n) === e.id) return r;
+ return r;
+ case 5:
+ return null;
+ default:
+ Ze(e);
+ }
+}
+function $e(e = {}, t = null, n = []) {
+ for (let [r, i] of Object.entries(e)) tt(n, et(t, r), i);
+ return n;
+}
+function et(e, t) {
+ return e ? e + `[` + t + `]` : t;
+}
+function tt(e, t, n) {
+ if (Array.isArray(n))
+ for (let [r, i] of n.entries()) tt(e, et(t, r.toString()), i);
+ else
+ n instanceof Date
+ ? e.push([t, n.toISOString()])
+ : typeof n == `boolean`
+ ? e.push([t, n ? `1` : `0`])
+ : typeof n == `string`
+ ? e.push([t, n])
+ : typeof n == `number`
+ ? e.push([t, `${n}`])
+ : n == null
+ ? e.push([t, ``])
+ : $e(n, t, e);
+}
+function nt(e, t) {
+ return e === t;
+}
+var rt = ((e) => (
+ (e[(e.Open = 0)] = `Open`),
+ (e[(e.Closed = 1)] = `Closed`),
+ e
+ ))(rt || {}),
+ it = ((e) => (
+ (e[(e.Single = 0)] = `Single`),
+ (e[(e.Multi = 1)] = `Multi`),
+ e
+ ))(it || {}),
+ at = ((e) => (
+ (e[(e.Pointer = 0)] = `Pointer`),
+ (e[(e.Focus = 1)] = `Focus`),
+ (e[(e.Other = 2)] = `Other`),
+ e
+ ))(at || {}),
+ ot = Symbol(`ComboboxContext`);
+function X(e) {
+ let t = S(ot, null);
+ if (t === null) {
+ let t = Error(`<${e} /> is missing a parent component.`);
+ throw (Error.captureStackTrace && Error.captureStackTrace(t, X), t);
+ }
+ return t;
+}
+var st = Symbol(`VirtualContext`),
+ ct = n({
+ name: `VirtualProvider`,
+ setup(e, {slots: t}) {
+ let n = X(`VirtualProvider`),
+ r = m(() => {
+ let e = V(n.optionsRef);
+ if (!e) return {start: 0, end: 0};
+ let t = window.getComputedStyle(e);
+ return {
+ start: parseFloat(t.paddingBlockStart || t.paddingTop),
+ end: parseFloat(t.paddingBlockEnd || t.paddingBottom),
+ };
+ }),
+ a = Se(
+ m(() => ({
+ scrollPaddingStart: r.value.start,
+ scrollPaddingEnd: r.value.end,
+ count: n.virtual.value.options.length,
+ estimateSize() {
+ return 40;
+ },
+ getScrollElement() {
+ return V(n.optionsRef);
+ },
+ overscan: 12,
+ }))
+ ),
+ o = m(() => n.virtual.value?.options),
+ s = _(0);
+ return (
+ i([o], () => {
+ s.value += 1;
+ }),
+ P(st, n.virtual.value ? a : null),
+ () => [
+ C(
+ `div`,
+ {
+ style: {
+ position: `relative`,
+ width: `100%`,
+ height: `${a.value.getTotalSize()}px`,
+ },
+ ref: (e) => {
+ if (e) {
+ if (
+ (typeof process < `u` && {}.JEST_WORKER_ID !== void 0) ||
+ n.activationTrigger.value === 0
+ )
+ return;
+ n.activeOptionIndex.value !== null &&
+ n.virtual.value.options.length >
+ n.activeOptionIndex.value &&
+ a.value.scrollToIndex(n.activeOptionIndex.value);
+ }
+ },
+ },
+ a.value.getVirtualItems().map((e) =>
+ b(
+ t.default({
+ option: n.virtual.value.options[e.index],
+ open: n.comboboxState.value === 0,
+ })[0],
+ {
+ key: `${s.value}-${e.index}`,
+ 'data-index': e.index,
+ 'aria-setsize': n.virtual.value.options.length,
+ 'aria-posinset': e.index + 1,
+ style: {
+ position: `absolute`,
+ top: 0,
+ left: 0,
+ transform: `translateY(${e.start}px)`,
+ overflowAnchor: `none`,
+ },
+ }
+ )
+ )
+ ),
+ ]
+ );
+ },
+ }),
+ lt = n({
+ name: `Combobox`,
+ emits: {'update:modelValue': (e) => !0},
+ props: {
+ as: {type: [Object, String], default: `template`},
+ disabled: {type: [Boolean], default: !1},
+ by: {type: [String, Function], nullable: !0, default: null},
+ modelValue: {type: [Object, String, Number, Boolean], default: void 0},
+ defaultValue: {type: [Object, String, Number, Boolean], default: void 0},
+ form: {type: String, optional: !0},
+ name: {type: String, optional: !0},
+ nullable: {type: Boolean, default: !1},
+ multiple: {type: [Boolean], default: !1},
+ immediate: {type: [Boolean], default: !1},
+ virtual: {type: Object, default: null},
+ },
+ inheritAttrs: !1,
+ setup(e, {slots: t, attrs: n, emit: a}) {
+ let o = _(1),
+ s = _(null),
+ c = _(null),
+ l = _(null),
+ u = _(null),
+ d = _({static: !1, hold: !1}),
+ f = _([]),
+ p = _(null),
+ h = _(2),
+ g = _(!1);
+ function y(e = (e) => e) {
+ let t = p.value === null ? null : f.value[p.value],
+ n = e(f.value.slice()),
+ r =
+ n.length > 0 && n[0].dataRef.order.value !== null
+ ? n.sort((e, t) => e.dataRef.order.value - t.dataRef.order.value)
+ : Re(n, (e) => V(e.dataRef.domRef)),
+ i = t ? r.indexOf(t) : null;
+ return (i === -1 && (i = null), {options: r, activeOptionIndex: i});
+ }
+ let b = m(() => +!!e.multiple),
+ x = m(() => e.nullable),
+ [S, T] = Ce(
+ m(() => e.modelValue),
+ (e) => a(`update:modelValue`, e),
+ m(() => e.defaultValue)
+ ),
+ D = m(() =>
+ S.value === void 0 ? I(b.value, {1: [], 0: void 0}) : S.value
+ ),
+ O = null,
+ k = null;
+ function A(e) {
+ return I(b.value, {
+ 0() {
+ return T?.(e);
+ },
+ 1: () => {
+ let t = v(j.value.value).slice(),
+ n = v(e),
+ r = t.findIndex((e) => j.compare(n, v(e)));
+ return (r === -1 ? t.push(n) : t.splice(r, 1), T?.(t));
+ },
+ });
+ }
+ i([m(() => {})], ([e], [t]) => {
+ if (j.virtual.value && e && t && p.value !== null) {
+ let n = e.indexOf(t[p.value]);
+ n === -1 ? (p.value = null) : (p.value = n);
+ }
+ });
+ let j = {
+ comboboxState: o,
+ value: D,
+ mode: b,
+ compare(t, n) {
+ if (typeof e.by == `string`) {
+ let r = e.by;
+ return t?.[r] === n?.[r];
+ }
+ return e.by === null ? nt(t, n) : e.by(t, n);
+ },
+ calculateIndex(t) {
+ return j.virtual.value
+ ? e.by === null
+ ? j.virtual.value.options.indexOf(t)
+ : j.virtual.value.options.findIndex((e) => j.compare(e, t))
+ : f.value.findIndex((e) => j.compare(e.dataRef.value, t));
+ },
+ defaultValue: m(() => e.defaultValue),
+ nullable: x,
+ immediate: m(() => !1),
+ virtual: m(() => null),
+ inputRef: c,
+ labelRef: s,
+ buttonRef: l,
+ optionsRef: u,
+ disabled: m(() => e.disabled),
+ options: f,
+ change(e) {
+ T(e);
+ },
+ activeOptionIndex: m(() => {
+ if (
+ g.value &&
+ p.value === null &&
+ (j.virtual.value
+ ? j.virtual.value.options.length > 0
+ : f.value.length > 0)
+ ) {
+ if (j.virtual.value) {
+ let e = j.virtual.value.options.findIndex((e) => {
+ var t;
+ return !((t = j.virtual.value) != null && t.disabled(e));
+ });
+ if (e !== -1) return e;
+ }
+ let e = f.value.findIndex((e) => !e.dataRef.disabled);
+ if (e !== -1) return e;
+ }
+ return p.value;
+ }),
+ activationTrigger: h,
+ optionsPropsRef: d,
+ closeCombobox() {
+ ((g.value = !1),
+ !e.disabled && o.value !== 1 && ((o.value = 1), (p.value = null)));
+ },
+ openCombobox() {
+ if (((g.value = !0), !e.disabled && o.value !== 0)) {
+ if (j.value.value) {
+ let e = j.calculateIndex(j.value.value);
+ e !== -1 && (p.value = e);
+ }
+ o.value = 0;
+ }
+ },
+ setActivationTrigger(e) {
+ h.value = e;
+ },
+ goToOption(t, n, r) {
+ ((g.value = !1),
+ O !== null && cancelAnimationFrame(O),
+ (O = requestAnimationFrame(() => {
+ if (e.disabled || (u.value && !d.value.static && o.value === 1))
+ return;
+ if (j.virtual.value) {
+ ((p.value =
+ t === Y.Specific
+ ? n
+ : Qe(
+ {focus: t},
+ {
+ resolveItems: () => j.virtual.value.options,
+ resolveActiveIndex: () =>
+ j.activeOptionIndex.value ??
+ j.virtual.value.options.findIndex((e) => {
+ var t;
+ return !(
+ (t = j.virtual.value) != null && t.disabled(e)
+ );
+ }) ??
+ null,
+ resolveDisabled: (e) => j.virtual.value.disabled(e),
+ resolveId() {
+ throw Error(`Function not implemented.`);
+ },
+ }
+ )),
+ (h.value = r ?? 2));
+ return;
+ }
+ let i = y();
+ if (i.activeOptionIndex === null) {
+ let e = i.options.findIndex((e) => !e.dataRef.disabled);
+ e !== -1 && (i.activeOptionIndex = e);
+ }
+ ((p.value =
+ t === Y.Specific
+ ? n
+ : Qe(
+ {focus: t},
+ {
+ resolveItems: () => i.options,
+ resolveActiveIndex: () => i.activeOptionIndex,
+ resolveId: (e) => e.id,
+ resolveDisabled: (e) => e.dataRef.disabled,
+ }
+ )),
+ (h.value = r ?? 2),
+ (f.value = i.options));
+ })));
+ },
+ selectOption(e) {
+ let t = f.value.find((t) => t.id === e);
+ if (!t) return;
+ let {dataRef: n} = t;
+ A(n.value);
+ },
+ selectActiveOption() {
+ if (j.activeOptionIndex.value !== null) {
+ if (j.virtual.value)
+ A(j.virtual.value.options[j.activeOptionIndex.value]);
+ else {
+ let {dataRef: e} = f.value[j.activeOptionIndex.value];
+ A(e.value);
+ }
+ j.goToOption(Y.Specific, j.activeOptionIndex.value);
+ }
+ },
+ registerOption(e, t) {
+ let n = E({id: e, dataRef: t});
+ if (j.virtual.value) {
+ f.value.push(n);
+ return;
+ }
+ k && cancelAnimationFrame(k);
+ let r = y((e) => (e.push(n), e));
+ (p.value === null &&
+ j.isSelected(t.value.value) &&
+ (r.activeOptionIndex = r.options.indexOf(n)),
+ (f.value = r.options),
+ (p.value = r.activeOptionIndex),
+ (h.value = 2),
+ r.options.some((e) => !V(e.dataRef.domRef)) &&
+ (k = requestAnimationFrame(() => {
+ let e = y();
+ ((f.value = e.options), (p.value = e.activeOptionIndex));
+ })));
+ },
+ unregisterOption(e, t) {
+ if (
+ (O !== null && cancelAnimationFrame(O),
+ t && (g.value = !0),
+ j.virtual.value)
+ ) {
+ f.value = f.value.filter((t) => t.id !== e);
+ return;
+ }
+ let n = y((t) => {
+ let n = t.findIndex((t) => t.id === e);
+ return (n !== -1 && t.splice(n, 1), t);
+ });
+ ((f.value = n.options),
+ (p.value = n.activeOptionIndex),
+ (h.value = 2));
+ },
+ isSelected(e) {
+ return I(b.value, {
+ 0: () => j.compare(v(j.value.value), v(e)),
+ 1: () => v(j.value.value).some((t) => j.compare(v(t), v(e))),
+ });
+ },
+ isActive(e) {
+ return p.value === j.calculateIndex(e);
+ },
+ };
+ (Ue(
+ [c, l, u],
+ () => j.closeCombobox(),
+ m(() => o.value === 0)
+ ),
+ P(ot, j),
+ te(m(() => I(o.value, {0: z.Open, 1: z.Closed}))));
+ let M = m(() => V(c)?.closest(`form`));
+ return (
+ r(() => {
+ i(
+ [M],
+ () => {
+ if (!M.value || e.defaultValue === void 0) return;
+ function t() {
+ j.change(e.defaultValue);
+ }
+ return (
+ M.value.addEventListener(`reset`, t),
+ () => {
+ var e;
+ (e = M.value) == null || e.removeEventListener(`reset`, t);
+ }
+ );
+ },
+ {immediate: !0}
+ );
+ }),
+ () => {
+ let {name: r, disabled: i, form: a, ...s} = e,
+ c = {
+ open: o.value === 0,
+ disabled: i,
+ activeIndex: j.activeOptionIndex.value,
+ activeOption:
+ j.activeOptionIndex.value === null
+ ? null
+ : j.virtual.value
+ ? j.virtual.value.options[j.activeOptionIndex.value ?? 0]
+ : (j.options.value[j.activeOptionIndex.value]?.dataRef
+ .value ?? null),
+ value: D.value,
+ };
+ return C(w, [
+ ...(r != null && D.value != null
+ ? $e({[r]: D.value}).map(([e, t]) =>
+ C(
+ Je,
+ ae({
+ features: qe.Hidden,
+ key: e,
+ as: `input`,
+ type: `hidden`,
+ hidden: !0,
+ readOnly: !0,
+ form: a,
+ disabled: i,
+ name: e,
+ value: t,
+ })
+ )
+ )
+ : []),
+ B({
+ theirProps: {
+ ...n,
+ ...U(s, [
+ `by`,
+ `defaultValue`,
+ `immediate`,
+ `modelValue`,
+ `multiple`,
+ `nullable`,
+ `onUpdate:modelValue`,
+ `virtual`,
+ ]),
+ },
+ ourProps: {},
+ slot: c,
+ slots: t,
+ attrs: n,
+ name: `Combobox`,
+ }),
+ ]);
+ }
+ );
+ },
+ });
+n({
+ name: `ComboboxLabel`,
+ props: {
+ as: {type: [Object, String], default: `label`},
+ id: {type: String, default: null},
+ },
+ setup(e, {attrs: t, slots: n}) {
+ let r = e.id ?? `headlessui-combobox-label-${R()}`,
+ i = X(`ComboboxLabel`);
+ function a() {
+ var e;
+ (e = V(i.inputRef)) == null || e.focus({preventScroll: !0});
+ }
+ return () => {
+ let o = {open: i.comboboxState.value === 0, disabled: i.disabled.value},
+ {...s} = e;
+ return B({
+ ourProps: {id: r, ref: i.labelRef, onClick: a},
+ theirProps: s,
+ slot: o,
+ attrs: t,
+ slots: n,
+ name: `ComboboxLabel`,
+ });
+ };
+ },
+});
+var ut = n({
+ name: `ComboboxButton`,
+ props: {
+ as: {type: [Object, String], default: `button`},
+ id: {type: String, default: null},
+ },
+ setup(e, {attrs: t, slots: n, expose: r}) {
+ let i = e.id ?? `headlessui-combobox-button-${R()}`,
+ a = X(`ComboboxButton`);
+ r({el: a.buttonRef, $el: a.buttonRef});
+ function o(e) {
+ a.disabled.value ||
+ (a.comboboxState.value === 0
+ ? a.closeCombobox()
+ : (e.preventDefault(), a.openCombobox()),
+ s(() => V(a.inputRef)?.focus({preventScroll: !0})));
+ }
+ function c(e) {
+ switch (e.key) {
+ case H.ArrowDown:
+ (e.preventDefault(),
+ e.stopPropagation(),
+ a.comboboxState.value === 1 && a.openCombobox(),
+ s(() => a.inputRef.value?.focus({preventScroll: !0})));
+ return;
+ case H.ArrowUp:
+ (e.preventDefault(),
+ e.stopPropagation(),
+ a.comboboxState.value === 1 &&
+ (a.openCombobox(),
+ s(() => {
+ a.value.value || a.goToOption(Y.Last);
+ })),
+ s(() => a.inputRef.value?.focus({preventScroll: !0})));
+ return;
+ case H.Escape:
+ if (a.comboboxState.value !== 0) return;
+ (e.preventDefault(),
+ a.optionsRef.value &&
+ !a.optionsPropsRef.value.static &&
+ e.stopPropagation(),
+ a.closeCombobox(),
+ s(() => a.inputRef.value?.focus({preventScroll: !0})));
+ return;
+ }
+ }
+ let l = ne(
+ m(() => ({as: e.as, type: t.type})),
+ a.buttonRef
+ );
+ return () => {
+ let r = {
+ open: a.comboboxState.value === 0,
+ disabled: a.disabled.value,
+ value: a.value.value,
+ },
+ {...s} = e;
+ return B({
+ ourProps: {
+ ref: a.buttonRef,
+ id: i,
+ type: l.value,
+ tabindex: `-1`,
+ 'aria-haspopup': `listbox`,
+ 'aria-controls': V(a.optionsRef)?.id,
+ 'aria-expanded': a.comboboxState.value === 0,
+ 'aria-labelledby': a.labelRef.value
+ ? [V(a.labelRef)?.id, i].join(` `)
+ : void 0,
+ disabled: a.disabled.value === !0 ? !0 : void 0,
+ onKeydown: c,
+ onClick: o,
+ },
+ theirProps: s,
+ slot: r,
+ attrs: t,
+ slots: n,
+ name: `ComboboxButton`,
+ });
+ };
+ },
+ }),
+ dt = n({
+ name: `ComboboxInput`,
+ props: {
+ as: {type: [Object, String], default: `input`},
+ static: {type: Boolean, default: !1},
+ unmount: {type: Boolean, default: !0},
+ displayValue: {type: Function},
+ defaultValue: {type: String, default: void 0},
+ id: {type: String, default: null},
+ },
+ emits: {change: (e) => !0},
+ setup(e, {emit: t, attrs: n, slots: a, expose: o}) {
+ let c = e.id ?? `headlessui-combobox-input-${R()}`,
+ l = X(`ComboboxInput`),
+ u = m(() => Ae(V(l.inputRef))),
+ d = {value: !1};
+ o({el: l.inputRef, $el: l.inputRef});
+ function f() {
+ l.change(null);
+ let e = V(l.optionsRef);
+ (e && (e.scrollTop = 0), l.goToOption(Y.Nothing));
+ }
+ let p = m(() => {
+ let t = l.value.value;
+ return V(l.inputRef)
+ ? e.displayValue !== void 0 && t !== void 0
+ ? (e.displayValue(t) ?? ``)
+ : typeof t == `string`
+ ? t
+ : ``
+ : ``;
+ });
+ r(() => {
+ (i(
+ [p, l.comboboxState, u],
+ ([e, t], [n, r]) => {
+ if (d.value) return;
+ let i = V(l.inputRef);
+ i &&
+ (((r === 0 && t === 1) || e !== n) && (i.value = e),
+ requestAnimationFrame(() => {
+ if (d.value || !i || u.value?.activeElement !== i) return;
+ let {selectionStart: e, selectionEnd: t} = i;
+ Math.abs((t ?? 0) - (e ?? 0)) === 0 &&
+ e === 0 &&
+ i.setSelectionRange(i.value.length, i.value.length);
+ }));
+ },
+ {immediate: !0}
+ ),
+ i([l.comboboxState], ([e], [t]) => {
+ if (e === 0 && t === 1) {
+ if (d.value) return;
+ let e = V(l.inputRef);
+ if (!e) return;
+ let t = e.value,
+ {selectionStart: n, selectionEnd: r, selectionDirection: i} = e;
+ ((e.value = ``),
+ (e.value = t),
+ i === null
+ ? e.setSelectionRange(n, r)
+ : e.setSelectionRange(n, r, i));
+ }
+ }));
+ });
+ let h = _(!1);
+ function g() {
+ h.value = !0;
+ }
+ function v() {
+ G().nextFrame(() => {
+ h.value = !1;
+ });
+ }
+ let y = Ee();
+ function b(e) {
+ switch (
+ ((d.value = !0),
+ y(() => {
+ d.value = !1;
+ }),
+ e.key)
+ ) {
+ case H.Enter:
+ if (((d.value = !1), l.comboboxState.value !== 0 || h.value))
+ return;
+ if (
+ (e.preventDefault(),
+ e.stopPropagation(),
+ l.activeOptionIndex.value === null)
+ ) {
+ l.closeCombobox();
+ return;
+ }
+ (l.selectActiveOption(), l.mode.value === 0 && l.closeCombobox());
+ break;
+ case H.ArrowDown:
+ return (
+ (d.value = !1),
+ e.preventDefault(),
+ e.stopPropagation(),
+ I(l.comboboxState.value, {
+ 0: () => l.goToOption(Y.Next),
+ 1: () => l.openCombobox(),
+ })
+ );
+ case H.ArrowUp:
+ return (
+ (d.value = !1),
+ e.preventDefault(),
+ e.stopPropagation(),
+ I(l.comboboxState.value, {
+ 0: () => l.goToOption(Y.Previous),
+ 1: () => {
+ (l.openCombobox(),
+ s(() => {
+ l.value.value || l.goToOption(Y.Last);
+ }));
+ },
+ })
+ );
+ case H.Home:
+ if (e.shiftKey) break;
+ return (
+ (d.value = !1),
+ e.preventDefault(),
+ e.stopPropagation(),
+ l.goToOption(Y.First)
+ );
+ case H.PageUp:
+ return (
+ (d.value = !1),
+ e.preventDefault(),
+ e.stopPropagation(),
+ l.goToOption(Y.First)
+ );
+ case H.End:
+ if (e.shiftKey) break;
+ return (
+ (d.value = !1),
+ e.preventDefault(),
+ e.stopPropagation(),
+ l.goToOption(Y.Last)
+ );
+ case H.PageDown:
+ return (
+ (d.value = !1),
+ e.preventDefault(),
+ e.stopPropagation(),
+ l.goToOption(Y.Last)
+ );
+ case H.Escape:
+ if (((d.value = !1), l.comboboxState.value !== 0)) return;
+ (e.preventDefault(),
+ l.optionsRef.value &&
+ !l.optionsPropsRef.value.static &&
+ e.stopPropagation(),
+ l.nullable.value &&
+ l.mode.value === 0 &&
+ l.value.value === null &&
+ f(),
+ l.closeCombobox());
+ break;
+ case H.Tab:
+ if (((d.value = !1), l.comboboxState.value !== 0)) return;
+ (l.mode.value === 0 &&
+ l.activationTrigger.value !== 1 &&
+ l.selectActiveOption(),
+ l.closeCombobox());
+ break;
+ }
+ }
+ function x(e) {
+ (t(`change`, e),
+ l.nullable.value &&
+ l.mode.value === 0 &&
+ e.target.value === `` &&
+ f(),
+ l.openCombobox());
+ }
+ function S(e) {
+ var t, n;
+ let r = e.relatedTarget ?? J.find((t) => t !== e.currentTarget);
+ if (
+ ((d.value = !1),
+ !((t = V(l.optionsRef)) != null && t.contains(r)) &&
+ !((n = V(l.buttonRef)) != null && n.contains(r)) &&
+ l.comboboxState.value === 0)
+ )
+ return (
+ e.preventDefault(),
+ l.mode.value === 0 &&
+ (l.nullable.value && l.value.value === null
+ ? f()
+ : l.activationTrigger.value !== 1 && l.selectActiveOption()),
+ l.closeCombobox()
+ );
+ }
+ function C(e) {
+ var t, n;
+ let r = e.relatedTarget ?? J.find((t) => t !== e.currentTarget);
+ ((t = V(l.buttonRef)) != null && t.contains(r)) ||
+ ((n = V(l.optionsRef)) != null && n.contains(r)) ||
+ l.disabled.value ||
+ (l.immediate.value &&
+ l.comboboxState.value !== 0 &&
+ (l.openCombobox(),
+ G().nextFrame(() => {
+ l.setActivationTrigger(1);
+ })));
+ }
+ let w = m(
+ () =>
+ e.defaultValue ??
+ (l.defaultValue.value === void 0
+ ? null
+ : e.displayValue?.call(e, l.defaultValue.value)) ??
+ l.defaultValue.value ??
+ ``
+ );
+ return () => {
+ let t = {open: l.comboboxState.value === 0},
+ {displayValue: r, onChange: i, ...o} = e;
+ return B({
+ ourProps: {
+ 'aria-controls': l.optionsRef.value?.id,
+ 'aria-expanded': l.comboboxState.value === 0,
+ 'aria-activedescendant':
+ l.activeOptionIndex.value === null
+ ? void 0
+ : l.virtual.value
+ ? l.options.value.find(
+ (e) =>
+ !l.virtual.value.disabled(e.dataRef.value) &&
+ l.compare(
+ e.dataRef.value,
+ l.virtual.value.options[l.activeOptionIndex.value]
+ )
+ )?.id
+ : l.options.value[l.activeOptionIndex.value]?.id,
+ 'aria-labelledby': V(l.labelRef)?.id ?? V(l.buttonRef)?.id,
+ 'aria-autocomplete': `list`,
+ id: c,
+ onCompositionstart: g,
+ onCompositionend: v,
+ onKeydown: b,
+ onInput: x,
+ onFocus: C,
+ onBlur: S,
+ role: `combobox`,
+ type: n.type ?? `text`,
+ tabIndex: 0,
+ ref: l.inputRef,
+ defaultValue: w.value,
+ disabled: l.disabled.value === !0 ? !0 : void 0,
+ },
+ theirProps: o,
+ slot: t,
+ attrs: n,
+ slots: a,
+ features: F.RenderStrategy | F.Static,
+ name: `ComboboxInput`,
+ });
+ };
+ },
+ }),
+ ft = n({
+ name: `ComboboxOptions`,
+ props: {
+ as: {type: [Object, String], default: `ul`},
+ static: {type: Boolean, default: !1},
+ unmount: {type: Boolean, default: !0},
+ hold: {type: [Boolean], default: !1},
+ },
+ setup(e, {attrs: t, slots: n, expose: r}) {
+ let i = X(`ComboboxOptions`),
+ a = `headlessui-combobox-options-${R()}`;
+ (r({el: i.optionsRef, $el: i.optionsRef}),
+ p(() => {
+ i.optionsPropsRef.value.static = e.static;
+ }),
+ p(() => {
+ i.optionsPropsRef.value.hold = e.hold;
+ }));
+ let o = ie(),
+ s = m(() =>
+ o === null
+ ? i.comboboxState.value === 0
+ : (o.value & z.Open) === z.Open
+ );
+ Ke({
+ container: m(() => V(i.optionsRef)),
+ enabled: m(() => i.comboboxState.value === 0),
+ accept(e) {
+ return e.getAttribute(`role`) === `option`
+ ? NodeFilter.FILTER_REJECT
+ : e.hasAttribute(`role`)
+ ? NodeFilter.FILTER_SKIP
+ : NodeFilter.FILTER_ACCEPT;
+ },
+ walk(e) {
+ e.setAttribute(`role`, `none`);
+ },
+ });
+ function c(e) {
+ e.preventDefault();
+ }
+ return () => {
+ let r = {open: i.comboboxState.value === 0};
+ return B({
+ ourProps: {
+ 'aria-labelledby': V(i.labelRef)?.id ?? V(i.buttonRef)?.id,
+ id: a,
+ ref: i.optionsRef,
+ role: `listbox`,
+ 'aria-multiselectable': i.mode.value === 1 ? !0 : void 0,
+ onMousedown: c,
+ },
+ theirProps: U(e, [`hold`]),
+ slot: r,
+ attrs: t,
+ slots:
+ i.virtual.value && i.comboboxState.value === 0
+ ? {...n, default: () => [C(ct, {}, n.default)]}
+ : n,
+ features: F.RenderStrategy | F.Static,
+ visible: s.value,
+ name: `ComboboxOptions`,
+ });
+ };
+ },
+ }),
+ pt = n({
+ name: `ComboboxOption`,
+ props: {
+ as: {type: [Object, String], default: `li`},
+ value: {type: [Object, String, Number, Boolean]},
+ disabled: {type: Boolean, default: !1},
+ order: {type: [Number], default: null},
+ },
+ setup(e, {slots: t, attrs: n, expose: i}) {
+ let o = X(`ComboboxOption`),
+ c = `headlessui-combobox-option-${R()}`,
+ l = _(null),
+ u = m(() => e.disabled);
+ i({el: l, $el: l});
+ let d = m(() =>
+ o.virtual.value
+ ? o.activeOptionIndex.value === o.calculateIndex(e.value)
+ : o.activeOptionIndex.value === null
+ ? !1
+ : o.options.value[o.activeOptionIndex.value]?.id === c
+ ),
+ f = m(() => o.isSelected(e.value)),
+ h = S(st, null),
+ g = m(() => ({
+ disabled: e.disabled,
+ value: e.value,
+ domRef: l,
+ order: m(() => e.order),
+ }));
+ (r(() => o.registerOption(c, g)),
+ a(() => o.unregisterOption(c, d.value)),
+ p(() => {
+ let e = V(l);
+ e && h?.value.measureElement(e);
+ }),
+ p(() => {
+ o.comboboxState.value === 0 &&
+ d.value &&
+ (o.virtual.value ||
+ (o.activationTrigger.value !== 0 &&
+ s(() => {
+ var e;
+ return (e = V(l))?.scrollIntoView?.call(e, {
+ block: `nearest`,
+ });
+ })));
+ }));
+ function v(e) {
+ (e.preventDefault(),
+ e.button === Ye.Left &&
+ (u.value ||
+ (o.selectOption(c),
+ Ve() ||
+ requestAnimationFrame(() =>
+ V(o.inputRef)?.focus({preventScroll: !0})
+ ),
+ o.mode.value === 0 && o.closeCombobox())));
+ }
+ function y() {
+ var t;
+ if (
+ e.disabled ||
+ ((t = o.virtual.value) != null && t.disabled(e.value))
+ )
+ return o.goToOption(Y.Nothing);
+ let n = o.calculateIndex(e.value);
+ o.goToOption(Y.Specific, n);
+ }
+ let b = Ge();
+ function x(e) {
+ b.update(e);
+ }
+ function C(t) {
+ var n;
+ if (
+ !b.wasMoved(t) ||
+ e.disabled ||
+ ((n = o.virtual.value) != null && n.disabled(e.value)) ||
+ d.value
+ )
+ return;
+ let r = o.calculateIndex(e.value);
+ o.goToOption(Y.Specific, r, 0);
+ }
+ function w(t) {
+ var n;
+ b.wasMoved(t) &&
+ (e.disabled ||
+ ((n = o.virtual.value) != null && n.disabled(e.value)) ||
+ (d.value &&
+ (o.optionsPropsRef.value.hold || o.goToOption(Y.Nothing))));
+ }
+ return () => {
+ let {disabled: r} = e,
+ i = {active: d.value, selected: f.value, disabled: r};
+ return B({
+ ourProps: {
+ id: c,
+ ref: l,
+ role: `option`,
+ tabIndex: r === !0 ? void 0 : -1,
+ 'aria-disabled': r === !0 ? !0 : void 0,
+ 'aria-selected': f.value,
+ disabled: void 0,
+ onMousedown: v,
+ onFocus: y,
+ onPointerenter: x,
+ onMouseenter: x,
+ onPointermove: C,
+ onMousemove: C,
+ onPointerleave: w,
+ onMouseleave: w,
+ },
+ theirProps: U(e, [`order`, `value`]),
+ slot: i,
+ attrs: n,
+ slots: t,
+ name: `ComboboxOption`,
+ });
+ };
+ },
+ });
+function mt(e) {
+ let t = {called: !1};
+ return (...n) => {
+ if (!t.called) return ((t.called = !0), e(...n));
+ };
+}
+function ht(e, ...t) {
+ e && t.length > 0 && e.classList.add(...t);
+}
+function Z(e, ...t) {
+ e && t.length > 0 && e.classList.remove(...t);
+}
+var gt = ((e) => ((e.Finished = `finished`), (e.Cancelled = `cancelled`), e))(
+ gt || {}
+);
+function _t(e, t) {
+ let n = G();
+ if (!e) return n.dispose;
+ let {transitionDuration: r, transitionDelay: i} = getComputedStyle(e),
+ [a, o] = [r, i].map((e) => {
+ let [t = 0] = e
+ .split(`,`)
+ .filter(Boolean)
+ .map((e) => (e.includes(`ms`) ? parseFloat(e) : parseFloat(e) * 1e3))
+ .sort((e, t) => t - e);
+ return t;
+ });
+ return (
+ a === 0 ? t(`finished`) : n.setTimeout(() => t(`finished`), a + o),
+ n.add(() => t(`cancelled`)),
+ n.dispose
+ );
+}
+function vt(e, t, n, r, i, a) {
+ let o = G(),
+ s = a === void 0 ? () => {} : mt(a);
+ return (
+ Z(e, ...i),
+ ht(e, ...t, ...n),
+ o.nextFrame(() => {
+ (Z(e, ...n),
+ ht(e, ...r),
+ o.add(_t(e, (n) => (Z(e, ...r, ...t), ht(e, ...i), s(n)))));
+ }),
+ o.add(() => Z(e, ...t, ...n, ...r, ...i)),
+ o.add(() => s(`cancelled`)),
+ o.dispose
+ );
+}
+function Q(e = ``) {
+ return e.split(/\s+/).filter((e) => e.length > 1);
+}
+var yt = Symbol(`TransitionContext`),
+ bt = ((e) => ((e.Visible = `visible`), (e.Hidden = `hidden`), e))(bt || {});
+function xt() {
+ return S(yt, null) !== null;
+}
+function St() {
+ let e = S(yt, null);
+ if (e === null)
+ throw Error(
+ `A is used but it is missing a parent .`
+ );
+ return e;
+}
+function Ct() {
+ let e = S(wt, null);
+ if (e === null)
+ throw Error(
+ `A is used but it is missing a parent .`
+ );
+ return e;
+}
+var wt = Symbol(`NestingContext`);
+function $(e) {
+ return `children` in e
+ ? $(e.children)
+ : e.value.filter(({state: e}) => e === `visible`).length > 0;
+}
+function Tt(e) {
+ let t = _([]),
+ n = _(!1);
+ (r(() => (n.value = !0)), a(() => (n.value = !1)));
+ function i(r, i = L.Hidden) {
+ let a = t.value.findIndex(({id: e}) => e === r);
+ a !== -1 &&
+ (I(i, {
+ [L.Unmount]() {
+ t.value.splice(a, 1);
+ },
+ [L.Hidden]() {
+ t.value[a].state = `hidden`;
+ },
+ }),
+ !$(t) && n.value && e?.());
+ }
+ function o(e) {
+ let n = t.value.find(({id: t}) => t === e);
+ return (
+ n
+ ? n.state !== `visible` && (n.state = `visible`)
+ : t.value.push({id: e, state: `visible`}),
+ () => i(e, L.Unmount)
+ );
+ }
+ return {children: t, register: o, unregister: i};
+}
+var Et = F.RenderStrategy,
+ Dt = n({
+ props: {
+ as: {type: [Object, String], default: `div`},
+ show: {type: [Boolean], default: null},
+ unmount: {type: [Boolean], default: !0},
+ appear: {type: [Boolean], default: !1},
+ enter: {type: [String], default: ``},
+ enterFrom: {type: [String], default: ``},
+ enterTo: {type: [String], default: ``},
+ entered: {type: [String], default: ``},
+ leave: {type: [String], default: ``},
+ leaveFrom: {type: [String], default: ``},
+ leaveTo: {type: [String], default: ``},
+ },
+ emits: {
+ beforeEnter: () => !0,
+ afterEnter: () => !0,
+ beforeLeave: () => !0,
+ afterLeave: () => !0,
+ },
+ setup(e, {emit: t, attrs: n, slots: o, expose: s}) {
+ let l = _(0);
+ function u() {
+ ((l.value |= z.Opening), t(`beforeEnter`));
+ }
+ function d() {
+ ((l.value &= ~z.Opening), t(`afterEnter`));
+ }
+ function f() {
+ ((l.value |= z.Closing), t(`beforeLeave`));
+ }
+ function h() {
+ ((l.value &= ~z.Closing), t(`afterLeave`));
+ }
+ if (!xt() && re())
+ return () =>
+ C(
+ Ot,
+ {
+ ...e,
+ onBeforeEnter: u,
+ onAfterEnter: d,
+ onBeforeLeave: f,
+ onAfterLeave: h,
+ },
+ o
+ );
+ let g = _(null),
+ v = m(() => (e.unmount ? L.Unmount : L.Hidden));
+ s({el: g, $el: g});
+ let {show: y, appear: b} = St(),
+ {register: x, unregister: S} = Ct(),
+ w = _(y.value ? `visible` : `hidden`),
+ T = {value: !0},
+ E = R(),
+ D = {value: !1},
+ O = Tt(() => {
+ !D.value && w.value !== `hidden` && ((w.value = `hidden`), S(E), h());
+ });
+ (r(() => {
+ a(x(E));
+ }),
+ p(() => {
+ if (v.value === L.Hidden && E) {
+ if (y.value && w.value !== `visible`) {
+ w.value = `visible`;
+ return;
+ }
+ I(w.value, {hidden: () => S(E), visible: () => x(E)});
+ }
+ }));
+ let k = Q(e.enter),
+ A = Q(e.enterFrom),
+ j = Q(e.enterTo),
+ M = Q(e.entered),
+ N = Q(e.leave),
+ ee = Q(e.leaveFrom),
+ F = Q(e.leaveTo);
+ r(() => {
+ p(() => {
+ if (w.value === `visible`) {
+ let e = V(g);
+ if (e instanceof Comment && e.data === ``)
+ throw Error(
+ 'Did you forget to passthrough the `ref` to the actual DOM node?'
+ );
+ }
+ });
+ });
+ function ne(e) {
+ let t = T.value && !b.value,
+ n = V(g);
+ !n ||
+ !(n instanceof HTMLElement) ||
+ t ||
+ ((D.value = !0),
+ y.value && u(),
+ y.value || f(),
+ e(
+ y.value
+ ? vt(n, k, A, j, M, (e) => {
+ ((D.value = !1), e === gt.Finished && d());
+ })
+ : vt(n, N, ee, F, M, (e) => {
+ ((D.value = !1),
+ e === gt.Finished &&
+ ($(O) || ((w.value = `hidden`), S(E), h())));
+ })
+ ));
+ }
+ return (
+ r(() => {
+ i(
+ [y],
+ (e, t, n) => {
+ (ne(n), (T.value = !1));
+ },
+ {immediate: !0}
+ );
+ }),
+ P(wt, O),
+ te(m(() => I(w.value, {visible: z.Open, hidden: z.Closed}) | l.value)),
+ () => {
+ let {
+ appear: t,
+ show: r,
+ enter: i,
+ enterFrom: a,
+ enterTo: s,
+ entered: l,
+ leave: u,
+ leaveFrom: d,
+ leaveTo: f,
+ ...p
+ } = e,
+ m = {ref: g};
+ return B({
+ theirProps: {
+ ...p,
+ ...(b.value && y.value && K.isServer
+ ? {class: c([n.class, p.class, ...k, ...A])}
+ : {}),
+ },
+ ourProps: m,
+ slot: {},
+ slots: o,
+ attrs: n,
+ features: Et,
+ visible: w.value === `visible`,
+ name: `TransitionChild`,
+ });
+ }
+ );
+ },
+ }),
+ Ot = n({
+ inheritAttrs: !1,
+ props: {
+ as: {type: [Object, String], default: `div`},
+ show: {type: [Boolean], default: null},
+ unmount: {type: [Boolean], default: !0},
+ appear: {type: [Boolean], default: !1},
+ enter: {type: [String], default: ``},
+ enterFrom: {type: [String], default: ``},
+ enterTo: {type: [String], default: ``},
+ entered: {type: [String], default: ``},
+ leave: {type: [String], default: ``},
+ leaveFrom: {type: [String], default: ``},
+ leaveTo: {type: [String], default: ``},
+ },
+ emits: {
+ beforeEnter: () => !0,
+ afterEnter: () => !0,
+ beforeLeave: () => !0,
+ afterLeave: () => !0,
+ },
+ setup(e, {emit: t, attrs: n, slots: i}) {
+ let a = ie(),
+ o = m(() =>
+ e.show === null && a !== null ? (a.value & z.Open) === z.Open : e.show
+ );
+ p(() => {
+ if (![!0, !1].includes(o.value))
+ throw Error(
+ 'A is used but it is missing a `:show="true | false"` prop.'
+ );
+ });
+ let s = _(o.value ? `visible` : `hidden`),
+ c = Tt(() => {
+ s.value = `hidden`;
+ }),
+ l = _(!0),
+ u = {show: o, appear: m(() => e.appear || !l.value)};
+ return (
+ r(() => {
+ p(() => {
+ ((l.value = !1),
+ o.value ? (s.value = `visible`) : $(c) || (s.value = `hidden`));
+ });
+ }),
+ P(wt, c),
+ P(yt, u),
+ () => {
+ let r = U(e, [
+ `show`,
+ `appear`,
+ `unmount`,
+ `onBeforeEnter`,
+ `onBeforeLeave`,
+ `onAfterEnter`,
+ `onAfterLeave`,
+ ]),
+ a = {unmount: e.unmount};
+ return B({
+ ourProps: {...a, as: `template`},
+ theirProps: {},
+ slot: {},
+ slots: {
+ ...i,
+ default: () => [
+ C(
+ Dt,
+ {
+ onBeforeEnter: () => t(`beforeEnter`),
+ onAfterEnter: () => t(`afterEnter`),
+ onBeforeLeave: () => t(`beforeLeave`),
+ onAfterLeave: () => t(`afterLeave`),
+ ...n,
+ ...a,
+ ...r,
+ },
+ i.default
+ ),
+ ],
+ },
+ attrs: {},
+ features: Et,
+ visible: s.value === `visible`,
+ name: `Transition`,
+ });
+ }
+ );
+ },
+ }),
+ kt = [`active`, `checked`, `hint`],
+ At = {class: `flex gap-2 items-center`},
+ jt = {key: 1},
+ Mt = n({
+ __name: `InputComboboxOption`,
+ props: {option: {}},
+ setup(t) {
+ return (n, r) => (
+ l(),
+ ee(
+ x(pt),
+ {value: t.option, as: `template`},
+ {
+ default: f(({active: r, selected: i}) => [
+ d(
+ n.$slots,
+ `option`,
+ {option: t.option, active: r, selected: i},
+ () => [
+ j(
+ `craft-option`,
+ {active: r, checked: i, hint: t.option.data?.hint},
+ [
+ j(`div`, At, [
+ t.option.data?.indicator
+ ? (l(),
+ N(
+ `craft-indicator`,
+ e(o({key: 0}, t.option.data.indicator)),
+ null,
+ 16
+ ))
+ : g(``, !0),
+ t.option.label.startsWith(`$`) ||
+ t.option.label.startsWith(`@`)
+ ? (l(), N(`code`, jt, k(t.option.label), 1))
+ : (l(),
+ N(w, {key: 2}, [M(k(t.option.label), 1)], 64)),
+ ]),
+ ],
+ 8,
+ kt
+ ),
+ ]
+ ),
+ ]),
+ _: 3,
+ },
+ 8,
+ [`value`]
+ )
+ );
+ },
+ }),
+ Nt = {key: 1},
+ Pt = {class: `group-label`},
+ Ft = O(
+ n({
+ __name: `InputCombobox`,
+ props: {
+ label: {},
+ options: {default: () => []},
+ modelValue: {type: [String, Number, Boolean], default: ``},
+ requireOptionMatch: {type: Boolean, default: !1},
+ transformModelValue: {
+ type: Function,
+ default: (e) => (e ? e.value : ``),
+ },
+ class: {type: [Boolean, null, String, Object, Array]},
+ placeholder: {},
+ disabled: {type: Boolean},
+ },
+ emits: [`update:modelValue`],
+ setup(e, {emit: n}) {
+ let r = n,
+ i = e,
+ a = m({
+ get() {
+ let e = null;
+ return (
+ i.options.forEach((t) => {
+ t.type === `optgroup`
+ ? t.options.forEach((t) => {
+ t.value === i.modelValue && (e = t);
+ })
+ : t.value === i.modelValue && (e = t);
+ }),
+ !e &&
+ !i.requireOptionMatch &&
+ (e = {label: String(i.modelValue), value: i.modelValue}),
+ e
+ );
+ },
+ set(e) {
+ r(`update:modelValue`, i.transformModelValue(e));
+ },
+ }),
+ o = D(`reference`),
+ s = _(String(i.modelValue ?? ``)),
+ p = m(() => o.value?.getBoundingClientRect() || new DOMRect());
+ function h(e, t) {
+ let n = String(x(e)).toLowerCase(),
+ r = x(t);
+ return (
+ r.label.toLowerCase().includes(n) ||
+ r.value.toString().toLowerCase().includes(n) ||
+ (r.data?.keywords?.toLowerCase().includes(n) ?? !1)
+ );
+ }
+ function v(e, t) {
+ return x(t)
+ .map((t) => {
+ if (t.type === `optgroup`) {
+ let n = t.options.filter((t) => h(e, t));
+ return n.length > 0 ? {...t, options: n} : null;
+ }
+ return h(e, t) ? t : null;
+ })
+ .filter((e) => e !== null);
+ }
+ let b = m(() => (s.value === `` ? i.options : v(s, i.options)));
+ function S(e) {
+ return e ? e.label : ``;
+ }
+ let C = m(() =>
+ [``, `@`, `$`].includes(s.value)
+ ? null
+ : {value: s.value, label: s.value}
+ );
+ return (n, r) => (
+ l(),
+ N(
+ `div`,
+ {class: `relative w-full`, ref_key: `reference`, ref: o},
+ [
+ u(
+ x(lt),
+ {
+ modelValue: a.value,
+ 'onUpdate:modelValue': (r[2] ||= (e) => (a.value = e)),
+ disabled: i.disabled,
+ },
+ {
+ default: f(() => [
+ u(
+ x(dt),
+ {
+ onChange: (r[0] ||= (e) => (s.value = e.target.value)),
+ class: c([`input`, i.class]),
+ 'display-value': S,
+ placeholder: e.placeholder,
+ },
+ null,
+ 8,
+ [`class`, `placeholder`]
+ ),
+ u(
+ x(ut),
+ {
+ class: `absolute inset-y-1 right-1 flex items-center`,
+ type: `button`,
+ as: `craft-button`,
+ appearance: `plain`,
+ size: `small`,
+ icon: ``,
+ 'aria-label': e.label,
+ },
+ {
+ default: f(() => [
+ ...(r[3] ||= [
+ j(
+ `craft-icon`,
+ {
+ name: `chevron-down`,
+ style: {'font-size': `0.8em`},
+ },
+ null,
+ -1
+ ),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`aria-label`]
+ ),
+ u(
+ x(Ot),
+ {
+ leave: `transition ease-in duration-100`,
+ 'leave-from': `opacity-100`,
+ 'leave-to': `opacity-0`,
+ onAfterLeave: (r[1] ||= (e) => (s.value = ``)),
+ },
+ {
+ default: f(() => [
+ u(
+ x(ft),
+ {
+ class: `options`,
+ style: y({
+ position: `fixed`,
+ insetInlineStart: `${p.value.left}px`,
+ width: `${p.value.width}px`,
+ insetBlockStart: `${p.value.bottom}px`,
+ }),
+ },
+ {
+ default: f(() => [
+ !e.requireOptionMatch && C.value
+ ? (l(),
+ ee(Mt, {key: 0, option: C.value}, null, 8, [
+ `option`,
+ ]))
+ : b.value.length === 0 && s.value !== ``
+ ? (l(), N(`div`, Nt, ` Nothing found. `))
+ : g(``, !0),
+ (l(!0),
+ N(
+ w,
+ null,
+ t(
+ b.value,
+ (e, r) => (
+ l(),
+ N(
+ w,
+ {key: r},
+ [
+ e.type === `optgroup`
+ ? (l(),
+ N(
+ w,
+ {key: 0},
+ [
+ j(`div`, Pt, k(e.label), 1),
+ (l(!0),
+ N(
+ w,
+ null,
+ t(e.options, (e, t) =>
+ d(
+ n.$slots,
+ `option`,
+ {key: t, option: e},
+ () => [
+ u(
+ Mt,
+ {option: e},
+ null,
+ 8,
+ [`option`]
+ ),
+ ],
+ !0
+ )
+ ),
+ 128
+ )),
+ ],
+ 64
+ ))
+ : d(
+ n.$slots,
+ `option`,
+ {key: 1, option: e},
+ () => [
+ u(Mt, {option: e}, null, 8, [
+ `option`,
+ ]),
+ ],
+ !0
+ ),
+ ],
+ 64
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ _: 3,
+ },
+ 8,
+ [`style`]
+ ),
+ ]),
+ _: 3,
+ }
+ ),
+ ]),
+ _: 3,
+ },
+ 8,
+ [`modelValue`, `disabled`]
+ ),
+ ],
+ 512
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-60ff9649`]]
+ );
+export {Ft as t};
diff --git a/resources/build/assets/Install-DPFOSrC0.js b/resources/build/assets/Install-DPFOSrC0.js
new file mode 100644
index 00000000000..b692e613382
--- /dev/null
+++ b/resources/build/assets/Install-DPFOSrC0.js
@@ -0,0 +1,1131 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import './lit-BpPOIUnZ.js';
+import {
+ B as t,
+ E as n,
+ G as r,
+ I as i,
+ J as a,
+ M as o,
+ Q as s,
+ R as c,
+ T as l,
+ V as u,
+ X as d,
+ Y as f,
+ _ as p,
+ a as ee,
+ b as m,
+ c as h,
+ ct as g,
+ d as _,
+ ht as v,
+ l as y,
+ m as b,
+ ot as x,
+ p as S,
+ q as C,
+ r as w,
+ t as T,
+ tt as E,
+ v as D,
+ w as O,
+ x as k,
+ y as A,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as j} from './Select-uUcGssK_.js';
+import {t as M} from './Pane-CJi1MPPH.js';
+import {n as N} from './wayfinder-V597ZF_3.js';
+import {i as P} from './useFetch-B2oo1RkU.js';
+import {i as F} from './dist-BSfJDNP3.js';
+import {t as I} from './Modal-D6UmxwmM.js';
+import {t as L} from './CraftInput-B2G9EaE3.js';
+import {t as R} from './CraftCombobox-NlyOETnv.js';
+var te = `` + new URL(`installer-bg-D5zoDR_3.png`, import.meta.url).href,
+ z = (e) => {
+ a(C(e), async (e) => {
+ (e?.tagName.includes(`CRAFT-`) &&
+ (await customElements.whenDefined(e.tagName.toLowerCase()),
+ await e?.updateComplete),
+ e?.focus());
+ });
+ },
+ ne = [`.modelValue`, `has-feedback-for`],
+ B = {slot: `feedback`},
+ V = {key: 0, class: `error-list`},
+ H = n({
+ name: `CraftInputPassword`,
+ __name: `CraftInputPassword`,
+ props: o({error: {}}, {modelValue: {}, modelModifiers: {}}),
+ emits: [`update:modelValue`],
+ setup(e) {
+ let t = r(e, `modelValue`);
+ return (n, r) => (
+ c(),
+ k(
+ `craft-input-password`,
+ {
+ '.modelValue': t.value,
+ onModelValueChanged: (r[0] ||= (e) =>
+ (t.value = e.target?.modelValue)),
+ 'has-feedback-for': e.error ? `error` : ``,
+ },
+ [
+ u(n.$slots, `default`),
+ D(`div`, B, [
+ e.error
+ ? (c(), k(`ul`, V, [D(`li`, null, E(e.error), 1)]))
+ : m(``, !0),
+ ]),
+ ],
+ 40,
+ ne
+ )
+ );
+ },
+ }),
+ U = n({
+ __name: `AccountFields`,
+ props: {
+ modelValue: {default: () => ({email: ``, username: ``, password: ``})},
+ errors: {default: () => ({email: ``, username: ``, password: ``})},
+ },
+ emits: [`success`, `click:back`, `update:modelValue`],
+ setup(t, {emit: n}) {
+ let r = n,
+ i = t,
+ a = y(),
+ o = p(() => !a.props.useEmailAsUsername),
+ s = p({
+ get() {
+ return i.modelValue;
+ },
+ set(e) {
+ r(`update:modelValue`, e);
+ },
+ });
+ return (
+ z(`username-input`),
+ (n, r) => (
+ c(),
+ k(
+ b,
+ null,
+ [
+ o.value
+ ? (c(),
+ A(
+ L,
+ {
+ key: 0,
+ label: v(e)(`Username`),
+ id: `account-username`,
+ name: `username`,
+ modelValue: s.value.username,
+ 'onUpdate:modelValue': (r[0] ||= (e) =>
+ (s.value.username = e)),
+ error: t.errors?.username,
+ maxlength: `255`,
+ required: ``,
+ autofocus: ``,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ))
+ : m(``, !0),
+ l(
+ L,
+ {
+ label: v(e)(`Email`),
+ id: `account-email`,
+ name: `email`,
+ modelValue: s.value.email,
+ 'onUpdate:modelValue': (r[1] ||= (e) => (s.value.email = e)),
+ maxlength: `255`,
+ autocomplete: `email`,
+ error: t.errors?.email,
+ required: ``,
+ type: `email`,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ l(
+ H,
+ {
+ label: v(e)(`Password`),
+ id: `account-password`,
+ name: `password`,
+ modelValue: s.value.password,
+ 'onUpdate:modelValue': (r[2] ||= (e) =>
+ (s.value.password = e)),
+ error: t.errors?.password,
+ required: ``,
+ autocomplete: `new-password`,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ ],
+ 64
+ )
+ )
+ );
+ },
+ }),
+ W = {variant: `info`, appearance: `plain`, class: `p-0`, icon: `lightbulb`},
+ G = {
+ href: `https://craftcms.com/docs/5.x/configure.html#control-panel-settings`,
+ },
+ K = n({
+ __name: `SiteFields`,
+ props: {
+ modelValue: {default: () => ({})},
+ localeOptions: {default: () => []},
+ errors: {default: () => ({})},
+ },
+ emits: [`update:modelValue`],
+ setup(t, {emit: n}) {
+ let r = n,
+ i = t,
+ a = y(),
+ o = p({
+ get() {
+ return i.modelValue;
+ },
+ set(e) {
+ r(`update:modelValue`, e);
+ },
+ });
+ return (
+ z(`site-name`),
+ (n, r) => (
+ c(),
+ k(
+ b,
+ null,
+ [
+ l(
+ L,
+ {
+ name: `name`,
+ label: v(e)(`System Name`),
+ id: `site-name`,
+ modelValue: o.value.name,
+ 'onUpdate:modelValue': (r[0] ||= (e) => (o.value.name = e)),
+ maxlength: `255`,
+ ref: `site-name`,
+ error: t.errors?.name,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ l(
+ R,
+ {
+ modelValue: o.value.baseUrl,
+ 'onUpdate:modelValue': (r[1] ||= (e) =>
+ (o.value.baseUrl = e)),
+ label: v(e)(`Base URL`),
+ 'help-text': v(e)(`The base URL for the site.`),
+ id: `base-url`,
+ name: `baseUrl`,
+ error: t.errors?.baseUrl,
+ options: v(a).props.baseUrlSuggestions,
+ },
+ {
+ after: d(() => [
+ D(`craft-callout`, W, [
+ O(
+ E(
+ v(e)(
+ `This can begin with an environment variable or alias.`
+ )
+ ) + ` `,
+ 1
+ ),
+ D(`a`, G, E(v(e)(`Learn more`)), 1),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`modelValue`, `label`, `help-text`, `error`, `options`]
+ ),
+ l(
+ j,
+ {
+ modelValue: o.value.language,
+ 'onUpdate:modelValue': (r[2] ||= (e) =>
+ (o.value.language = e)),
+ options: t.localeOptions,
+ label: v(e)(`Language`),
+ id: `site-language`,
+ name: `language`,
+ },
+ {
+ 'option-label': d(({option: e}) => [
+ O(E(e.value) + ` (` + E(e.label) + `) `, 1),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`modelValue`, `options`, `label`]
+ ),
+ ],
+ 64
+ )
+ )
+ );
+ },
+ }),
+ q = (e) => ({url: q.url(e), method: `post`});
+((q.definition = {
+ methods: [`post`],
+ url: `/admin/actions/install/validate-db`,
+}),
+ (q.url = (e) => q.definition.url + N(e)),
+ (q.post = (e) => ({url: q.url(e), method: `post`})));
+var J = (e) => ({url: J.url(e), method: `post`});
+((J.definition = {
+ methods: [`post`],
+ url: `/admin/actions/install/validate-account`,
+}),
+ (J.url = (e) => J.definition.url + N(e)),
+ (J.post = (e) => ({url: J.url(e), method: `post`})));
+var Y = (e) => ({url: Y.url(e), method: `post`});
+((Y.definition = {
+ methods: [`post`],
+ url: `/admin/actions/install/validate-site`,
+}),
+ (Y.url = (e) => Y.definition.url + N(e)),
+ (Y.post = (e) => ({url: Y.url(e), method: `post`})));
+var X = (e) => ({url: X.url(e), method: `post`});
+((X.definition = {methods: [`post`], url: `/admin/actions/install/install`}),
+ (X.url = (e) => X.definition.url + N(e)),
+ (X.post = (e) => ({url: X.url(e), method: `post`})));
+var Z = (e) => ({url: Z.url(e), method: `get`});
+((Z.definition = {methods: [`get`, `head`], url: `/admin/install`}),
+ (Z.url = (e) => Z.definition.url + N(e)),
+ (Z.get = (e) => ({url: Z.url(e), method: `get`})),
+ (Z.head = (e) => ({url: Z.url(e), method: `head`})));
+var re = () => {
+ let t = g({
+ start: {},
+ license: {id: `license`, label: `License`},
+ account: {
+ id: `account`,
+ label: `Account`,
+ action: J().url,
+ heading: e(`Create your account`),
+ },
+ db: {
+ id: `db`,
+ label: `Database`,
+ action: q().url,
+ heading: e(`Connect to your database`),
+ },
+ site: {
+ id: `site`,
+ label: `Site`,
+ action: Y().url,
+ heading: e(`Set up your site`),
+ submitLabel: e(`Finish up`),
+ },
+ installing: {label: `Installing`, id: `installing`},
+ }),
+ n = p(() =>
+ Object.keys(t.value).reduce((e, n) => {
+ let r = t.value[n];
+ return ((r.hidden ?? !1) || (e[n] = r), e);
+ }, {})
+ ),
+ r = p(() =>
+ Object.keys(n.value).reduce((e, t) => {
+ let r = n.value[t];
+ return ((r.label ?? !1) && (e[t] = r), e);
+ }, {})
+ ),
+ i = F(n),
+ a = p(() => i.stepNames.value[i.index.value]);
+ return {...i, possibleSteps: t, currentId: a, dotSteps: r};
+ },
+ ie = `` + new URL(`account-Bwr2nbaw.png`, import.meta.url).href,
+ ae = `` + new URL(`site-DFRpgmW9.png`, import.meta.url).href,
+ oe = `` + new URL(`db-BfYMxU0Q.png`, import.meta.url).href,
+ se = T(
+ n({
+ __name: `Callout`,
+ props: {variant: {default: `info`}, appearance: {default: `default`}},
+ setup(e) {
+ return (t, n) => (
+ c(),
+ k(
+ `div`,
+ {
+ class: s({
+ callout: !0,
+ 'callout--danger': e.variant === `danger`,
+ 'callout--info': e.variant === `info`,
+ 'callout--success': e.variant === `success`,
+ 'callout--warning': e.variant === `warning`,
+ 'callout--emphasis': e.appearance === `emphasis`,
+ 'callout--default': e.appearance === `default`,
+ 'callout--outline': e.appearance === `outline`,
+ 'callout--plain': e.appearance === `plain`,
+ }),
+ },
+ [u(t.$slots, `default`, {}, void 0, !0)],
+ 2
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-65fa67e2`]]
+ ),
+ ce = {class: `grid grid-cols-5 gap-2`},
+ le = {class: `col-span-2`},
+ ue = {class: `col-span-2`},
+ de = {key: 0, class: `error-list col-span-5`},
+ fe = {class: `grid grid-cols-2 gap-2`},
+ pe = {key: 0, class: `error-list col-span-2`},
+ me = {class: `grid grid-cols-4 gap-2`},
+ he = {class: `col-span-2`},
+ ge = n({
+ __name: `DbFields`,
+ props: {modelValue: {default: () => ({})}, errors: {default: () => ({})}},
+ emits: [`update:modelValue`],
+ setup(n, {emit: r}) {
+ let i = r,
+ a = n,
+ o = p({
+ get() {
+ return a.modelValue;
+ },
+ set(e) {
+ i(`update:modelValue`, e);
+ },
+ }),
+ s = [
+ {value: `mysql`, label: `MySQL`},
+ {value: `pgsql`, label: `PostgreSQL`},
+ ];
+ return (
+ z(`db-driver`),
+ (r, i) => (
+ c(),
+ k(
+ b,
+ null,
+ [
+ n.errors && n.errors[`*`]
+ ? (c(),
+ A(
+ se,
+ {key: 0, variant: `danger`},
+ {
+ default: d(() => [
+ D(`ul`, null, [
+ (c(!0),
+ k(
+ b,
+ null,
+ t(
+ n.errors[`*`],
+ (e) => (c(), k(`li`, {key: e}, E(e), 1))
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ _: 1,
+ }
+ ))
+ : m(``, !0),
+ D(`div`, ce, [
+ D(`div`, le, [
+ l(
+ j,
+ {
+ label: v(e)(`Driver`),
+ name: `driver`,
+ id: `db-driver`,
+ modelValue: o.value.driver,
+ 'onUpdate:modelValue': (i[0] ||= (e) =>
+ (o.value.driver = e)),
+ ref: `db-driver`,
+ options: s,
+ error: n.errors?.drive,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ ]),
+ D(`div`, ue, [
+ l(
+ L,
+ {
+ label: v(e)(`Host`),
+ name: `host`,
+ id: `db-host`,
+ modelValue: o.value.host,
+ 'onUpdate:modelValue': (i[1] ||= (e) =>
+ (o.value.host = e)),
+ placeholder: `127.0.0.1`,
+ error: n.errors?.host,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ ]),
+ D(`div`, null, [
+ l(
+ L,
+ {
+ label: v(e)(`Port`),
+ name: `port`,
+ id: `db-port`,
+ modelValue: o.value.port,
+ 'onUpdate:modelValue': (i[2] ||= (e) =>
+ (o.value.port = e)),
+ size: `7`,
+ error: n.errors?.port,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ ]),
+ n.errors?.server
+ ? (c(), k(`ul`, de, [D(`li`, null, E(n.errors?.server), 1)]))
+ : m(``, !0),
+ ]),
+ D(`div`, fe, [
+ D(`div`, null, [
+ l(
+ L,
+ {
+ label: v(e)(`Username`),
+ name: `username`,
+ id: `db-username`,
+ modelValue: o.value.username,
+ 'onUpdate:modelValue': (i[3] ||= (e) =>
+ (o.value.username = e)),
+ placeholder: `root`,
+ error: n.errors?.username,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ ]),
+ D(`div`, null, [
+ l(
+ H,
+ {
+ label: v(e)(`Password`),
+ name: `password`,
+ id: `db-password`,
+ modelValue: o.value.password,
+ 'onUpdate:modelValue': (i[4] ||= (e) =>
+ (o.value.password = e)),
+ error: n.errors?.password,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ ]),
+ n.errors?.user
+ ? (c(), k(`ul`, pe, [D(`li`, null, E(n.errors?.user), 1)]))
+ : m(``, !0),
+ ]),
+ D(`div`, me, [
+ D(`div`, he, [
+ l(
+ L,
+ {
+ label: v(e)(`Database Name`),
+ name: `name`,
+ id: `db-database`,
+ modelValue: o.value.database,
+ 'onUpdate:modelValue': (i[5] ||= (e) =>
+ (o.value.database = e)),
+ errors: n.errors?.database,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `errors`]
+ ),
+ ]),
+ D(`div`, null, [
+ l(
+ L,
+ {
+ label: v(e)(`Prefix`),
+ name: `prefix`,
+ id: `db-prefix`,
+ modelValue: o.value.prefix,
+ 'onUpdate:modelValue': (i[6] ||= (e) =>
+ (o.value.prefix = e)),
+ maxlength: `5`,
+ size: `7`,
+ error: n.errors?.prefix,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`]
+ ),
+ ]),
+ ]),
+ ],
+ 64
+ )
+ )
+ );
+ },
+ }),
+ _e = {key: 0, class: `content`},
+ ve = {key: 1, class: `content`},
+ ye = {key: 2, class: `content`},
+ be = {
+ class: `text-left border border-red-500 rounded p-4 text-red-800 bg-red-50 font-mono text-xs`,
+ },
+ xe = T(
+ n({
+ __name: `InstallingScreen`,
+ props: {data: {}},
+ setup(t) {
+ let {props: n} = y(),
+ r = t,
+ {
+ execute: a,
+ error: o,
+ isSuccess: s,
+ isLoading: l,
+ isError: u,
+ } = P(`/admin/actions/install/install`, {
+ onSuccess: () => {
+ setTimeout(() => {
+ window.location.href = n.postCpLoginRedirect;
+ }, 1e3);
+ },
+ });
+ return (
+ i(async () => {
+ await a(r.data);
+ }),
+ (t, n) => (
+ c(),
+ A(
+ M,
+ {class: `max-w-[80ch] mx-auto`},
+ {
+ default: d(() => [
+ v(l)
+ ? (c(),
+ k(`div`, _e, [
+ D(`h2`, null, E(v(e)(`Installing Craft CMS…`)), 1),
+ (n[0] ||= D(`craft-spinner`, null, null, -1)),
+ ]))
+ : v(s)
+ ? (c(),
+ k(`div`, ve, [
+ D(`h2`, null, E(v(e)(`Craft is installed! 🎉`)), 1),
+ (n[1] ||= D(
+ `div`,
+ {class: `flex justify-center items-center`},
+ [
+ D(`craft-icon`, {
+ name: `circle-check`,
+ variant: `regular`,
+ style: {
+ color: `var(--c-color-success-fill-loud)`,
+ 'font-size': `2.5rem`,
+ },
+ }),
+ ],
+ -1
+ )),
+ ]))
+ : m(``, !0),
+ v(u)
+ ? (c(),
+ k(`div`, ye, [
+ D(`h2`, null, E(v(e)(`Install failed 😞`)), 1),
+ D(`div`, be, E(v(o).message), 1),
+ ]))
+ : m(``, !0),
+ ]),
+ _: 1,
+ }
+ )
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-c35f1a74`]]
+ ),
+ Se = {class: `grid md:grid-cols-2 gap-4 items-center`},
+ Ce = {class: `aspect-[352/455] w-1/2 md:w-3/4 mx-auto`},
+ we = [`src`],
+ Te = {class: `mb-4`},
+ Ee = {class: `grid gap-3 md:pr-6`},
+ Q = n({
+ __name: `StepScreen`,
+ props: {illustrationSrc: {default: ``}, heading: {default: ``}},
+ setup(e) {
+ return (t, n) => (
+ c(),
+ k(`div`, Se, [
+ D(`div`, Ce, [
+ D(
+ `img`,
+ {loading: `lazy`, src: e.illustrationSrc, alt: ``, width: `368`},
+ null,
+ 8,
+ we
+ ),
+ ]),
+ D(`div`, null, [
+ D(`h2`, Te, E(e.heading), 1),
+ D(`div`, Ee, [u(t.$slots, `default`)]),
+ ]),
+ ])
+ );
+ },
+ }),
+ De = {class: `install`},
+ $ = [`innerHTML`],
+ Oe = {class: `flex justify-center w-full`},
+ ke = {key: 2},
+ Ae = {class: `grid grid-cols-3 items-center gap-2 w-full`},
+ je = {class: `flex gap-2 justify-center`},
+ Me = {class: `sr-only`},
+ Ne = [`loading`],
+ Pe = T(
+ n({
+ __name: `Install`,
+ props: {
+ dbConfig: {},
+ localeOptions: {},
+ licenseHtml: {},
+ defaultSystemName: {},
+ defaultSiteUrl: {},
+ defaultSiteLanguage: {},
+ showDbScreen: {type: Boolean},
+ },
+ setup(n) {
+ _((e) => ({a4b8a6cc: r.value}));
+ let r = p(() => `url(${te})`),
+ i = n,
+ {
+ dotSteps: a,
+ current: o,
+ currentId: u,
+ goTo: g,
+ goToNext: y,
+ goToPrevious: C,
+ isCurrent: T,
+ possibleSteps: j,
+ } = re();
+ f(() => {
+ j.value.db.hidden = !i.showDbScreen;
+ });
+ function N() {
+ g(`license`);
+ }
+ let P = x({account: {}, db: {}, site: {}}),
+ F = h({
+ account: {username: ``, email: ``, password: ``},
+ db: {
+ driver: i.dbConfig.driver,
+ host: i.dbConfig.host,
+ port: i.dbConfig.port,
+ database: i.dbConfig.database,
+ username: i.dbConfig.username,
+ password: i.dbConfig.password,
+ prefix: i.dbConfig.prefix,
+ },
+ site: {
+ name: i.defaultSystemName,
+ baseUrl: i.defaultSiteUrl,
+ language: i.defaultSiteLanguage,
+ },
+ }),
+ L = p(() => !T(`start`));
+ function R(e) {
+ if (F.processing) return;
+ P[u.value] = {};
+ let t = e.currentTarget;
+ F.transform((e) => e[u.value]).post(t.action, {
+ onSuccess: () => {
+ y();
+ },
+ onError: (e) => {
+ P[u.value] = e;
+ },
+ });
+ }
+ return (r, i) => (
+ c(),
+ k(
+ b,
+ null,
+ [
+ l(v(ee), {title: v(e)(`Install Craft CMS`)}, null, 8, [`title`]),
+ D(`div`, De, [
+ v(T)(`start`)
+ ? (c(),
+ k(
+ `craft-button`,
+ {
+ key: 0,
+ type: `button`,
+ onClick: N,
+ variant: `accent`,
+ class: `begin-button`,
+ },
+ [
+ O(E(v(e)(`Install Craft CMS`)) + ` `, 1),
+ (i[6] ||= D(
+ `craft-icon`,
+ {name: `arrow-right`, slot: `suffix`},
+ null,
+ -1
+ )),
+ ]
+ ))
+ : m(``, !0),
+ l(
+ I,
+ {'is-active': L.value, overlay: !1, width: `2xl`},
+ {
+ default: d(() => [
+ v(T)(`license`)
+ ? (c(),
+ A(
+ M,
+ {key: 0, class: `max-w-[80ch] mx-auto`},
+ {
+ actions: d(() => [
+ D(`div`, Oe, [
+ D(
+ `craft-button`,
+ {
+ type: `button`,
+ variant: `accent`,
+ onClick: (i[0] ||= (e) =>
+ v(g)(`account`)),
+ },
+ E(v(e)(`Got it`)),
+ 1
+ ),
+ ]),
+ ]),
+ default: d(() => [
+ l(
+ v(w),
+ {data: `licenseHtml`},
+ {
+ fallback: d(() => [
+ ...(i[7] ||= [
+ D(
+ `div`,
+ {class: `flex justify-center`},
+ [D(`craft-spinner`)],
+ -1
+ ),
+ ]),
+ ]),
+ default: d(() => [
+ D(
+ `div`,
+ {
+ class: `license`,
+ innerHTML: n.licenseHtml,
+ },
+ null,
+ 8,
+ $
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ }
+ ))
+ : v(T)(`installing`)
+ ? (c(),
+ A(
+ xe,
+ {
+ key: 1,
+ data: v(F),
+ onSuccess: (i[1] ||= (e) => v(y)()),
+ },
+ null,
+ 8,
+ [`data`]
+ ))
+ : (c(),
+ k(`div`, ke, [
+ l(
+ M,
+ {
+ as: `form`,
+ action: v(o).action,
+ onSubmit: S(R, [`prevent`]),
+ },
+ {
+ 'footer-content': d(() => [
+ D(`div`, Ae, [
+ D(
+ `craft-button`,
+ {
+ type: `button`,
+ onClick: (i[5] ||= (...e) =>
+ v(C) && v(C)(...e)),
+ appearance: `plain`,
+ class: `justify-self-start`,
+ },
+ [
+ O(E(v(e)(`Back`)) + ` `, 1),
+ (i[9] ||= D(
+ `craft-icon`,
+ {
+ name: `arrow-left`,
+ slot: `prefix`,
+ },
+ null,
+ -1
+ )),
+ ]
+ ),
+ D(`ul`, je, [
+ (c(!0),
+ k(
+ b,
+ null,
+ t(
+ v(a),
+ (e, t) => (
+ c(),
+ k(`li`, {key: t}, [
+ D(
+ `span`,
+ {
+ class: s([
+ `dot`,
+ {'dot--active': v(T)(t)},
+ ]),
+ },
+ [
+ D(
+ `span`,
+ Me,
+ E(e.label),
+ 1
+ ),
+ ],
+ 2
+ ),
+ ])
+ )
+ ),
+ 128
+ )),
+ ]),
+ D(
+ `craft-button`,
+ {
+ class: `justify-self-end`,
+ type: `submit`,
+ variant: `accent`,
+ loading: v(F).processing,
+ },
+ [
+ O(
+ E(
+ v(o).submitLabel ?? v(e)(`Next`)
+ ) + ` `,
+ 1
+ ),
+ (i[10] ||= D(
+ `craft-icon`,
+ {
+ name: `arrow-right`,
+ slot: `suffix`,
+ },
+ null,
+ -1
+ )),
+ ],
+ 8,
+ Ne
+ ),
+ ]),
+ ]),
+ default: d(() => [
+ v(T)(`account`)
+ ? (c(),
+ A(
+ Q,
+ {
+ key: 0,
+ 'illustration-src': v(ie),
+ heading: v(o).heading,
+ class: `screen`,
+ },
+ {
+ default: d(() => [
+ v(T)(`account`)
+ ? (c(),
+ A(
+ U,
+ {
+ key: 0,
+ modelValue: v(F).account,
+ 'onUpdate:modelValue':
+ (i[2] ||= (e) =>
+ (v(F).account = e)),
+ errors: P.account,
+ },
+ null,
+ 8,
+ [`modelValue`, `errors`]
+ ))
+ : m(``, !0),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`illustration-src`, `heading`]
+ ))
+ : m(``, !0),
+ v(T)(`db`)
+ ? (c(),
+ A(
+ Q,
+ {
+ key: 1,
+ 'illustration-src': v(oe),
+ heading: v(o).heading,
+ class: `screen`,
+ },
+ {
+ default: d(() => [
+ l(
+ ge,
+ {
+ modelValue: v(F).db,
+ 'onUpdate:modelValue':
+ (i[3] ||= (e) =>
+ (v(F).db = e)),
+ errors: P.db,
+ },
+ null,
+ 8,
+ [`modelValue`, `errors`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`illustration-src`, `heading`]
+ ))
+ : m(``, !0),
+ v(T)(`site`)
+ ? (c(),
+ A(
+ Q,
+ {
+ key: 2,
+ 'illustration-src': v(ae),
+ heading: v(o).heading,
+ class: `screen`,
+ },
+ {
+ default: d(() => [
+ l(
+ v(w),
+ {data: `localeOptions`},
+ {
+ fallback: d(() => [
+ ...(i[8] ||= [
+ D(
+ `craft-spinner`,
+ null,
+ null,
+ -1
+ ),
+ ]),
+ ]),
+ default: d(() => [
+ l(
+ K,
+ {
+ modelValue: v(F).site,
+ 'onUpdate:modelValue':
+ (i[4] ||= (e) =>
+ (v(F).site = e)),
+ 'locale-options': (
+ n.localeOptions ?? []
+ ).map((e) => ({
+ id: e.id,
+ label: e.name,
+ value: e.id,
+ })),
+ errors: P.site,
+ },
+ null,
+ 8,
+ [
+ `modelValue`,
+ `locale-options`,
+ `errors`,
+ ]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`illustration-src`, `heading`]
+ ))
+ : m(``, !0),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`action`]
+ ),
+ ])),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`is-active`]
+ ),
+ ]),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-48348632`]]
+ );
+export {Pe as default};
diff --git a/resources/build/assets/Login-DZJ04Jsw.js b/resources/build/assets/Login-DZJ04Jsw.js
new file mode 100644
index 00000000000..3a1f83c9d25
--- /dev/null
+++ b/resources/build/assets/Login-DZJ04Jsw.js
@@ -0,0 +1,123 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ V as i,
+ X as a,
+ a as o,
+ ht as s,
+ l as c,
+ m as l,
+ t as u,
+ tt as d,
+ v as f,
+ w as p,
+ x as m,
+ y as h,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as g} from './wayfinder-V597ZF_3.js';
+import './login-form-Ch1MgWfC.js';
+import {n as _} from './LoginController-DVCyoRyw.js';
+var v = `` + new URL(`craftcms-Dn6fy_A6.svg`, import.meta.url).href,
+ y = {class: `cp-login`},
+ b = {class: `cp-login__wrapper grid gap-3 justify-items-center`},
+ x = {class: `flex justify-center`},
+ S = [`src`, `alt`],
+ C = {class: `cp-login__form-wrapper`},
+ w = {
+ class: `cp-login__powered-by`,
+ href: `https://craftcms.com/`,
+ title: `Powered by Craft CMS`,
+ },
+ T = [`src`],
+ E = u(
+ t({
+ __name: `AuthBase`,
+ setup(t) {
+ let {general: a, system: c} = g();
+ return (t, u) => (
+ n(),
+ m(
+ l,
+ null,
+ [
+ r(s(o), {title: s(e)(`Sign In`)}, null, 8, [`title`]),
+ f(`main`, y, [
+ f(`div`, b, [
+ f(`h1`, x, [
+ s(a).cpLogoUrl
+ ? (n(),
+ m(
+ `img`,
+ {
+ key: 0,
+ src: s(a).cpLogoUrl,
+ alt: s(c).name,
+ class: `cp-login__logo`,
+ width: `288px`,
+ },
+ null,
+ 8,
+ S
+ ))
+ : (n(), m(l, {key: 1}, [p(d(s(c).name), 1)], 64)),
+ ]),
+ f(`div`, C, [i(t.$slots, `default`, {}, void 0, !0)]),
+ f(`a`, w, [
+ f(
+ `img`,
+ {
+ src: s(v),
+ alt: `Craft CMS`,
+ class: `cp-login__craft-logo`,
+ width: `104`,
+ height: `26`,
+ },
+ null,
+ 8,
+ T
+ ),
+ ]),
+ ]),
+ ]),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-1c1215c9`]]
+ ),
+ D = [`action`, `username`, `use-email-as-username`],
+ O = t({
+ __name: `Login`,
+ props: {errors: {}, authFormData: {}},
+ setup(e) {
+ let t = c(),
+ {general: r} = g();
+ return (e, i) => (
+ n(),
+ h(E, null, {
+ default: a(() => [
+ f(
+ `craft-login-form`,
+ {
+ action: s(_)().url,
+ 'show-reset-password': ``,
+ 'show-remember-me': ``,
+ username: s(t).props.username,
+ 'use-email-as-username': s(r).useEmailAsUsername ? `` : null,
+ },
+ null,
+ 8,
+ D
+ ),
+ ]),
+ _: 1,
+ })
+ );
+ },
+ });
+export {O as default};
diff --git a/resources/build/assets/LoginController-DVCyoRyw.js b/resources/build/assets/LoginController-DVCyoRyw.js
new file mode 100644
index 00000000000..5ce60509ba6
--- /dev/null
+++ b/resources/build/assets/LoginController-DVCyoRyw.js
@@ -0,0 +1,62 @@
+import {n as e} from './wayfinder-V597ZF_3.js';
+var t = (e) => ({url: t.url(e), method: `post`});
+((t.definition = {methods: [`post`], url: `/actions/users/login-modal`}),
+ (t.url = (n) => t.definition.url + e(n)),
+ (t.post = (e) => ({url: t.url(e), method: `post`})));
+var n = (e) => ({url: n.url(e), method: `post`});
+((n.definition = {methods: [`post`], url: `/admin/actions/users/login-modal`}),
+ (n.url = (t) => n.definition.url + e(t)),
+ (n.post = (e) => ({url: n.url(e), method: `post`})));
+var r = {
+ '/actions/users/login-modal': t,
+ '/admin/actions/users/login-modal': n,
+ },
+ i = (e) => ({url: i.url(e), method: `get`});
+((i.definition = {
+ methods: [`get`, `head`, `post`, `put`, `patch`, `delete`, `options`],
+ url: `/actions/users/redirect`,
+}),
+ (i.url = (t) => i.definition.url + e(t)),
+ (i.get = (e) => ({url: i.url(e), method: `get`})),
+ (i.head = (e) => ({url: i.url(e), method: `head`})),
+ (i.post = (e) => ({url: i.url(e), method: `post`})),
+ (i.put = (e) => ({url: i.url(e), method: `put`})),
+ (i.patch = (e) => ({url: i.url(e), method: `patch`})),
+ (i.delete = (e) => ({url: i.url(e), method: `delete`})),
+ (i.options = (e) => ({url: i.url(e), method: `options`})));
+var a = (e) => ({url: a.url(e), method: `get`});
+((a.definition = {
+ methods: [`get`, `head`, `post`, `put`, `patch`, `delete`, `options`],
+ url: `/admin/actions/users/redirect`,
+}),
+ (a.url = (t) => a.definition.url + e(t)),
+ (a.get = (e) => ({url: a.url(e), method: `get`})),
+ (a.head = (e) => ({url: a.url(e), method: `head`})),
+ (a.post = (e) => ({url: a.url(e), method: `post`})),
+ (a.put = (e) => ({url: a.url(e), method: `put`})),
+ (a.patch = (e) => ({url: a.url(e), method: `patch`})),
+ (a.delete = (e) => ({url: a.url(e), method: `delete`})),
+ (a.options = (e) => ({url: a.url(e), method: `options`})));
+var o = {'/actions/users/redirect': i, '/admin/actions/users/redirect': a},
+ s = (e) => ({url: s.url(e), method: `get`});
+((s.definition = {methods: [`get`, `head`], url: `/admin/login`}),
+ (s.url = (t) => s.definition.url + e(t)),
+ (s.get = (e) => ({url: s.url(e), method: `get`})),
+ (s.head = (e) => ({url: s.url(e), method: `head`})));
+var c = (e) => ({url: c.url(e), method: `post`});
+((c.definition = {methods: [`post`], url: `/admin/login`}),
+ (c.url = (t) => c.definition.url + e(t)),
+ (c.post = (e) => ({url: c.url(e), method: `post`})));
+var l = (e) => ({url: l.url(e), method: `get`});
+((l.definition = {methods: [`get`, `head`], url: `/admin/logout`}),
+ (l.url = (t) => l.definition.url + e(t)),
+ (l.get = (e) => ({url: l.url(e), method: `get`})),
+ (l.head = (e) => ({url: l.url(e), method: `head`})));
+var u = {
+ showLoginModal: r,
+ redirect: o,
+ showLogin: s,
+ attemptLogin: c,
+ logout: l,
+};
+export {c as n, u as t};
diff --git a/resources/build/assets/Modal-D6UmxwmM.js b/resources/build/assets/Modal-D6UmxwmM.js
new file mode 100644
index 00000000000..129e11ec281
--- /dev/null
+++ b/resources/build/assets/Modal-D6UmxwmM.js
@@ -0,0 +1,89 @@
+import {
+ E as e,
+ Q as t,
+ R as n,
+ T as r,
+ V as i,
+ X as a,
+ _ as o,
+ b as s,
+ m as c,
+ t as l,
+ u,
+ v as d,
+ x as f,
+ y as p,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as m} from './dist-BSfJDNP3.js';
+var h = {key: 0, class: `cp-modal`},
+ g = l(
+ e({
+ __name: `Modal`,
+ props: {
+ isActive: {type: Boolean, default: !1},
+ overlay: {type: Boolean, default: !0},
+ width: {default: `md`},
+ },
+ emits: [`close`],
+ setup(e, {emit: l}) {
+ let g = l,
+ _ = e;
+ m(`Escape`, () => {
+ g(`close`);
+ });
+ let v = o(() => `w-${_.width}`);
+ return (o, l) => (
+ n(),
+ f(
+ c,
+ null,
+ [
+ r(
+ u,
+ {name: `body`},
+ {
+ default: a(() => [
+ e.isActive
+ ? (n(),
+ f(`div`, h, [
+ d(
+ `div`,
+ {class: t({content: !0, [v.value]: !0})},
+ [i(o.$slots, `default`, {}, void 0, !0)],
+ 2
+ ),
+ ]))
+ : s(``, !0),
+ ]),
+ _: 3,
+ }
+ ),
+ e.overlay
+ ? (n(),
+ p(
+ u,
+ {key: 0, name: `fade`},
+ {
+ default: a(() => [
+ e.isActive
+ ? (n(),
+ f(`div`, {
+ key: 0,
+ class: `cp-overlay`,
+ onClick: (l[0] ||= (e) => g(`close`)),
+ }))
+ : s(``, !0),
+ ]),
+ _: 1,
+ }
+ ))
+ : s(``, !0),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-03a670fc`]]
+ );
+export {g as t};
diff --git a/resources/build/assets/ModalForm-ZyQ-Rf8C.js b/resources/build/assets/ModalForm-ZyQ-Rf8C.js
new file mode 100644
index 00000000000..46d450a08ed
--- /dev/null
+++ b/resources/build/assets/ModalForm-ZyQ-Rf8C.js
@@ -0,0 +1,107 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ R as r,
+ S as i,
+ T as a,
+ V as o,
+ X as s,
+ p as c,
+ tt as l,
+ v as u,
+ y as d,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as f} from './Pane-CJi1MPPH.js';
+import {t as p} from './Modal-D6UmxwmM.js';
+var m = [`loading`],
+ h = n({
+ __name: `ModalForm`,
+ props: {
+ isActive: {type: Boolean},
+ overlay: {type: Boolean, default: !0},
+ width: {},
+ loading: {type: Boolean, default: !1},
+ title: {default: void 0},
+ resetLabel: {default: e(`Cancel`)},
+ submitLabel: {default: e(`Save`)},
+ },
+ emits: [`close`, `submit`],
+ setup(e, {emit: n}) {
+ let h = n;
+ function g() {
+ h(`submit`);
+ }
+ return (n, _) => (
+ r(),
+ d(
+ p,
+ {
+ 'is-active': e.isActive,
+ overlay: e.overlay,
+ onClose: (_[1] ||= (e) => h(`close`)),
+ width: e.width,
+ },
+ {
+ default: s(() => [
+ u(
+ `form`,
+ {onSubmit: c(g, [`prevent`])},
+ [
+ a(
+ f,
+ {title: e.title},
+ i(
+ {
+ 'secondary-action': s(() => [
+ u(
+ `craft-button`,
+ {
+ type: `reset`,
+ onClick: (_[0] ||= (e) => h(`close`)),
+ appearance: `plain`,
+ },
+ l(e.resetLabel),
+ 1
+ ),
+ ]),
+ 'primary-action': s(() => [
+ u(
+ `craft-button`,
+ {
+ type: `submit`,
+ variant: `accent`,
+ loading: e.loading,
+ },
+ l(e.submitLabel),
+ 9,
+ m
+ ),
+ ]),
+ default: s(() => [o(n.$slots, `default`)]),
+ _: 2,
+ },
+ [
+ t(n.$slots, (e, t) => ({
+ name: t,
+ fn: s(() => [o(n.$slots, t)]),
+ })),
+ ]
+ ),
+ 1032,
+ [`title`]
+ ),
+ ],
+ 32
+ ),
+ ]),
+ _: 3,
+ },
+ 8,
+ [`is-active`, `overlay`, `width`]
+ )
+ );
+ },
+ });
+export {h as t};
diff --git a/resources/build/assets/Pane-CJi1MPPH.js b/resources/build/assets/Pane-CJi1MPPH.js
new file mode 100644
index 00000000000..9681f6a3171
--- /dev/null
+++ b/resources/build/assets/Pane-CJi1MPPH.js
@@ -0,0 +1,169 @@
+import {
+ E as e,
+ K as t,
+ Q as n,
+ R as r,
+ U as i,
+ V as a,
+ X as o,
+ _ as s,
+ b as c,
+ d as l,
+ t as u,
+ tt as d,
+ v as f,
+ x as p,
+ y as m,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var h = {class: `cp-pane__header`},
+ g = {key: 0, class: `text-lg`},
+ _ = {class: `cp-pane__actions`},
+ v = {class: `cp-pane__body`},
+ y = {class: `cp-pane__footer`},
+ b = {class: `actions`},
+ x = u(
+ e({
+ __name: `Pane`,
+ props: {
+ as: {default: `div`},
+ variant: {},
+ appearance: {},
+ hideHeader: {type: Boolean, default: !1},
+ hideFooter: {type: Boolean, default: !1},
+ title: {},
+ padding: {default: `lg`},
+ },
+ setup(e) {
+ l((e) => ({e9fb4380: T.value}));
+ let u = t(),
+ x = e;
+ function S(e) {
+ return !isNaN(parseFloat(String(e))) && isFinite(Number(e));
+ }
+ let C = s(
+ () => !!(u.header || x.title || u.title || u[`header-actions`])
+ ),
+ w = s(
+ () =>
+ u.footer ||
+ u.actions ||
+ u.feedback ||
+ u[`footer-content`] ||
+ u[`primary-action`] ||
+ u[`secondary-action`]
+ ),
+ T = s(() =>
+ x.padding === 0
+ ? 0
+ : S(x.padding)
+ ? `calc(${x.padding}rem / 16)`
+ : [`sm`, `md`, `lg`, `xl`].includes(x.padding)
+ ? `var(--c-spacing-${x.padding})`
+ : x.padding
+ );
+ return (t, s) => (
+ r(),
+ m(
+ i(e.as),
+ {
+ class: n({
+ 'cp-pane': !0,
+ 'cp-pane--code': e.variant === `code`,
+ 'cp-pane--error': e.variant === `error`,
+ 'cp-pane--outline': e.appearance === `outline`,
+ 'cp-pane--raised': e.appearance === `raised`,
+ }),
+ },
+ {
+ default: o(() => [
+ C.value
+ ? a(
+ t.$slots,
+ `header`,
+ {key: 0},
+ () => [
+ f(`div`, h, [
+ a(
+ t.$slots,
+ `title`,
+ {},
+ () => [
+ e.title
+ ? (r(), p(`h1`, g, d(e.title), 1))
+ : c(``, !0),
+ ],
+ !0
+ ),
+ f(`div`, _, [
+ a(t.$slots, `header-actions`, {}, void 0, !0),
+ ]),
+ ]),
+ ],
+ !0
+ )
+ : c(``, !0),
+ a(
+ t.$slots,
+ `body`,
+ {},
+ () => [f(`div`, v, [a(t.$slots, `default`, {}, void 0, !0)])],
+ !0
+ ),
+ w.value
+ ? a(
+ t.$slots,
+ `footer`,
+ {key: 1},
+ () => [
+ f(`div`, y, [
+ a(
+ t.$slots,
+ `footer-content`,
+ {},
+ () => [
+ a(t.$slots, `feedback`, {}, void 0, !0),
+ (s[0] ||= f(`div`, {class: `flex-1`}, null, -1)),
+ a(
+ t.$slots,
+ `actions`,
+ {},
+ () => [
+ f(`div`, b, [
+ a(
+ t.$slots,
+ `secondary-action`,
+ {},
+ void 0,
+ !0
+ ),
+ a(
+ t.$slots,
+ `primary-action`,
+ {},
+ void 0,
+ !0
+ ),
+ ]),
+ ],
+ !0
+ ),
+ ],
+ !0
+ ),
+ ]),
+ ],
+ !0
+ )
+ : c(``, !0),
+ ]),
+ _: 3,
+ },
+ 8,
+ [`class`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-5e15a836`]]
+ );
+export {x as t};
diff --git a/resources/build/assets/Plugins-ss2clMPq.js b/resources/build/assets/Plugins-ss2clMPq.js
new file mode 100644
index 00000000000..e7fe4c092b2
--- /dev/null
+++ b/resources/build/assets/Plugins-ss2clMPq.js
@@ -0,0 +1,1025 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {r as t} from './cp-npqTfNqh.js';
+import {
+ B as n,
+ C as r,
+ E as i,
+ I as a,
+ J as o,
+ R as s,
+ T as c,
+ U as l,
+ X as u,
+ _ as d,
+ b as f,
+ c as p,
+ ct as m,
+ gt as h,
+ ht as g,
+ i as _,
+ k as v,
+ l as y,
+ m as b,
+ p as x,
+ s as ee,
+ t as S,
+ tt as C,
+ v as w,
+ w as T,
+ x as E,
+ y as D,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as te, n as O, o as ne, t as re} from './AdminTable-32qWVDq-.js';
+import {t as ie} from './Empty-D0VMu5kQ.js';
+import {t as ae} from './Pane-CJi1MPPH.js';
+import {s as k} from './InlineFlash-DnK6Yp2V.js';
+import {t as A} from './Badge-B_Mkh-0t.js';
+import {n as j, t as M} from './wayfinder-V597ZF_3.js';
+import {n as N} from './useFetch-B2oo1RkU.js';
+import {t as P} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as oe} from './CraftInput-B2G9EaE3.js';
+import {r as se, t as ce} from './AppLayout-BXGMFlSp.js';
+var le = {key: 0, class: `cp-plugin-edition__name`},
+ ue = {key: 1, class: `cp-plugin-edition__trial`},
+ de = S(
+ i({
+ __name: `PluginEdition`,
+ props: {
+ url: {default: null},
+ edition: {default: null},
+ isTrial: {type: Boolean, default: !1},
+ },
+ setup(n) {
+ let r = n,
+ i = d(() => (r.edition ? t(r.edition) : null));
+ return (t, r) => (
+ s(),
+ D(
+ l(n.url ? `a` : `div`),
+ {href: n.url, class: `cp-plugin-edition`, 'data-color': `neutral`},
+ {
+ default: u(() => [
+ n.edition ? (s(), E(`div`, le, C(i.value), 1)) : f(``, !0),
+ n.isTrial
+ ? (s(), E(`div`, ue, C(g(e)(`Trial`)), 1))
+ : f(``, !0),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-8a77e167`]]
+ ),
+ fe = {
+ key: 0,
+ xmlns: `http://www.w3.org/2000/svg`,
+ 'xml:space': `preserve`,
+ id: `Layer_1`,
+ x: `0`,
+ y: `0`,
+ version: `1.1`,
+ viewBox: `0 0 100 100`,
+ },
+ pe = {
+ key: 1,
+ xmlns: `http://www.w3.org/2000/svg`,
+ 'xml:space': `preserve`,
+ viewBox: `0 0 100 100`,
+ },
+ F = S(
+ i({
+ __name: `PluginLicenseStatusIcon`,
+ props: {status: {}},
+ setup(e) {
+ return (t, n) => (
+ s(),
+ E(`div`, null, [
+ e.status === `valid`
+ ? (s(),
+ E(`svg`, fe, [
+ ...(n[0] ||= [
+ r(
+ ` `,
+ 4
+ ),
+ ]),
+ ]))
+ : f(``, !0),
+ e.status === `invalid`
+ ? (s(),
+ E(`svg`, pe, [
+ ...(n[1] ||= [
+ r(
+ ` `,
+ 3
+ ),
+ ]),
+ ]))
+ : f(``, !0),
+ ])
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-a39161d3`]]
+ ),
+ I = (e) => ({url: I.url(e), method: `post`});
+((I.definition = {
+ methods: [`post`],
+ url: `/admin/actions/plugins/install-plugin`,
+}),
+ (I.url = (e) => I.definition.url + j(e)),
+ (I.post = (e) => ({url: I.url(e), method: `post`})));
+var L = (e) => ({url: L.url(e), method: `post`});
+((L.definition = {
+ methods: [`post`],
+ url: `/admin/actions/plugins/uninstall-plugin`,
+}),
+ (L.url = (e) => L.definition.url + j(e)),
+ (L.post = (e) => ({url: L.url(e), method: `post`})));
+var R = (e) => ({url: R.url(e), method: `post`});
+((R.definition = {
+ methods: [`post`],
+ url: `/admin/actions/plugins/switch-edition`,
+}),
+ (R.url = (e) => R.definition.url + j(e)),
+ (R.post = (e) => ({url: R.url(e), method: `post`})));
+var z = (e) => ({url: z.url(e), method: `post`});
+((z.definition = {
+ methods: [`post`],
+ url: `/admin/actions/plugins/disable-plugin`,
+}),
+ (z.url = (e) => z.definition.url + j(e)),
+ (z.post = (e) => ({url: z.url(e), method: `post`})));
+var B = (e) => ({url: B.url(e), method: `post`});
+((B.definition = {
+ methods: [`post`],
+ url: `/admin/actions/plugins/enable-plugin`,
+}),
+ (B.url = (e) => B.definition.url + j(e)),
+ (B.post = (e) => ({url: B.url(e), method: `post`})));
+var V = (e) => ({url: V.url(e), method: `post`});
+((V.definition = {
+ methods: [`post`],
+ url: `/admin/actions/plugins/save-plugin-settings`,
+}),
+ (V.url = (e) => V.definition.url + j(e)),
+ (V.post = (e) => ({url: V.url(e), method: `post`})));
+var H = (e) => ({url: H.url(e), method: `get`});
+((H.definition = {methods: [`get`, `head`], url: `/admin/settings/plugins`}),
+ (H.url = (e) => H.definition.url + j(e)),
+ (H.get = (e) => ({url: H.url(e), method: `get`})),
+ (H.head = (e) => ({url: H.url(e), method: `head`})));
+var U = (e, t) => ({url: U.url(e, t), method: `get`});
+((U.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/plugins/{handle}`,
+}),
+ (U.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {handle: e}),
+ Array.isArray(e) && (e = {handle: e[0]}),
+ (e = M(e)));
+ let n = {handle: e.handle};
+ return (
+ U.definition.url
+ .replace(`{handle}`, n.handle.toString())
+ .replace(/\/+$/, ``) + j(t)
+ );
+ }),
+ (U.get = (e, t) => ({url: U.url(e, t), method: `get`})),
+ (U.head = (e, t) => ({url: U.url(e, t), method: `head`})));
+var me = {key: 0, class: `flex gap-3 items-base`},
+ he = [`href`],
+ ge = [`name`],
+ _e = i({
+ __name: `PluginLinks`,
+ props: {plugin: {}},
+ setup(e) {
+ let t = e,
+ r = y(),
+ i = d(() => r.props.readOnly),
+ a = d(() => {
+ if (t.plugin.links) return t.plugin.links;
+ let e = [];
+ return (
+ t.plugin.developer &&
+ e.push({
+ icon: `building`,
+ href: t.plugin.developerUrl,
+ text: t.plugin.developer,
+ }),
+ t.plugin.documentationUrl &&
+ e.push({
+ icon: `book`,
+ href: t.plugin.documentationUrl,
+ text: `Documentation`,
+ }),
+ t.plugin.hasCpSettings &&
+ (!i.value || t.plugin.hasReadOnlyCpSettings) &&
+ e.push({
+ icon: `gear`,
+ href: U(t.plugin.handle).url,
+ text: `Settings`,
+ }),
+ e
+ );
+ });
+ return (e, t) =>
+ a.value?.length > 0
+ ? (s(),
+ E(`ul`, me, [
+ (s(!0),
+ E(
+ b,
+ null,
+ n(
+ a.value,
+ (e) => (
+ s(),
+ E(`li`, {key: e.href}, [
+ w(
+ `a`,
+ {
+ href: e.href,
+ target: `_blank`,
+ rel: `noopener`,
+ class: `flex gap-1 items-center`,
+ },
+ [
+ e.icon
+ ? (s(),
+ E(
+ `craft-icon`,
+ {key: 0, name: e.icon},
+ null,
+ 8,
+ ge
+ ))
+ : f(``, !0),
+ T(` ` + C(e.text), 1),
+ ],
+ 8,
+ he
+ ),
+ ])
+ )
+ ),
+ 128
+ )),
+ ]))
+ : f(``, !0);
+ },
+ }),
+ ve = {key: 0, class: `flex items-center gap-1`},
+ ye = [`value`],
+ be = [`value`],
+ xe = [`loading`],
+ Se = i({
+ __name: `PluginLicenseIssues`,
+ props: {plugin: {}},
+ setup(e) {
+ let r = e,
+ i = d(() => t(r.plugin.licensedEdition)),
+ a = d(
+ () =>
+ `console.craftcms.com `
+ );
+ return (t, r) => (
+ s(!0),
+ E(
+ b,
+ null,
+ n(
+ e.plugin.licenseIssues,
+ (t) => (
+ s(),
+ E(
+ `craft-callout`,
+ {key: t, variant: `danger`, appearance: `plain`, class: `p-0`},
+ [
+ t === `wrong_edition`
+ ? (s(),
+ E(`div`, ve, [
+ c(
+ O,
+ {
+ template: `This license is for the {name} edition.`,
+ params: {name: i.value},
+ },
+ null,
+ 8,
+ [`params`]
+ ),
+ c(
+ g(_),
+ {action: g(R)(), method: `post`},
+ {
+ default: u(({processing: t}) => [
+ w(
+ `input`,
+ {
+ type: `hidden`,
+ name: `pluginHandle`,
+ value: e.plugin.handle,
+ },
+ null,
+ 8,
+ ye
+ ),
+ w(
+ `input`,
+ {
+ type: `hidden`,
+ name: `edition`,
+ value: e.plugin.licensedEdition,
+ },
+ null,
+ 8,
+ be
+ ),
+ w(
+ `craft-button`,
+ {
+ type: `submit`,
+ appearance: `inline`,
+ variant: `inherit`,
+ loading: t,
+ },
+ `Switch`,
+ 8,
+ xe
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`action`]
+ ),
+ ]))
+ : t === `no_trials`
+ ? (s(),
+ D(O, {
+ key: 1,
+ template: `Plugin trials are not allowed on this domain.`,
+ }))
+ : t === `mismatched`
+ ? (s(),
+ D(
+ O,
+ {
+ key: 2,
+ template: `This license is tied to another Craft install. Visit {accountLink} to detach it, or buy a new license .`,
+ params: {
+ accountLink: a.value,
+ buyUrl: e.plugin.buyUrl,
+ },
+ },
+ null,
+ 8,
+ [`params`]
+ ))
+ : t === `astray`
+ ? (s(),
+ D(
+ O,
+ {
+ key: 3,
+ template: `This license isn’t allowed to run version {version}.`,
+ params: {version: e.plugin.version},
+ },
+ null,
+ 8,
+ [`params`]
+ ))
+ : t === `required`
+ ? (s(),
+ D(O, {
+ key: 4,
+ template: `A license key is required.`,
+ }))
+ : (s(),
+ D(O, {
+ key: 5,
+ template: `Your license key is invalid.`,
+ })),
+ ]
+ )
+ )
+ ),
+ 128
+ )
+ );
+ },
+ }),
+ W = (e) => ({url: W.url(e), method: `post`});
+((W.definition = {
+ methods: [`post`],
+ url: `/admin/actions/app/get-plugin-license-info`,
+}),
+ (W.url = (e) => W.definition.url + j(e)),
+ (W.post = (e) => ({url: W.url(e), method: `post`})));
+var G = (e) => ({url: G.url(e), method: `post`});
+((G.definition = {
+ methods: [`post`],
+ url: `/admin/actions/app/update-plugin-license`,
+}),
+ (G.url = (e) => G.definition.url + j(e)),
+ (G.post = (e) => ({url: G.url(e), method: `post`})));
+var K = {getLicenseInfo: W, updateLicense: G},
+ Ce = {class: `flex gap-1 items-start mb-1`},
+ we = [`value`],
+ q = [`loading`],
+ Te = i({
+ __name: `PluginLicenseInput`,
+ props: {plugin: {}},
+ setup(t) {
+ let n = t,
+ r = y(),
+ i = ee({handle: n.plugin.handle, key: o(n.plugin.licenseKey) ?? ``}),
+ a = d(() => i.key?.replace(/-/g, ``));
+ function o(e) {
+ return !e || e.startsWith(`$`)
+ ? e
+ : e
+ .replace(/[^a-zA-Z0-9]/g, ``)
+ .toUpperCase()
+ .replace(/.{4}/g, `$&-`)
+ .replace(/-$/, ``);
+ }
+ let l = d(() => o(i.key)),
+ p = d(() => r.props.readOnly || !n.plugin.isComposerInstalled),
+ m = d(
+ () =>
+ !p.value && n.plugin.buyUrl && n.plugin.licenseKeyStatus === `trial`
+ ),
+ h = d(
+ () =>
+ !p.value &&
+ ((!n.plugin.licenseKey && i.key) ||
+ (n.plugin.licenseKey && a.value !== n.plugin.licenseKey))
+ );
+ function _() {
+ i.transform((e) => ({...e, key: a.value})).submit(K.updateLicense());
+ }
+ function v() {
+ i.key = o(l.value) ?? ``;
+ }
+ return (n, r) => (
+ s(),
+ E(
+ `form`,
+ {onSubmit: (r[1] ||= x((e) => _(), [`prevent`]))},
+ [
+ w(`div`, Ce, [
+ c(
+ oe,
+ {
+ modelValue: g(i).key,
+ 'onUpdate:modelValue': (r[0] ||= (e) => (g(i).key = e)),
+ class: `font-mono`,
+ label: g(e)(`License Key`),
+ 'label-sr-only': ``,
+ placeholder: `XXXX-XXXX-XXXX-XXXX-XXXX-XXXX`,
+ readonly: p.value,
+ maxlength: `29`,
+ onBlur: v,
+ style: {width: `36ch`},
+ },
+ {
+ default: u(() => [
+ w(
+ `craft-copy-button`,
+ {slot: `suffix`, value: a.value},
+ null,
+ 8,
+ we
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`modelValue`, `label`, `readonly`]
+ ),
+ m.value
+ ? (s(),
+ D(
+ k,
+ {
+ key: 0,
+ appearance: `button`,
+ inertia: !1,
+ href: t.plugin.buyUrl,
+ variant:
+ t.plugin.licenseIssues.length > 0
+ ? `accent`
+ : `neutral`,
+ },
+ {default: u(() => [T(C(g(e)(`Buy now`)), 1)]), _: 1},
+ 8,
+ [`href`, `variant`]
+ ))
+ : f(``, !0),
+ h.value
+ ? (s(),
+ E(
+ `craft-button`,
+ {
+ key: 1,
+ type: `submit`,
+ loading: g(i).processing,
+ variant: `primary`,
+ },
+ C(g(e)(`Update`)),
+ 9,
+ q
+ ))
+ : f(``, !0),
+ ]),
+ ],
+ 32
+ )
+ );
+ },
+ }),
+ Ee = {class: `cp-plugin`},
+ De = {class: `cp-plugin__icon`},
+ Oe = [`src`],
+ ke = [`innerHTML`],
+ Ae = {class: `flex gap-2 items-baseline mb-1`},
+ je = {class: `font-mono text-xs`},
+ Me = {key: 0, class: `mb-1`},
+ Ne = {key: 1, class: `my-4`},
+ Pe = [`innerHTML`],
+ Fe = S(
+ i({
+ __name: `PluginDetails`,
+ props: {plugin: {}},
+ setup(t) {
+ let n = t,
+ r = d(
+ () => n.plugin.licenseKey && n.plugin.licenseKeyStatus !== `unknown`
+ ),
+ i = d(() =>
+ [
+ e(`This license has expired.`),
+ e(
+ `Renew now for another year of updates.`,
+ {renewalUrl: n.plugin.renewalUrl}
+ ),
+ ].join(` `)
+ );
+ return (e, n) => (
+ s(),
+ E(`div`, Ee, [
+ w(`div`, De, [
+ (s(),
+ D(
+ l(t.plugin.pluginStoreUrl ? `a` : `div`),
+ {
+ href: t.plugin.pluginStoreUrl,
+ class: `relative`,
+ target: `_blank`,
+ },
+ {
+ default: u(() => [
+ t.plugin.iconUrl
+ ? (s(),
+ E(
+ `img`,
+ {key: 0, src: t.plugin.iconUrl, alt: ``},
+ null,
+ 8,
+ Oe
+ ))
+ : t.plugin.iconSvg
+ ? (s(),
+ E(
+ `span`,
+ {key: 1, innerHTML: t.plugin.iconSvg},
+ null,
+ 8,
+ ke
+ ))
+ : f(``, !0),
+ t.plugin.licenseKeyStatus === `valid` ||
+ t.plugin.licenseIssues.length > 0
+ ? (s(),
+ D(
+ F,
+ {
+ key: 2,
+ class: `license-key-status`,
+ status:
+ t.plugin.licenseIssues.length === 0
+ ? `valid`
+ : `invalid`,
+ },
+ null,
+ 8,
+ [`status`]
+ ))
+ : f(``, !0),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ )),
+ ]),
+ w(`div`, null, [
+ w(`div`, Ae, [
+ w(`h2`, null, C(t.plugin.name), 1),
+ t.plugin.hasMultipleEditions || t.plugin.isTrial
+ ? (s(),
+ D(
+ de,
+ {
+ key: 0,
+ url: t.plugin.upgradeAvailable
+ ? t.plugin.pluginStoreUrl
+ : null,
+ edition: t.plugin.hasMultipleEditions
+ ? t.plugin.edition
+ : null,
+ 'is-trial': t.plugin.isTrial,
+ class: `self-center`,
+ },
+ null,
+ 8,
+ [`url`, `edition`, `is-trial`]
+ ))
+ : f(``, !0),
+ w(`div`, je, C(t.plugin.version), 1),
+ ]),
+ t.plugin.description
+ ? (s(),
+ E(`div`, Me, [w(`p`, null, C(t.plugin.description), 1)]))
+ : f(``, !0),
+ w(`div`, null, [c(_e, {plugin: t.plugin}, null, 8, [`plugin`])]),
+ r.value
+ ? (s(),
+ E(`div`, Ne, [
+ c(Te, {plugin: t.plugin}, null, 8, [`plugin`]),
+ t.plugin.licenseIssues.length > 0
+ ? (s(),
+ D(Se, {key: 0, plugin: t.plugin}, null, 8, [`plugin`]))
+ : f(``, !0),
+ t.plugin.expired
+ ? (s(),
+ E(
+ `craft-callout`,
+ {
+ key: 1,
+ variant: `warning`,
+ appearance: `plain`,
+ class: `p-0`,
+ innerHTML: i.value,
+ },
+ null,
+ 8,
+ Pe
+ ))
+ : f(``, !0),
+ ]))
+ : f(``, !0),
+ ]),
+ ])
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-9852b244`]]
+ ),
+ Ie = {key: 2, class: `flex gap-1 items-center`},
+ Le = {key: 0},
+ Re = {key: 3, class: `flex gap-1 items-center`},
+ ze = {key: 0},
+ Be = i({
+ __name: `PluginStatus`,
+ props: {plugin: {}},
+ setup(t) {
+ return (n, r) =>
+ t.plugin.isEnabled
+ ? (s(),
+ D(
+ A,
+ {key: 0, variant: `success`},
+ {default: u(() => [T(C(g(e)(`Installed`)), 1)]), _: 1}
+ ))
+ : t.plugin.isComposerInstalled
+ ? t.plugin.isInstalled
+ ? (s(),
+ E(`div`, Ie, [
+ c(
+ A,
+ {variant: `warning`},
+ {default: u(() => [T(C(g(e)(`Disabled`)), 1)]), _: 1}
+ ),
+ t.plugin.isForceDisabled
+ ? (s(),
+ E(
+ `craft-info-icon`,
+ Le,
+ C(
+ g(e)(
+ `{plugin} is disabled by the {setting} config setting.`,
+ {plugin: t.plugin.name, setting: `disabledPlugins`}
+ )
+ ),
+ 1
+ ))
+ : f(``, !0),
+ ]))
+ : (s(),
+ E(`div`, Re, [
+ c(A, null, {
+ default: u(() => [T(C(g(e)(`Not Installed`)), 1)]),
+ _: 1,
+ }),
+ t.plugin.isForceDisabled
+ ? (s(),
+ E(
+ `craft-info-icon`,
+ ze,
+ C(
+ g(e)(
+ `{plugin} can’t be installed due to the {setting} config setting.`,
+ {plugin: t.plugin.name, setting: `disabledPlugins`}
+ )
+ ),
+ 1
+ ))
+ : f(``, !0),
+ ]))
+ : (s(),
+ D(
+ A,
+ {key: 1},
+ {default: u(() => [T(C(g(e)(`Missing`)), 1)]), _: 1}
+ ));
+ },
+ }),
+ J = (e) => ({url: J.url(e), method: `post`});
+((J.definition = {methods: [`post`], url: `/admin/actions/pluginstore/remove`}),
+ (J.url = (e) => J.definition.url + j(e)),
+ (J.post = (e) => ({url: J.url(e), method: `post`})));
+var Y = (e) => ({url: Y.url(e), method: `post`});
+((Y.definition = {
+ methods: [`post`],
+ url: `/admin/actions/pluginstore/remove/precheck`,
+}),
+ (Y.url = (e) => Y.definition.url + j(e)),
+ (Y.post = (e) => ({url: Y.url(e), method: `post`})));
+var X = (e) => ({url: X.url(e), method: `post`});
+((X.definition = {
+ methods: [`post`],
+ url: `/admin/actions/pluginstore/remove/recheck-composer`,
+}),
+ (X.url = (e) => X.definition.url + j(e)),
+ (X.post = (e) => ({url: X.url(e), method: `post`})));
+var Z = (e) => ({url: Z.url(e), method: `post`});
+((Z.definition = {
+ methods: [`post`],
+ url: `/admin/actions/pluginstore/remove/composer-install`,
+}),
+ (Z.url = (e) => Z.definition.url + j(e)),
+ (Z.post = (e) => ({url: Z.url(e), method: `post`})));
+var Q = (e) => ({url: Q.url(e), method: `post`});
+((Q.definition = {
+ methods: [`post`],
+ url: `/admin/actions/pluginstore/remove/composer-remove`,
+}),
+ (Q.url = (e) => Q.definition.url + j(e)),
+ (Q.post = (e) => ({url: Q.url(e), method: `post`})));
+var $ = (e) => ({url: $.url(e), method: `post`});
+(($.definition = {
+ methods: [`post`],
+ url: `/admin/actions/pluginstore/remove/finish`,
+}),
+ ($.url = (e) => $.definition.url + j(e)),
+ ($.post = (e) => ({url: $.url(e), method: `post`})));
+var Ve = {
+ index: J,
+ precheck: Y,
+ recheckComposer: X,
+ composerInstall: Z,
+ composerRemove: Q,
+ finish: $,
+ },
+ He = i({
+ __name: `PluginActionMenu`,
+ props: {plugin: {}},
+ setup(t) {
+ let n = t,
+ r = d(() => {
+ let t = [
+ {
+ icon: `clipboard`,
+ label: e(`Copy plugin handle`),
+ action: {type: `clipboard`, value: n.plugin.handle},
+ feedback: {success: {message: e(`Copied!`)}},
+ },
+ {
+ icon: `clipboard`,
+ label: e(`Copy package name`),
+ action: {type: `clipboard`, value: n.plugin.packageName},
+ feedback: {success: {message: e(`Copied!`)}},
+ },
+ {type: `hr`},
+ ];
+ return (
+ n.plugin.isInstalled
+ ? n.plugin.isEnabled
+ ? (t.push({
+ icon: `circle-dashed`,
+ label: e(`Disable`),
+ action: {
+ type: `http`,
+ url: z().url,
+ body: {pluginHandle: n.plugin.handle},
+ },
+ }),
+ t.push({
+ icon: `xmark`,
+ label: e(`Uninstall`),
+ variant: `danger`,
+ action: {
+ type: `http`,
+ url: L().url,
+ body: {pluginHandle: n.plugin.handle},
+ confirm: e(
+ `Are you sure you want to uninstall {plugin}? You will lose all of its associated data.`,
+ {plugin: n.plugin.name}
+ ),
+ },
+ }))
+ : t.push({
+ icon: `circle`,
+ label: e(`Enable`),
+ action: {
+ type: `http`,
+ url: B().url,
+ body: {pluginHandle: n.plugin.handle},
+ },
+ disabled: n.plugin.isForceDisabled,
+ })
+ : (t.push({
+ icon: `plus`,
+ label: e(`Install`),
+ action: {
+ type: `http`,
+ url: I().url,
+ body: {pluginHandle: n.plugin.handle},
+ },
+ disabled: n.plugin.isForceDisabled,
+ }),
+ t.push({
+ icon: `minus`,
+ label: e(`Remove`),
+ variant: `danger`,
+ action: {
+ type: `event`,
+ name: `action:remove-plugin`,
+ confirm: e(`Are you sure you want to remove {plugin}?`, {
+ plugin: n.plugin.name,
+ }),
+ detail: {packageName: n.plugin.packageName},
+ },
+ })),
+ t
+ );
+ });
+ function i(e) {
+ let {detail: t} = e;
+ h.post(Ve.index(), {packageName: t.packageName});
+ }
+ return (
+ a(() => {
+ window.addEventListener(`action:remove-plugin`, i);
+ }),
+ (e, t) => (s(), D(se, {actions: r.value}, null, 8, [`actions`]))
+ );
+ },
+ }),
+ Ue = i({
+ __name: `PluginsList`,
+ props: {pluginInfo: {}, readOnly: {type: Boolean}},
+ setup(t) {
+ let n = t,
+ r = d(() =>
+ Object.entries(n.pluginInfo).map(([e, t]) => ({...t, handle: e}))
+ ),
+ i = P(),
+ a = te({
+ state: {
+ get columnVisibility() {
+ return {details: !0, status: !0, actions: !n.readOnly};
+ },
+ },
+ get columns() {
+ return [
+ i.display({
+ id: `details`,
+ header: e(`Plugin`),
+ cell: ({row: e}) => v(Fe, {plugin: e.original}),
+ }),
+ i.display({
+ id: `status`,
+ header: e(`Status`),
+ meta: {trackSize: `minmax(280px, 20%)`},
+ cell: ({row: e}) => v(Be, {plugin: e.original}),
+ }),
+ i.actions(({row: e}) => [v(He, {plugin: e.original})], {
+ meta: {trackSize: `60px`},
+ }),
+ ];
+ },
+ get data() {
+ return r.value;
+ },
+ getCoreRowModel: ne(),
+ });
+ function o(e) {
+ e.detail?.state === `success` &&
+ e.detail?.actionType === `http` &&
+ h.visit(H(), {only: [`pluginInfo`]});
+ }
+ return (t, n) => (
+ s(),
+ D(
+ ae,
+ {appearance: `raised`, padding: 0},
+ {
+ default: u(() => [
+ c(
+ re,
+ {table: g(a), 'onAction:changeState': o},
+ {
+ 'empty-row': u(() => [
+ c(
+ ie,
+ {
+ icon: `plugin`,
+ label: g(e)(`There are no available plugins.`),
+ },
+ null,
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`]
+ ),
+ ]),
+ _: 1,
+ }
+ )
+ );
+ },
+ }),
+ We = i({
+ __name: `Plugins`,
+ props: {
+ pluginInfo: {default: () => ({})},
+ readOnly: {type: Boolean, default: !1},
+ },
+ setup(e) {
+ let t = e,
+ {data: n} = N(`cms-licenses`),
+ r = m({}),
+ i = d(() => n.value?.license.pluginLicenses || []),
+ a = p({pluginLicenses: i.value});
+ o(i, () => {
+ a.post(K.getLicenseInfo().url, {
+ onSuccess: (e) => {
+ r.value = e;
+ },
+ });
+ });
+ let l = d(() =>
+ Object.fromEntries(
+ Object.entries(t.pluginInfo).map(([e, t]) => [
+ e,
+ {...t, ...(r.value[e] || {})},
+ ])
+ )
+ );
+ return (t, n) => (
+ s(),
+ D(ce, null, {
+ default: u(() => [
+ c(Ue, {'read-only': e.readOnly, 'plugin-info': l.value}, null, 8, [
+ `read-only`,
+ `plugin-info`,
+ ]),
+ ]),
+ _: 1,
+ })
+ );
+ },
+ });
+export {We as default};
diff --git a/resources/build/assets/RoutesController-u0nRHqnp.js b/resources/build/assets/RoutesController-u0nRHqnp.js
new file mode 100644
index 00000000000..1876f51f904
--- /dev/null
+++ b/resources/build/assets/RoutesController-u0nRHqnp.js
@@ -0,0 +1,63 @@
+import {n as e, t} from './wayfinder-V597ZF_3.js';
+var n = (e) => ({url: n.url(e), method: `get`});
+((n.definition = {methods: [`get`, `head`], url: `/admin/settings/routes`}),
+ (n.url = (t) => n.definition.url + e(t)),
+ (n.get = (e) => ({url: n.url(e), method: `get`})),
+ (n.head = (e) => ({url: n.url(e), method: `head`})));
+var r = (e, t) => ({url: r.url(e, t), method: `get`});
+((r.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/routes/{uid}`,
+}),
+ (r.url = (n, i) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {uid: n}),
+ Array.isArray(n) && (n = {uid: n[0]}),
+ (n = t(n)));
+ let a = {uid: n.uid};
+ return (
+ r.definition.url.replace(`{uid}`, a.uid.toString()).replace(/\/+$/, ``) +
+ e(i)
+ );
+ }),
+ (r.get = (e, t) => ({url: r.url(e, t), method: `get`})),
+ (r.head = (e, t) => ({url: r.url(e, t), method: `head`})));
+var i = (e) => ({url: i.url(e), method: `get`});
+((i.definition = {methods: [`get`, `head`], url: `/admin/settings/routes/new`}),
+ (i.url = (t) => i.definition.url + e(t)),
+ (i.get = (e) => ({url: i.url(e), method: `get`})),
+ (i.head = (e) => ({url: i.url(e), method: `head`})));
+var a = (e) => ({url: a.url(e), method: `post`});
+((a.definition = {methods: [`post`], url: `/admin/settings/routes`}),
+ (a.url = (t) => a.definition.url + e(t)),
+ (a.post = (e) => ({url: a.url(e), method: `post`})));
+var o = (e, t) => ({url: o.url(e, t), method: `patch`});
+((o.definition = {methods: [`patch`], url: `/admin/settings/routes/{uid}`}),
+ (o.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {uid: n}),
+ Array.isArray(n) && (n = {uid: n[0]}),
+ (n = t(n)));
+ let i = {uid: n.uid};
+ return (
+ o.definition.url.replace(`{uid}`, i.uid.toString()).replace(/\/+$/, ``) +
+ e(r)
+ );
+ }),
+ (o.patch = (e, t) => ({url: o.url(e, t), method: `patch`})));
+var s = (e, t) => ({url: s.url(e, t), method: `delete`});
+((s.definition = {methods: [`delete`], url: `/admin/settings/routes/{uid}`}),
+ (s.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {uid: n}),
+ Array.isArray(n) && (n = {uid: n[0]}),
+ (n = t(n)));
+ let i = {uid: n.uid};
+ return (
+ s.definition.url.replace(`{uid}`, i.uid.toString()).replace(/\/+$/, ``) +
+ e(r)
+ );
+ }),
+ (s.delete = (e, t) => ({url: s.url(e, t), method: `delete`})));
+var c = (e) => ({url: c.url(e), method: `post`});
+((c.definition = {methods: [`post`], url: `/admin/settings/routes/reorder`}),
+ (c.url = (t) => c.definition.url + e(t)),
+ (c.post = (e) => ({url: c.url(e), method: `post`})));
+export {a, c as i, s as n, o, r, i as t};
diff --git a/resources/build/assets/Schemas-BYHoOA8K.js b/resources/build/assets/Schemas-BYHoOA8K.js
new file mode 100644
index 00000000000..faec643dd5f
--- /dev/null
+++ b/resources/build/assets/Schemas-BYHoOA8K.js
@@ -0,0 +1,168 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ gt as a,
+ ht as o,
+ k as s,
+ tt as c,
+ w as l,
+ y as u,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as d, o as f, t as p} from './AdminTable-32qWVDq-.js';
+import {t as m} from './Pane-CJi1MPPH.js';
+import {s as h} from './InlineFlash-DnK6Yp2V.js';
+import {n as g, t as _} from './wayfinder-V597ZF_3.js';
+import {t as v} from './DeleteButton-BLk4eDvl.js';
+import {t as y} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as b} from './AppLayout-BXGMFlSp.js';
+var x = (e) => ({url: x.url(e), method: `post`});
+((x.definition = {
+ methods: [`post`],
+ url: `/admin/actions/graphql/save-schema`,
+}),
+ (x.url = (e) => x.definition.url + g(e)),
+ (x.post = (e) => ({url: x.url(e), method: `post`})));
+var S = (e) => ({url: S.url(e), method: `post`});
+((S.definition = {
+ methods: [`post`],
+ url: `/admin/actions/graphql/save-public-schema`,
+}),
+ (S.url = (e) => S.definition.url + g(e)),
+ (S.post = (e) => ({url: S.url(e), method: `post`})));
+var C = (e) => ({url: C.url(e), method: `get`});
+((C.definition = {methods: [`get`, `head`], url: `/admin/graphql/schemas`}),
+ (C.url = (e) => C.definition.url + g(e)),
+ (C.get = (e) => ({url: C.url(e), method: `get`})),
+ (C.head = (e) => ({url: C.url(e), method: `head`})));
+var w = (e) => ({url: w.url(e), method: `get`});
+((w.definition = {methods: [`get`, `head`], url: `/admin/graphql/schemas/new`}),
+ (w.url = (e) => w.definition.url + g(e)),
+ (w.get = (e) => ({url: w.url(e), method: `get`})),
+ (w.head = (e) => ({url: w.url(e), method: `head`})));
+var T = (e) => ({url: T.url(e), method: `get`});
+((T.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/graphql/schemas/public`,
+}),
+ (T.url = (e) => T.definition.url + g(e)),
+ (T.get = (e) => ({url: T.url(e), method: `get`})),
+ (T.head = (e) => ({url: T.url(e), method: `head`})));
+var E = (e, t) => ({url: E.url(e, t), method: `get`});
+((E.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/graphql/schemas/{schemaId}`,
+}),
+ (E.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {schemaId: e}),
+ Array.isArray(e) && (e = {schemaId: e[0]}),
+ (e = _(e)));
+ let n = {schemaId: e.schemaId};
+ return (
+ E.definition.url
+ .replace(`{schemaId}`, n.schemaId.toString())
+ .replace(/\/+$/, ``) + g(t)
+ );
+ }),
+ (E.get = (e, t) => ({url: E.url(e, t), method: `get`})),
+ (E.head = (e, t) => ({url: E.url(e, t), method: `head`})));
+var D = (e, t) => ({url: D.url(e, t), method: `delete`});
+((D.definition = {
+ methods: [`delete`],
+ url: `/admin/graphql/schemas/{schemaId}`,
+}),
+ (D.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {schemaId: e}),
+ Array.isArray(e) && (e = {schemaId: e[0]}),
+ (e = _(e)));
+ let n = {schemaId: e.schemaId};
+ return (
+ D.definition.url
+ .replace(`{schemaId}`, n.schemaId.toString())
+ .replace(/\/+$/, ``) + g(t)
+ );
+ }),
+ (D.delete = (e, t) => ({url: D.url(e, t), method: `delete`})));
+var O = t({
+ __name: `Schemas`,
+ props: {schemas: {}, readOnly: {type: Boolean}},
+ setup(t) {
+ let g = t;
+ function _(t) {
+ confirm(
+ e(`Are you sure you want to delete the “{name}” schema?`, {
+ name: t.name,
+ })
+ ) && a.delete(D(t.id));
+ }
+ let x = y(),
+ S = d({
+ get columns() {
+ return [
+ x.link(`name`, {
+ props: ({row: e}) => ({
+ href: e.original.isPublic ? T() : E(e.original.id).url,
+ inertia: !1,
+ }),
+ header: e(`Name`),
+ }),
+ x.display({
+ id: `scope`,
+ header: e(`Scope`),
+ cell: ({row: e}) => e.original.scope.join(`, `),
+ }),
+ x.display({
+ id: `public`,
+ header: e(`Public`),
+ cell: ({row: e}) => (e.original.isPublic ? `Yes` : `No`),
+ }),
+ x.actions(({row: e}) => [
+ e.original.isPublic ? null : s(v, {onClick: () => _(e.original)}),
+ ]),
+ ];
+ },
+ get data() {
+ return g.schemas;
+ },
+ state: {
+ get columnVisibility() {
+ return {name: !0, public: !0, actions: !g.readOnly};
+ },
+ },
+ enableSorting: !1,
+ getCoreRowModel: f(),
+ });
+ return (t, a) => (
+ n(),
+ u(b, null, {
+ actions: i(() => [
+ r(
+ h,
+ {
+ href: o(w).url(),
+ icon: `plus`,
+ inertia: !1,
+ appearance: `button`,
+ variant: `accent`,
+ },
+ {default: i(() => [l(c(o(e)(`New schema`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ default: i(() => [
+ r(
+ m,
+ {padding: 0, appearance: `raised`},
+ {default: i(() => [r(p, {table: o(S)}, null, 8, [`table`])]), _: 1}
+ ),
+ ]),
+ _: 1,
+ })
+ );
+ },
+});
+export {O as default};
diff --git a/resources/build/assets/Sections-C-mfNb_4.js b/resources/build/assets/Sections-C-mfNb_4.js
new file mode 100644
index 00000000000..343d700e511
--- /dev/null
+++ b/resources/build/assets/Sections-C-mfNb_4.js
@@ -0,0 +1,240 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ b as a,
+ ct as o,
+ gt as s,
+ ht as c,
+ k as l,
+ p as u,
+ s as d,
+ tt as f,
+ v as p,
+ w as m,
+ x as h,
+ y as g,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as _, o as v, t as y} from './AdminTable-32qWVDq-.js';
+import {t as b} from './Pane-CJi1MPPH.js';
+import {s as x} from './InlineFlash-DnK6Yp2V.js';
+import {i as S} from './wayfinder-V597ZF_3.js';
+import {t as C} from './createCraftColumnHelper-ssekFPQZ.js';
+import {n as w, t as T} from './AppLayout-BXGMFlSp.js';
+import {n as E, r as D, t as O} from './useServerSort-DgkJYi_Z.js';
+import {i as k, n as A, r as j, t as M} from './SectionsController-BNRww-4W.js';
+var N = [`loading`],
+ P = [`label`],
+ F = t({
+ __name: `DeleteSectionButton`,
+ props: {section: {}},
+ setup(t) {
+ let r = t,
+ i = d({id: r.section.id});
+ function a() {
+ confirm(
+ e(`Are you sure you want to delete “{name}” and all its entries?`, {
+ name: r.section.name,
+ })
+ ) && i.submit(A());
+ }
+ return (t, r) => (
+ n(),
+ h(
+ `form`,
+ {onSubmit: u(a, [`prevent`]), method: `post`},
+ [
+ p(
+ `craft-button`,
+ {
+ variant: `danger`,
+ type: `submit`,
+ size: `small`,
+ icon: ``,
+ appearance: `plain`,
+ loading: c(i).processing,
+ },
+ [
+ p(
+ `craft-icon`,
+ {label: c(e)(`Delete section`), name: `x`},
+ null,
+ 8,
+ P
+ ),
+ ],
+ 8,
+ N
+ ),
+ ],
+ 32
+ )
+ );
+ },
+ }),
+ I = t({
+ __name: `Sections`,
+ props: {
+ title: {},
+ data: {},
+ pagination: {},
+ sort: {},
+ searchTerm: {},
+ emptyMessage: {},
+ },
+ setup(t) {
+ let u = t,
+ {readOnly: d} = S(),
+ h = o(u.searchTerm ?? ``),
+ A = C(),
+ N = o([
+ A.accessor(`name`, {
+ header: e(`Name`),
+ cell: ({row: e, getValue: t}) =>
+ l(
+ `a`,
+ {
+ class: `font-bold`,
+ href: j[`/admin/settings/sections/{section}`](e.original.id)
+ .url,
+ },
+ t()
+ ),
+ }),
+ A.accessor(`handle`, {
+ header: e(`Handle`),
+ cell: ({getValue: e}) =>
+ l(`craft-copy-attribute`, {value: e()}, e()),
+ }),
+ A.accessor(`type`, {header: e(`Type`)}),
+ A.actions(({row: e}) => [l(F, {section: e.original})]),
+ ]),
+ {paginationState: P, paginationConfig: I} = D({
+ initialState: u.pagination,
+ onChange: ({query: e}) => {
+ s.visit(k({query: e}), {
+ only: [`data`, `pagination`],
+ preserveScroll: !0,
+ });
+ },
+ }),
+ {sortingState: L, sortingConfig: R} = O({
+ initialState: u.sort,
+ onChange: ({query: e}) => {
+ s.visit(k({query: e}), {
+ only: [`data`, `sort`],
+ preserveScroll: !0,
+ });
+ },
+ }),
+ z = _({
+ get data() {
+ return u.data;
+ },
+ get columns() {
+ return N.value;
+ },
+ getCoreRowModel: v(),
+ state: {
+ get pagination() {
+ return P.value;
+ },
+ get sorting() {
+ return L.value;
+ },
+ get columnVisibility() {
+ return {actions: !d};
+ },
+ },
+ ...I,
+ ...R,
+ });
+ return (o, s) => (
+ n(),
+ g(
+ T,
+ {title: t.title},
+ {
+ actions: i(() => [
+ c(d)
+ ? a(``, !0)
+ : (n(),
+ g(
+ x,
+ {
+ key: 0,
+ as: `craft-button`,
+ variant: `accent`,
+ href: c(M)(),
+ },
+ {
+ default: i(() => [
+ (s[1] ||= p(
+ `craft-icon`,
+ {name: `plus`, slot: `prefix`},
+ null,
+ -1
+ )),
+ m(` ` + f(c(e)(`New section`)), 1),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ )),
+ ]),
+ default: i(() => [
+ c(d) ? (n(), g(w, {key: 0})) : a(``, !0),
+ r(
+ b,
+ {padding: 0, appearance: `raised`},
+ {
+ default: i(() => [
+ r(
+ y,
+ {
+ spacing: `relaxed`,
+ title: t.title,
+ table: c(z),
+ reorderable: !1,
+ from: t.pagination.from,
+ to: t.pagination.to,
+ total: t.pagination.total,
+ 'enable-adjust-page-size': !0,
+ },
+ {
+ 'search-form': i(() => [
+ r(
+ E,
+ {
+ action: c(k)(),
+ modelValue: h.value,
+ 'onUpdate:modelValue': (s[0] ||= (e) =>
+ (h.value = e)),
+ },
+ null,
+ 8,
+ [`action`, `modelValue`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `table`, `from`, `to`, `total`]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`]
+ )
+ );
+ },
+ });
+export {I as default};
diff --git a/resources/build/assets/SectionsController-BNRww-4W.js b/resources/build/assets/SectionsController-BNRww-4W.js
new file mode 100644
index 00000000000..3b34a04a499
--- /dev/null
+++ b/resources/build/assets/SectionsController-BNRww-4W.js
@@ -0,0 +1,82 @@
+import {n as e, t} from './wayfinder-V597ZF_3.js';
+var n = (e) => ({url: n.url(e), method: `get`});
+((n.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/actions/sections/table-data`,
+}),
+ (n.url = (t) => n.definition.url + e(t)),
+ (n.get = (e) => ({url: n.url(e), method: `get`})),
+ (n.head = (e) => ({url: n.url(e), method: `head`})));
+var r = (e, t) => ({url: r.url(e, t), method: `get`});
+((r.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/actions/sections/edit/{section}`,
+}),
+ (r.url = (n, i) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {section: n}),
+ typeof n == `object` &&
+ !Array.isArray(n) &&
+ `id` in n &&
+ (n = {section: n.id}),
+ Array.isArray(n) && (n = {section: n[0]}),
+ (n = t(n)));
+ let a = {section: typeof n.section == `object` ? n.section.id : n.section};
+ return (
+ r.definition.url
+ .replace(`{section}`, a.section.toString())
+ .replace(/\/+$/, ``) + e(i)
+ );
+ }),
+ (r.get = (e, t) => ({url: r.url(e, t), method: `get`})),
+ (r.head = (e, t) => ({url: r.url(e, t), method: `head`})));
+var i = (e, t) => ({url: i.url(e, t), method: `get`});
+((i.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/sections/{section}`,
+}),
+ (i.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {section: n}),
+ typeof n == `object` &&
+ !Array.isArray(n) &&
+ `id` in n &&
+ (n = {section: n.id}),
+ Array.isArray(n) && (n = {section: n[0]}),
+ (n = t(n)));
+ let a = {section: typeof n.section == `object` ? n.section.id : n.section};
+ return (
+ i.definition.url
+ .replace(`{section}`, a.section.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (i.get = (e, t) => ({url: i.url(e, t), method: `get`})),
+ (i.head = (e, t) => ({url: i.url(e, t), method: `head`})));
+var a = {
+ '/admin/actions/sections/edit/{section}': r,
+ '/admin/settings/sections/{section}': i,
+ },
+ o = (e) => ({url: o.url(e), method: `post`});
+((o.definition = {
+ methods: [`post`],
+ url: `/admin/actions/sections/delete-section`,
+}),
+ (o.url = (t) => o.definition.url + e(t)),
+ (o.post = (e) => ({url: o.url(e), method: `post`})));
+var s = (e) => ({url: s.url(e), method: `get`});
+((s.definition = {methods: [`get`, `head`], url: `/admin/settings/sections`}),
+ (s.url = (t) => s.definition.url + e(t)),
+ (s.get = (e) => ({url: s.url(e), method: `get`})),
+ (s.head = (e) => ({url: s.url(e), method: `head`})));
+var c = (e) => ({url: c.url(e), method: `get`});
+((c.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/sections/new`,
+}),
+ (c.url = (t) => c.definition.url + e(t)),
+ (c.get = (e) => ({url: c.url(e), method: `get`})),
+ (c.head = (e) => ({url: c.url(e), method: `head`})));
+var l = (e) => ({url: l.url(e), method: `post`});
+((l.definition = {methods: [`post`], url: `/admin/sections/sections`}),
+ (l.url = (t) => l.definition.url + e(t)),
+ (l.post = (e) => ({url: l.url(e), method: `post`})));
+export {l as a, s as i, o as n, a as r, c as t};
diff --git a/resources/build/assets/SectionsEdit-C4v97RkN.js b/resources/build/assets/SectionsEdit-C4v97RkN.js
new file mode 100644
index 00000000000..e80369bcc5b
--- /dev/null
+++ b/resources/build/assets/SectionsEdit-C4v97RkN.js
@@ -0,0 +1,1510 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {a as t, i as n, n as r, t as i} from './cp-npqTfNqh.js';
+import {
+ B as a,
+ E as o,
+ J as s,
+ N as c,
+ Q as l,
+ R as u,
+ T as d,
+ V as f,
+ X as p,
+ _ as m,
+ b as h,
+ ct as g,
+ et as _,
+ gt as v,
+ ht as y,
+ k as b,
+ l as x,
+ m as S,
+ q as C,
+ s as w,
+ t as T,
+ tt as E,
+ v as D,
+ w as O,
+ x as k,
+ y as A,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {n as j, r as M, t as N} from './AdminTable-32qWVDq-.js';
+import {r as P} from './Empty-D0VMu5kQ.js';
+import {n as F} from './Select-uUcGssK_.js';
+import {t as I} from './Pane-CJi1MPPH.js';
+import {i as L} from './wayfinder-V597ZF_3.js';
+import {t as R} from './DeleteButton-BLk4eDvl.js';
+import {t as z} from './CraftInput-B2G9EaE3.js';
+import {r as B, t as V} from './AppLayout-BXGMFlSp.js';
+import {n as H, t as U} from './useEditableTable-DGQ7vq0w.js';
+import {t as ee} from './useSettingsSave-D5LL4sJi.js';
+import {a as te, n as ne, t as W} from './EntryTypesController-BmQTZRaT.js';
+import {a as G} from './SectionsController-BNRww-4W.js';
+import {t as K} from './CraftInputHandle-ByI6zEIo.js';
+import {t as q} from './useReorderableItems-CU0T2zos.js';
+import {t as J} from './useInputGenerator-Cl1F0ZZS.js';
+var Y = [`id`],
+ X = [`name`],
+ Z = [`placement`, `for`],
+ re = o({
+ __name: `Tooltip`,
+ props: {
+ id: {
+ default: () => `tooltip-${Math.random().toString(36).substring(2, 9)}`,
+ },
+ icon: {default: `circle-info`},
+ placement: {default: `top`},
+ },
+ setup(e) {
+ return (t, n) => (
+ u(),
+ k(
+ S,
+ null,
+ [
+ D(
+ `craft-button`,
+ {
+ type: `button`,
+ id: e.id,
+ appearance: `plain`,
+ size: `zero`,
+ icon: ``,
+ variant: `inherit`,
+ },
+ [
+ f(t.$slots, `icon`, {}, () => [
+ D(`craft-icon`, {name: e.icon}, null, 8, X),
+ ]),
+ ],
+ 8,
+ Y
+ ),
+ D(
+ `c-tooltip`,
+ {placement: e.placement, for: e.id},
+ [f(t.$slots, `default`)],
+ 8,
+ Z
+ ),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ ie = [`data-color`, `data-id`],
+ ae = {class: `grid gap-1 justify-items-start`},
+ oe = {class: `flex gap-1`},
+ se = {class: `font-bold`},
+ ce = {class: `cp-code`},
+ le = {key: 0},
+ ue = [`name`, `label`],
+ de = {slot: `suffix`, class: `flex gap-0.5 items-center`},
+ fe = T(
+ o({
+ __name: `EntryTypeChip`,
+ props: {
+ name: {},
+ id: {},
+ handle: {},
+ color: {},
+ icon: {},
+ description: {},
+ indicators: {},
+ actions: {},
+ draggable: {type: Boolean, default: !1},
+ },
+ emits: [`handle-ref`],
+ setup(e, {emit: t}) {
+ let n = t,
+ r = g(null);
+ return (
+ s(
+ r,
+ (e) => {
+ n(`handle-ref`, e);
+ },
+ {immediate: !0}
+ ),
+ (t, n) => (
+ u(),
+ k(
+ `craft-chip`,
+ {
+ 'data-color':
+ (e.color && typeof e.color != `string`
+ ? e.color.value
+ : e.color) ?? `white`,
+ 'data-id': e.id,
+ },
+ [
+ e.icon
+ ? (u(),
+ k(
+ `craft-icon`,
+ c({key: 0, slot: `icon`}, e.icon),
+ null,
+ 16
+ ))
+ : h(``, !0),
+ D(`div`, ae, [
+ D(`div`, oe, [
+ D(`div`, se, E(e.name), 1),
+ e.description
+ ? (u(),
+ A(
+ re,
+ {key: 0},
+ {default: p(() => [O(E(e.description), 1)]), _: 1}
+ ))
+ : h(``, !0),
+ ]),
+ D(`div`, ce, E(e.handle), 1),
+ e.indicators
+ ? (u(),
+ k(`div`, le, [
+ (u(!0),
+ k(
+ S,
+ null,
+ a(
+ e.indicators,
+ (e) => (
+ u(),
+ k(
+ `craft-icon`,
+ {
+ key: e.icon,
+ name: e.icon,
+ label: e.label,
+ style: _({color: e.iconColor}),
+ },
+ null,
+ 12,
+ ue
+ )
+ )
+ ),
+ 128
+ )),
+ ]))
+ : h(``, !0),
+ ]),
+ D(`div`, de, [
+ e.actions
+ ? (u(),
+ A(B, {key: 0, actions: e.actions}, null, 8, [`actions`]))
+ : h(``, !0),
+ e.draggable
+ ? (u(),
+ k(
+ `span`,
+ {
+ key: 1,
+ ref_key: `handleRef`,
+ ref: r,
+ class: `drag-handle`,
+ },
+ [
+ f(
+ t.$slots,
+ `drag-handle`,
+ {},
+ () => [d(P, {variant: `inherit`})],
+ !0
+ ),
+ ],
+ 512
+ ))
+ : h(``, !0),
+ ]),
+ ],
+ 8,
+ ie
+ )
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-1ce6a7e9`]]
+ ),
+ pe = o({
+ __name: `CreateEntryTypeButton`,
+ emits: [`success`],
+ setup(t, {emit: n}) {
+ let r = n,
+ i = C(`invoker`);
+ function a() {
+ let e = new Craft.CpScreenSlideout(
+ ne[`/admin/settings/entry-types/new`]().url
+ );
+ (e.on(`submit`, () => {
+ r(`success`);
+ }),
+ e.on(`close`, () => {
+ i.value?.focus();
+ }));
+ }
+ function o() {
+ a();
+ }
+ return (t, n) => (
+ u(),
+ k(
+ `craft-button`,
+ {
+ type: `button`,
+ appearance: `filled`,
+ onClick: o,
+ ref_key: `invoker`,
+ ref: i,
+ },
+ [
+ (n[0] ||= D(
+ `craft-icon`,
+ {name: `plus`, slot: `prefix`},
+ null,
+ -1
+ )),
+ O(` ` + E(y(e)(`Create`)), 1),
+ ],
+ 512
+ )
+ );
+ },
+ }),
+ Q = T(
+ o({
+ __name: `DragShadow`,
+ props: {height: {}, position: {}},
+ setup(e) {
+ return (t, n) =>
+ e.height
+ ? (u(),
+ k(
+ `div`,
+ {
+ key: 0,
+ class: l([
+ `drag-shadow`,
+ `drag-shadow--${e.position ?? `bottom`}`,
+ ]),
+ style: _({height: `${e.height}px`}),
+ },
+ null,
+ 6
+ ))
+ : h(``, !0);
+ },
+ }),
+ [[`__scopeId`, `data-v-80709fe3`]]
+ ),
+ me = {class: `entry-type-list`},
+ he = {class: `flex gap-2 mt-3 items-center`},
+ ge = {key: 0},
+ _e = {key: 0, type: `button`, slot: `invoker`, appearance: `filled`},
+ ve = {slot: `content`},
+ ye = {class: `p-2`},
+ be = {key: 0, class: `p-2`},
+ xe = [`onClick`, `icon`, `checked`, `data-color`],
+ Se = T(
+ o({
+ __name: `EntryTypeSelect`,
+ props: {modelValue: {}, entryTypes: {}, actions: {}},
+ emits: [`update:modelValue`],
+ setup(t, {emit: n}) {
+ let o = n,
+ s = t,
+ {readOnly: c} = L(),
+ f = g(``),
+ _ = m(() =>
+ s.entryTypes?.filter(
+ (e) => e.name.includes(f.value) || e.handle.includes(f.value)
+ )
+ );
+ function b(e, t) {
+ let n = [...s.modelValue],
+ [r] = n.splice(e, 1);
+ r !== void 0 && (n.splice(t, 0, r), o(`update:modelValue`, n));
+ }
+ function x(e) {
+ return e === 0
+ ? `first`
+ : e === s.modelValue.length - 1
+ ? `last`
+ : `middle`;
+ }
+ let {
+ setItemRef: C,
+ setHandleRef: w,
+ getDragState: T,
+ getDropState: M,
+ } = q({
+ getItemIds: () => s.modelValue.map((e) => e.id),
+ onReorder: b,
+ enabled: () => s.modelValue.length > 1,
+ });
+ function N(e) {
+ let t = M(e);
+ return t.type === `is-over` ? t : null;
+ }
+ function F(e) {
+ s.modelValue.find((t) => t.id === e.id)
+ ? I(e.id)
+ : o(`update:modelValue`, [...s.modelValue, e]);
+ }
+ function I(e) {
+ o(`update:modelValue`, [...s.modelValue.filter((t) => t.id !== e)]);
+ }
+ let R = g(void 0),
+ B = g({});
+ function V(t, {namespace: n = ``, id: r = null}) {
+ let i = `
+
+
+ ${n ? ` ` : ``}
+ ${r ? ` ` : ``}
+ ${t}
+
+
+
+ `,
+ a = new Craft.Slideout(i, {
+ containerElement: `form`,
+ containerAttributes: {
+ action: W().url,
+ method: `post`,
+ novalidate: ``,
+ class: `entry-type-override-settings`,
+ },
+ }),
+ c = a.$container[0];
+ if (c)
+ return (
+ c.addEventListener(`submit`, async (e) => {
+ e.preventDefault();
+ let t = e.target,
+ n = new FormData(t),
+ r = {
+ id: n.get(`id`),
+ settingsNamespace: n.get(`settingsNamespace`),
+ settings: new URLSearchParams(n).toString(),
+ };
+ try {
+ let {data: e} = await Craft.sendActionRequest(
+ `POST`,
+ W().url,
+ {data: r}
+ );
+ ((B.value = {...B.value, [e.config.id]: e.config}),
+ o(
+ `update:modelValue`,
+ s.modelValue.map((t) =>
+ t.id === e.entryType.id ? {...t, ...e.entryType} : t
+ )
+ ),
+ a.close());
+ } catch (e) {
+ console.error(e);
+ }
+ }),
+ c.querySelectorAll(`[data-action]`).forEach((e) => {
+ e.addEventListener(`click`, (e) => {
+ let t = e.target;
+ if (t)
+ switch (t.dataset.action) {
+ case `close`:
+ a.close();
+ break;
+ }
+ });
+ }),
+ a.on(`close`, () => {
+ a.destroy();
+ }),
+ a
+ );
+ }
+ async function H(e) {
+ try {
+ let t = s.modelValue.find((t) => t.id === e),
+ {data: n} = await Craft.sendActionRequest(`POST`, te().url, {
+ data: {
+ id: e,
+ name: t?.name,
+ handle: t?.handle,
+ description: t?.description,
+ },
+ }),
+ {settingsHtml: a, headHtml: o, bodyHtml: c, namespace: l} = n;
+ ((R.value = V(a, {namespace: l, id: e})),
+ o && (await r(o)),
+ c && (await i(c)),
+ Craft?.initUiElements(R.value?.$container));
+ } catch (e) {
+ throw (Craft.cp?.displayError?.(e?.response?.data?.message), e);
+ }
+ }
+ return (n, r) => (
+ u(),
+ k(
+ S,
+ null,
+ [
+ D(`div`, me, [
+ (u(!0),
+ k(
+ S,
+ null,
+ a(
+ t.modelValue,
+ (n, r) => (
+ u(),
+ k(
+ `div`,
+ {
+ key: n.id,
+ ref_for: !0,
+ ref: (e) => y(C)(e, n.id),
+ class: l([
+ `entry-type-item`,
+ {
+ 'entry-type-item--dragging':
+ y(T)(n.id).type === `is-dragging`,
+ 'entry-type-item--hidden':
+ y(T)(n.id).type === `is-dragging-and-left-self`,
+ },
+ ]),
+ },
+ [
+ N(n.id)?.closestEdge === `top`
+ ? (u(),
+ A(
+ Q,
+ {key: 0, height: N(n.id)?.draggingRect?.height},
+ null,
+ 8,
+ [`height`]
+ ))
+ : h(``, !0),
+ d(
+ fe,
+ {
+ name: n.name,
+ id: n.id,
+ handle: n.handle,
+ color: n.color,
+ icon: n.icon,
+ description: n.description,
+ draggable: t.modelValue.length > 1,
+ indicators: n.indicators,
+ actions: [
+ {
+ label: y(e)(`Settings`),
+ icon: `gear`,
+ onClick: () => H(n.id),
+ },
+ ...(y(c)
+ ? []
+ : [
+ {
+ label: y(e)(`Remove`),
+ variant: `danger`,
+ icon: `x`,
+ onClick: () => I(n.id),
+ },
+ ]),
+ ],
+ onHandleRef: (e) => y(w)(e, n.id),
+ },
+ {
+ 'drag-handle': p(() => [
+ y(c)
+ ? h(``, !0)
+ : (u(),
+ A(
+ P,
+ {
+ key: 0,
+ variant: `inherit`,
+ position: x(r),
+ 'onClick:up': (e) => b(r, r - 1),
+ 'onClick:down': (e) => b(r, r + 1),
+ },
+ null,
+ 8,
+ [`position`, `onClick:up`, `onClick:down`]
+ )),
+ ]),
+ _: 2,
+ },
+ 1032,
+ [
+ `name`,
+ `id`,
+ `handle`,
+ `color`,
+ `icon`,
+ `description`,
+ `draggable`,
+ `indicators`,
+ `actions`,
+ `onHandleRef`,
+ ]
+ ),
+ N(n.id)?.closestEdge === `bottom`
+ ? (u(),
+ A(
+ Q,
+ {key: 1, height: N(n.id)?.draggingRect?.height},
+ null,
+ 8,
+ [`height`]
+ ))
+ : h(``, !0),
+ ],
+ 2
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ D(`div`, he, [
+ t.entryTypes?.length
+ ? (u(),
+ k(`craft-action-menu`, ge, [
+ y(c)
+ ? h(``, !0)
+ : (u(),
+ k(`craft-button`, _e, [
+ (r[2] ||= D(
+ `craft-icon`,
+ {name: `chevron-down`, slot: `prefix`},
+ null,
+ -1
+ )),
+ O(` ` + E(y(e)(`Choose`)), 1),
+ ])),
+ D(`div`, ve, [
+ D(`div`, ye, [
+ d(
+ z,
+ {
+ label: y(e)(`Search`),
+ modelValue: f.value,
+ 'onUpdate:modelValue': (r[0] ||= (e) =>
+ (f.value = e)),
+ 'label-sr-only': ``,
+ },
+ {
+ default: p(() => [
+ ...(r[3] ||= [
+ D(
+ `craft-icon`,
+ {name: `search`, slot: `prefix`},
+ null,
+ -1
+ ),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`, `modelValue`]
+ ),
+ ]),
+ (r[4] ||= D(`hr`, {class: `m-0`}, null, -1)),
+ _.value.length < 1
+ ? (u(),
+ k(`div`, be, [
+ d(
+ j,
+ {
+ template: `No entry types match “{query}”`,
+ params: {query: f.value},
+ },
+ null,
+ 8,
+ [`params`]
+ ),
+ ]))
+ : (u(!0),
+ k(
+ S,
+ {key: 1},
+ a(
+ _.value,
+ (e) => (
+ u(),
+ k(
+ `craft-action-item`,
+ {
+ key: e.id,
+ onClick: (t) => F(e),
+ type: `checkbox`,
+ icon: e.icon ?? `empty`,
+ checked: t.modelValue.find(
+ (t) => t.id === e.id
+ ),
+ 'data-color':
+ (e.color && typeof e.color != `string`
+ ? e.color.value
+ : e.color) ?? `white`,
+ },
+ [
+ D(`div`, null, [
+ O(E(e.name) + ` `, 1),
+ D(`pre`, null, E(e.handle), 1),
+ ]),
+ ],
+ 8,
+ xe
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]))
+ : h(``, !0),
+ y(c)
+ ? h(``, !0)
+ : (u(),
+ A(pe, {
+ key: 1,
+ onSuccess: (r[1] ||= (e) =>
+ y(v).reload({only: [`entryTypes`]})),
+ })),
+ ]),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-6c5576bc`]]
+ ),
+ Ce = o({
+ __name: `SiteSettingsTable`,
+ props: {
+ modelValue: {},
+ selectedType: {},
+ isMultisite: {type: Boolean, default: !1},
+ isHeadless: {type: Boolean, default: !1},
+ },
+ emits: [`update:modelValue`],
+ setup(t, {emit: n}) {
+ let r = n,
+ i = t,
+ a = x(),
+ o = m(() => a.props.homepageUri),
+ s = m(() => a.props.templateOptions),
+ c = m(() => ({
+ name: !0,
+ enabled: i.isMultisite,
+ singleHomepage: i.selectedType === `single`,
+ singleUri: i.selectedType === `single`,
+ uriFormat: i.selectedType !== `single`,
+ template: !i.isHeadless,
+ enabledByDefault: i.selectedType !== `single`,
+ })),
+ {table: l} = U({
+ data: () => i.modelValue,
+ key: `handle`,
+ name: `sites`,
+ columnVisibility: () => c.value,
+ onChange: (e) => r(`update:modelValue`, e),
+ columns: ({columnHelper: t}) => [
+ t.accessor(`name`, {
+ header: e(`Site`),
+ cell: ({getValue: e}) => e(),
+ meta: {cellTag: `th`, trackSize: `0.25fr`},
+ }),
+ t.lightswitch(`enabled`, {
+ header: e(`Enabled`),
+ meta: {
+ trackSize: `80px`,
+ cellClass: `bg-[var(--c-color-neutral-fill-quiet)]`,
+ },
+ label: e(`Enabled`),
+ }),
+ t.checkbox(`singleHomepage`, {
+ header: () =>
+ b(`craft-icon`, {name: `home`, label: e(`Homepage`)}),
+ meta: {
+ trackSize: `44px`,
+ cellClass: `text-center`,
+ headerClass: `justify-center`,
+ },
+ onChange: (e, {row: t}) => {
+ if (e) {
+ let e = {...i.modelValue};
+ ((e[t.original.handle].singleUri = o.value ?? ``),
+ r(`update:modelValue`, e));
+ } else {
+ let e = {...i.modelValue};
+ ((e[t.original.handle].singleUri = ``),
+ r(`update:modelValue`, e));
+ }
+ },
+ disabled: (e) => !e.original.enabled,
+ }),
+ t.text(`singleUri`, {
+ header: e(`URI`),
+ class: `font-mono text-xs`,
+ placeholder: e(`Leave blank if the entry doesn't have a URL`),
+ disabled: (e) => !e.original.enabled || e.original.singleHomepage,
+ meta: {
+ headerTip: e(
+ `What the entry URI should be for the site. Leave blank if the entry doesn’t have a URL.`
+ ),
+ },
+ }),
+ t.text(`uriFormat`, {
+ header: e(`Entry URI Format`),
+ class: `font-mono text-xs`,
+ placeholder: e(`Leave blank if the entry doesn't have a URL`),
+ disabled: (e) => !e.original.enabled,
+ meta: {
+ headerTip: e(
+ `What entry URIs should look like for the site. Leave blank if entries don’t have URLs.`
+ ),
+ },
+ }),
+ t.autocomplete(`template`, {
+ header: e(`Template`),
+ class: `w-full flex-1 font-mono text-xs !px-[var(--_cell-spacing)]`,
+ options: s.value,
+ disabled: (e) => !e.original.enabled,
+ meta: {
+ headerTip: e(
+ `Which template should be loaded when an entry’s URL is requested.`
+ ),
+ },
+ }),
+ t.lightswitch(`enabledByDefault`, {
+ header: e(`Default Status`),
+ meta: {trackSize: `120px`},
+ disabled: (e) => !e.original.enabled,
+ }),
+ ],
+ });
+ return (e, t) => (
+ u(),
+ A(
+ I,
+ {padding: 0, appearance: `raised`},
+ {
+ default: p(() => [
+ d(
+ N,
+ {table: y(l), spacing: y(M).Relaxed, reorderable: !1},
+ null,
+ 8,
+ [`table`, `spacing`]
+ ),
+ ]),
+ _: 1,
+ }
+ )
+ );
+ },
+ }),
+ we = {
+ key: 0,
+ class: `border border-dashed border-neutral-border-quiet rounded-bl-md rounded-br-md border-t-0 p-1 pt-2 -mt-1`,
+ },
+ Te = o({
+ __name: `PreviewTargetsTable`,
+ props: {
+ modelValue: {},
+ name: {default: `previewTargets`},
+ disabled: {type: Boolean, default: !1},
+ },
+ emits: [`update:modelValue`],
+ setup(t, {emit: n}) {
+ let r = n,
+ i = t,
+ {table: a} = U({
+ data: () => i.modelValue,
+ name: i.name,
+ onChange: (e) => r(`update:modelValue`, e),
+ columns: ({columnHelper: t}) => [
+ t.text(`label`, {header: e(`Label`), disabled: () => i.disabled}),
+ t.text(`urlFormat`, {
+ header: e(`URL Format`),
+ class: `font-mono text-xs`,
+ disabled: () => i.disabled,
+ }),
+ t.lightswitch(`refresh`, {
+ header: e(`Auto-Refresh`),
+ disabled: () => i.disabled,
+ }),
+ t.display({
+ id: `actions`,
+ header: e(`Actions`),
+ meta: {headerSrOnly: !0},
+ cell: ({row: e}) =>
+ b(`div`, {class: `flex justify-end gap-2`}, [
+ b(R, {
+ disabled: i.disabled,
+ onClick: () => {
+ let t = [...i.modelValue];
+ (t.splice(e.index, 1), r(`update:modelValue`, t));
+ },
+ }),
+ ]),
+ }),
+ ],
+ });
+ function o() {
+ r(`update:modelValue`, [
+ ...i.modelValue,
+ {label: ``, urlFormat: ``, refresh: !0},
+ ]);
+ }
+ return (n, r) => (
+ u(),
+ k(
+ S,
+ null,
+ [
+ d(
+ I,
+ {padding: 0, appearance: `raised`},
+ {
+ default: p(() => [
+ d(
+ N,
+ {table: y(a), spacing: y(M).Relaxed, reorderable: !1},
+ null,
+ 8,
+ [`table`, `spacing`]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ t.disabled
+ ? h(``, !0)
+ : (u(),
+ k(`div`, we, [
+ D(
+ `craft-button`,
+ {
+ type: `button`,
+ size: `small`,
+ onClick: o,
+ class: `w-full`,
+ appearance: `plain`,
+ },
+ E(y(e)(`Add a target`)),
+ 1
+ ),
+ ])),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ Ee = {class: `grid gap-3`},
+ De = [`value`],
+ Oe = {slot: `input`},
+ ke = [`value`],
+ Ae = {key: 0, slot: `after`},
+ je = {
+ variant: `danger`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `triangle-exclamation`,
+ },
+ Me = {class: `grid gap-3`},
+ Ne = {class: `font-bold text-sm`},
+ Pe = {class: `text-sm text-neutral-500 mb-2`},
+ $ = {class: `grid gap-6`},
+ Fe = {class: `font-bold text-sm`},
+ Ie = {class: `text-sm text-neutral-500 mb-2`},
+ Le = {slot: `input`},
+ Re = [`value`],
+ ze = {key: 0, slot: `after`},
+ Be = {
+ variant: `danger`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `triangle-exclamation`,
+ },
+ Ve = {class: `grid gap-3`},
+ He = {slot: `input`},
+ Ue = [`value`],
+ We = {class: `grid gap-3`},
+ Ge = {class: `font-bold text-sm`},
+ Ke = {class: `text-sm text-neutral-500 mb-2`},
+ qe = {key: 1, class: `grid gap-3`},
+ Je = o({
+ __name: `SectionsEdit`,
+ props: {
+ title: {},
+ crumbs: {},
+ section: {},
+ brandNew: {type: Boolean},
+ typeOptions: {},
+ entryTypes: {},
+ propagationOptions: {},
+ placementOptions: {},
+ siteSettings: {},
+ isMultiSite: {type: Boolean},
+ headlessMode: {type: Boolean},
+ flash: {},
+ errors: {},
+ },
+ setup(r) {
+ let i = r,
+ {readOnly: o} = L(),
+ s = w({
+ sectionId: i.section.id,
+ name: i.section.name ?? ``,
+ handle: i.section.handle ?? ``,
+ type: i.section.type,
+ entryTypes: (i.section.entryTypes ?? []).map(
+ ({actions: e, ...t}) => t
+ ),
+ enableVersioning: i.section.enableVersioning,
+ minAuthors: i.section.minAuthors ?? 0,
+ maxAuthors: i.section.maxAuthors ?? ``,
+ maxLevels: i.section.maxLevels ?? ``,
+ propagationMethod: i.section.propagationMethod,
+ defaultPlacement: i.section.defaultPlacement,
+ previewTargets: i.section.previewTargets ?? [],
+ sites: Object.fromEntries(
+ i.siteSettings.map((e) => [
+ e.handle,
+ {
+ enabled: e.enabled,
+ siteId: e.siteId ?? null,
+ name: e.name ?? ``,
+ singleHomepage: !1,
+ singleUri: e.uriFormat ?? ``,
+ uriFormat: e.uriFormat ?? ``,
+ template: e.template ?? ``,
+ enabledByDefault: e.enabledByDefault,
+ },
+ ])
+ ),
+ }),
+ c = m(() => s.type === `structure`),
+ l = m(() => s.type === `channel` || s.type === `structure`),
+ f = J(
+ () => s.name,
+ (e) => (s.handle = t(e))
+ ),
+ g = J(
+ () => s.name,
+ (e) => {
+ if (!s.sites) return;
+ let t = n(e);
+ s.sites = Object.fromEntries(
+ Object.entries(s.sites).map(([e, n]) => [
+ e,
+ {
+ ...n,
+ singleUri: t && !n.singleHomepage ? `${t}` : n.singleUri,
+ uriFormat: t ? `${t}/{slug}` : ``,
+ template: t ? `${t}/_entry.twig` : ``,
+ },
+ ])
+ );
+ }
+ );
+ i.brandNew || (f.stop(), g.stop());
+ let {save: _} = ee(s, G);
+ return (t, n) => (
+ u(),
+ A(
+ V,
+ {
+ title: r.title,
+ debug: {form: y(s), $props: t.$props},
+ form: y(s),
+ onSave: y(_),
+ },
+ {
+ default: p(() => [
+ d(
+ I,
+ {appearance: `raised`},
+ {
+ default: p(() => [
+ D(`div`, Ee, [
+ r.section.id
+ ? (u(),
+ k(
+ `input`,
+ {
+ key: 0,
+ type: `hidden`,
+ name: `sectionId`,
+ value: r.section.id,
+ },
+ null,
+ 8,
+ De
+ ))
+ : h(``, !0),
+ d(
+ z,
+ {
+ label: y(e)(`Name`),
+ 'help-text': y(e)(
+ `What this section will be called in the control panel.`
+ ),
+ id: `name`,
+ name: `name`,
+ modelValue: y(s).name,
+ 'onUpdate:modelValue': (n[0] ||= (e) =>
+ (y(s).name = e)),
+ disabled: y(o),
+ error: r.errors?.name,
+ required: ``,
+ autofocus: ``,
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `disabled`,
+ `error`,
+ ]
+ ),
+ d(
+ K,
+ {
+ label: y(e)(`Handle`),
+ 'help-text': y(e)(
+ `How you'll refer to this section in the templates.`
+ ),
+ id: `handle`,
+ name: `handle`,
+ modelValue: y(s).handle,
+ 'onUpdate:modelValue': (n[1] ||= (e) =>
+ (y(s).handle = e)),
+ disabled: y(o),
+ error: r.errors?.handle,
+ required: ``,
+ onChange: (n[2] ||= (e) => y(f).markDirty()),
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `disabled`,
+ `error`,
+ ]
+ ),
+ d(
+ H,
+ {
+ label: y(e)(
+ `Enable versioning for entries in this section`
+ ),
+ id: `enableVersioning`,
+ name: `enableVersioning`,
+ disabled: y(o),
+ modelValue: y(s).enableVersioning,
+ 'onUpdate:modelValue': (n[3] ||= (e) =>
+ (y(s).enableVersioning = e)),
+ },
+ null,
+ 8,
+ [`label`, `disabled`, `modelValue`]
+ ),
+ d(
+ F,
+ {
+ label: y(e)(`Section Type`),
+ 'help-text': y(e)(`What type of section is this?`),
+ id: `type`,
+ name: `type`,
+ modelValue: y(s).type,
+ 'onUpdate:modelValue': (n[4] ||= (e) =>
+ (y(s).type = e)),
+ disabled: y(o),
+ error: r.errors?.type,
+ },
+ {
+ default: p(() => [
+ D(`select`, Oe, [
+ (u(!0),
+ k(
+ S,
+ null,
+ a(
+ r.typeOptions,
+ (e) => (
+ u(),
+ k(
+ `option`,
+ {key: e.value, value: e.value},
+ E(e.label),
+ 9,
+ ke
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ r.section.id && y(s).type !== `single`
+ ? (u(),
+ k(`div`, Ae, [
+ D(
+ `craft-callout`,
+ je,
+ E(
+ y(e)(
+ `Changing this may result in data loss.`
+ )
+ ),
+ 1
+ ),
+ ]))
+ : h(``, !0),
+ ]),
+ _: 1,
+ },
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `disabled`,
+ `error`,
+ ]
+ ),
+ ]),
+ (n[14] ||= D(`hr`, {class: `my-6`}, null, -1)),
+ D(`div`, Me, [
+ D(`div`, null, [
+ D(`h3`, Ne, E(y(e)(`Entry Types`)), 1),
+ D(
+ `p`,
+ Pe,
+ E(
+ y(e)(
+ `Choose the types of entries that can be included in this section.`
+ )
+ ),
+ 1
+ ),
+ d(
+ Se,
+ {
+ 'entry-types': r.entryTypes,
+ modelValue: y(s).entryTypes,
+ 'onUpdate:modelValue': (n[5] ||= (e) =>
+ (y(s).entryTypes = e)),
+ },
+ null,
+ 8,
+ [`entry-types`, `modelValue`]
+ ),
+ ]),
+ ]),
+ (n[15] ||= D(`hr`, {class: `my-6`}, null, -1)),
+ D(`div`, $, [
+ D(`div`, null, [
+ D(`h3`, Fe, E(y(e)(`Site settings`)), 1),
+ D(
+ `p`,
+ Ie,
+ E(
+ y(e)(
+ `Choose which sites this section should be available in, and configure the site-specific settings.`
+ )
+ ),
+ 1
+ ),
+ d(
+ Ce,
+ {
+ 'is-multisite': r.isMultiSite,
+ 'is-headless': r.headlessMode,
+ 'selected-type': y(s).type,
+ modelValue: y(s).sites,
+ 'onUpdate:modelValue': (n[6] ||= (e) =>
+ (y(s).sites = e)),
+ },
+ null,
+ 8,
+ [
+ `is-multisite`,
+ `is-headless`,
+ `selected-type`,
+ `modelValue`,
+ ]
+ ),
+ ]),
+ r.isMultiSite && l.value
+ ? (u(),
+ A(
+ F,
+ {
+ key: 0,
+ label: y(e)(`Propagation Method`),
+ 'help-text': y(e)(
+ `Of the enabled sites above, which sites should entries in this section be saved to?`
+ ),
+ id: `propagationMethod`,
+ name: `propagationMethod`,
+ modelValue: y(s).propagationMethod,
+ 'onUpdate:modelValue': (n[7] ||= (e) =>
+ (y(s).propagationMethod = e)),
+ disabled: y(o),
+ },
+ {
+ default: p(() => [
+ D(`select`, Le, [
+ (u(!0),
+ k(
+ S,
+ null,
+ a(
+ r.propagationOptions,
+ (e) => (
+ u(),
+ k(
+ `option`,
+ {key: e.value, value: e.value},
+ E(e.label),
+ 9,
+ Re
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ r.section.id &&
+ r.section.propagationMethod !== `none` &&
+ r.siteSettings.length > 1
+ ? (u(),
+ k(`div`, ze, [
+ D(
+ `craft-callout`,
+ Be,
+ E(
+ y(e)(
+ `Changing this may result in data loss.`
+ )
+ ),
+ 1
+ ),
+ ]))
+ : h(``, !0),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`, `help-text`, `modelValue`, `disabled`]
+ ))
+ : h(``, !0),
+ ]),
+ c.value
+ ? (u(),
+ k(
+ S,
+ {key: 0},
+ [
+ (n[13] ||= D(`hr`, {class: `my-6`}, null, -1)),
+ D(`div`, Ve, [
+ d(
+ z,
+ {
+ label: y(e)(`Max Levels`),
+ 'help-text': y(e)(
+ `The maximum number of levels this section can have.`
+ ),
+ id: `maxLevels`,
+ name: `maxLevels`,
+ modelValue: y(s).maxLevels,
+ 'onUpdate:modelValue': (n[8] ||= (e) =>
+ (y(s).maxLevels = e)),
+ disabled: y(o),
+ inputmode: `numeric`,
+ size: `5`,
+ error: r.errors?.maxLevels,
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `disabled`,
+ `error`,
+ ]
+ ),
+ d(
+ F,
+ {
+ label: y(e)(`Default {type} Placement`, {
+ type: y(e)(`Entry`),
+ }),
+ 'help-text': y(e)(
+ `Where new {type} should be placed by default in the structure.`,
+ {type: y(e)(`entries`)}
+ ),
+ id: `defaultPlacement`,
+ name: `defaultPlacement`,
+ modelValue: y(s).defaultPlacement,
+ 'onUpdate:modelValue': (n[9] ||= (e) =>
+ (y(s).defaultPlacement = e)),
+ disabled: y(o),
+ },
+ {
+ default: p(() => [
+ D(`select`, He, [
+ (u(!0),
+ k(
+ S,
+ null,
+ a(
+ r.placementOptions,
+ (e) => (
+ u(),
+ k(
+ `option`,
+ {key: e.value, value: e.value},
+ E(e.label),
+ 9,
+ Ue
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`, `help-text`, `modelValue`, `disabled`]
+ ),
+ ]),
+ ],
+ 64
+ ))
+ : h(``, !0),
+ (n[16] ||= D(`hr`, {class: `my-6`}, null, -1)),
+ D(`div`, We, [
+ D(`div`, null, [
+ D(`h3`, Ge, E(y(e)(`Preview Targets`)), 1),
+ D(
+ `p`,
+ Ke,
+ E(
+ y(e)(
+ `Locations that should be available for previewing entries in this section.`
+ )
+ ),
+ 1
+ ),
+ d(
+ Te,
+ {
+ modelValue: y(s).previewTargets,
+ 'onUpdate:modelValue': (n[10] ||= (e) =>
+ (y(s).previewTargets = e)),
+ disabled: y(o),
+ },
+ null,
+ 8,
+ [`modelValue`, `disabled`]
+ ),
+ ]),
+ ]),
+ (n[17] ||= D(`hr`, {class: `my-6`}, null, -1)),
+ l.value
+ ? (u(),
+ k(`div`, qe, [
+ d(
+ z,
+ {
+ label: y(e)(`Min Authors`),
+ 'help-text': y(e)(
+ `The minimum number of authors that entries in this section can have.`
+ ),
+ id: `minAuthors`,
+ name: `minAuthors`,
+ modelValue: y(s).minAuthors,
+ 'onUpdate:modelValue': (n[11] ||= (e) =>
+ (y(s).minAuthors = e)),
+ disabled: y(o),
+ inputmode: `numeric`,
+ maxlength: `5`,
+ error: r.errors?.minAuthors,
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `disabled`,
+ `error`,
+ ]
+ ),
+ d(
+ z,
+ {
+ label: y(e)(`Max Authors`),
+ 'help-text': y(e)(
+ `The maximum number of authors that entries in this section can have.`
+ ),
+ id: `maxAuthors`,
+ name: `maxAuthors`,
+ modelValue: y(s).maxAuthors,
+ 'onUpdate:modelValue': (n[12] ||= (e) =>
+ (y(s).maxAuthors = e)),
+ disabled: y(o),
+ inputmode: `numeric`,
+ maxlength: `5`,
+ error: r.errors?.maxAuthors,
+ },
+ null,
+ 8,
+ [
+ `label`,
+ `help-text`,
+ `modelValue`,
+ `disabled`,
+ `error`,
+ ]
+ ),
+ ]))
+ : h(``, !0),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `debug`, `form`, `onSave`]
+ )
+ );
+ },
+ });
+export {Je as default};
diff --git a/resources/build/assets/Select-uUcGssK_.js b/resources/build/assets/Select-uUcGssK_.js
new file mode 100644
index 00000000000..fb698bb3623
--- /dev/null
+++ b/resources/build/assets/Select-uUcGssK_.js
@@ -0,0 +1,131 @@
+import {
+ B as e,
+ E as t,
+ G as n,
+ M as r,
+ N as i,
+ R as a,
+ V as o,
+ X as s,
+ _ as c,
+ b as l,
+ m as u,
+ tt as d,
+ v as f,
+ w as p,
+ x as m,
+ y as h,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+var g = [`.modelValue`, `has-feedback-for`],
+ _ = {slot: `feedback`},
+ v = {key: 0, class: `error-list`},
+ y = t({
+ name: `CraftSelect`,
+ __name: `CraftSelect`,
+ props: r({error: {}}, {modelValue: {}, modelModifiers: {}}),
+ emits: [`update:modelValue`],
+ setup(e) {
+ let t = n(e, `modelValue`);
+ return (n, r) => (
+ a(),
+ m(
+ `craft-select`,
+ {
+ '.modelValue': t.value,
+ onModelValueChanged: (r[0] ||= (e) =>
+ (t.value = e.target?.modelValue)),
+ 'has-feedback-for': e.error ? `error` : ``,
+ },
+ [
+ o(n.$slots, `default`),
+ f(`div`, _, [
+ e.error
+ ? (a(), m(`ul`, v, [f(`li`, null, d(e.error), 1)]))
+ : l(``, !0),
+ ]),
+ ],
+ 40,
+ g
+ )
+ );
+ },
+ }),
+ b = {slot: `input`},
+ x = [`value`],
+ S = {key: 0, class: `error-list`, slot: `feedback`},
+ C = t({
+ __name: `Select`,
+ props: {modelValue: {}, options: {}, error: {}},
+ emits: [`update:modelValue`],
+ setup(t, {emit: n}) {
+ let r = n,
+ g = t,
+ _ = c(() =>
+ g.options.map((e) =>
+ typeof e == `string` || typeof e == `number`
+ ? {label: e.toString(), value: e}
+ : e
+ )
+ ),
+ v = c({
+ get() {
+ return g.modelValue.toString();
+ },
+ set(e) {
+ r(`update:modelValue`, e);
+ },
+ });
+ return (n, r) => (
+ a(),
+ h(
+ y,
+ i(
+ {
+ modelValue: v.value,
+ 'onUpdate:modelValue': (r[0] ||= (e) => (v.value = e)),
+ },
+ n.$attrs
+ ),
+ {
+ default: s(() => [
+ f(`select`, b, [
+ (a(!0),
+ m(
+ u,
+ null,
+ e(
+ _.value,
+ (e) => (
+ a(),
+ m(
+ `option`,
+ {key: e.value, value: e.value},
+ [
+ o(
+ n.$slots,
+ `option-label`,
+ {option: e, selected: e.value === v.value},
+ () => [p(d(e.label), 1)]
+ ),
+ ],
+ 8,
+ x
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ t.error
+ ? (a(), m(`ul`, S, [f(`li`, null, d(t.error), 1)]))
+ : l(``, !0),
+ ]),
+ _: 3,
+ },
+ 16,
+ [`modelValue`]
+ )
+ );
+ },
+ });
+export {y as n, C as t};
diff --git a/resources/build/assets/Show-Bv39pkfZ.js b/resources/build/assets/Show-Bv39pkfZ.js
new file mode 100644
index 00000000000..6a4581a25b8
--- /dev/null
+++ b/resources/build/assets/Show-Bv39pkfZ.js
@@ -0,0 +1,92 @@
+import {
+ B as e,
+ E as t,
+ R as n,
+ X as r,
+ b as i,
+ m as a,
+ tt as o,
+ v as s,
+ w as c,
+ x as l,
+ y as u,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {s as d} from './InlineFlash-DnK6Yp2V.js';
+import {t as f} from './DynamicHtmlRenderer-tRw5R4gl.js';
+import {t as p} from './IndexLayout-dNU8P7d2.js';
+var m = {class: `content-pane`},
+ h = t({
+ __name: `Show`,
+ props: {
+ id: {},
+ title: {},
+ contentHtml: {},
+ toolbarHtml: {},
+ footerHtml: {},
+ viewData: {},
+ utilities: {},
+ },
+ setup(t) {
+ return (h, g) => (
+ n(),
+ u(
+ p,
+ {title: t.title, debug: h.$props},
+ {
+ actions: r(() => [
+ t.toolbarHtml
+ ? (n(), u(f, {key: 0, html: t.toolbarHtml}, null, 8, [`html`]))
+ : i(``, !0),
+ ]),
+ 'interior-nav': r(() => [
+ s(`craft-nav-list`, null, [
+ (n(!0),
+ l(
+ a,
+ null,
+ e(
+ t.utilities,
+ (e) => (
+ n(),
+ u(
+ d,
+ {
+ key: e.id,
+ as: `craft-nav-item`,
+ icon: e.iconPath,
+ href: e.url,
+ active: e.id === t.id,
+ indicator: !!e.badgeCount,
+ block: ``,
+ flush: ``,
+ },
+ {default: r(() => [c(o(e.displayName), 1)]), _: 2},
+ 1032,
+ [`icon`, `href`, `active`, `indicator`]
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ default: r(() => [
+ s(`div`, m, [
+ t.contentHtml
+ ? (n(),
+ u(f, {key: 0, html: t.contentHtml}, null, 8, [`html`]))
+ : i(``, !0),
+ t.footerHtml
+ ? (n(), u(f, {key: 1, html: t.footerHtml}, null, 8, [`html`]))
+ : i(``, !0),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `debug`]
+ )
+ );
+ },
+ });
+export {h as default};
diff --git a/resources/build/assets/Sites-fz5VZjmp.css b/resources/build/assets/Sites-fz5VZjmp.css
new file mode 100644
index 00000000000..030a9de01dc
--- /dev/null
+++ b/resources/build/assets/Sites-fz5VZjmp.css
@@ -0,0 +1,16 @@
+.interior[data-v-f8afee1d] {
+ gap: var(--c-spacing-md);
+ grid-template-columns: minmax(7.5rem, 16%) 1fr;
+ align-items: start;
+ display: grid;
+}
+.title[data-v-f8afee1d] {
+ align-items: center;
+ gap: var(--c-spacing-md);
+ display: flex;
+}
+.separator[data-v-f8afee1d] {
+ opacity: 0.5;
+ font-size: 0.8em;
+ font-weight: 400;
+}
diff --git a/resources/build/assets/Sites-x_iP6yq9.js b/resources/build/assets/Sites-x_iP6yq9.js
new file mode 100644
index 00000000000..56ad75eb2a9
--- /dev/null
+++ b/resources/build/assets/Sites-x_iP6yq9.js
@@ -0,0 +1,614 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ J as r,
+ P as i,
+ R as a,
+ T as o,
+ X as s,
+ Z as c,
+ _ as l,
+ b as u,
+ ct as d,
+ f as ee,
+ gt as f,
+ ht as p,
+ k as m,
+ m as h,
+ p as g,
+ r as _,
+ s as te,
+ t as v,
+ tt as y,
+ v as b,
+ w as x,
+ x as S,
+ y as C,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as w, o as T, t as E} from './AdminTable-32qWVDq-.js';
+import {t as D} from './Empty-D0VMu5kQ.js';
+import {s as O} from './InlineFlash-DnK6Yp2V.js';
+import {t as ne} from './Badge-B_Mkh-0t.js';
+import {i as re, n as k, t as A} from './wayfinder-V597ZF_3.js';
+import {t as ie} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as ae} from './InputCombobox-BGX5z3XZ.js';
+import {t as oe} from './ModalForm-ZyQ-Rf8C.js';
+import {n as j} from './AppLayout-BXGMFlSp.js';
+import {t as M} from './IndexLayout-dNU8P7d2.js';
+import {i as N, n as P, r as F, t as I} from './DeleteSiteModal-BN07_W_D.js';
+var L = (e) => ({url: L.url(e), method: `post`});
+((L.definition = {methods: [`post`], url: `/admin/settings/site-groups`}),
+ (L.url = (e) => L.definition.url + k(e)),
+ (L.post = (e) => ({url: L.url(e), method: `post`})));
+var R = (e, t) => ({url: R.url(e, t), method: `delete`});
+((R.definition = {
+ methods: [`delete`],
+ url: `/admin/settings/site-groups/{groupId}`,
+}),
+ (R.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {groupId: e}),
+ Array.isArray(e) && (e = {groupId: e[0]}),
+ (e = A(e)));
+ let n = {groupId: e.groupId};
+ return (
+ R.definition.url
+ .replace(`{groupId}`, n.groupId.toString())
+ .replace(/\/+$/, ``) + k(t)
+ );
+ }),
+ (R.delete = (e, t) => ({url: R.url(e, t), method: `delete`})));
+var z = [`disabled`],
+ B = n({
+ __name: `DeleteSiteButton`,
+ props: {site: {}},
+ setup(e) {
+ let t = d(!1);
+ return (n, r) => (
+ a(),
+ S(`div`, null, [
+ b(
+ `craft-button`,
+ {
+ size: `small`,
+ icon: ``,
+ type: `button`,
+ variant: `danger`,
+ appearance: `plain`,
+ disabled: e.site.primary,
+ onClick: (r[0] ||= (e) => (t.value = !0)),
+ },
+ [
+ ...(r[2] ||= [
+ b(
+ `craft-icon`,
+ {name: `x`, label: `t('Delete site'`},
+ null,
+ -1
+ ),
+ ]),
+ ],
+ 8,
+ z
+ ),
+ o(
+ I,
+ {
+ site: e.site,
+ open: t.value,
+ onClose: (r[1] ||= (e) => (t.value = !1)),
+ },
+ null,
+ 8,
+ [`site`, `open`]
+ ),
+ ])
+ );
+ },
+ }),
+ V = (e) => ({url: V.url(e), method: `get`});
+((V.definition = {methods: [`get`, `head`], url: `/admin/settings/sites`}),
+ (V.url = (e) => V.definition.url + k(e)),
+ (V.get = (e) => ({url: V.url(e), method: `get`})),
+ (V.head = (e) => ({url: V.url(e), method: `head`})),
+ Object.assign(V, V));
+var H = {class: `flex gap-2 items-center`},
+ U = {class: `title text-xl`},
+ W = {key: 0},
+ G = {type: `button`, icon: ``, size: `small`, slot: `invoker`},
+ K = [`label`],
+ q = {slot: `content`},
+ se = [`disabled`],
+ ce = {class: `-mx-2`},
+ le = {key: 0, class: `mt-4 flex gap-2`},
+ ue = [`label`, `help-text`],
+ de = {slot: `after`},
+ fe = {variant: `info`, appearance: `plain`, class: `p-0`, icon: `lightbulb`},
+ pe = {
+ href: `https://craftcms.com/docs/5.x/configure.html#control-panel-settings`,
+ },
+ me = [`label`, `help-text`, `has-feedback-for`],
+ he = {slot: `after`},
+ ge = {variant: `info`, appearance: `plain`, class: `p-0`, icon: `lightbulb`},
+ _e = {
+ href: `https://craftcms.com/docs/5.x/configure.html#control-panel-settings`,
+ },
+ ve = {slot: `feedback`},
+ J = {key: 0, class: `error-list`},
+ Y = v(
+ n({
+ __name: `Sites`,
+ props: {group: {}, groups: {}, sites: {}, nameSuggestions: {}, flash: {}},
+ setup(n) {
+ let v = n,
+ k = d(!1),
+ A = ie(),
+ {readOnly: I} = re(),
+ z = te({id: v.group?.id ?? null, name: v.group?.name ?? ``});
+ function Y() {
+ z.clearErrors().submit(L(), {
+ onSuccess: () => {
+ ((k.value = !1), z.reset());
+ },
+ });
+ }
+ function X(e) {
+ (e === `create`
+ ? ((z.name = ``), (z.id = null))
+ : e === `update` &&
+ ((z.name = v.group?.rawName ?? v.group?.name ?? ``),
+ (z.id = v.group?.id ?? null)),
+ (k.value = !0));
+ }
+ let Z = d(v.sites.map((e) => e.id)),
+ Q = l(() =>
+ Z.value.length > 0
+ ? Z.value
+ .map((e) => v.sites.find((t) => t.id === e))
+ .filter((e) => e !== void 0)
+ : []
+ );
+ r(Z, (e, t) => {
+ i(() => {
+ f.post(
+ N(),
+ {ids: [...e]},
+ {
+ preserveScroll: !0,
+ preserveState: !0,
+ onError: () => {
+ Z.value = t;
+ },
+ }
+ );
+ });
+ });
+ function ye(e, t) {
+ let n = [...Z.value],
+ [r] = n.splice(e, 1);
+ r !== void 0 && (n.splice(t, 0, r), (Z.value = n));
+ }
+ let be = d([
+ A.accessor(`name`, {
+ header: () => e(`Name`),
+ cell: ({row: e, getValue: t}) =>
+ m(O, {href: F.url(e.original.id)}, () =>
+ m(`div`, {class: `flex gap-2`}, [
+ m(`craft-indicator`, {
+ variant: e.original.enabled ? `success` : `empty`,
+ }),
+ m(`span`, t()),
+ ])
+ ),
+ }),
+ A.accessor(`handle`, {
+ header: () => e(`Handle`),
+ cell: (e) => m(`code`, e.getValue()),
+ }),
+ A.accessor(`enabled`, {
+ header: () => e(`Status`),
+ cell: (t) =>
+ m(ne, {variant: t.getValue() ? `success` : `default`}, () =>
+ t.getValue() ? e(`Enabled`) : e(`Disabled`)
+ ),
+ }),
+ A.accessor(`language`, {
+ header: () => e(`Language`),
+ cell: (e) => m(`code`, e.getValue()),
+ }),
+ A.accessor(`primary`, {
+ header: () => e(`Primary`),
+ cell: (e) =>
+ e.getValue() ? m(`craft-icon`, {name: `check`}) : ``,
+ }),
+ A.accessor(`baseUrl`, {
+ header: () => e(`Base URL`),
+ cell: (e) => m(`code`, e.getValue()),
+ }),
+ A.accessor(`group.name`, {id: `group`, header: () => e(`Group`)}),
+ A.actions(({row: e}) => [
+ m(B, {
+ site: e.original,
+ disabled: e.original.primary,
+ class: `whitespace-normal`,
+ }),
+ ]),
+ ]),
+ xe = w({
+ get data() {
+ return Q.value;
+ },
+ get columns() {
+ return be.value;
+ },
+ state: {
+ get columnVisibility() {
+ return {actions: !I};
+ },
+ },
+ getCoreRowModel: T(),
+ getRowId: (e) => e.id.toString(),
+ enableSorting: !1,
+ defaultColumn: {size: `auto`, minSize: 50, maxSize: 200},
+ });
+ function Se() {
+ v.group?.id &&
+ confirm(e(`Are you sure you want to delete this group?`)) &&
+ f.delete(R({groupId: v.group.id}));
+ }
+ let $ = l(() => (v.group?.name ? v.group.name : e(`Sites`)));
+ return (r, i) => (
+ a(),
+ S(
+ h,
+ null,
+ [
+ o(
+ M,
+ {
+ debug: {form: p(z), $props: r.$props},
+ 'full-width': !0,
+ title: $.value,
+ },
+ {
+ title: s(() => [
+ b(`div`, H, [
+ b(`h1`, U, y($.value), 1),
+ n.group?.id && !p(I)
+ ? (a(),
+ S(`craft-action-menu`, W, [
+ b(`craft-button`, G, [
+ b(
+ `craft-icon`,
+ {
+ name: `gear`,
+ label: p(e)(`Site group Actions`),
+ },
+ null,
+ 8,
+ K
+ ),
+ ]),
+ b(`div`, q, [
+ b(
+ `craft-action-item`,
+ {
+ onClick: (i[0] ||= g(
+ (e) => X(`update`),
+ [`prevent`]
+ )),
+ },
+ y(p(e)(`Rename Group`)),
+ 1
+ ),
+ b(
+ `craft-action-item`,
+ {
+ variant: `danger`,
+ disabled: Q.value.length > 0,
+ onClick: g(Se, [`prevent`]),
+ },
+ y(p(e)(`Delete Group`)),
+ 9,
+ se
+ ),
+ ]),
+ ]))
+ : u(``, !0),
+ ]),
+ ]),
+ actions: s(() => [
+ p(I)
+ ? u(``, !0)
+ : (a(),
+ C(
+ O,
+ {
+ key: 0,
+ as: `craft-button`,
+ href: p(P)({query: {groupId: n.group?.id}}).url,
+ variant: `accent`,
+ appearance: `button`,
+ },
+ {
+ default: s(() => [
+ (i[5] ||= b(
+ `craft-icon`,
+ {name: `plus`, slot: `prefix`},
+ null,
+ -1
+ )),
+ x(` ` + y(p(e)(`New Site`)), 1),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ )),
+ ]),
+ 'interior-nav': s(() => [
+ b(`craft-nav-list`, ce, [
+ o(
+ O,
+ {
+ as: `craft-nav-item`,
+ href: p(V).url(),
+ active: !n.group,
+ },
+ {default: s(() => [x(y(p(e)(`All Sites`)), 1)]), _: 1},
+ 8,
+ [`href`, `active`]
+ ),
+ (a(!0),
+ S(
+ h,
+ null,
+ t(
+ n.groups,
+ (e) => (
+ a(),
+ C(
+ O,
+ {
+ as: `craft-nav-item`,
+ key: e.id,
+ href: p(V).url({query: {groupId: e.id}}),
+ active: n.group && e.id === n.group.id,
+ block: ``,
+ },
+ {default: s(() => [x(y(e.name), 1)]), _: 2},
+ 1032,
+ [`href`, `active`]
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ p(I)
+ ? u(``, !0)
+ : (a(),
+ S(`div`, le, [
+ b(
+ `craft-button`,
+ {
+ type: `button`,
+ onClick: (i[1] ||= (e) => X(`create`)),
+ size: `small`,
+ },
+ [
+ (i[6] ||= b(
+ `craft-icon`,
+ {name: `plus`, slot: `prefix`},
+ null,
+ -1
+ )),
+ x(` ` + y(p(e)(`New Group`)), 1),
+ ]
+ ),
+ ])),
+ ]),
+ default: s(() => [
+ b(`div`, null, [
+ p(I) ? (a(), C(j, {key: 0})) : u(``, !0),
+ o(
+ E,
+ {
+ table: p(xe),
+ 'read-only': p(I),
+ reorderable: !!n.group?.id,
+ spacing: `relaxed`,
+ onReorder: ye,
+ },
+ {
+ 'empty-row': s(() => [
+ o(
+ D,
+ {
+ icon: `light/earth-americas`,
+ label: p(e)(`No sites exist yet.`),
+ },
+ {
+ default: s(() => [
+ p(I)
+ ? u(``, !0)
+ : (a(),
+ C(
+ O,
+ {
+ key: 0,
+ as: `craft-button`,
+ href: p(P)({
+ query: {groupId: n.group?.id},
+ }).url,
+ appearance: `button`,
+ },
+ {
+ default: s(() => [
+ (i[7] ||= b(
+ `craft-icon`,
+ {name: `plus`, slot: `prefix`},
+ null,
+ -1
+ )),
+ x(` ` + y(p(e)(`New Site`)), 1),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ )),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`, `read-only`, `reorderable`]
+ ),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`debug`, `title`]
+ ),
+ o(
+ oe,
+ {
+ 'is-active': k.value,
+ onClose: (i[4] ||= (e) => {
+ ((k.value = !1), p(z).reset());
+ }),
+ onSubmit: Y,
+ loading: p(z).processing,
+ },
+ {
+ default: s(() => [
+ c(
+ b(
+ `craft-input`,
+ {
+ name: `id`,
+ id: `id`,
+ 'onUpdate:modelValue': (i[2] ||= (e) =>
+ (p(z).id = e)),
+ type: `hidden`,
+ },
+ null,
+ 512
+ ),
+ [[ee, p(z).id]]
+ ),
+ o(
+ p(_),
+ {data: `nameSuggestions`},
+ {
+ fallback: s(() => [
+ b(
+ `craft-input`,
+ {
+ readonly: ``,
+ name: `readonly-name`,
+ label: p(e)(`Group Name`),
+ 'help-text': p(e)(
+ `What this group will be called in the control panel.`
+ ),
+ },
+ [
+ b(`div`, de, [
+ b(`craft-callout`, fe, [
+ x(
+ y(
+ p(e)(
+ `This can begin with an environment variable.`
+ )
+ ) + ` `,
+ 1
+ ),
+ b(`a`, pe, y(p(e)(`Learn more`)), 1),
+ ]),
+ ]),
+ ],
+ 8,
+ ue
+ ),
+ ]),
+ default: s(() => [
+ b(
+ `craft-input`,
+ {
+ label: p(e)(`Group Name`),
+ id: `name`,
+ name: `name`,
+ required: ``,
+ 'help-text': p(e)(
+ `What this group will be called in the control panel.`
+ ),
+ 'has-feedback-for': p(z).errors?.name
+ ? `error`
+ : ``,
+ },
+ [
+ o(
+ ae,
+ {
+ options: n.nameSuggestions,
+ modelValue: p(z).name,
+ 'onUpdate:modelValue': (i[3] ||= (e) =>
+ (p(z).name = e)),
+ slot: `input`,
+ },
+ null,
+ 8,
+ [`options`, `modelValue`]
+ ),
+ b(`div`, he, [
+ b(`craft-callout`, ge, [
+ x(
+ y(
+ p(e)(
+ `This can begin with an environment variable.`
+ )
+ ) + ` `,
+ 1
+ ),
+ b(`a`, _e, y(p(e)(`Learn more`)), 1),
+ ]),
+ ]),
+ b(`div`, ve, [
+ p(z).errors?.name
+ ? (a(),
+ S(`ul`, J, [
+ b(`li`, null, y(p(z).errors.name), 1),
+ ]))
+ : u(``, !0),
+ ]),
+ ],
+ 8,
+ me
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`is-active`, `loading`]
+ ),
+ ],
+ 64
+ )
+ );
+ },
+ }),
+ [[`__scopeId`, `data-v-f8afee1d`]]
+ );
+export {Y as default};
diff --git a/resources/build/assets/SitesEdit-DkUkyq3N.js b/resources/build/assets/SitesEdit-DkUkyq3N.js
new file mode 100644
index 00000000000..fb7ca805365
--- /dev/null
+++ b/resources/build/assets/SitesEdit-DkUkyq3N.js
@@ -0,0 +1,554 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {a as t, o as n} from './cp-npqTfNqh.js';
+import {
+ B as r,
+ E as i,
+ R as a,
+ T as o,
+ X as s,
+ Z as c,
+ _ as l,
+ b as u,
+ ct as d,
+ f,
+ ht as p,
+ l as ee,
+ m,
+ s as h,
+ tt as g,
+ v as _,
+ w as v,
+ x as y,
+ y as b,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as x} from './Pane-CJi1MPPH.js';
+import {t as S} from './Badge-B_Mkh-0t.js';
+import {i as C} from './wayfinder-V597ZF_3.js';
+import {n as w} from './dist-BSfJDNP3.js';
+import {t as T} from './AppLayout-BXGMFlSp.js';
+import {t as E} from './CraftCombobox-NlyOETnv.js';
+import {t as D} from './useSettingsSave-D5LL4sJi.js';
+import {t as O} from './transformBooleanOptions-BLp8ecwx.js';
+import {t as k} from './useInputGenerator-Cl1F0ZZS.js';
+import {a as A, t as j} from './DeleteSiteModal-BN07_W_D.js';
+var M = [`label`, `help-text`, `.modelValue`, `disabled`],
+ N = {slot: `input`},
+ P = [`value`],
+ F = {key: 0, class: `error-list`, slot: `feedback`},
+ I = {key: 1, slot: `after`},
+ L = {
+ variant: `danger`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `triangle-exclamation`,
+ },
+ R = {class: `sr-only`},
+ z = {slot: `after`},
+ B = {variant: `info`, appearance: `plain`, class: `p-0`, icon: `lightbulb`},
+ V = {
+ href: `https://craftcms.com/docs/5.x/configure.html#control-panel-settings`,
+ },
+ H = [`label`, `help-text`, `has-feedback-for`, `disabled`],
+ U = {slot: `feedback`},
+ W = {key: 0, class: `error-list`},
+ G = [`innerHTML`],
+ K = {slot: `after`},
+ q = {
+ key: 0,
+ variant: `warning`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `lightbulb`,
+ },
+ J = [`innerHTML`],
+ Y = [`label`, `help-text`, `disabled`, `checked`],
+ te = [`label`, `disabled`, `checked`],
+ ne = {variant: `info`, appearance: `plain`, class: `p-0`, icon: `lightbulb`},
+ re = {
+ href: `https://craftcms.com/docs/5.x/configure.html#control-panel-settings`,
+ },
+ X = i({
+ __name: `SiteFields`,
+ props: {inertiaForm: {}},
+ setup(i) {
+ let d = i,
+ h = ee(),
+ {readOnly: x} = C(),
+ S = l(() => d.inertiaForm),
+ w = l(() => h.props.isMultisite),
+ T = l(() => h.props.groupOptions),
+ D = l(() => h.props.nameSuggestions),
+ A = l(() => h.props.languageOptions),
+ j = l(() => O(h.props.booleanEnvOptions)),
+ X = l(() => h.props.baseUrlSuggestions),
+ Z = l(() => h.props.site),
+ Q = k(
+ () => S.value.name,
+ (e) => (S.value.handle = t(e))
+ ),
+ $ = k(
+ () => S.value.name,
+ (e) => (S.value.baseUrl = n(e, {prefix: `$`, suffix: `_URL`}))
+ );
+ return (
+ S.value.id && (Q.stop(), $.stop()),
+ (t, n) => (
+ a(),
+ y(
+ m,
+ null,
+ [
+ S.value.id
+ ? c(
+ (a(),
+ y(
+ `input`,
+ {
+ key: 0,
+ name: `id`,
+ 'onUpdate:modelValue': (n[0] ||= (e) =>
+ (S.value.id = e)),
+ type: `hidden`,
+ },
+ null,
+ 512
+ )),
+ [[f, S.value.id]]
+ )
+ : u(``, !0),
+ _(
+ `craft-select`,
+ {
+ label: p(e)(`Group`),
+ 'help-text': p(e)(`Which group should this site belong to?`),
+ name: `group`,
+ id: `group`,
+ '.modelValue': S.value.group,
+ onModelValueChanged: (n[1] ||= (e) =>
+ (S.value.group = e.target?.modelValue)),
+ disabled: p(x),
+ },
+ [
+ _(`select`, N, [
+ (a(!0),
+ y(
+ m,
+ null,
+ r(
+ T.value,
+ (e) => (
+ a(),
+ y(
+ `option`,
+ {key: e.value, value: e.value},
+ g(e.label),
+ 9,
+ P
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ S.value.errors?.group
+ ? (a(),
+ y(`ul`, F, [
+ (a(!0),
+ y(
+ m,
+ null,
+ r(
+ S.value.errors?.group,
+ (e) => (a(), y(`li`, {key: e}, g(e), 1))
+ ),
+ 128
+ )),
+ ]))
+ : u(``, !0),
+ S.value?.id && w.value
+ ? (a(),
+ y(`div`, I, [
+ _(`craft-callout`, L, [
+ _(`span`, R, g(p(e)(`Warning:`)), 1),
+ v(
+ ` ` +
+ g(p(e)(`Changing this may result in data loss.`)),
+ 1
+ ),
+ ]),
+ ]))
+ : u(``, !0),
+ ],
+ 40,
+ M
+ ),
+ o(
+ E,
+ {
+ modelValue: S.value.name,
+ 'onUpdate:modelValue': (n[2] ||= (e) => (S.value.name = e)),
+ options: D.value,
+ label: p(e)(`Name`),
+ id: `name`,
+ name: `name`,
+ disabled: p(x),
+ error: S.value.errors?.name,
+ },
+ {
+ default: s(() => [
+ _(`div`, z, [
+ _(`craft-callout`, B, [
+ v(
+ g(
+ p(e)(`This can begin with an environment variable.`)
+ ) + ` `,
+ 1
+ ),
+ _(`a`, V, g(p(e)(`Learn more`)), 1),
+ ]),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`modelValue`, `options`, `label`, `disabled`, `error`]
+ ),
+ c(
+ _(
+ `craft-input-handle`,
+ {
+ label: p(e)(`Handle`),
+ 'help-text': p(e)(
+ `How you’ll refer to this site in the templates.`
+ ),
+ ref: `handle`,
+ id: `handle`,
+ name: `handle`,
+ 'has-feedback-for': S.value.errors?.handle ? `error` : ``,
+ disabled: p(x),
+ 'onUpdate:modelValue': (n[3] ||= (e) =>
+ (S.value.handle = e)),
+ },
+ [
+ _(`div`, U, [
+ S.value.errors?.handle
+ ? (a(),
+ y(`ul`, W, [
+ _(`li`, null, g(S.value.errors.handle), 1),
+ ]))
+ : u(``, !0),
+ ]),
+ ],
+ 8,
+ H
+ ),
+ [[f, S.value.handle]]
+ ),
+ o(
+ E,
+ {
+ modelValue: S.value.language,
+ 'onUpdate:modelValue': (n[4] ||= (e) =>
+ (S.value.language = e)),
+ label: p(e)(`Language`),
+ name: `language`,
+ id: `site-language`,
+ 'help-text': p(e)(
+ `The language content in this site will use.`
+ ),
+ options: A.value,
+ disabled: p(x),
+ error: S.value.errors?.language,
+ 'require-option-match': !0,
+ },
+ {
+ after: s(() => [
+ _(
+ `craft-callout`,
+ {
+ variant: `info`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `lightbulb`,
+ innerHTML: p(e)(
+ `This can be set to an environment variable with a valid language ID ({examples}).`,
+ {examples: `en/en-GB`}
+ ),
+ },
+ null,
+ 8,
+ G
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [
+ `modelValue`,
+ `label`,
+ `help-text`,
+ `options`,
+ `disabled`,
+ `error`,
+ ]
+ ),
+ w.value || !Z.value.id
+ ? (a(),
+ b(
+ E,
+ {
+ key: 1,
+ label: p(e)(`Status`),
+ name: `enabled`,
+ id: `enabled`,
+ disabled: p(x),
+ modelValue: S.value.enabled,
+ 'onUpdate:modelValue': (n[5] ||= (e) =>
+ (S.value.enabled = e)),
+ 'require-option-match': !0,
+ options: j.value,
+ error: S.value.errors?.enabled,
+ },
+ {
+ default: s(() => [
+ _(`div`, K, [
+ Z.value.primary
+ ? (a(),
+ y(
+ `craft-callout`,
+ q,
+ g(p(e)(`The primary site cannot be disabled.`)),
+ 1
+ ))
+ : u(``, !0),
+ _(
+ `craft-callout`,
+ {
+ variant: `info`,
+ appearance: `plain`,
+ class: `p-0`,
+ icon: `lightbulb`,
+ innerHTML: p(e)(
+ `This can be set to an environment variable with a boolean value ({examples})`,
+ {
+ examples: `yes/no/true/false/on/off/0/1`,
+ }
+ ),
+ },
+ null,
+ 8,
+ J
+ ),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`, `disabled`, `modelValue`, `options`, `error`]
+ ))
+ : u(``, !0),
+ (w.value || !Z.value.id) && !Z.value.primary
+ ? (a(),
+ y(
+ m,
+ {key: 2},
+ [
+ Z.value.primary
+ ? u(``, !0)
+ : (a(),
+ y(
+ `craft-switch`,
+ {
+ key: 0,
+ label: p(e)(`Make this the primary site`),
+ 'help-text': p(e)(
+ `The primary site will be loaded by default on the front end.`
+ ),
+ disabled: p(x),
+ checked: S.value.primary,
+ onCheckedChanged: (n[6] ||= (e) =>
+ (S.value.primary = e.target?.checked)),
+ },
+ null,
+ 40,
+ Y
+ )),
+ ],
+ 64
+ ))
+ : u(``, !0),
+ _(
+ `craft-switch`,
+ {
+ label: p(e)(`This site has its own base URL`),
+ id: `has-urls`,
+ name: `hasUrls`,
+ disabled: p(x),
+ checked: S.value.hasUrls,
+ onCheckedChanged: (n[7] ||= (e) =>
+ (S.value.hasUrls = e.target?.checked)),
+ },
+ null,
+ 40,
+ te
+ ),
+ S.value.hasUrls
+ ? (a(),
+ b(
+ E,
+ {
+ key: 3,
+ modelValue: S.value.baseUrl,
+ 'onUpdate:modelValue': (n[8] ||= (e) =>
+ (S.value.baseUrl = e)),
+ label: p(e)(`Base URL`),
+ 'help-text': p(e)(`The base URL for the site.`),
+ id: `base-url`,
+ name: `baseUrl`,
+ error: S.value.errors?.baseUrl,
+ options: X.value,
+ disabled: p(x),
+ },
+ {
+ after: s(() => [
+ _(`craft-callout`, ne, [
+ v(
+ g(
+ p(e)(
+ `This can begin with an environment variable or alias.`
+ )
+ ) + ` `,
+ 1
+ ),
+ _(`a`, re, g(p(e)(`Learn more`)), 1),
+ ]),
+ ]),
+ _: 1,
+ },
+ 8,
+ [
+ `modelValue`,
+ `label`,
+ `help-text`,
+ `error`,
+ `options`,
+ `disabled`,
+ ]
+ ))
+ : u(``, !0),
+ ],
+ 64
+ )
+ )
+ );
+ },
+ }),
+ Z = {key: 0, size: `small`, inline: ``},
+ Q = {class: `grid gap-3`},
+ $ = i({
+ __name: `SitesEdit`,
+ props: {
+ title: {},
+ crumbs: {},
+ site: {},
+ groupId: {},
+ flash: {},
+ errors: {},
+ isMultisite: {type: Boolean},
+ },
+ setup(t) {
+ let n = t,
+ r = h({
+ siteId: n.site.id ?? null,
+ group: n.groupId,
+ name: n.site.nameRaw,
+ handle: n.site.handle,
+ language: n.site.languageRaw,
+ enabled: n.site.enabledRaw,
+ hasUrls: n.site.hasUrls,
+ primary: n.site.primary,
+ baseUrl: n.site.baseUrlRaw ?? ``,
+ });
+ w(`keydown`, (e) => {
+ (e.metaKey || e.ctrlKey) && e.key === `s` && (e.preventDefault(), i());
+ });
+ let {save: i} = D(r, A),
+ c = d(!1);
+ return (l, d) => (
+ a(),
+ y(
+ m,
+ null,
+ [
+ o(
+ T,
+ {title: t.title, form: p(r), onSave: p(i)},
+ {
+ 'title-badge': s(() => [
+ o(
+ S,
+ {variant: t.site.enabled ? `success` : `default`},
+ {
+ default: s(() => [
+ v(
+ g(
+ t.site.enabled ? p(e)(`Enabled`) : p(e)(`Disabled`)
+ ),
+ 1
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`variant`]
+ ),
+ t.site.primary
+ ? (a(),
+ y(`craft-callout`, Z, [
+ _(`span`, null, g(p(e)(`Primary`)), 1),
+ ]))
+ : u(``, !0),
+ ]),
+ default: s(() => [
+ o(
+ x,
+ {appearance: `raised`},
+ {
+ default: s(() => [
+ _(`div`, Q, [
+ o(X, {'inertia-form': p(r)}, null, 8, [
+ `inertia-form`,
+ ]),
+ ]),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`, `form`, `onSave`]
+ ),
+ t.site.primary
+ ? u(``, !0)
+ : (a(),
+ b(
+ j,
+ {
+ key: 0,
+ onClose: (d[0] ||= (e) => (c.value = !1)),
+ open: c.value,
+ site: n.site,
+ },
+ null,
+ 8,
+ [`open`, `site`]
+ )),
+ ],
+ 64
+ )
+ );
+ },
+ });
+export {$ as default};
diff --git a/resources/build/assets/Tokens-D_TBkI0Z.js b/resources/build/assets/Tokens-D_TBkI0Z.js
new file mode 100644
index 00000000000..4b7aae23cfe
--- /dev/null
+++ b/resources/build/assets/Tokens-D_TBkI0Z.js
@@ -0,0 +1,193 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ E as t,
+ R as n,
+ T as r,
+ X as i,
+ gt as a,
+ ht as o,
+ k as s,
+ tt as c,
+ w as l,
+ y as u,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as d, o as f, t as p} from './AdminTable-32qWVDq-.js';
+import {t as m} from './Empty-D0VMu5kQ.js';
+import {t as h} from './Pane-CJi1MPPH.js';
+import {s as g} from './InlineFlash-DnK6Yp2V.js';
+import {n as _, t as v} from './wayfinder-V597ZF_3.js';
+import {t as y} from './DeleteButton-BLk4eDvl.js';
+import {t as b} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as x} from './AppLayout-BXGMFlSp.js';
+var S = (e) => ({url: S.url(e), method: `post`});
+((S.definition = {
+ methods: [`post`],
+ url: `/admin/actions/graphql/generate-token`,
+}),
+ (S.url = (e) => S.definition.url + _(e)),
+ (S.post = (e) => ({url: S.url(e), method: `post`})));
+var C = (e) => ({url: C.url(e), method: `post`});
+((C.definition = {methods: [`post`], url: `/admin/actions/graphql/save-token`}),
+ (C.url = (e) => C.definition.url + _(e)),
+ (C.post = (e) => ({url: C.url(e), method: `post`})));
+var w = (e) => ({url: w.url(e), method: `post`});
+((w.definition = {
+ methods: [`post`],
+ url: `/admin/actions/graphql/fetch-token`,
+}),
+ (w.url = (e) => w.definition.url + _(e)),
+ (w.post = (e) => ({url: w.url(e), method: `post`})));
+var T = (e) => ({url: T.url(e), method: `get`});
+((T.definition = {methods: [`get`, `head`], url: `/admin/graphql/tokens`}),
+ (T.url = (e) => T.definition.url + _(e)),
+ (T.get = (e) => ({url: T.url(e), method: `get`})),
+ (T.head = (e) => ({url: T.url(e), method: `head`})));
+var E = (e) => ({url: E.url(e), method: `get`});
+((E.definition = {methods: [`get`, `head`], url: `/admin/graphql/tokens/new`}),
+ (E.url = (e) => E.definition.url + _(e)),
+ (E.get = (e) => ({url: E.url(e), method: `get`})),
+ (E.head = (e) => ({url: E.url(e), method: `head`})));
+var D = (e, t) => ({url: D.url(e, t), method: `get`});
+((D.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/graphql/tokens/{tokenId}`,
+}),
+ (D.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {tokenId: e}),
+ Array.isArray(e) && (e = {tokenId: e[0]}),
+ (e = v(e)));
+ let n = {tokenId: e.tokenId};
+ return (
+ D.definition.url
+ .replace(`{tokenId}`, n.tokenId.toString())
+ .replace(/\/+$/, ``) + _(t)
+ );
+ }),
+ (D.get = (e, t) => ({url: D.url(e, t), method: `get`})),
+ (D.head = (e, t) => ({url: D.url(e, t), method: `head`})));
+var O = (e, t) => ({url: O.url(e, t), method: `delete`});
+((O.definition = {methods: [`delete`], url: `/admin/graphql/tokens/{tokenId}`}),
+ (O.url = (e, t) => {
+ ((typeof e == `string` || typeof e == `number`) && (e = {tokenId: e}),
+ Array.isArray(e) && (e = {tokenId: e[0]}),
+ (e = v(e)));
+ let n = {tokenId: e.tokenId};
+ return (
+ O.definition.url
+ .replace(`{tokenId}`, n.tokenId.toString())
+ .replace(/\/+$/, ``) + _(t)
+ );
+ }),
+ (O.delete = (e, t) => ({url: O.url(e, t), method: `delete`})));
+var k = t({
+ __name: `Tokens`,
+ props: {tokens: {}, dates: {}, readOnly: {type: Boolean}},
+ setup(t) {
+ let _ = t;
+ function v(t) {
+ confirm(
+ e(`Are you sure you want to delete the “{name}” token?`, {name: t.name})
+ ) && a.delete(O(t.id));
+ }
+ let S = b(),
+ C = d({
+ get columns() {
+ return [
+ S.link(`name`, {
+ header: e(`Name`),
+ props: ({row: e}) => ({href: D(e.original.id).url, inertia: !1}),
+ }),
+ S.date(`lastUsed`, {header: e(`Last Used`)}),
+ S.date(`expiryDate`, {header: e(`Expires`)}),
+ S.actions(({row: e}) => [s(y, {onClick: () => v(e.original)})]),
+ ];
+ },
+ get data() {
+ return _.tokens;
+ },
+ state: {
+ get columnVisibility() {
+ return {
+ name: !0,
+ lastUsed: !0,
+ expiryDate: !0,
+ actions: !_.readOnly,
+ };
+ },
+ },
+ enableSorting: !1,
+ getCoreRowModel: f(),
+ });
+ return (t, a) => (
+ n(),
+ u(x, null, {
+ actions: i(() => [
+ r(
+ g,
+ {
+ href: o(E)().url,
+ icon: `plus`,
+ inertia: !1,
+ appearance: `button`,
+ variant: `accent`,
+ },
+ {default: i(() => [l(c(o(e)(`New token`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ default: i(() => [
+ r(
+ h,
+ {padding: 0, appearance: `raised`},
+ {
+ default: i(() => [
+ r(
+ p,
+ {table: o(C)},
+ {
+ 'empty-row': i(() => [
+ r(
+ m,
+ {label: o(e)(`No GraphQL tokens exist yet.`)},
+ {
+ default: i(() => [
+ r(
+ g,
+ {
+ href: o(E)().url,
+ icon: `plus`,
+ inertia: !1,
+ appearance: `button`,
+ },
+ {
+ default: i(() => [l(c(o(e)(`New token`)), 1)]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`]
+ ),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ })
+ );
+ },
+});
+export {k as default};
diff --git a/resources/build/assets/UserGroups-Drbiuiiz.js b/resources/build/assets/UserGroups-Drbiuiiz.js
new file mode 100644
index 00000000000..aefeda6bc0f
--- /dev/null
+++ b/resources/build/assets/UserGroups-Drbiuiiz.js
@@ -0,0 +1,154 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ R as r,
+ T as i,
+ X as a,
+ gt as o,
+ ht as s,
+ k as c,
+ m as l,
+ tt as u,
+ v as d,
+ w as f,
+ x as p,
+ y as m,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as h, o as g, t as _} from './AdminTable-32qWVDq-.js';
+import {t as v} from './Empty-D0VMu5kQ.js';
+import {s as y} from './InlineFlash-DnK6Yp2V.js';
+import {t as b} from './DeleteButton-BLk4eDvl.js';
+import {t as x} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as S} from './IndexLayout-dNU8P7d2.js';
+import {n as C, r as w, t as T} from './UserGroupsController-CFAwxvIz.js';
+var E = n({
+ __name: `UserGroups`,
+ props: {groups: {}, subnav: {}, readOnly: {type: Boolean}},
+ setup(n) {
+ let E = n;
+ function D(t) {
+ confirm(e(`Are you sure you want to delete "{name}"?`, {name: t.name})) &&
+ o.delete(C(t.id));
+ }
+ let O = x(),
+ k = h({
+ get columns() {
+ return [
+ O.link(`name`, {
+ header: e(`Name`),
+ props: ({row: e}) => ({href: w(e.original.id).url}),
+ }),
+ O.handle(`handle`),
+ O.actions(({row: e}) => [c(b, {onClick: () => D(e.original)})]),
+ ];
+ },
+ get data() {
+ return E.groups;
+ },
+ state: {
+ get columnVisibility() {
+ return {};
+ },
+ },
+ manualPagination: !0,
+ pageCount: 1,
+ getCoreRowModel: g(),
+ });
+ return (o, c) => (
+ r(),
+ m(S, null, {
+ actions: a(() => [
+ i(
+ y,
+ {
+ inertia: !1,
+ href: s(T)().url,
+ class: `btn submit add icon`,
+ icon: `plus`,
+ appearance: `button`,
+ variant: `accent`,
+ },
+ {default: a(() => [f(u(s(e)(`New user group`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ 'interior-nav': a(() => [
+ d(`craft-nav-list`, null, [
+ (r(!0),
+ p(
+ l,
+ null,
+ t(
+ n.subnav,
+ (e, t) => (
+ r(),
+ m(
+ y,
+ {
+ key: t,
+ as: `craft-nav-item`,
+ active: e.active ?? !1,
+ href: e.url,
+ inertia: e.inertia ?? !0,
+ block: ``,
+ flush: ``,
+ },
+ {default: a(() => [f(u(e.label), 1)]), _: 2},
+ 1032,
+ [`active`, `href`, `inertia`]
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ default: a(() => [
+ i(
+ _,
+ {table: s(k)},
+ {
+ 'empty-row': a(() => [
+ i(
+ v,
+ {icon: `users`, label: s(e)(`No groups exist yet.`)},
+ {
+ default: a(() => [
+ i(
+ y,
+ {
+ inertia: !1,
+ href: s(T)().url,
+ class: `btn submit add icon`,
+ icon: `plus`,
+ appearance: `button`,
+ },
+ {
+ default: a(() => [f(u(s(e)(`New user group`)), 1)]),
+ _: 1,
+ },
+ 8,
+ [`href`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`]
+ ),
+ ]),
+ _: 1,
+ })
+ );
+ },
+});
+export {E as default};
diff --git a/resources/build/assets/UserGroupsController-CFAwxvIz.js b/resources/build/assets/UserGroupsController-CFAwxvIz.js
new file mode 100644
index 00000000000..642c86fe40f
--- /dev/null
+++ b/resources/build/assets/UserGroupsController-CFAwxvIz.js
@@ -0,0 +1,55 @@
+import {n as e, t} from './wayfinder-V597ZF_3.js';
+var n = (e) => ({url: n.url(e), method: `get`});
+((n.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/users/groups/new`,
+}),
+ (n.url = (t) => n.definition.url + e(t)),
+ (n.get = (e) => ({url: n.url(e), method: `get`})),
+ (n.head = (e) => ({url: n.url(e), method: `head`})));
+var r = (e) => ({url: r.url(e), method: `post`});
+((r.definition = {methods: [`post`], url: `/admin/settings/users/groups`}),
+ (r.url = (t) => r.definition.url + e(t)),
+ (r.post = (e) => ({url: r.url(e), method: `post`})));
+var i = (e, t) => ({url: i.url(e, t), method: `delete`});
+((i.definition = {
+ methods: [`delete`],
+ url: `/admin/settings/users/groups/{groupId}`,
+}),
+ (i.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {groupId: n}),
+ Array.isArray(n) && (n = {groupId: n[0]}),
+ (n = t(n)));
+ let a = {groupId: n.groupId};
+ return (
+ i.definition.url
+ .replace(`{groupId}`, a.groupId.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (i.delete = (e, t) => ({url: i.url(e, t), method: `delete`})));
+var a = (e, t) => ({url: a.url(e, t), method: `get`});
+((a.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/users/groups/{userGroup}`,
+}),
+ (a.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {userGroup: n}),
+ typeof n == `object` &&
+ !Array.isArray(n) &&
+ `id` in n &&
+ (n = {userGroup: n.id}),
+ Array.isArray(n) && (n = {userGroup: n[0]}),
+ (n = t(n)));
+ let i = {
+ userGroup: typeof n.userGroup == `object` ? n.userGroup.id : n.userGroup,
+ };
+ return (
+ a.definition.url
+ .replace(`{userGroup}`, i.userGroup.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (a.get = (e, t) => ({url: a.url(e, t), method: `get`})),
+ (a.head = (e, t) => ({url: a.url(e, t), method: `head`})));
+export {r as i, i as n, a as r, n as t};
diff --git a/resources/build/assets/UserGroupsEdit-DsA7IVX4.js b/resources/build/assets/UserGroupsEdit-DsA7IVX4.js
new file mode 100644
index 00000000000..631afdc2b1e
--- /dev/null
+++ b/resources/build/assets/UserGroupsEdit-DsA7IVX4.js
@@ -0,0 +1,416 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import {a as t} from './cp-npqTfNqh.js';
+import {
+ B as n,
+ E as r,
+ H as i,
+ Q as a,
+ R as o,
+ T as s,
+ X as c,
+ _ as l,
+ b as u,
+ et as d,
+ gt as f,
+ ht as p,
+ m,
+ s as h,
+ t as g,
+ tt as _,
+ v,
+ w as y,
+ x as b,
+ y as x,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {t as S} from './Pane-CJi1MPPH.js';
+import {t as C} from './CraftInput-B2G9EaE3.js';
+import {n as w, t as T} from './CraftTextarea-BNsSoX8c.js';
+import {t as E} from './AppLayout-BXGMFlSp.js';
+import {t as D} from './useSettingsSave-D5LL4sJi.js';
+import {t as O} from './CraftInputHandle-ByI6zEIo.js';
+import {t as k} from './useInputGenerator-Cl1F0ZZS.js';
+import {i as A, n as j} from './UserGroupsController-CFAwxvIz.js';
+function M(e) {
+ return (
+ e.nested &&
+ typeof e.nested == `object` &&
+ !Array.isArray(e.nested) &&
+ Object.keys(e.nested).length > 0
+ );
+}
+function N(e) {
+ return !e || !M(e)
+ ? []
+ : Object.values(e.nested).flatMap((e) => [e.key.toLowerCase(), ...N(e)]);
+}
+var P = {key: 0, slot: `help-text`},
+ F = {key: 1, class: `flex gap-1 items-center`, 'data-color': `warning`},
+ I = g(
+ r({
+ __name: `PermissionList`,
+ props: {
+ modelValue: {default: () => []},
+ permissions: {default: () => ({})},
+ disabled: {type: Boolean, default: !1},
+ level: {default: 0},
+ },
+ emits: [`update:modelValue`],
+ setup(e, {emit: t}) {
+ let r = t,
+ l = e;
+ function f(e) {
+ let t = e.toLowerCase();
+ if (l.modelValue.indexOf(t) === -1)
+ r(`update:modelValue`, [...l.modelValue, t]);
+ else {
+ let n = new Set([t, ...N(l.permissions[e])]);
+ r(
+ `update:modelValue`,
+ l.modelValue.filter((e) => !n.has(e))
+ );
+ }
+ }
+ return (t, l) => {
+ let h = i(`PermissionList`, !0);
+ return (
+ o(!0),
+ b(
+ m,
+ null,
+ n(
+ e.permissions,
+ (t, n) => (
+ o(),
+ b(
+ `ul`,
+ {
+ class: `group`,
+ key: n,
+ style: d({
+ '--gap-x': `calc((${e.level} * 1lh) + var(--c-spacing-md))`,
+ }),
+ },
+ [
+ v(`li`, null, [
+ s(
+ w,
+ {
+ label: t.label,
+ 'model-value': e.modelValue.includes(
+ n.toLowerCase()
+ ),
+ value: n,
+ disabled: e.disabled,
+ 'onUpdate:modelValue': (e) => f(n),
+ class: a({'cp-checkbox-indentation': e.level > 0}),
+ },
+ {
+ default: c(() => [
+ t.info || t.warning
+ ? (o(),
+ b(`div`, P, [
+ t.info
+ ? (o(),
+ b(m, {key: 0}, [y(_(t.info), 1)], 64))
+ : u(``, !0),
+ t.warning
+ ? (o(),
+ b(`div`, F, [
+ (l[1] ||= v(
+ `craft-icon`,
+ {name: `triangle-exclamation`},
+ null,
+ -1
+ )),
+ y(` ` + _(t.warning), 1),
+ ]))
+ : u(``, !0),
+ ]))
+ : u(``, !0),
+ ]),
+ _: 2,
+ },
+ 1032,
+ [
+ `label`,
+ `model-value`,
+ `value`,
+ `disabled`,
+ `onUpdate:modelValue`,
+ `class`,
+ ]
+ ),
+ p(M)(t)
+ ? (o(),
+ x(
+ h,
+ {
+ key: 0,
+ permissions: t.nested,
+ 'model-value': e.modelValue,
+ disabled:
+ e.disabled ||
+ !e.modelValue.includes(t.key.toLowerCase()),
+ 'onUpdate:modelValue': (l[0] ||= (e) =>
+ r(`update:modelValue`, e)),
+ level: e.level + 1,
+ },
+ null,
+ 8,
+ [
+ `permissions`,
+ `model-value`,
+ `disabled`,
+ `level`,
+ ]
+ ))
+ : u(``, !0),
+ ]),
+ ],
+ 4
+ )
+ )
+ ),
+ 128
+ )
+ );
+ };
+ },
+ }),
+ [[`__scopeId`, `data-v-851d8baa`]]
+ ),
+ L = {class: `grid gap-3`},
+ R = {class: `text-lg mb-3`},
+ z = {class: `grid gap-3`},
+ B = {class: `flex gap-2 items-center`},
+ V = [`id`],
+ H = [`onClick`],
+ U = r({
+ __name: `UserGroupsEdit`,
+ props: {
+ group: {},
+ brandNew: {type: Boolean},
+ permissions: {},
+ formActions: {},
+ redirect: {},
+ toolbar: {},
+ errors: {},
+ readOnly: {type: Boolean},
+ redirectUrl: {},
+ },
+ setup(r) {
+ let i = r,
+ a = h({
+ id: i.group.id,
+ redirect: i.redirect,
+ name: i.group.name,
+ handle: i.group.handle,
+ description: i.group.description ?? ``,
+ permissions: i.group.permissions ?? [],
+ }),
+ u = k(
+ () => a.name,
+ (e) => (a.handle = t(e))
+ );
+ function d(e) {
+ return Object.values(e).flatMap((e) => [
+ e.key,
+ ...(M(e) ? d(e.nested) : []),
+ ]);
+ }
+ let g = l(() =>
+ i.permissions.reduce(
+ (e, t) => (
+ (e[t.handle] = d(t.permissions).map((e) => e.toLowerCase())),
+ e
+ ),
+ {}
+ )
+ );
+ function w(e) {
+ if (!e) return !1;
+ let t = new Set(a.permissions);
+ return e.every((e) => t.has(e));
+ }
+ function N(e) {
+ let t = g.value[e];
+ if (t)
+ if (w(t)) {
+ let e = new Set(t);
+ a.permissions = a.permissions.filter((t) => !e.has(t));
+ } else a.permissions = [...new Set([...a.permissions, ...t])];
+ }
+ i.brandNew || u.stop();
+ let {save: P} = D(a, A),
+ F = l(() =>
+ i.readOnly || !i.group.id
+ ? []
+ : [
+ {
+ variant: `danger`,
+ label: e(`Delete group`),
+ onClick: () => {
+ confirm(
+ e(`Are you sure you want to delete “{name}”?`, {
+ name: i.group.name,
+ })
+ ) && f.delete(j({groupId: i.group.id}));
+ },
+ },
+ ]
+ );
+ return (t, i) => (
+ o(),
+ x(
+ E,
+ {form: p(a), 'form-actions': F.value, onSave: p(P)},
+ {
+ default: c(() => [
+ s(
+ S,
+ {appearance: `raised`},
+ {
+ default: c(() => [
+ v(`div`, L, [
+ s(
+ C,
+ {
+ label: p(e)(`Name`),
+ id: `name`,
+ 'data-error-key': `name`,
+ autofocus: !0,
+ required: !0,
+ disabled: r.readOnly,
+ error: r.errors?.name,
+ name: `name`,
+ modelValue: p(a).name,
+ 'onUpdate:modelValue': (i[0] ||= (e) =>
+ (p(a).name = e)),
+ },
+ null,
+ 8,
+ [`label`, `disabled`, `error`, `modelValue`]
+ ),
+ s(
+ O,
+ {
+ label: p(e)(`Handle`),
+ id: `handle`,
+ modelValue: p(a).handle,
+ 'onUpdate:modelValue': (i[1] ||= (e) =>
+ (p(a).handle = e)),
+ autocorrect: !1,
+ autocapitalize: !1,
+ name: `handle`,
+ error: r.errors?.handle,
+ required: !0,
+ 'data-error-key': `handle`,
+ disabled: r.readOnly,
+ onChange: (i[2] ||= (e) => p(u).markDirty()),
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`, `disabled`]
+ ),
+ s(
+ T,
+ {
+ label: p(e)(`Description`),
+ id: `description`,
+ name: `description`,
+ modelValue: p(a).description,
+ 'onUpdate:modelValue': (i[3] ||= (e) =>
+ (p(a).description = e)),
+ error: r.errors?.description,
+ 'data-error-key': `description`,
+ disabled: r.readOnly,
+ },
+ null,
+ 8,
+ [`label`, `modelValue`, `error`, `disabled`]
+ ),
+ ]),
+ (i[5] ||= v(`hr`, {class: `my-8`}, null, -1)),
+ v(`h2`, R, _(p(e)(`Permissions`)), 1),
+ v(`div`, z, [
+ (o(!0),
+ b(
+ m,
+ null,
+ n(
+ r.permissions,
+ (t) => (
+ o(),
+ b(`div`, {key: t.handle}, [
+ v(`div`, B, [
+ v(
+ `h3`,
+ {
+ class: `mb-1 text-base`,
+ id: `content-heading-${t.handle}`,
+ },
+ _(t.heading),
+ 9,
+ V
+ ),
+ v(
+ `craft-button`,
+ {
+ type: `button`,
+ size: `small`,
+ appearance: `plain`,
+ onClick: (e) => N(t.handle),
+ },
+ [
+ w(g.value[t.handle])
+ ? (o(),
+ b(
+ m,
+ {key: 0},
+ [y(_(p(e)(`Deselect all`)), 1)],
+ 64
+ ))
+ : (o(),
+ b(
+ m,
+ {key: 1},
+ [y(_(p(e)(`Select all`)), 1)],
+ 64
+ )),
+ ],
+ 8,
+ H
+ ),
+ ]),
+ s(
+ I,
+ {
+ permissions: t.permissions,
+ modelValue: p(a).permissions,
+ 'onUpdate:modelValue': (i[4] ||= (e) =>
+ (p(a).permissions = e)),
+ },
+ null,
+ 8,
+ [`permissions`, `modelValue`]
+ ),
+ ])
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ _: 1,
+ }
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`form`, `form-actions`, `onSave`]
+ )
+ );
+ },
+ });
+export {U as default};
diff --git a/resources/build/assets/Volumes-D_MCjKSs.js b/resources/build/assets/Volumes-D_MCjKSs.js
new file mode 100644
index 00000000000..b39e327b00b
--- /dev/null
+++ b/resources/build/assets/Volumes-D_MCjKSs.js
@@ -0,0 +1,186 @@
+import {l as e} from './nav-item-CyC1px5v-DZDpUldI.js';
+import './cp-npqTfNqh.js';
+import {
+ B as t,
+ E as n,
+ J as r,
+ P as i,
+ R as a,
+ T as o,
+ X as s,
+ _ as c,
+ ct as l,
+ gt as u,
+ ht as d,
+ k as f,
+ m as p,
+ tt as m,
+ v as h,
+ w as g,
+ x as _,
+ y as v,
+} from './_plugin-vue_export-helper-g2tzphu6.js';
+import {i as y, o as b, t as x} from './AdminTable-32qWVDq-.js';
+import {t as S} from './Empty-D0VMu5kQ.js';
+import {s as C} from './InlineFlash-DnK6Yp2V.js';
+import {t as w} from './DeleteButton-BLk4eDvl.js';
+import {t as T} from './createCraftColumnHelper-ssekFPQZ.js';
+import {t as E} from './IndexLayout-dNU8P7d2.js';
+import {
+ a as D,
+ c as O,
+ i as k,
+ n as A,
+ r as j,
+ t as M,
+} from './VolumesController-CeQEFyKw.js';
+var N = n({
+ __name: `Volumes`,
+ props: {title: {}, volumes: {}, sort: {}, readOnly: {type: Boolean}},
+ setup(n) {
+ let N = n;
+ function P(t) {
+ confirm(e(`Are you sure you want to delete “{name}?`, {name: t.name})) &&
+ u.delete(A(t.id));
+ }
+ let F = l(N.volumes.map((e) => e.id)),
+ I = c(() =>
+ (F.value ?? [])
+ .map((e) => N.volumes.find((t) => t.id === e))
+ .filter((e) => e !== void 0)
+ );
+ function L(e, t) {
+ let n = [...F.value],
+ [r] = n.splice(e, 1);
+ r !== void 0 && (n.splice(t, 0, r), (F.value = n));
+ }
+ r(F, (e, t) => {
+ i(() => {
+ u.post(
+ D(),
+ {ids: [...e]},
+ {
+ preserveScroll: !0,
+ preserveState: !0,
+ onError: () => {
+ F.value = t;
+ },
+ }
+ );
+ });
+ });
+ let R = T(),
+ z = c(() => ({name: !0, handle: !0, actions: !N.readOnly})),
+ B = c(() => [
+ R.link(`name`, {
+ header: e(`Name`),
+ props: ({row: e}) => ({href: j(e.original.id).url, inertia: !1}),
+ }),
+ R.handle(`handle`),
+ R.actions(({row: e}) => [f(w, {onClick: () => P(e.original)})]),
+ ]),
+ V = y({
+ get data() {
+ return I.value;
+ },
+ get columns() {
+ return B.value;
+ },
+ state: {
+ get columnVisibility() {
+ return z.value;
+ },
+ },
+ enableSorting: !1,
+ getCoreRowModel: b(),
+ }),
+ H = c(() => ({
+ volumes: {label: e(`Volumes`), url: k().url, active: !0},
+ transforms: {label: e(`Image Transforms`), url: O().url},
+ }));
+ return (r, i) => (
+ a(),
+ v(
+ E,
+ {title: n.title},
+ {
+ actions: s(() => [
+ o(
+ C,
+ {
+ appearance: `button`,
+ href: d(M)().url,
+ variant: `accent`,
+ inertia: !1,
+ icon: `plus`,
+ },
+ {default: s(() => [g(m(d(e)(`New volume`)), 1)]), _: 1},
+ 8,
+ [`href`]
+ ),
+ ]),
+ 'interior-nav': s(() => [
+ h(`craft-nav-list`, null, [
+ (a(!0),
+ _(
+ p,
+ null,
+ t(
+ H.value,
+ (e, t) => (
+ a(),
+ v(
+ C,
+ {
+ key: t,
+ as: `craft-nav-item`,
+ active: e.active ?? !1,
+ href: e.url,
+ block: ``,
+ flush: ``,
+ inertia: e.inertia ?? !0,
+ },
+ {default: s(() => [g(m(e.label), 1)]), _: 2},
+ 1032,
+ [`active`, `href`, `inertia`]
+ )
+ )
+ ),
+ 128
+ )),
+ ]),
+ ]),
+ default: s(() => [
+ o(
+ x,
+ {
+ table: d(V),
+ reorderable: !0,
+ 'read-only': n.readOnly,
+ onReorder: L,
+ },
+ {
+ 'empty-row': s(() => [
+ o(
+ S,
+ {label: d(e)(`No volumes exist yet.`), icon: `light/files`},
+ null,
+ 8,
+ [`label`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`table`, `read-only`]
+ ),
+ ]),
+ _: 1,
+ },
+ 8,
+ [`title`]
+ )
+ );
+ },
+});
+export {N as default};
diff --git a/resources/build/assets/VolumesController-CeQEFyKw.js b/resources/build/assets/VolumesController-CeQEFyKw.js
new file mode 100644
index 00000000000..a620152b9ed
--- /dev/null
+++ b/resources/build/assets/VolumesController-CeQEFyKw.js
@@ -0,0 +1,123 @@
+import {n as e, t} from './wayfinder-V597ZF_3.js';
+var n = (e) => ({url: n.url(e), method: `post`});
+((n.definition = {
+ methods: [`post`],
+ url: `/admin/actions/image-transforms/save`,
+}),
+ (n.url = (t) => n.definition.url + e(t)),
+ (n.post = (e) => ({url: n.url(e), method: `post`})));
+var r = (e) => ({url: r.url(e), method: `get`});
+((r.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/assets/transforms`,
+}),
+ (r.url = (t) => r.definition.url + e(t)),
+ (r.get = (e) => ({url: r.url(e), method: `get`})),
+ (r.head = (e) => ({url: r.url(e), method: `head`})));
+var i = (e) => ({url: i.url(e), method: `get`});
+((i.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/assets/transforms/new`,
+}),
+ (i.url = (t) => i.definition.url + e(t)),
+ (i.get = (e) => ({url: i.url(e), method: `get`})),
+ (i.head = (e) => ({url: i.url(e), method: `head`})));
+var a = (e, t) => ({url: a.url(e, t), method: `get`});
+((a.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/assets/transforms/{transformHandle}`,
+}),
+ (a.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) &&
+ (n = {transformHandle: n}),
+ Array.isArray(n) && (n = {transformHandle: n[0]}),
+ (n = t(n)));
+ let i = {transformHandle: n.transformHandle};
+ return (
+ a.definition.url
+ .replace(`{transformHandle}`, i.transformHandle.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (a.get = (e, t) => ({url: a.url(e, t), method: `get`})),
+ (a.head = (e, t) => ({url: a.url(e, t), method: `head`})));
+var o = (e, t) => ({url: o.url(e, t), method: `delete`});
+((o.definition = {
+ methods: [`delete`],
+ url: `/admin/settings/assets/transforms/{transformId}`,
+}),
+ (o.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {transformId: n}),
+ Array.isArray(n) && (n = {transformId: n[0]}),
+ (n = t(n)));
+ let i = {transformId: n.transformId};
+ return (
+ o.definition.url
+ .replace(`{transformId}`, i.transformId.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (o.delete = (e, t) => ({url: o.url(e, t), method: `delete`})));
+var s = (e) => ({url: s.url(e), method: `post`});
+((s.definition = {
+ methods: [`post`],
+ url: `/admin/actions/volumes/save-volume`,
+}),
+ (s.url = (t) => s.definition.url + e(t)),
+ (s.post = (e) => ({url: s.url(e), method: `post`})));
+var c = (e) => ({url: c.url(e), method: `post`});
+((c.definition = {
+ methods: [`post`],
+ url: `/admin/actions/volumes/reorder-volumes`,
+}),
+ (c.url = (t) => c.definition.url + e(t)),
+ (c.post = (e) => ({url: c.url(e), method: `post`})));
+var l = (e) => ({url: l.url(e), method: `get`});
+((l.definition = {methods: [`get`, `head`], url: `/admin/settings/assets`}),
+ (l.url = (t) => l.definition.url + e(t)),
+ (l.get = (e) => ({url: l.url(e), method: `get`})),
+ (l.head = (e) => ({url: l.url(e), method: `head`})));
+var u = (e) => ({url: u.url(e), method: `get`});
+((u.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/assets/volumes/new`,
+}),
+ (u.url = (t) => u.definition.url + e(t)),
+ (u.get = (e) => ({url: u.url(e), method: `get`})),
+ (u.head = (e) => ({url: u.url(e), method: `head`})));
+var d = (e, t) => ({url: d.url(e, t), method: `get`});
+((d.definition = {
+ methods: [`get`, `head`],
+ url: `/admin/settings/assets/volumes/{volumeId}`,
+}),
+ (d.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {volumeId: n}),
+ Array.isArray(n) && (n = {volumeId: n[0]}),
+ (n = t(n)));
+ let i = {volumeId: n.volumeId};
+ return (
+ d.definition.url
+ .replace(`{volumeId}`, i.volumeId.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (d.get = (e, t) => ({url: d.url(e, t), method: `get`})),
+ (d.head = (e, t) => ({url: d.url(e, t), method: `head`})));
+var f = (e, t) => ({url: f.url(e, t), method: `delete`});
+((f.definition = {
+ methods: [`delete`],
+ url: `/admin/settings/assets/volumes/{volumeId}`,
+}),
+ (f.url = (n, r) => {
+ ((typeof n == `string` || typeof n == `number`) && (n = {volumeId: n}),
+ Array.isArray(n) && (n = {volumeId: n[0]}),
+ (n = t(n)));
+ let i = {volumeId: n.volumeId};
+ return (
+ f.definition.url
+ .replace(`{volumeId}`, i.volumeId.toString())
+ .replace(/\/+$/, ``) + e(r)
+ );
+ }),
+ (f.delete = (e, t) => ({url: f.url(e, t), method: `delete`})));
+export {c as a, r as c, l as i, f as n, i as o, d as r, o as s, u as t};
diff --git a/resources/build/assets/_plugin-vue_export-helper-g2tzphu6.js b/resources/build/assets/_plugin-vue_export-helper-g2tzphu6.js
new file mode 100644
index 00000000000..f1177e94370
--- /dev/null
+++ b/resources/build/assets/_plugin-vue_export-helper-g2tzphu6.js
@@ -0,0 +1,16732 @@
+import {n as e} from './rolldown-runtime-DXc-PV0M.js';
+function t(e) {
+ return typeof e == `symbol` || e instanceof Symbol;
+}
+var n =
+ (typeof globalThis == `object` && globalThis) ||
+ (typeof window == `object` && window) ||
+ (typeof self == `object` && self) ||
+ (typeof global == `object` && global) ||
+ (function () {
+ return this;
+ })() ||
+ Function(`return this`)();
+function r(e, t, {signal: n, edges: r} = {}) {
+ let i,
+ a = null,
+ o = r != null && r.includes(`leading`),
+ s = r == null || r.includes(`trailing`),
+ c = () => {
+ a !== null && (e.apply(i, a), (i = void 0), (a = null));
+ },
+ l = () => {
+ (s && c(), p());
+ },
+ u = null,
+ d = () => {
+ (u != null && clearTimeout(u),
+ (u = setTimeout(() => {
+ ((u = null), l());
+ }, t)));
+ },
+ f = () => {
+ u !== null && (clearTimeout(u), (u = null));
+ },
+ p = () => {
+ (f(), (i = void 0), (a = null));
+ },
+ m = () => {
+ c();
+ },
+ h = function (...e) {
+ if (n?.aborted) return;
+ ((i = this), (a = e));
+ let t = u == null;
+ (d(), o && t && c());
+ };
+ return (
+ (h.schedule = d),
+ (h.cancel = p),
+ (h.flush = m),
+ n?.addEventListener(`abort`, p, {once: !0}),
+ h
+ );
+}
+function i() {}
+function a(e) {
+ return e == null || (typeof e != `object` && typeof e != `function`);
+}
+function o(e) {
+ return ArrayBuffer.isView(e) && !(e instanceof DataView);
+}
+function s(e) {
+ if (a(e)) return e;
+ if (
+ Array.isArray(e) ||
+ o(e) ||
+ e instanceof ArrayBuffer ||
+ (typeof SharedArrayBuffer < `u` && e instanceof SharedArrayBuffer)
+ )
+ return e.slice(0);
+ let t = Object.getPrototypeOf(e);
+ if (t == null) return Object.assign(Object.create(t), e);
+ let n = t.constructor;
+ if (e instanceof Date || e instanceof Map || e instanceof Set)
+ return new n(e);
+ if (e instanceof RegExp) {
+ let t = new n(e);
+ return ((t.lastIndex = e.lastIndex), t);
+ }
+ if (e instanceof DataView) return new n(e.buffer.slice(0));
+ if (e instanceof Error) {
+ let t;
+ return (
+ (t =
+ e instanceof AggregateError
+ ? new n(e.errors, e.message, {cause: e.cause})
+ : new n(e.message, {cause: e.cause})),
+ (t.stack = e.stack),
+ Object.assign(t, e),
+ t
+ );
+ }
+ return typeof File < `u` && e instanceof File
+ ? new n([e], e.name, {type: e.type, lastModified: e.lastModified})
+ : typeof e == `object`
+ ? Object.assign(Object.create(t), e)
+ : e;
+}
+function c(e) {
+ return Object.getOwnPropertySymbols(e).filter((t) =>
+ Object.prototype.propertyIsEnumerable.call(e, t)
+ );
+}
+function l(e) {
+ return e == null
+ ? e === void 0
+ ? `[object Undefined]`
+ : `[object Null]`
+ : Object.prototype.toString.call(e);
+}
+var u = `[object RegExp]`,
+ d = `[object String]`,
+ f = `[object Number]`,
+ p = `[object Boolean]`,
+ m = `[object Arguments]`,
+ h = `[object Symbol]`,
+ g = `[object Date]`,
+ _ = `[object Map]`,
+ v = `[object Set]`,
+ y = `[object Array]`,
+ b = `[object Function]`,
+ x = `[object ArrayBuffer]`,
+ S = `[object Object]`,
+ C = `[object Error]`,
+ w = `[object DataView]`,
+ T = `[object Uint8Array]`,
+ E = `[object Uint8ClampedArray]`,
+ D = `[object Uint16Array]`,
+ ee = `[object Uint32Array]`,
+ te = `[object BigUint64Array]`,
+ ne = `[object Int8Array]`,
+ re = `[object Int16Array]`,
+ ie = `[object Int32Array]`,
+ ae = `[object BigInt64Array]`,
+ oe = `[object Float32Array]`,
+ se = `[object Float64Array]`;
+function ce(e) {
+ return n.Buffer !== void 0 && n.Buffer.isBuffer(e);
+}
+function le(e, t) {
+ return ue(e, void 0, e, new Map(), t);
+}
+function ue(e, t, n, r = new Map(), i = void 0) {
+ let s = i?.(e, t, n, r);
+ if (s !== void 0) return s;
+ if (a(e)) return e;
+ if (r.has(e)) return r.get(e);
+ if (Array.isArray(e)) {
+ let t = Array(e.length);
+ r.set(e, t);
+ for (let a = 0; a < e.length; a++) t[a] = ue(e[a], a, n, r, i);
+ return (
+ Object.hasOwn(e, `index`) && (t.index = e.index),
+ Object.hasOwn(e, `input`) && (t.input = e.input),
+ t
+ );
+ }
+ if (e instanceof Date) return new Date(e.getTime());
+ if (e instanceof RegExp) {
+ let t = new RegExp(e.source, e.flags);
+ return ((t.lastIndex = e.lastIndex), t);
+ }
+ if (e instanceof Map) {
+ let t = new Map();
+ r.set(e, t);
+ for (let [a, o] of e) t.set(a, ue(o, a, n, r, i));
+ return t;
+ }
+ if (e instanceof Set) {
+ let t = new Set();
+ r.set(e, t);
+ for (let a of e) t.add(ue(a, void 0, n, r, i));
+ return t;
+ }
+ if (ce(e)) return e.subarray();
+ if (o(e)) {
+ let t = new (Object.getPrototypeOf(e).constructor)(e.length);
+ r.set(e, t);
+ for (let a = 0; a < e.length; a++) t[a] = ue(e[a], a, n, r, i);
+ return t;
+ }
+ if (
+ e instanceof ArrayBuffer ||
+ (typeof SharedArrayBuffer < `u` && e instanceof SharedArrayBuffer)
+ )
+ return e.slice(0);
+ if (e instanceof DataView) {
+ let t = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
+ return (r.set(e, t), de(t, e, n, r, i), t);
+ }
+ if (typeof File < `u` && e instanceof File) {
+ let t = new File([e], e.name, {type: e.type});
+ return (r.set(e, t), de(t, e, n, r, i), t);
+ }
+ if (typeof Blob < `u` && e instanceof Blob) {
+ let t = new Blob([e], {type: e.type});
+ return (r.set(e, t), de(t, e, n, r, i), t);
+ }
+ if (e instanceof Error) {
+ let t = structuredClone(e);
+ return (
+ r.set(e, t),
+ (t.message = e.message),
+ (t.name = e.name),
+ (t.stack = e.stack),
+ (t.cause = e.cause),
+ (t.constructor = e.constructor),
+ de(t, e, n, r, i),
+ t
+ );
+ }
+ if (e instanceof Boolean) {
+ let t = new Boolean(e.valueOf());
+ return (r.set(e, t), de(t, e, n, r, i), t);
+ }
+ if (e instanceof Number) {
+ let t = new Number(e.valueOf());
+ return (r.set(e, t), de(t, e, n, r, i), t);
+ }
+ if (e instanceof String) {
+ let t = new String(e.valueOf());
+ return (r.set(e, t), de(t, e, n, r, i), t);
+ }
+ if (typeof e == `object` && fe(e)) {
+ let t = Object.create(Object.getPrototypeOf(e));
+ return (r.set(e, t), de(t, e, n, r, i), t);
+ }
+ return e;
+}
+function de(e, t, n = e, r, i) {
+ let a = [...Object.keys(t), ...c(t)];
+ for (let o = 0; o < a.length; o++) {
+ let s = a[o],
+ c = Object.getOwnPropertyDescriptor(e, s);
+ (c == null || c.writable) && (e[s] = ue(t[s], s, n, r, i));
+ }
+}
+function fe(e) {
+ switch (l(e)) {
+ case m:
+ case y:
+ case x:
+ case w:
+ case p:
+ case g:
+ case oe:
+ case se:
+ case ne:
+ case re:
+ case ie:
+ case _:
+ case f:
+ case S:
+ case u:
+ case v:
+ case d:
+ case h:
+ case T:
+ case E:
+ case D:
+ case ee:
+ return !0;
+ default:
+ return !1;
+ }
+}
+function O(e) {
+ return ue(e, void 0, e, new Map(), void 0);
+}
+function pe(e) {
+ if (!e || typeof e != `object`) return !1;
+ let t = Object.getPrototypeOf(e);
+ return t === null ||
+ t === Object.prototype ||
+ Object.getPrototypeOf(t) === null
+ ? Object.prototype.toString.call(e) === `[object Object]`
+ : !1;
+}
+function me(e) {
+ return e === `__proto__`;
+}
+function he(e) {
+ if (typeof e != `object` || !e) return !1;
+ if (Object.getPrototypeOf(e) === null) return !0;
+ if (Object.prototype.toString.call(e) !== `[object Object]`) {
+ let t = e[Symbol.toStringTag];
+ return t == null ||
+ !Object.getOwnPropertyDescriptor(e, Symbol.toStringTag)?.writable
+ ? !1
+ : e.toString() === `[object ${t}]`;
+ }
+ let t = e;
+ for (; Object.getPrototypeOf(t) !== null; ) t = Object.getPrototypeOf(t);
+ return Object.getPrototypeOf(e) === t;
+}
+function ge(e, t) {
+ return e === t || (Number.isNaN(e) && Number.isNaN(t));
+}
+function _e(e, t, n) {
+ return ve(e, t, void 0, void 0, void 0, void 0, n);
+}
+function ve(e, t, n, r, i, a, o) {
+ let s = o(e, t, n, r, i, a);
+ if (s !== void 0) return s;
+ if (typeof e == typeof t)
+ switch (typeof e) {
+ case `bigint`:
+ case `string`:
+ case `boolean`:
+ case `symbol`:
+ case `undefined`:
+ return e === t;
+ case `number`:
+ return e === t || Object.is(e, t);
+ case `function`:
+ return e === t;
+ case `object`:
+ return ye(e, t, a, o);
+ }
+ return ye(e, t, a, o);
+}
+function ye(e, t, n, r) {
+ if (Object.is(e, t)) return !0;
+ let i = l(e),
+ a = l(t);
+ if (
+ (i === `[object Arguments]` && (i = S),
+ a === `[object Arguments]` && (a = S),
+ i !== a)
+ )
+ return !1;
+ switch (i) {
+ case d:
+ return e.toString() === t.toString();
+ case f:
+ return ge(e.valueOf(), t.valueOf());
+ case p:
+ case g:
+ case h:
+ return Object.is(e.valueOf(), t.valueOf());
+ case u:
+ return e.source === t.source && e.flags === t.flags;
+ case b:
+ return e === t;
+ }
+ n ??= new Map();
+ let o = n.get(e),
+ s = n.get(t);
+ if (o != null && s != null) return o === t;
+ (n.set(e, t), n.set(t, e));
+ try {
+ switch (i) {
+ case _:
+ if (e.size !== t.size) return !1;
+ for (let [i, a] of e.entries())
+ if (!t.has(i) || !ve(a, t.get(i), i, e, t, n, r)) return !1;
+ return !0;
+ case v: {
+ if (e.size !== t.size) return !1;
+ let i = Array.from(e.values()),
+ a = Array.from(t.values());
+ for (let o = 0; o < i.length; o++) {
+ let s = i[o],
+ c = a.findIndex((i) => ve(s, i, void 0, e, t, n, r));
+ if (c === -1) return !1;
+ a.splice(c, 1);
+ }
+ return !0;
+ }
+ case y:
+ case T:
+ case E:
+ case D:
+ case ee:
+ case te:
+ case ne:
+ case re:
+ case ie:
+ case ae:
+ case oe:
+ case se:
+ if (ce(e) !== ce(t) || e.length !== t.length) return !1;
+ for (let i = 0; i < e.length; i++)
+ if (!ve(e[i], t[i], i, e, t, n, r)) return !1;
+ return !0;
+ case x:
+ return e.byteLength === t.byteLength
+ ? ye(new Uint8Array(e), new Uint8Array(t), n, r)
+ : !1;
+ case w:
+ return e.byteLength !== t.byteLength || e.byteOffset !== t.byteOffset
+ ? !1
+ : ye(new Uint8Array(e), new Uint8Array(t), n, r);
+ case C:
+ return e.name === t.name && e.message === t.message;
+ case S: {
+ if (!(ye(e.constructor, t.constructor, n, r) || (pe(e) && pe(t))))
+ return !1;
+ let i = [...Object.keys(e), ...c(e)],
+ a = [...Object.keys(t), ...c(t)];
+ if (i.length !== a.length) return !1;
+ for (let a = 0; a < i.length; a++) {
+ let o = i[a],
+ s = e[o];
+ if (!Object.hasOwn(t, o)) return !1;
+ let c = t[o];
+ if (!ve(s, c, o, e, t, n, r)) return !1;
+ }
+ return !0;
+ }
+ default:
+ return !1;
+ }
+ } finally {
+ (n.delete(e), n.delete(t));
+ }
+}
+function be(e, t) {
+ return _e(e, t, i);
+}
+function xe(e) {
+ return Number.isSafeInteger(e) && e >= 0;
+}
+var Se = {'&': `&`, '<': `<`, '>': `>`, '"': `"`, "'": `'`};
+function Ce(e) {
+ return e.replace(/[&<>"']/g, (e) => Se[e]);
+}
+function we(e) {
+ return e != null && typeof e != `function` && xe(e.length);
+}
+function Te(e) {
+ switch (typeof e) {
+ case `number`:
+ case `symbol`:
+ return !1;
+ case `string`:
+ return e.includes(`.`) || e.includes(`[`) || e.includes(`]`);
+ }
+}
+function Ee(e) {
+ return typeof e == `string` || typeof e == `symbol`
+ ? e
+ : Object.is(e?.valueOf?.(), -0)
+ ? `-0`
+ : String(e);
+}
+function De(e) {
+ if (e == null) return ``;
+ if (typeof e == `string`) return e;
+ if (Array.isArray(e)) return e.map(De).join(`,`);
+ let t = String(e);
+ return t === `0` && Object.is(Number(e), -0) ? `-0` : t;
+}
+function Oe(e) {
+ if (Array.isArray(e)) return e.map(Ee);
+ if (typeof e == `symbol`) return [e];
+ e = De(e);
+ let t = [],
+ n = e.length;
+ if (n === 0) return t;
+ let r = 0,
+ i = ``,
+ a = ``,
+ o = !1;
+ for (e.charCodeAt(0) === 46 && (t.push(``), r++); r < n; ) {
+ let s = e[r];
+ (a
+ ? s === `\\` && r + 1 < n
+ ? (r++, (i += e[r]))
+ : s === a
+ ? (a = ``)
+ : (i += s)
+ : o
+ ? s === `"` || s === `'`
+ ? (a = s)
+ : s === `]`
+ ? ((o = !1), t.push(i), (i = ``))
+ : (i += s)
+ : s === `[`
+ ? ((o = !0), (i &&= (t.push(i), ``)))
+ : s === `.`
+ ? (i &&= (t.push(i), ``))
+ : (i += s),
+ r++);
+ }
+ return (i && t.push(i), t);
+}
+function k(e, t, n) {
+ if (e == null) return n;
+ switch (typeof t) {
+ case `string`: {
+ if (me(t)) return n;
+ let r = e[t];
+ return r === void 0 ? (Te(t) ? k(e, Oe(t), n) : n) : r;
+ }
+ case `number`:
+ case `symbol`: {
+ typeof t == `number` && (t = Ee(t));
+ let r = e[t];
+ return r === void 0 ? n : r;
+ }
+ default: {
+ if (Array.isArray(t)) return ke(e, t, n);
+ if (((t = Object.is(t?.valueOf(), -0) ? `-0` : String(t)), me(t)))
+ return n;
+ let r = e[t];
+ return r === void 0 ? n : r;
+ }
+ }
+}
+function ke(e, t, n) {
+ if (t.length === 0) return n;
+ let r = e;
+ for (let e = 0; e < t.length; e++) {
+ if (r == null || me(t[e])) return n;
+ r = r[t[e]];
+ }
+ return r === void 0 ? n : r;
+}
+function Ae(e) {
+ return e !== null && (typeof e == `object` || typeof e == `function`);
+}
+function je(e, t) {
+ return le(e, (n, r, i, a) => {
+ let o = t?.(n, r, i, a);
+ if (o !== void 0) return o;
+ if (typeof e == `object`) {
+ if (l(e) === `[object Object]` && typeof e.constructor != `function`) {
+ let t = {};
+ return (a.set(e, t), de(t, e, i, a), t);
+ }
+ switch (Object.prototype.toString.call(e)) {
+ case f:
+ case d:
+ case p: {
+ let t = new e.constructor(e?.valueOf());
+ return (de(t, e), t);
+ }
+ case m: {
+ let t = {};
+ return (
+ de(t, e),
+ (t.length = e.length),
+ (t[Symbol.iterator] = e[Symbol.iterator]),
+ t
+ );
+ }
+ default:
+ return;
+ }
+ }
+ });
+}
+function Me(e) {
+ return je(e);
+}
+var Ne = /^(?:0|[1-9]\d*)$/;
+function Pe(e, t = 2 ** 53 - 1) {
+ switch (typeof e) {
+ case `number`:
+ return Number.isInteger(e) && e >= 0 && e < t;
+ case `symbol`:
+ return !1;
+ case `string`:
+ return Ne.test(e);
+ }
+}
+function Fe(e) {
+ return typeof e == `object` && !!e && l(e) === `[object Arguments]`;
+}
+function Ie(e, t) {
+ let n;
+ if (
+ ((n = Array.isArray(t)
+ ? t
+ : typeof t == `string` && Te(t) && e?.[t] == null
+ ? Oe(t)
+ : [t]),
+ n.length === 0)
+ )
+ return !1;
+ let r = e;
+ for (let e = 0; e < n.length; e++) {
+ let t = n[e];
+ if (
+ (r == null || !Object.hasOwn(r, t)) &&
+ !((Array.isArray(r) || Fe(r)) && Pe(t) && t < r.length)
+ )
+ return !1;
+ r = r[t];
+ }
+ return !0;
+}
+function Le(e) {
+ return typeof e == `object` && !!e;
+}
+function Re(e) {
+ return Le(e) && we(e);
+}
+var ze = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
+ Be = /^\w*$/;
+function Ve(e, n) {
+ return Array.isArray(e)
+ ? !1
+ : typeof e == `number` || typeof e == `boolean` || e == null || t(e)
+ ? !0
+ : (typeof e == `string` && (Be.test(e) || !ze.test(e))) ||
+ (n != null && Object.hasOwn(n, e));
+}
+var He = (e, t, n) => {
+ let r = e[t];
+ (!(Object.hasOwn(e, t) && ge(r, n)) || (n === void 0 && !(t in e))) &&
+ (e[t] = n);
+};
+function Ue(e, t, n, r) {
+ if (e == null && !Ae(e)) return e;
+ let i;
+ i = Ve(t, e) ? [t] : Array.isArray(t) ? t : Oe(t);
+ let a = n(k(e, i)),
+ o = e;
+ for (let t = 0; t < i.length && o != null; t++) {
+ let n = Ee(i[t]);
+ if (me(n)) continue;
+ let s;
+ if (t === i.length - 1) s = a;
+ else {
+ let a = o[n],
+ c = r?.(a, n, e);
+ s = c === void 0 ? (Ae(a) ? a : Pe(i[t + 1]) ? [] : {}) : c;
+ }
+ (He(o, n, s), (o = o[n]));
+ }
+ return e;
+}
+function We(e, t, n) {
+ return Ue(
+ e,
+ t,
+ () => n,
+ () => void 0
+ );
+}
+function Ge(e, t = 0, n = {}) {
+ typeof n != `object` && (n = {});
+ let {leading: i = !1, trailing: a = !0, maxWait: o} = n,
+ s = [, ,];
+ (i && (s[0] = `leading`), a && (s[1] = `trailing`));
+ let c,
+ l = null,
+ u = r(
+ function (...t) {
+ ((c = e.apply(this, t)), (l = null));
+ },
+ t,
+ {edges: s}
+ ),
+ d = function (...t) {
+ return o != null && (l === null && (l = Date.now()), Date.now() - l >= o)
+ ? ((c = e.apply(this, t)),
+ (l = Date.now()),
+ u.cancel(),
+ u.schedule(),
+ c)
+ : (u.apply(this, t), c);
+ };
+ return ((d.cancel = u.cancel), (d.flush = () => (u.flush(), c)), d);
+}
+function Ke(e) {
+ return o(e);
+}
+function qe(e, ...t) {
+ let n = t.slice(0, -1),
+ r = t[t.length - 1],
+ i = e;
+ for (let e = 0; e < n.length; e++) {
+ let t = n[e];
+ i = Je(i, t, r, new Map());
+ }
+ return i;
+}
+function Je(e, t, n, r) {
+ if ((a(e) && (e = Object(e)), typeof t != `object` || !t)) return e;
+ if (r.has(t)) return s(r.get(t));
+ if ((r.set(t, e), Array.isArray(t))) {
+ t = t.slice();
+ for (let e = 0; e < t.length; e++) t[e] = t[e] ?? void 0;
+ }
+ let i = [...Object.keys(t), ...c(t)];
+ for (let a = 0; a < i.length; a++) {
+ let o = i[a];
+ if (me(o)) continue;
+ let s = t[o],
+ c = e[o];
+ if (
+ (Fe(s) && (s = {...s}),
+ Fe(c) && (c = {...c}),
+ ce(s) && (s = Me(s)),
+ Array.isArray(s))
+ )
+ if (Array.isArray(c)) {
+ let e = [],
+ t = Reflect.ownKeys(c);
+ for (let n = 0; n < t.length; n++) {
+ let r = t[n];
+ e[r] = c[r];
+ }
+ c = e;
+ } else if (Re(c)) {
+ let e = [];
+ for (let t = 0; t < c.length; t++) e[t] = c[t];
+ c = e;
+ } else c = [];
+ let l = n(c, s, o, e, t, r);
+ l === void 0
+ ? Array.isArray(s) ||
+ (Le(c) && Le(s) && (he(c) || he(s) || Ke(c) || Ke(s)))
+ ? (e[o] = Je(c, s, n, r))
+ : c == null && he(s)
+ ? (e[o] = Je({}, s, n, r))
+ : c == null && Ke(s)
+ ? (e[o] = Me(s))
+ : (c === void 0 || s !== void 0) && (e[o] = s)
+ : (e[o] = l);
+ }
+ return e;
+}
+function Ye(e, ...t) {
+ return qe(e, ...t, i);
+}
+function Xe(e) {
+ return Ce(De(e));
+}
+var Ze = (e) =>
+ (typeof File < `u` && e instanceof File) ||
+ e instanceof Blob ||
+ (typeof FileList < `u` && e instanceof FileList && e.length > 0),
+ Qe = (e) =>
+ e instanceof FormData
+ ? !0
+ : Ze(e) ||
+ (typeof e == `object` && !!e && Object.values(e).some((e) => Qe(e))),
+ $e = class extends Error {
+ response;
+ constructor(e) {
+ (super(`HTTP error ${e.status}`),
+ (this.name = `HttpResponseError`),
+ (this.response = e));
+ }
+ },
+ et = class extends Error {
+ constructor(e = `Request was cancelled`) {
+ (super(e), (this.name = `HttpCancelledError`));
+ }
+ },
+ tt = class extends Error {
+ constructor(e = `Network error`) {
+ (super(e), (this.name = `HttpNetworkError`));
+ }
+ };
+function nt(e) {
+ let t = new URLSearchParams();
+ return (
+ Object.entries(e).forEach(([e, n]) => {
+ n != null &&
+ (Array.isArray(n)
+ ? n.forEach((n) => t.append(`${e}[]`, String(n)))
+ : typeof n == `object`
+ ? t.append(e, JSON.stringify(n))
+ : t.append(e, String(n)));
+ }),
+ t.toString()
+ );
+}
+function rt(e, t, n) {
+ if (
+ (t &&
+ !e.startsWith(`http://`) &&
+ !e.startsWith(`https://`) &&
+ (e = t.replace(/\/$/, ``) + `/` + e.replace(/^\//, ``)),
+ n && Object.keys(n).length > 0)
+ ) {
+ let t = nt(n);
+ t && (e += (e.includes(`?`) ? `&` : `?`) + t);
+ }
+ return e;
+}
+function it() {
+ return typeof window > `u`
+ ? null
+ : (window.axios?.defaults?.headers?.common?.[`X-Requested-With`] ?? null);
+}
+function at(e, t = new FormData(), n = null) {
+ for (let r in e)
+ Object.prototype.hasOwnProperty.call(e, r) &&
+ ot(t, n ? `${n}[${r}]` : r, e[r]);
+ return t;
+}
+function ot(e, t, n) {
+ if (Array.isArray(n)) return n.forEach((n, r) => ot(e, `${t}[${r}]`, n));
+ if (n instanceof Date) return e.append(t, n.toISOString());
+ if (typeof File < `u` && n instanceof File) return e.append(t, n, n.name);
+ if (n instanceof Blob) return e.append(t, n);
+ if (typeof n == `boolean`) return e.append(t, n ? `1` : `0`);
+ if (typeof n == `string`) return e.append(t, n);
+ if (typeof n == `number`) return e.append(t, `${n}`);
+ if (n == null) return e.append(t, ``);
+ at(n, e, t);
+}
+function st(e, t) {
+ if (e != null)
+ return e instanceof FormData
+ ? e
+ : typeof e == `object` && Qe(e)
+ ? at(e)
+ : typeof e == `object` ||
+ t[`Content-Type`]?.includes(`application/json`)
+ ? JSON.stringify(e)
+ : String(e);
+}
+function ct(e) {
+ let t = {};
+ return (
+ e.forEach((e, n) => {
+ t[n.toLowerCase()] = e;
+ }),
+ t
+ );
+}
+function lt(e = {}) {
+ let t = e.xsrfCookieName ?? `XSRF-TOKEN`,
+ n = e.xsrfHeaderName ?? `X-XSRF-TOKEN`;
+ function r() {
+ if (typeof document > `u`) return null;
+ let e = document.cookie.match(RegExp(`(^|;\\s*)` + t + `=([^;]*)`));
+ return e ? decodeURIComponent(e[2]) : null;
+ }
+ return {
+ setXsrfCookieName(e) {
+ t = e;
+ },
+ setXsrfHeaderName(e) {
+ n = e;
+ },
+ async request(e) {
+ let t = rt(e.url, e.baseURL, e.params),
+ i = e.method.toUpperCase(),
+ a = {},
+ o = it();
+ (o && (a[`X-Requested-With`] = o),
+ e.data !== void 0 &&
+ ![`GET`, `DELETE`].includes(i) &&
+ !(e.data instanceof FormData) &&
+ !Qe(e.data) &&
+ (a[`Content-Type`] = `application/json`),
+ e.headers &&
+ Object.entries(e.headers).forEach(([e, t]) => {
+ t !== void 0 && (a[e] = String(t));
+ }));
+ let s = r();
+ s && ![`GET`, `HEAD`, `OPTIONS`].includes(i) && (a[n] = s);
+ let c = e.signal,
+ l,
+ u = e.timeout ?? 3e4;
+ if (u > 0 && !c) {
+ let e = new AbortController();
+ ((c = e.signal), (l = setTimeout(() => e.abort(), u)));
+ }
+ let d = [`GET`, `DELETE`].includes(i) ? void 0 : st(e.data, a);
+ d instanceof FormData && delete a[`Content-Type`];
+ try {
+ let n = await fetch(t, {
+ method: i,
+ headers: a,
+ body: d,
+ signal: c,
+ credentials: e.credentials ?? `same-origin`,
+ });
+ l && clearTimeout(l);
+ let r;
+ r = n.headers.get(`content-type`)?.includes(`application/json`)
+ ? await n.json()
+ : await n.text();
+ let o = {status: n.status, data: r, headers: ct(n.headers)};
+ if (!n.ok) throw new $e(o);
+ return o;
+ } catch (e) {
+ throw (
+ l && clearTimeout(l),
+ e instanceof $e
+ ? e
+ : e instanceof DOMException && e.name === `AbortError`
+ ? new et()
+ : e instanceof TypeError
+ ? new tt(e.message)
+ : e
+ );
+ }
+ },
+ };
+}
+var ut = lt(),
+ dt = ut,
+ ft = void 0,
+ pt = void 0,
+ mt = `same-origin`,
+ ht = (e) => `${e.method}:${e.baseURL ?? ft ?? ``}${e.url}`,
+ gt = (e) => e.status === 204 && e.headers[`precognition-success`] === `true`,
+ _t = {},
+ vt = {
+ get: (e, t = {}, n = {}) => bt(yt(`get`, e, t, n)),
+ post: (e, t = {}, n = {}) => bt(yt(`post`, e, t, n)),
+ patch: (e, t = {}, n = {}) => bt(yt(`patch`, e, t, n)),
+ put: (e, t = {}, n = {}) => bt(yt(`put`, e, t, n)),
+ delete: (e, t = {}, n = {}) => bt(yt(`delete`, e, t, n)),
+ useHttpClient(e) {
+ return ((dt = e), vt);
+ },
+ withBaseURL(e) {
+ return ((ft = e), vt);
+ },
+ withTimeout(e) {
+ return ((pt = e), vt);
+ },
+ withCredentials(e) {
+ return ((mt = typeof e == `string` ? e : e ? `include` : `omit`), vt);
+ },
+ fingerprintRequestsUsing(e) {
+ return ((ht = e === null ? () => null : e), vt);
+ },
+ determineSuccessUsing(e) {
+ return ((gt = e), vt);
+ },
+ withXsrfCookieName(e) {
+ return (ut.setXsrfCookieName(e), vt);
+ },
+ withXsrfHeaderName(e) {
+ return (ut.setXsrfHeaderName(e), vt);
+ },
+ },
+ yt = (e, t, n, r) => ({
+ url: t,
+ method: e,
+ ...r,
+ ...([`get`, `delete`].includes(e)
+ ? {params: Ye({}, n, r?.params)}
+ : {data: Ye({}, n, r?.data)}),
+ }),
+ bt = (e = {}) => {
+ let t = [xt, Ct, wt].reduce((e, t) => t(e), e);
+ return (t.onBefore ?? (() => !0))() === !1
+ ? Promise.resolve(null)
+ : ((t.onStart ?? (() => null))(),
+ dt
+ .request({
+ method: t.method,
+ url: t.url,
+ baseURL: t.baseURL ?? ft,
+ data: t.data,
+ params: t.params,
+ headers: t.headers,
+ signal: t.signal,
+ timeout: t.timeout,
+ credentials: mt,
+ })
+ .then(
+ async (e) => {
+ t.precognitive && Tt(e);
+ let n = e.status,
+ r = e;
+ return (
+ t.precognitive &&
+ t.onPrecognitionSuccess &&
+ gt(e) &&
+ (r = await Promise.resolve(t.onPrecognitionSuccess(e) ?? r)),
+ t.onSuccess &&
+ St(n) &&
+ (r = await Promise.resolve(t.onSuccess(r) ?? r)),
+ (Dt(t, n) ?? ((e) => e))(r) ?? r
+ );
+ },
+ (e) => {
+ if (Et(e)) return Promise.reject(e);
+ let n = e;
+ return (
+ t.precognitive && Tt(n.response),
+ (Dt(t, n.response.status) ?? ((e, t) => Promise.reject(t)))(
+ n.response,
+ n
+ )
+ );
+ }
+ )
+ .finally(t.onFinish ?? (() => null)));
+ },
+ xt = (e) => {
+ let t = e.only ?? e.validate;
+ return {
+ ...e,
+ timeout: e.timeout ?? pt,
+ precognitive: e.precognitive !== !1,
+ fingerprint: e.fingerprint === void 0 ? ht(e, dt) : e.fingerprint,
+ headers: {
+ ...e.headers,
+ Accept: `application/json`,
+ 'Content-Type': Ot(e),
+ ...(e.precognitive === !1 ? {} : {Precognition: !0}),
+ ...(t ? {'Precognition-Validate-Only': Array.from(t).join()} : {}),
+ },
+ };
+ },
+ St = (e) => e >= 200 && e < 300,
+ Ct = (e) =>
+ typeof e.fingerprint == `string`
+ ? (_t[e.fingerprint]?.abort(), delete _t[e.fingerprint], e)
+ : e,
+ wt = (e) =>
+ typeof e.fingerprint != `string` || e.signal || !e.precognitive
+ ? e
+ : ((_t[e.fingerprint] = new AbortController()),
+ {...e, signal: _t[e.fingerprint].signal}),
+ Tt = (e) => {
+ if (e.headers?.precognition !== `true`)
+ throw Error(
+ `Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.`
+ );
+ },
+ Et = (e) => !(e instanceof $e) || typeof e.response?.status != `number`,
+ Dt = (e, t) =>
+ ({
+ 401: e.onUnauthorized,
+ 403: e.onForbidden,
+ 404: e.onNotFound,
+ 409: e.onConflict,
+ 422: e.onValidationError,
+ 423: e.onLocked,
+ })[t],
+ Ot = (e) =>
+ e.headers?.[`Content-Type`] ??
+ e.headers?.[`Content-type`] ??
+ e.headers?.[`content-type`] ??
+ (Qe(e.data) ? `multipart/form-data` : `application/json`),
+ kt = (e, t) => {
+ if (!e.includes(`*`)) return [e];
+ let n = e.split(`.`),
+ r = [``];
+ for (let e of n)
+ if (e === `*`) {
+ let e = [];
+ for (let n of r) {
+ let r = n ? k(t, n) : t;
+ if (Array.isArray(r))
+ for (let t = 0; t < r.length; t++)
+ e.push(n ? `${n}.${t}` : String(t));
+ else if (typeof r == `object` && r)
+ for (let t of Object.keys(r)) e.push(n ? `${n}.${t}` : t);
+ }
+ r = e;
+ } else r = r.map((t) => (t ? `${t}.${e}` : e));
+ return r;
+ },
+ At = (e, t) =>
+ t.includes(`*`)
+ ? RegExp(
+ `^` + t.replace(/\./g, `\\.`).replace(/\*/g, `[^.]+`) + `$`
+ ).test(e)
+ : e === t,
+ jt = (e, t) =>
+ Object.fromEntries(
+ Object.entries(e).filter(([e]) => !t.some((t) => At(e, t)))
+ ),
+ Mt = (e, t = {}) => {
+ let n = {
+ errorsChanged: [],
+ touchedChanged: [],
+ validatingChanged: [],
+ validatedChanged: [],
+ },
+ r = !1,
+ i = !1,
+ a = (e) => (e === i ? [] : ((i = e), n.validatingChanged)),
+ o = [],
+ s = (e) => {
+ let t = [...new Set(e)];
+ return o.length !== t.length || !t.every((e) => o.includes(e))
+ ? ((o = t), n.validatedChanged)
+ : [];
+ },
+ c = () => o.filter((e) => d[e] === void 0),
+ l = [],
+ u = (e) => {
+ let t = [...new Set(e)];
+ return l.length !== t.length || !t.every((e) => l.includes(e))
+ ? ((l = t), n.touchedChanged)
+ : [];
+ },
+ d = {},
+ f = (e) => {
+ let t = Pt(e);
+ return be(d, t) ? [] : ((d = t), n.errorsChanged);
+ },
+ p = (e) => {
+ let t = {...d};
+ return (delete t[Ft(e)], f(t));
+ },
+ m = () => Object.keys(d).length > 0,
+ h = 1500,
+ g = (e) => {
+ ((h = e), S.cancel(), (S = x()));
+ },
+ _ = t,
+ v = null,
+ y = [],
+ b = null,
+ x = () =>
+ Ge(
+ (t) => {
+ e({
+ get: (e, n = {}, r = {}) => vt.get(e, T(n), C(r, t, n)),
+ post: (e, n = {}, r = {}) => vt.post(e, T(n), C(r, t, n)),
+ patch: (e, n = {}, r = {}) => vt.patch(e, T(n), C(r, t, n)),
+ put: (e, n = {}, r = {}) => vt.put(e, T(n), C(r, t, n)),
+ delete: (e, n = {}, r = {}) => vt.delete(e, T(n), C(r, t, n)),
+ }).catch((e) =>
+ e instanceof et || (e instanceof $e && e.response?.status === 422)
+ ? null
+ : Promise.reject(e)
+ );
+ },
+ h,
+ {leading: !0, trailing: !0}
+ ),
+ S = x(),
+ C = (e, t, n = {}) => {
+ let r = {...e, ...t},
+ i = Array.from(r.only ?? r.validate ?? l);
+ return {
+ ...t,
+ ...Ye({}, e, t),
+ only: i,
+ timeout: r.timeout ?? 5e3,
+ onValidationError: (e, t) => (
+ [
+ ...s([...o, ...i]),
+ ...f(Ye(jt({...d}, i), e.data.errors)),
+ ].forEach((e) => e()),
+ r.onValidationError ? r.onValidationError(e, t) : Promise.reject(t)
+ ),
+ onSuccess: (e) => (
+ s([...o, ...i]).forEach((e) => e()),
+ r.onSuccess ? r.onSuccess(e) : e
+ ),
+ onPrecognitionSuccess: (e) => (
+ [...s([...o, ...i]), ...f(jt({...d}, i))].forEach((e) => e()),
+ r.onPrecognitionSuccess ? r.onPrecognitionSuccess(e) : e
+ ),
+ onBefore: () => {
+ let e = l.some((e) => e.includes(`*`)),
+ t = e ? [...new Set(l.flatMap((e) => kt(e, n)))] : l;
+ return (r.onBeforeValidation &&
+ r.onBeforeValidation(
+ {data: n, touched: t},
+ {data: _, touched: y}
+ ) === !1) ||
+ (r.onBefore || (() => !0))() === !1
+ ? !1
+ : (e && u(t).forEach((e) => e()), (b = l), (v = n), !0);
+ },
+ onStart: () => {
+ (a(!0).forEach((e) => e()), (r.onStart ?? (() => null))());
+ },
+ onFinish: () => {
+ (a(!1).forEach((e) => e()),
+ (y = b),
+ (_ = v),
+ (b = v = null),
+ (r.onFinish ?? (() => null))());
+ },
+ };
+ },
+ w = (e, t, n) => {
+ if (e === void 0) {
+ let e = Array.from(n?.only ?? n?.validate ?? []);
+ (u([...l, ...e]).forEach((e) => e()), S(n ?? {}));
+ return;
+ }
+ if (Ze(t) && !r) {
+ console.warn(
+ `Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.`
+ );
+ return;
+ }
+ ((e = Ft(e)),
+ (e.includes(`*`) || k(_, e) !== t) &&
+ (u([e, ...l]).forEach((e) => e()), S(n ?? {})));
+ },
+ T = (e) => (r === !1 ? It(e) : e),
+ E = {
+ touched: () => l,
+ validate(e, t, n) {
+ return (
+ typeof e == `object` &&
+ !(`target` in e) &&
+ ((n = e), (e = t = void 0)),
+ w(e, t, n),
+ E
+ );
+ },
+ touch(e) {
+ let t = Array.isArray(e) ? e : [Ft(e)];
+ return (u([...l, ...t]).forEach((e) => e()), E);
+ },
+ validating: () => i,
+ valid: c,
+ errors: () => d,
+ hasErrors: m,
+ setErrors(e) {
+ return (f(e).forEach((e) => e()), E);
+ },
+ forgetError(e) {
+ return (p(e).forEach((e) => e()), E);
+ },
+ defaults(e) {
+ return ((t = e), (_ = e), E);
+ },
+ reset(...e) {
+ if (e.length === 0) u([]).forEach((e) => e());
+ else {
+ let n = [...l];
+ (e.forEach((e) => {
+ (n.includes(e) && n.splice(n.indexOf(e), 1), We(_, e, k(t, e)));
+ }),
+ u(n).forEach((e) => e()));
+ }
+ return E;
+ },
+ setTimeout(e) {
+ return (g(e), E);
+ },
+ on(e, t) {
+ return (n[e].push(t), E);
+ },
+ validateFiles() {
+ return ((r = !0), E);
+ },
+ withoutFileValidation() {
+ return ((r = !1), E);
+ },
+ };
+ return E;
+ },
+ Nt = (e) =>
+ Object.keys(e).reduce(
+ (t, n) => ({...t, [n]: Array.isArray(e[n]) ? e[n][0] : e[n]}),
+ {}
+ ),
+ Pt = (e) =>
+ Object.keys(e).reduce(
+ (t, n) => ({...t, [n]: typeof e[n] == `string` ? [e[n]] : e[n]}),
+ {}
+ ),
+ Ft = (e) => (typeof e == `string` ? e : e.target.name),
+ It = (e) => {
+ let t = {...e};
+ return (
+ Object.keys(t).forEach((e) => {
+ let n = t[e];
+ if (n !== null) {
+ if (Ze(n)) {
+ delete t[e];
+ return;
+ }
+ if (Array.isArray(n)) {
+ t[e] = Object.values(It({...n}));
+ return;
+ }
+ if (typeof n == `object`) {
+ t[e] = It(t[e]);
+ return;
+ }
+ }
+ }),
+ t
+ );
+ },
+ Lt = new (class {
+ config = {};
+ defaults;
+ constructor(e) {
+ this.defaults = e;
+ }
+ extend(e) {
+ return (e && (this.defaults = {...this.defaults, ...e}), this);
+ }
+ replace(e) {
+ this.config = e;
+ }
+ get(e) {
+ return Ie(this.config, e) ? k(this.config, e) : k(this.defaults, e);
+ }
+ set(e, t) {
+ typeof e == `string`
+ ? We(this.config, e, t)
+ : Object.entries(e).forEach(([e, t]) => {
+ We(this.config, e, t);
+ });
+ }
+ })({
+ form: {
+ recentlySuccessfulDuration: 2e3,
+ forceIndicesArrayFormatInFormData: !0,
+ withAllErrors: !1,
+ },
+ prefetch: {cacheFor: 3e4, hoverDelay: 75},
+ });
+function Rt(e, t) {
+ let n;
+ return function (...r) {
+ (clearTimeout(n), (n = setTimeout(() => e.apply(this, r), t)));
+ };
+}
+function zt(e, t) {
+ return document.dispatchEvent(new CustomEvent(`inertia:${e}`, t));
+}
+var Bt = (e) => zt(`before`, {cancelable: !0, detail: {visit: e}}),
+ Vt = (e) => zt(`error`, {detail: {errors: e}}),
+ Ht = (e) => zt(`networkError`, {cancelable: !0, detail: {error: e}}),
+ Ut = (e) => zt(`finish`, {detail: {visit: e}}),
+ Wt = (e) => zt(`httpException`, {cancelable: !0, detail: {response: e}}),
+ Gt = (e) => zt(`beforeUpdate`, {detail: {page: e}}),
+ Kt = (e) => zt(`navigate`, {detail: {page: e}}),
+ qt = (e) => zt(`progress`, {detail: {progress: e}}),
+ Jt = (e) => zt(`start`, {detail: {visit: e}}),
+ Yt = (e) => zt(`success`, {detail: {page: e}}),
+ Xt = (e, t) =>
+ zt(`prefetched`, {detail: {fetchedAt: Date.now(), response: e, visit: t}}),
+ Zt = (e) => zt(`prefetching`, {detail: {visit: e}}),
+ Qt = (e) => zt(`flash`, {detail: {flash: e}}),
+ $t = class {
+ static locationVisitKey = `inertiaLocationVisit`;
+ static set(e, t) {
+ typeof window < `u` &&
+ window.sessionStorage.setItem(e, JSON.stringify(t));
+ }
+ static get(e) {
+ if (typeof window < `u`)
+ return JSON.parse(window.sessionStorage.getItem(e) || `null`);
+ }
+ static merge(e, t) {
+ let n = this.get(e);
+ n === null ? this.set(e, t) : this.set(e, {...n, ...t});
+ }
+ static remove(e) {
+ typeof window < `u` && window.sessionStorage.removeItem(e);
+ }
+ static removeNested(e, t) {
+ let n = this.get(e);
+ n !== null && (delete n[t], this.set(e, n));
+ }
+ static exists(e) {
+ try {
+ return this.get(e) !== null;
+ } catch {
+ return !1;
+ }
+ }
+ static clear() {
+ typeof window < `u` && window.sessionStorage.clear();
+ }
+ },
+ en = async (e) => {
+ if (typeof window > `u`) throw Error(`Unable to encrypt history`);
+ let t = on(),
+ n = await ln(await un());
+ if (!n) throw Error(`Unable to encrypt history`);
+ return await rn(t, n, e);
+ },
+ tn = {key: `historyKey`, iv: `historyIv`},
+ nn = async (e) => {
+ let t = on(),
+ n = await un();
+ if (!n) throw Error(`Unable to decrypt history`);
+ return await an(t, n, e);
+ },
+ rn = async (e, t, n) => {
+ if (typeof window > `u`) throw Error(`Unable to encrypt history`);
+ if (window.crypto.subtle === void 0)
+ return (
+ console.warn(
+ `Encryption is not supported in this environment. SSL is required.`
+ ),
+ Promise.resolve(n)
+ );
+ let r = new TextEncoder(),
+ i = JSON.stringify(n),
+ a = new Uint8Array(i.length * 3),
+ o = r.encodeInto(i, a);
+ return window.crypto.subtle.encrypt(
+ {name: `AES-GCM`, iv: e},
+ t,
+ a.subarray(0, o.written)
+ );
+ },
+ an = async (e, t, n) => {
+ if (window.crypto.subtle === void 0)
+ return (
+ console.warn(
+ `Decryption is not supported in this environment. SSL is required.`
+ ),
+ Promise.resolve(n)
+ );
+ let r = await window.crypto.subtle.decrypt({name: `AES-GCM`, iv: e}, t, n);
+ return JSON.parse(new TextDecoder().decode(r));
+ },
+ on = () => {
+ let e = $t.get(tn.iv);
+ if (e) return new Uint8Array(e);
+ let t = window.crypto.getRandomValues(new Uint8Array(12));
+ return ($t.set(tn.iv, Array.from(t)), t);
+ },
+ sn = async () =>
+ window.crypto.subtle === void 0
+ ? (console.warn(
+ `Encryption is not supported in this environment. SSL is required.`
+ ),
+ Promise.resolve(null))
+ : window.crypto.subtle.generateKey({name: `AES-GCM`, length: 256}, !0, [
+ `encrypt`,
+ `decrypt`,
+ ]),
+ cn = async (e) => {
+ if (window.crypto.subtle === void 0)
+ return (
+ console.warn(
+ `Encryption is not supported in this environment. SSL is required.`
+ ),
+ Promise.resolve()
+ );
+ let t = await window.crypto.subtle.exportKey(`raw`, e);
+ $t.set(tn.key, Array.from(new Uint8Array(t)));
+ },
+ ln = async (e) => {
+ if (e) return e;
+ let t = await sn();
+ return t ? (await cn(t), t) : null;
+ },
+ un = async () => {
+ let e = $t.get(tn.key);
+ return e
+ ? await window.crypto.subtle.importKey(
+ `raw`,
+ new Uint8Array(e),
+ {name: `AES-GCM`, length: 256},
+ !0,
+ [`encrypt`, `decrypt`]
+ )
+ : null;
+ },
+ dn = (e, t, n) => {
+ if (e === t) return !0;
+ for (let r in e)
+ if (!n.includes(r) && e[r] !== t[r] && !fn(e[r], t[r])) return !1;
+ for (let r in t) if (!n.includes(r) && !(r in e)) return !1;
+ return !0;
+ },
+ fn = (e, t) => {
+ switch (typeof e) {
+ case `object`:
+ return dn(e, t, []);
+ case `function`:
+ return e.toString() === t.toString();
+ default:
+ return e === t;
+ }
+ },
+ pn = {ms: 1, s: 1e3, m: 1e3 * 60, h: 1e3 * 60 * 60, d: 1e3 * 60 * 60 * 24},
+ mn = (e) => {
+ if (typeof e == `number`) return e;
+ for (let [t, n] of Object.entries(pn))
+ if (e.endsWith(t)) return parseFloat(e) * n;
+ return parseInt(e);
+ },
+ hn = new (class {
+ cached = [];
+ inFlightRequests = [];
+ removalTimers = [];
+ currentUseId = null;
+ add(e, t, {cacheFor: n, cacheTags: r}) {
+ if (this.findInFlight(e)) return Promise.resolve();
+ let i = this.findCached(e);
+ if (!e.fresh && i && i.staleTimestamp > Date.now())
+ return Promise.resolve();
+ let [a, o] = this.extractStaleValues(n),
+ s = new Promise((n, r) => {
+ t({
+ ...e,
+ onCancel: () => {
+ (this.remove(e), e.onCancel(), r());
+ },
+ onError: (t) => {
+ (this.remove(e), e.onError(t), r());
+ },
+ onPrefetching(t) {
+ e.onPrefetching(t);
+ },
+ onPrefetched(t, n) {
+ e.onPrefetched(t, n);
+ },
+ onPrefetchResponse(e) {
+ n(e);
+ },
+ onPrefetchError(t) {
+ (hn.removeFromInFlight(e), r(t));
+ },
+ });
+ }).then((t) => {
+ this.remove(e);
+ let n = t.getPageResponse();
+ (A.mergeOncePropsIntoResponse(n),
+ this.cached.push({
+ params: {...e},
+ staleTimestamp: Date.now() + a,
+ expiresAt: Date.now() + o,
+ response: s,
+ singleUse: o === 0,
+ timestamp: Date.now(),
+ inFlight: !1,
+ tags: Array.isArray(r) ? r : [r],
+ }));
+ let i = this.getShortestOncePropTtl(n);
+ return (
+ this.scheduleForRemoval(e, i ? Math.min(o, i) : o),
+ this.removeFromInFlight(e),
+ t.handlePrefetch(),
+ t
+ );
+ });
+ return (
+ this.inFlightRequests.push({
+ params: {...e},
+ response: s,
+ staleTimestamp: null,
+ inFlight: !0,
+ }),
+ s
+ );
+ }
+ removeAll() {
+ ((this.cached = []),
+ this.removalTimers.forEach((e) => {
+ clearTimeout(e.timer);
+ }),
+ (this.removalTimers = []));
+ }
+ removeByTags(e) {
+ this.cached = this.cached.filter(
+ (t) => !t.tags.some((t) => e.includes(t))
+ );
+ }
+ remove(e) {
+ ((this.cached = this.cached.filter(
+ (t) => !this.paramsAreEqual(t.params, e)
+ )),
+ this.clearTimer(e));
+ }
+ removeFromInFlight(e) {
+ this.inFlightRequests = this.inFlightRequests.filter(
+ (t) => !this.paramsAreEqual(t.params, e)
+ );
+ }
+ extractStaleValues(e) {
+ let [t, n] = this.cacheForToStaleAndExpires(e);
+ return [mn(t), mn(n)];
+ }
+ cacheForToStaleAndExpires(e) {
+ if (!Array.isArray(e)) return [e, e];
+ switch (e.length) {
+ case 0:
+ return [0, 0];
+ case 1:
+ return [e[0], e[0]];
+ default:
+ return [e[0], e[1]];
+ }
+ }
+ clearTimer(e) {
+ let t = this.removalTimers.find((t) => this.paramsAreEqual(t.params, e));
+ t &&
+ (clearTimeout(t.timer),
+ (this.removalTimers = this.removalTimers.filter((e) => e !== t)));
+ }
+ scheduleForRemoval(e, t) {
+ if (!(typeof window > `u`) && (this.clearTimer(e), t > 0)) {
+ let n = window.setTimeout(() => this.remove(e), t);
+ this.removalTimers.push({params: e, timer: n});
+ }
+ }
+ get(e) {
+ return this.findCached(e) || this.findInFlight(e);
+ }
+ use(e, t) {
+ let n = `${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;
+ return (
+ (this.currentUseId = n),
+ e.response.then((e) => {
+ if (this.currentUseId === n)
+ return (
+ e.mergeParams({...t, onPrefetched: () => {}}),
+ this.removeSingleUseItems(t),
+ e.handle()
+ );
+ })
+ );
+ }
+ removeSingleUseItems(e) {
+ this.cached = this.cached.filter((t) =>
+ this.paramsAreEqual(t.params, e) ? !t.singleUse : !0
+ );
+ }
+ findCached(e) {
+ return this.cached.find((t) => this.paramsAreEqual(t.params, e)) || null;
+ }
+ findInFlight(e) {
+ return (
+ this.inFlightRequests.find((t) => this.paramsAreEqual(t.params, e)) ||
+ null
+ );
+ }
+ withoutPurposePrefetchHeader(e) {
+ let t = O(e);
+ return (t.headers.Purpose === `prefetch` && delete t.headers.Purpose, t);
+ }
+ paramsAreEqual(e, t) {
+ return dn(
+ this.withoutPurposePrefetchHeader(e),
+ this.withoutPurposePrefetchHeader(t),
+ [
+ `showProgress`,
+ `replace`,
+ `prefetch`,
+ `preserveScroll`,
+ `preserveState`,
+ `onBefore`,
+ `onBeforeUpdate`,
+ `onStart`,
+ `onProgress`,
+ `onFinish`,
+ `onCancel`,
+ `onSuccess`,
+ `onError`,
+ `onFlash`,
+ `onPrefetched`,
+ `onCancelToken`,
+ `onPrefetching`,
+ `async`,
+ `viewTransition`,
+ `optimistic`,
+ `component`,
+ `pageProps`,
+ ]
+ );
+ }
+ updateCachedOncePropsFromCurrentPage() {
+ this.cached.forEach((e) => {
+ e.response.then((t) => {
+ let n = t.getPageResponse();
+ A.mergeOncePropsIntoResponse(n, {force: !0});
+ for (let [e, t] of Object.entries(n.deferredProps ?? {})) {
+ let r = t.filter((e) => k(n.props, e) === void 0);
+ r.length > 0 ? (n.deferredProps[e] = r) : delete n.deferredProps[e];
+ }
+ let r = this.getShortestOncePropTtl(n);
+ if (r === null) return;
+ let i = e.expiresAt - Date.now(),
+ a = Math.min(i, r);
+ a > 0 ? this.scheduleForRemoval(e.params, a) : this.remove(e.params);
+ });
+ });
+ }
+ getShortestOncePropTtl(e) {
+ let t = Object.values(e.onceProps ?? {})
+ .map((e) => e.expiresAt)
+ .filter((e) => !!e);
+ return t.length === 0 ? null : Math.min(...t) - Date.now();
+ }
+ })(),
+ gn = (e, t = 1) => {
+ window.requestAnimationFrame(() => {
+ t > 1 ? gn(e, t - 1) : e();
+ });
+ },
+ _n = (e) => {
+ if (typeof window > `u`) return null;
+ let t = document.querySelector(
+ `script[data-page="${e}"][type="application/json"]`
+ );
+ return t?.textContent ? JSON.parse(t.textContent) : null;
+ },
+ vn = typeof window > `u`,
+ yn = !vn && /Firefox/i.test(window.navigator.userAgent),
+ bn = class {
+ static save() {
+ j.saveScrollPositions(this.getScrollRegions());
+ }
+ static getScrollRegions() {
+ return Array.from(this.regions()).map((e) => ({
+ top: e.scrollTop,
+ left: e.scrollLeft,
+ }));
+ }
+ static regions() {
+ return document.querySelectorAll(`[scroll-region]`);
+ }
+ static scrollToTop() {
+ if (
+ yn &&
+ getComputedStyle(document.documentElement).scrollBehavior === `smooth`
+ )
+ return gn(() => window.scrollTo(0, 0), 2);
+ window.scrollTo(0, 0);
+ }
+ static reset() {
+ ((!vn && window.location.hash) || this.scrollToTop(),
+ this.regions().forEach((e) => {
+ typeof e.scrollTo == `function`
+ ? e.scrollTo(0, 0)
+ : ((e.scrollTop = 0), (e.scrollLeft = 0));
+ }),
+ this.save(),
+ this.scrollToAnchor());
+ }
+ static scrollToAnchor() {
+ let e = vn ? null : window.location.hash;
+ e &&
+ setTimeout(() => {
+ let t = document.getElementById(e.slice(1));
+ t ? t.scrollIntoView() : this.scrollToTop();
+ });
+ }
+ static restore(e) {
+ vn ||
+ window.requestAnimationFrame(() => {
+ (this.restoreDocument(), this.restoreScrollRegions(e));
+ });
+ }
+ static restoreScrollRegions(e) {
+ vn ||
+ this.regions().forEach((t, n) => {
+ let r = e[n];
+ r &&
+ (typeof t.scrollTo == `function`
+ ? t.scrollTo(r.left, r.top)
+ : ((t.scrollTop = r.top), (t.scrollLeft = r.left)));
+ });
+ }
+ static restoreDocument() {
+ let e = j.getDocumentScrollPosition();
+ window.scrollTo(e.left, e.top);
+ }
+ static onScroll(e) {
+ let t = e.target;
+ typeof t.hasAttribute == `function` &&
+ t.hasAttribute(`scroll-region`) &&
+ this.save();
+ }
+ static onWindowScroll() {
+ j.saveDocumentScrollPosition({top: window.scrollY, left: window.scrollX});
+ }
+ },
+ xn = (e) =>
+ (typeof File < `u` && e instanceof File) ||
+ e instanceof Blob ||
+ (typeof FileList < `u` && e instanceof FileList && e.length > 0);
+function Sn(e) {
+ return (
+ xn(e) ||
+ (e instanceof FormData && Array.from(e.values()).some((e) => Sn(e))) ||
+ (typeof e == `object` && !!e && Object.values(e).some((e) => Sn(e)))
+ );
+}
+var Cn = (e) => e instanceof FormData;
+function wn(e, t = new FormData(), n = null, r = `brackets`) {
+ e ||= {};
+ for (let i in e)
+ Object.prototype.hasOwnProperty.call(e, i) &&
+ En(t, Tn(n, i, `indices`), e[i], r);
+ return t;
+}
+function Tn(e, t, n) {
+ return e ? (n === `brackets` ? `${e}[]` : `${e}[${t}]`) : t;
+}
+function En(e, t, n, r) {
+ if (Array.isArray(n))
+ return Array.from(n.keys()).forEach((i) =>
+ En(e, Tn(t, i.toString(), r), n[i], r)
+ );
+ if (n instanceof Date) return e.append(t, n.toISOString());
+ if (n instanceof File) return e.append(t, n, n.name);
+ if (n instanceof Blob) return e.append(t, n);
+ if (typeof n == `boolean`) return e.append(t, n ? `1` : `0`);
+ if (typeof n == `string`) return e.append(t, n);
+ if (typeof n == `number`) return e.append(t, `${n}`);
+ if (n == null) return e.append(t, ``);
+ wn(n, e, t, r);
+}
+function Dn(e) {
+ return /\[\d+\]/.test(decodeURIComponent(e.search));
+}
+function On(e) {
+ if (!e || e === `?`) return {};
+ let t = {};
+ return (
+ e
+ .replace(/^\?/, ``)
+ .split(`&`)
+ .filter(Boolean)
+ .forEach((e) => {
+ let [n, r] = An(e);
+ Mn(t, jn(n), jn(r));
+ }),
+ t
+ );
+}
+function kn(e, t) {
+ let n = [];
+ return (Pn(e, ``, n, t), n.length ? `?` + n.join(`&`) : ``);
+}
+function An(e) {
+ let t = e.indexOf(`=`);
+ return t === -1 ? [e, ``] : [e.substring(0, t), e.substring(t + 1)];
+}
+function jn(e) {
+ return decodeURIComponent(e.replace(/\+/g, ` `));
+}
+function Mn(e, t, n) {
+ let r = Nn(t),
+ i = e;
+ for (; r.length > 1; ) {
+ let e = r.shift(),
+ t = r[0] === ``;
+ ((typeof i[e] != `object` || i[e] === null) && (i[e] = t ? [] : {}),
+ (i = i[e]));
+ }
+ let a = r.shift();
+ a === `` && Array.isArray(i) ? i.push(n) : (i[a] = n);
+}
+function Nn(e) {
+ let t = [],
+ n = e.split(`[`)[0];
+ n && t.push(n);
+ let r,
+ i = /\[([^\]]*)\]/g;
+ for (; (r = i.exec(e)) !== null; ) t.push(r[1]);
+ return t;
+}
+function Pn(e, t, n, r) {
+ if (e !== void 0) {
+ if (e === null) {
+ n.push(`${t}=`);
+ return;
+ }
+ if (Array.isArray(e)) {
+ e.forEach((e, i) => {
+ Pn(e, r === `indices` ? `${t}[${i}]` : `${t}[]`, n, r);
+ });
+ return;
+ }
+ if (typeof e == `object`) {
+ Object.keys(e).forEach((i) => {
+ Pn(e[i], t ? `${t}[${i}]` : i, n, r);
+ });
+ return;
+ }
+ n.push(`${t}=${encodeURIComponent(String(e))}`);
+ }
+}
+function Fn(e) {
+ return new URL(
+ e.toString(),
+ typeof window > `u` ? void 0 : window.location.toString()
+ );
+}
+var In = (e, t, n, r, i) => {
+ let a = typeof e == `string` ? Fn(e) : e;
+ if (
+ ((Sn(t) || r) &&
+ !Cn(t) &&
+ (Lt.get(`form.forceIndicesArrayFormatInFormData`) && (i = `indices`),
+ (t = wn(t, new FormData(), null, i))),
+ Cn(t))
+ )
+ return [a, t];
+ let [o, s] = Ln(n, a, t, i);
+ return [Fn(o), s];
+};
+function Ln(e, t, n, r = `brackets`) {
+ let i = e === `get` && !Cn(n) && Object.keys(n).length > 0,
+ a = Wn(t.toString()),
+ o = a || t.toString().startsWith(`/`) || t.toString() === ``,
+ s = !o && !t.toString().startsWith(`#`) && !t.toString().startsWith(`?`),
+ c = /^[.]{1,2}([/]|$)/.test(t.toString()),
+ l = t.toString().includes(`?`) || i,
+ u = t.toString().includes(`#`),
+ d = new URL(
+ t.toString(),
+ typeof window > `u` ? `http://localhost` : window.location.toString()
+ );
+ if (i) {
+ let e = Dn(d) ? `indices` : r;
+ d.search = kn({...On(d.search), ...n}, e);
+ }
+ return [
+ [
+ a ? `${d.protocol}//${d.host}` : ``,
+ o ? d.pathname : ``,
+ s ? d.pathname.substring(+!c) : ``,
+ l ? d.search : ``,
+ u ? d.hash : ``,
+ ].join(``),
+ i ? {} : n,
+ ];
+}
+function Rn(e) {
+ return ((e = new URL(e.href)), (e.hash = ``), e);
+}
+var zn = (e, t) => {
+ e.hash && !t.hash && Rn(e).href === t.href && (t.hash = e.hash);
+ },
+ Bn = (e, t) => Rn(e).href === Rn(t).href,
+ Vn = (e, t) => e.origin === t.origin && e.pathname === t.pathname;
+function Hn(e) {
+ return (
+ typeof e == `object` && !!e && e !== void 0 && `url` in e && `method` in e
+ );
+}
+function Un(e) {
+ return e.component
+ ? typeof e.component == `string`
+ ? e.component
+ : (console.error(
+ `The "component" property on the URL method pair received multiple components (${Object.keys(e.component).join(`, `)}), but only a single component string is supported for instant visits. Use the withComponent() method to specify which component to use.`
+ ),
+ null)
+ : null;
+}
+function Wn(e) {
+ return /^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e);
+}
+var A = new (class {
+ page;
+ swapComponent;
+ resolveComponent;
+ onFlashCallback;
+ componentId = {};
+ listeners = [];
+ isFirstPageLoad = !0;
+ cleared = !1;
+ pendingDeferredProps = null;
+ historyQuotaExceeded = !1;
+ optimisticBaseline = {};
+ pendingOptimistics = [];
+ optimisticCounter = 0;
+ init({initialPage: e, swapComponent: t, resolveComponent: n, onFlash: r}) {
+ return (
+ (this.page = {...e, flash: e.flash ?? {}}),
+ (this.swapComponent = t),
+ (this.resolveComponent = n),
+ (this.onFlashCallback = r),
+ Xn.on(`historyQuotaExceeded`, () => {
+ this.historyQuotaExceeded = !0;
+ }),
+ this
+ );
+ }
+ set(
+ e,
+ {
+ replace: t = !1,
+ preserveScroll: n = !1,
+ preserveState: r = !1,
+ viewTransition: i = !1,
+ } = {}
+ ) {
+ (Object.keys(e.deferredProps || {}).length &&
+ ((this.pendingDeferredProps = {
+ deferredProps: e.deferredProps,
+ component: e.component,
+ url: e.url,
+ }),
+ e.initialDeferredProps === void 0 &&
+ (e.initialDeferredProps = e.deferredProps)),
+ (this.componentId = {}));
+ let a = this.componentId;
+ return (
+ e.clearHistory && j.clear(),
+ this.resolve(e.component, e).then((o) => {
+ if (a !== this.componentId) return;
+ e.rememberedState ??= {};
+ let s = typeof window > `u`,
+ c = s ? new URL(e.url) : window.location,
+ l = !s && n ? bn.getScrollRegions() : [];
+ t ||= Bn(Fn(e.url), c);
+ let u = {...e, flash: {}};
+ return new Promise((e) =>
+ t ? j.replaceState(u, e) : j.pushState(u, e)
+ ).then(() => {
+ let a = !this.isTheSame(e);
+ if (
+ (!a && Object.keys(e.props.errors || {}).length > 0 && (i = !1),
+ (this.page = e),
+ (this.cleared = !1),
+ this.hasOnceProps() && hn.updateCachedOncePropsFromCurrentPage(),
+ a && this.fireEventsFor(`newComponent`),
+ this.isFirstPageLoad && this.fireEventsFor(`firstLoad`),
+ (this.isFirstPageLoad = !1),
+ this.historyQuotaExceeded)
+ ) {
+ this.historyQuotaExceeded = !1;
+ return;
+ }
+ return this.swap({
+ component: o,
+ page: e,
+ preserveState: r,
+ viewTransition: i,
+ }).then(() => {
+ (n
+ ? window.requestAnimationFrame(() => bn.restoreScrollRegions(l))
+ : bn.reset(),
+ this.pendingDeferredProps &&
+ this.pendingDeferredProps.component === e.component &&
+ this.pendingDeferredProps.url === e.url &&
+ Xn.fireInternalEvent(
+ `loadDeferredProps`,
+ this.pendingDeferredProps.deferredProps
+ ),
+ (this.pendingDeferredProps = null),
+ t || Kt(e));
+ });
+ });
+ })
+ );
+ }
+ setQuietly(e, {preserveState: t = !1} = {}) {
+ return this.resolve(e.component, e).then(
+ (n) => (
+ (this.page = e),
+ (this.cleared = !1),
+ j.setCurrent(e),
+ this.swap({
+ component: n,
+ page: e,
+ preserveState: t,
+ viewTransition: !1,
+ })
+ )
+ );
+ }
+ clear() {
+ this.cleared = !0;
+ }
+ isCleared() {
+ return this.cleared;
+ }
+ get() {
+ return this.page;
+ }
+ getWithoutFlashData() {
+ return {...this.page, flash: {}};
+ }
+ hasOnceProps() {
+ return Object.keys(this.page.onceProps ?? {}).length > 0;
+ }
+ merge(e) {
+ this.page = {...this.page, ...e};
+ }
+ setPropsQuietly(e) {
+ return (
+ (this.page = {...this.page, props: e}),
+ this.resolve(this.page.component, this.page).then((e) =>
+ this.swap({
+ component: e,
+ page: this.page,
+ preserveState: !0,
+ viewTransition: !1,
+ })
+ )
+ );
+ }
+ setFlash(e) {
+ ((this.page = {...this.page, flash: e}), this.onFlashCallback?.(e));
+ }
+ setUrlHash(e) {
+ this.page.url.includes(e) || (this.page.url += e);
+ }
+ remember(e) {
+ this.page.rememberedState = e;
+ }
+ swap({component: e, page: t, preserveState: n, viewTransition: r}) {
+ let i = () =>
+ this.swapComponent({component: e, page: t, preserveState: n});
+ if (
+ !r ||
+ !document?.startViewTransition ||
+ document.visibilityState === `hidden`
+ )
+ return i();
+ let a = typeof r == `boolean` ? () => null : r;
+ return new Promise((e) => {
+ a(document.startViewTransition(() => i().then(e)));
+ });
+ }
+ resolve(e, t) {
+ return Promise.resolve(this.resolveComponent(e, t));
+ }
+ nextOptimisticId() {
+ return ++this.optimisticCounter;
+ }
+ setBaseline(e, t) {
+ e in this.optimisticBaseline || (this.optimisticBaseline[e] = t);
+ }
+ updateBaseline(e, t) {
+ e in this.optimisticBaseline && (this.optimisticBaseline[e] = t);
+ }
+ hasBaseline(e) {
+ return e in this.optimisticBaseline;
+ }
+ registerOptimistic(e, t) {
+ this.pendingOptimistics.push({id: e, callback: t});
+ }
+ unregisterOptimistic(e) {
+ this.pendingOptimistics = this.pendingOptimistics.filter(
+ (t) => t.id !== e
+ );
+ }
+ replayOptimistics() {
+ let e = Object.keys(this.optimisticBaseline);
+ if (e.length === 0) return {};
+ let t = O(this.page.props);
+ for (let n of e) t[n] = O(this.optimisticBaseline[n]);
+ for (let {callback: e} of this.pendingOptimistics) {
+ let n = e(O(t));
+ n && Object.assign(t, n);
+ }
+ let n = {};
+ for (let r of e) n[r] = t[r];
+ return n;
+ }
+ pendingOptimisticCount() {
+ return this.pendingOptimistics.length;
+ }
+ clearOptimisticState() {
+ ((this.optimisticBaseline = {}), (this.pendingOptimistics = []));
+ }
+ isTheSame(e) {
+ return this.page.component === e.component;
+ }
+ on(e, t) {
+ return (
+ this.listeners.push({event: e, callback: t}),
+ () => {
+ this.listeners = this.listeners.filter(
+ (n) => n.event !== e && n.callback !== t
+ );
+ }
+ );
+ }
+ fireEventsFor(e) {
+ this.listeners.filter((t) => t.event === e).forEach((e) => e.callback());
+ }
+ mergeOncePropsIntoResponse(e, {force: t = !1} = {}) {
+ Object.entries(e.onceProps ?? {}).forEach(([n, r]) => {
+ let i = this.page.onceProps?.[n];
+ i !== void 0 &&
+ (t || k(e.props, r.prop) === void 0) &&
+ (We(e.props, r.prop, k(this.page.props, i.prop)),
+ (e.onceProps[n].expiresAt = i.expiresAt));
+ });
+ }
+ })(),
+ Gn = class {
+ items = [];
+ processingPromise = null;
+ add(e) {
+ return (this.items.push(e), this.process());
+ }
+ process() {
+ return (
+ (this.processingPromise ??= this.processNext().finally(() => {
+ this.processingPromise = null;
+ })),
+ this.processingPromise
+ );
+ }
+ processNext() {
+ let e = this.items.shift();
+ return e
+ ? Promise.resolve(e()).then(() => this.processNext())
+ : Promise.resolve();
+ }
+ },
+ Kn = typeof window > `u`,
+ qn = new Gn(),
+ Jn = !Kn && /CriOS/.test(window.navigator.userAgent),
+ Yn = class {
+ rememberedState = `rememberedState`;
+ scrollRegions = `scrollRegions`;
+ preserveUrl = !1;
+ current = {};
+ initialState = null;
+ remember(e, t) {
+ this.replaceState({
+ ...A.getWithoutFlashData(),
+ rememberedState: {...(A.get()?.rememberedState ?? {}), [t]: e},
+ });
+ }
+ restore(e) {
+ if (!Kn)
+ return this.current[this.rememberedState]?.[e] === void 0
+ ? this.initialState?.[this.rememberedState]?.[e]
+ : this.current[this.rememberedState]?.[e];
+ }
+ pushState(e, t = null) {
+ if (!Kn) {
+ if (this.preserveUrl) {
+ t && t();
+ return;
+ }
+ ((this.current = e),
+ qn.add(() =>
+ this.getPageData(e).then((n) => {
+ let r = () =>
+ this.doPushState({page: n}, e.url).then(() => t?.());
+ return Jn
+ ? new Promise((e) => {
+ setTimeout(() => r().then(e));
+ })
+ : r();
+ })
+ ));
+ }
+ }
+ clonePageProps(e) {
+ try {
+ return (structuredClone(e.props), e);
+ } catch {
+ return {...e, props: O(e.props)};
+ }
+ }
+ getPageData(e) {
+ let t = this.clonePageProps(e);
+ return new Promise((n) => (e.encryptHistory ? en(t).then(n) : n(t)));
+ }
+ processQueue() {
+ return qn.process();
+ }
+ decrypt(e = null) {
+ if (Kn) return Promise.resolve(e ?? A.get());
+ let t = e ?? window.history.state?.page;
+ return this.decryptPageData(t).then((e) => {
+ if (!e) throw Error(`Unable to decrypt history`);
+ return (
+ this.initialState === null
+ ? (this.initialState = e ?? void 0)
+ : (this.current = e ?? {}),
+ e
+ );
+ });
+ }
+ decryptPageData(e) {
+ return e instanceof ArrayBuffer ? nn(e) : Promise.resolve(e);
+ }
+ saveScrollPositions(e) {
+ qn.add(() =>
+ Promise.resolve().then(() => {
+ if (window.history.state?.page && !be(this.getScrollRegions(), e))
+ return this.doReplaceState({
+ page: window.history.state.page,
+ scrollRegions: e,
+ });
+ })
+ );
+ }
+ saveDocumentScrollPosition(e) {
+ qn.add(() =>
+ Promise.resolve().then(() => {
+ if (
+ window.history.state?.page &&
+ !be(this.getDocumentScrollPosition(), e)
+ )
+ return this.doReplaceState({
+ page: window.history.state.page,
+ documentScrollPosition: e,
+ });
+ })
+ );
+ }
+ getScrollRegions() {
+ return window.history.state?.scrollRegions || [];
+ }
+ getDocumentScrollPosition() {
+ return window.history.state?.documentScrollPosition || {top: 0, left: 0};
+ }
+ replaceState(e, t = null) {
+ if (be(this.current, e)) {
+ t && t();
+ return;
+ }
+ let {flash: n, ...r} = e;
+ if ((A.merge(r), !Kn)) {
+ if (this.preserveUrl) {
+ t && t();
+ return;
+ }
+ ((this.current = e),
+ qn.add(() =>
+ this.getPageData(e).then((n) => {
+ let r = () =>
+ this.doReplaceState({page: n}, e.url).then(() => t?.());
+ return Jn
+ ? new Promise((e) => {
+ setTimeout(() => r().then(e));
+ })
+ : r();
+ })
+ ));
+ }
+ }
+ isHistoryThrottleError(e) {
+ return (
+ e instanceof Error &&
+ e.name === `SecurityError` &&
+ (e.message.includes(`history.pushState`) ||
+ e.message.includes(`history.replaceState`))
+ );
+ }
+ isQuotaExceededError(e) {
+ return e instanceof Error && e.name === `QuotaExceededError`;
+ }
+ withThrottleProtection(e) {
+ return Promise.resolve().then(() => {
+ try {
+ return e();
+ } catch (e) {
+ if (!this.isHistoryThrottleError(e)) throw e;
+ console.error(e.message);
+ }
+ });
+ }
+ doReplaceState(e, t) {
+ return this.withThrottleProtection(() => {
+ window.history.replaceState(
+ {
+ ...e,
+ scrollRegions:
+ e.scrollRegions ?? window.history.state?.scrollRegions,
+ documentScrollPosition:
+ e.documentScrollPosition ??
+ window.history.state?.documentScrollPosition,
+ },
+ ``,
+ t
+ );
+ });
+ }
+ doPushState(e, t) {
+ return this.withThrottleProtection(() => {
+ try {
+ window.history.pushState(e, ``, t);
+ } catch (e) {
+ if (!this.isQuotaExceededError(e)) throw e;
+ Xn.fireInternalEvent(`historyQuotaExceeded`, t);
+ }
+ });
+ }
+ getState(e, t) {
+ return this.current?.[e] ?? t;
+ }
+ deleteState(e) {
+ this.current[e] !== void 0 &&
+ (delete this.current[e], this.replaceState(this.current));
+ }
+ clearInitialState(e) {
+ this.initialState &&
+ this.initialState[e] !== void 0 &&
+ delete this.initialState[e];
+ }
+ browserHasHistoryEntry() {
+ return !Kn && !!window.history.state?.page;
+ }
+ clear() {
+ ($t.remove(tn.key), $t.remove(tn.iv));
+ }
+ setCurrent(e) {
+ this.current = e;
+ }
+ isValidState(e) {
+ return !!e.page;
+ }
+ getAllState() {
+ return this.current;
+ }
+ };
+typeof window < `u` &&
+ window.history.scrollRestoration &&
+ (window.history.scrollRestoration = `manual`);
+var j = new Yn(),
+ Xn = new (class {
+ internalListeners = [];
+ init() {
+ (typeof window < `u` &&
+ (window.addEventListener(
+ `popstate`,
+ this.handlePopstateEvent.bind(this)
+ ),
+ window.addEventListener(
+ `pageshow`,
+ this.handlePageshowEvent.bind(this)
+ ),
+ window.addEventListener(
+ `scroll`,
+ Rt(bn.onWindowScroll.bind(bn), 100),
+ !0
+ )),
+ typeof document < `u` &&
+ document.addEventListener(
+ `scroll`,
+ Rt(bn.onScroll.bind(bn), 100),
+ !0
+ ));
+ }
+ onGlobalEvent(e, t) {
+ return this.registerListener(`inertia:${e}`, (e) => {
+ let n = t(e);
+ e.cancelable && !e.defaultPrevented && n === !1 && e.preventDefault();
+ });
+ }
+ on(e, t) {
+ return (
+ this.internalListeners.push({event: e, listener: t}),
+ () => {
+ this.internalListeners = this.internalListeners.filter(
+ (e) => e.listener !== t
+ );
+ }
+ );
+ }
+ onMissingHistoryItem() {
+ (A.clear(), this.fireInternalEvent(`missingHistoryItem`));
+ }
+ fireInternalEvent(e, ...t) {
+ this.internalListeners
+ .filter((t) => t.event === e)
+ .forEach((e) => e.listener(...t));
+ }
+ registerListener(e, t) {
+ return (
+ document.addEventListener(e, t),
+ () => document.removeEventListener(e, t)
+ );
+ }
+ handlePageshowEvent(e) {
+ e.persisted && j.decrypt().catch(() => this.onMissingHistoryItem());
+ }
+ handlePopstateEvent(e) {
+ let t = e.state || null;
+ if (t === null) {
+ let e = Fn(A.get().url);
+ ((e.hash = window.location.hash),
+ j.replaceState({...A.getWithoutFlashData(), url: e.href}),
+ bn.reset());
+ return;
+ }
+ if (!j.isValidState(t)) return this.onMissingHistoryItem();
+ j.decrypt(t.page)
+ .then((e) => {
+ if (A.get().version !== e.version) {
+ this.onMissingHistoryItem();
+ return;
+ }
+ (N.cancelAll({prefetch: !1}),
+ A.setQuietly(e, {preserveState: !1}).then(() => {
+ (bn.restore(j.getScrollRegions()), Kt(A.get()));
+ let t = {},
+ n = A.get().props;
+ for (let [r, i] of Object.entries(
+ e.initialDeferredProps ?? e.deferredProps ?? {}
+ )) {
+ let e = i.filter((e) => k(n, e) === void 0);
+ e.length > 0 && (t[r] = e);
+ }
+ Object.keys(t).length > 0 &&
+ this.fireInternalEvent(`loadDeferredProps`, t);
+ }));
+ })
+ .catch(() => {
+ this.onMissingHistoryItem();
+ });
+ }
+ })(),
+ Zn = new (class {
+ type;
+ constructor() {
+ this.type = this.resolveType();
+ }
+ resolveType() {
+ return typeof window > `u`
+ ? `navigate`
+ : (window.performance?.getEntriesByType(`navigation`)[0]?.type ??
+ `navigate`);
+ }
+ get() {
+ return this.type;
+ }
+ isBackForward() {
+ return this.type === `back_forward`;
+ }
+ isReload() {
+ return this.type === `reload`;
+ }
+ })(),
+ Qn = class {
+ static handle() {
+ (this.clearRememberedStateOnReload(),
+ [this.handleBackForward, this.handleLocation, this.handleDefault].find(
+ (e) => e.bind(this)()
+ ));
+ }
+ static clearRememberedStateOnReload() {
+ Zn.isReload() &&
+ (j.deleteState(j.rememberedState),
+ j.clearInitialState(j.rememberedState));
+ }
+ static handleBackForward() {
+ if (!Zn.isBackForward() || !j.browserHasHistoryEntry()) return !1;
+ let e = j.getScrollRegions();
+ return (
+ j
+ .decrypt()
+ .then((t) => {
+ A.set(t, {preserveScroll: !0, preserveState: !0}).then(() => {
+ (bn.restore(e), Kt(A.get()));
+ });
+ })
+ .catch(() => {
+ Xn.onMissingHistoryItem();
+ }),
+ !0
+ );
+ }
+ static handleLocation() {
+ if (!$t.exists($t.locationVisitKey)) return !1;
+ let e = $t.get($t.locationVisitKey) || {};
+ return (
+ $t.remove($t.locationVisitKey),
+ typeof window < `u` && A.setUrlHash(window.location.hash),
+ j
+ .decrypt(A.get())
+ .then(() => {
+ let t = j.getState(j.rememberedState, {}),
+ n = j.getScrollRegions();
+ (A.remember(t),
+ A.set(A.get(), {
+ preserveScroll: e.preserveScroll,
+ preserveState: !0,
+ }).then(() => {
+ (e.preserveScroll && bn.restore(n), this.fireInitialEvents());
+ }));
+ })
+ .catch(() => {
+ Xn.onMissingHistoryItem();
+ }),
+ !0
+ );
+ }
+ static handleDefault() {
+ (typeof window < `u` && A.setUrlHash(window.location.hash),
+ A.set(A.get(), {preserveScroll: !0, preserveState: !0}).then(() => {
+ (Zn.isReload()
+ ? bn.restore(j.getScrollRegions())
+ : bn.scrollToAnchor(),
+ this.fireInitialEvents());
+ }));
+ }
+ static fireInitialEvents() {
+ let e = A.get();
+ (Kt(e),
+ Object.keys(e.flash).length > 0 && queueMicrotask(() => Qt(e.flash)));
+ }
+ },
+ $n = class {
+ id = null;
+ throttle = !1;
+ keepAlive = !1;
+ cb;
+ interval;
+ cbCount = 0;
+ constructor(e, t, n) {
+ ((this.keepAlive = n.keepAlive ?? !1),
+ (this.cb = t),
+ (this.interval = e),
+ (n.autoStart ?? !0) && this.start());
+ }
+ stop() {
+ this.id && clearInterval(this.id);
+ }
+ start() {
+ typeof window > `u` ||
+ (this.stop(),
+ (this.id = window.setInterval(() => {
+ ((!this.throttle || this.cbCount % 10 == 0) && this.cb(),
+ this.throttle && this.cbCount++);
+ }, this.interval)));
+ }
+ isInBackground(e) {
+ ((this.throttle = this.keepAlive ? !1 : e),
+ this.throttle && (this.cbCount = 0));
+ }
+ },
+ er = new (class {
+ polls = [];
+ constructor() {
+ this.setupVisibilityListener();
+ }
+ add(e, t, n) {
+ let r = new $n(e, t, n);
+ return (
+ this.polls.push(r),
+ {stop: () => r.stop(), start: () => r.start()}
+ );
+ }
+ clear() {
+ (this.polls.forEach((e) => e.stop()), (this.polls = []));
+ }
+ setupVisibilityListener() {
+ typeof document > `u` ||
+ document.addEventListener(
+ `visibilitychange`,
+ () => {
+ this.polls.forEach((e) => e.isInBackground(document.hidden));
+ },
+ !1
+ );
+ }
+ })(),
+ tr = new (class {
+ requestHandlers = [];
+ responseHandlers = [];
+ errorHandlers = [];
+ onRequest(e) {
+ return (
+ this.requestHandlers.push(e),
+ () => {
+ this.requestHandlers = this.requestHandlers.filter((t) => t !== e);
+ }
+ );
+ }
+ onResponse(e) {
+ return (
+ this.responseHandlers.push(e),
+ () => {
+ this.responseHandlers = this.responseHandlers.filter((t) => t !== e);
+ }
+ );
+ }
+ onError(e) {
+ return (
+ this.errorHandlers.push(e),
+ () => {
+ this.errorHandlers = this.errorHandlers.filter((t) => t !== e);
+ }
+ );
+ }
+ async processRequest(e) {
+ let t = e;
+ for (let e of this.requestHandlers) t = await e(t);
+ return t;
+ }
+ async processResponse(e) {
+ let t = e;
+ for (let e of this.responseHandlers) t = await e(t);
+ return t;
+ }
+ async processError(e) {
+ for (let t of this.errorHandlers) await t(e);
+ }
+ })(),
+ nr = class extends Error {
+ code;
+ url;
+ constructor(e, t, n) {
+ (super(n ? `${e} (${n})` : e),
+ (this.name = `HttpError`),
+ (this.code = t),
+ (this.url = n));
+ }
+ },
+ rr = class extends nr {
+ response;
+ constructor(e, t, n) {
+ (super(e, `ERR_HTTP_RESPONSE`, n),
+ (this.name = `HttpResponseError`),
+ (this.response = t));
+ }
+ },
+ ir = class extends nr {
+ constructor(e = `Request was cancelled`, t) {
+ (super(e, `ERR_CANCELLED`, t), (this.name = `HttpCancelledError`));
+ }
+ },
+ ar = class extends nr {
+ cause;
+ constructor(e, t, n) {
+ (super(e, `ERR_NETWORK`, t),
+ (this.name = `HttpNetworkError`),
+ (this.cause = n));
+ }
+ };
+function or(e) {
+ let t = document.cookie.match(RegExp(`(^|;\\s*)(` + e + `)=([^;]*)`));
+ return t ? decodeURIComponent(t[3]) : null;
+}
+function sr(e) {
+ let t = {};
+ return (
+ e
+ .getAllResponseHeaders()
+ .split(
+ `\r
+`
+ )
+ .forEach((e) => {
+ let n = e.indexOf(`:`);
+ n > 0 &&
+ (t[e.slice(0, n).toLowerCase().trim()] = e.slice(n + 1).trim());
+ }),
+ t
+ );
+}
+function cr(e, t) {
+ if (!t.headers) return;
+ let n = t.data instanceof FormData;
+ Object.entries(t.headers).forEach(([t, r]) => {
+ (t.toLowerCase() !== `content-type` || !n) &&
+ e.setRequestHeader(t, String(r));
+ });
+}
+function lr(e, t) {
+ if (!t || Object.keys(t).length === 0) return e;
+ let [n] = Ln(`get`, e, t);
+ return n;
+}
+var ur = class {
+ xsrfCookieName;
+ xsrfHeaderName;
+ constructor(e = {}) {
+ ((this.xsrfCookieName = e.xsrfCookieName ?? `XSRF-TOKEN`),
+ (this.xsrfHeaderName = e.xsrfHeaderName ?? `X-XSRF-TOKEN`));
+ }
+ async request(e) {
+ let t = await tr.processRequest(e);
+ try {
+ let e = await this.doRequest(t);
+ return await tr.processResponse(e);
+ } catch (e) {
+ throw (
+ (e instanceof rr || e instanceof ar || e instanceof ir) &&
+ (await tr.processError(e)),
+ e
+ );
+ }
+ }
+ doRequest(e) {
+ return new Promise((t, n) => {
+ let r = new XMLHttpRequest(),
+ i = lr(e.url, e.params);
+ r.open(e.method.toUpperCase(), i, !0);
+ let a = or(this.xsrfCookieName);
+ a && r.setRequestHeader(this.xsrfHeaderName, a);
+ let o = null;
+ (e.data !== null &&
+ e.data !== void 0 &&
+ (e.data instanceof FormData
+ ? (o = e.data)
+ : typeof e.data == `object`
+ ? ((o = JSON.stringify(e.data)),
+ !e.headers?.[`Content-Type`] &&
+ !e.headers?.[`content-type`] &&
+ r.setRequestHeader(`Content-Type`, `application/json`))
+ : (o = String(e.data))),
+ cr(r, e),
+ e.onUploadProgress &&
+ (r.upload.onprogress = (t) => {
+ let n = t.lengthComputable ? t.loaded / t.total : void 0;
+ e.onUploadProgress({
+ progress: n,
+ percentage: n ? Math.round(n * 100) : 0,
+ loaded: t.loaded,
+ total: t.lengthComputable ? t.total : void 0,
+ });
+ }),
+ e.signal && e.signal.addEventListener(`abort`, () => r.abort()),
+ (r.onabort = () => n(new ir(`Request was cancelled`, e.url))),
+ (r.onerror = () => n(new ar(`Network error`, e.url))),
+ (r.onload = () => {
+ let i = {status: r.status, data: r.responseText, headers: sr(r)};
+ r.status >= 400
+ ? n(new rr(`Request failed with status ${r.status}`, i, e.url))
+ : t(i);
+ }),
+ r.send(o));
+ });
+ }
+ },
+ dr = new ur();
+function fr(e) {
+ return !(`request` in e);
+}
+var pr = {
+ getClient() {
+ return dr;
+ },
+ setClient(e) {
+ if (!fr(e)) {
+ dr = e;
+ return;
+ }
+ ((dr = new ur(e)),
+ e.xsrfCookieName && vt.withXsrfCookieName(e.xsrfCookieName),
+ e.xsrfHeaderName && vt.withXsrfHeaderName(e.xsrfHeaderName));
+ },
+ onRequest: tr.onRequest.bind(tr),
+ onResponse: tr.onResponse.bind(tr),
+ onError: tr.onError.bind(tr),
+ processRequest: tr.processRequest.bind(tr),
+ processResponse: tr.processResponse.bind(tr),
+ processError: tr.processError.bind(tr),
+ },
+ mr = class e {
+ callbacks = [];
+ params;
+ constructor(e) {
+ if (!e.prefetch) this.params = e;
+ else {
+ let t = {
+ onBefore: this.wrapCallback(e, `onBefore`),
+ onBeforeUpdate: this.wrapCallback(e, `onBeforeUpdate`),
+ onStart: this.wrapCallback(e, `onStart`),
+ onProgress: this.wrapCallback(e, `onProgress`),
+ onFinish: this.wrapCallback(e, `onFinish`),
+ onCancel: this.wrapCallback(e, `onCancel`),
+ onSuccess: this.wrapCallback(e, `onSuccess`),
+ onError: this.wrapCallback(e, `onError`),
+ onHttpException: this.wrapCallback(e, `onHttpException`),
+ onNetworkError: this.wrapCallback(e, `onNetworkError`),
+ onFlash: this.wrapCallback(e, `onFlash`),
+ onCancelToken: this.wrapCallback(e, `onCancelToken`),
+ onPrefetched: this.wrapCallback(e, `onPrefetched`),
+ onPrefetching: this.wrapCallback(e, `onPrefetching`),
+ };
+ this.params = {
+ ...e,
+ ...t,
+ onPrefetchResponse: e.onPrefetchResponse || (() => {}),
+ onPrefetchError: e.onPrefetchError || (() => {}),
+ };
+ }
+ }
+ static create(t) {
+ return new e(t);
+ }
+ data() {
+ return this.params.method === `get` ? null : this.params.data;
+ }
+ queryParams() {
+ return this.params.method === `get` ? this.params.data : {};
+ }
+ isPartial() {
+ return (
+ this.params.only.length > 0 ||
+ this.params.except.length > 0 ||
+ this.params.reset.length > 0
+ );
+ }
+ isPrefetch() {
+ return this.params.prefetch === !0;
+ }
+ isDeferredPropsRequest() {
+ return this.params.deferredProps === !0;
+ }
+ onCancelToken(e) {
+ this.params.onCancelToken({cancel: e});
+ }
+ markAsFinished() {
+ ((this.params.completed = !0),
+ (this.params.cancelled = !1),
+ (this.params.interrupted = !1));
+ }
+ markAsCancelled({cancelled: e = !0, interrupted: t = !1}) {
+ (this.params.onCancel(),
+ (this.params.completed = !1),
+ (this.params.cancelled = e),
+ (this.params.interrupted = t));
+ }
+ wasCancelledAtAll() {
+ return this.params.cancelled || this.params.interrupted;
+ }
+ onFinish() {
+ this.params.onFinish(this.params);
+ }
+ onStart() {
+ this.params.onStart(this.params);
+ }
+ onPrefetching() {
+ this.params.onPrefetching(this.params);
+ }
+ onPrefetchResponse(e) {
+ this.params.onPrefetchResponse && this.params.onPrefetchResponse(e);
+ }
+ onPrefetchError(e) {
+ this.params.onPrefetchError && this.params.onPrefetchError(e);
+ }
+ all() {
+ return this.params;
+ }
+ headers() {
+ let e = {...this.params.headers};
+ this.isPartial() &&
+ (e[`X-Inertia-Partial-Component`] = A.get().component);
+ let t = this.params.only.concat(this.params.reset);
+ return (
+ t.length > 0 && (e[`X-Inertia-Partial-Data`] = t.join(`,`)),
+ this.params.except.length > 0 &&
+ (e[`X-Inertia-Partial-Except`] = this.params.except.join(`,`)),
+ this.params.reset.length > 0 &&
+ (e[`X-Inertia-Reset`] = this.params.reset.join(`,`)),
+ this.params.errorBag &&
+ this.params.errorBag.length > 0 &&
+ (e[`X-Inertia-Error-Bag`] = this.params.errorBag),
+ e
+ );
+ }
+ setPreserveOptions(t) {
+ ((this.params.preserveScroll = e.resolvePreserveOption(
+ this.params.preserveScroll,
+ t
+ )),
+ (this.params.preserveState = e.resolvePreserveOption(
+ this.params.preserveState,
+ t
+ )));
+ }
+ runCallbacks() {
+ this.callbacks.forEach(({name: e, args: t}) => {
+ this.params[e](...t);
+ });
+ }
+ merge(e) {
+ this.params = {...this.params, ...e};
+ }
+ wrapCallback(e, t) {
+ return (...n) => {
+ (this.recordCallback(t, n), e[t](...n));
+ };
+ }
+ recordCallback(e, t) {
+ this.callbacks.push({name: e, args: t});
+ }
+ static resolvePreserveOption(e, t) {
+ return typeof e == `function`
+ ? e(t)
+ : e === `errors`
+ ? Object.keys(t.props.errors || {}).length > 0
+ : e;
+ }
+ },
+ hr = {
+ createIframeAndPage(e) {
+ typeof e == `object` &&
+ (e = `All Inertia requests must receive a valid Inertia response, however a plain JSON response was received. ${JSON.stringify(e)}`);
+ let t = document.createElement(`html`);
+ ((t.innerHTML = e),
+ t
+ .querySelectorAll(`a`)
+ .forEach((e) => e.setAttribute(`target`, `_top`)));
+ let n = document.createElement(`iframe`);
+ return (
+ (n.style.backgroundColor = `white`),
+ (n.style.borderRadius = `5px`),
+ (n.style.width = `100%`),
+ (n.style.height = `100%`),
+ {iframe: n, page: t}
+ );
+ },
+ show(e) {
+ let {iframe: t, page: n} = this.createIframeAndPage(e);
+ ((t.style.boxSizing = `border-box`), (t.style.display = `block`));
+ let r = document.createElement(`dialog`);
+ ((r.id = `inertia-error-dialog`),
+ Object.assign(r.style, {
+ width: `calc(100vw - 100px)`,
+ height: `calc(100vh - 100px)`,
+ padding: `0`,
+ margin: `auto`,
+ border: `none`,
+ backgroundColor: `transparent`,
+ }));
+ let i = document.createElement(`style`);
+ if (
+ ((i.textContent = `
+ dialog#inertia-error-dialog::backdrop {
+ background-color: rgba(0, 0, 0, 0.6);
+ }
+
+ dialog#inertia-error-dialog:focus {
+ outline: none;
+ }
+ `),
+ document.head.appendChild(i),
+ r.addEventListener(`click`, (e) => {
+ e.target === r && r.close();
+ }),
+ r.addEventListener(`close`, () => {
+ (i.remove(), r.remove());
+ }),
+ r.appendChild(t),
+ document.body.prepend(r),
+ r.showModal(),
+ r.focus(),
+ !t.contentWindow)
+ )
+ throw Error(`iframe not yet ready.`);
+ (t.contentWindow.document.open(),
+ t.contentWindow.document.write(n.outerHTML),
+ t.contentWindow.document.close());
+ },
+ },
+ gr = new Gn(),
+ _r = class e {
+ constructor(e, t, n) {
+ ((this.requestParams = e),
+ (this.response = t),
+ (this.originatingPage = n));
+ }
+ wasPrefetched = !1;
+ processed = !1;
+ static create(t, n, r) {
+ return new e(t, n, r);
+ }
+ isProcessed() {
+ return this.processed;
+ }
+ async handlePrefetch() {
+ Bn(this.requestParams.all().url, window.location) && this.handle();
+ }
+ async handle() {
+ return gr.add(() => this.process());
+ }
+ async process() {
+ if (this.requestParams.all().prefetch)
+ return (
+ (this.wasPrefetched = !0),
+ (this.requestParams.all().prefetch = !1),
+ this.requestParams
+ .all()
+ .onPrefetched(this.response, this.requestParams.all()),
+ Xt(this.response, this.requestParams.all()),
+ Promise.resolve()
+ );
+ if (
+ (this.requestParams.runCallbacks(),
+ (this.processed = !0),
+ !this.isInertiaResponse())
+ )
+ return this.handleNonInertiaResponse();
+ if (this.isHttpException()) {
+ let e = {
+ ...this.response,
+ data: this.getDataFromResponse(this.response.data),
+ };
+ if (this.requestParams.all().onHttpException(e) === !1 || !Wt(e))
+ return;
+ }
+ (await j.processQueue(),
+ (j.preserveUrl = this.requestParams.all().preserveUrl),
+ await this.setPage());
+ let {flash: e} = A.get();
+ Object.keys(e).length > 0 &&
+ !this.requestParams.isDeferredPropsRequest() &&
+ (Qt(e), this.requestParams.all().onFlash(e));
+ let t = A.get().props.errors || {};
+ if (Object.keys(t).length > 0) {
+ let e = this.getScopedErrors(t);
+ return (Vt(e), this.requestParams.all().onError(e));
+ }
+ (N.flushByCacheTags(this.requestParams.all().invalidateCacheTags || []),
+ this.wasPrefetched || N.flush(A.get().url),
+ Yt(A.get()),
+ await this.requestParams.all().onSuccess(A.get()),
+ (j.preserveUrl = !1));
+ }
+ mergeParams(e) {
+ this.requestParams.merge(e);
+ }
+ getPageResponse() {
+ let e = this.getDataFromResponse(this.response.data);
+ return typeof e == `object`
+ ? (this.response.data = {...e, flash: e.flash ?? {}})
+ : (this.response.data = e);
+ }
+ async handleNonInertiaResponse() {
+ if (this.isInertiaRedirect()) {
+ N.visit(this.getHeader(`x-inertia-redirect`), {
+ ...this.requestParams.all(),
+ method: `get`,
+ data: {},
+ });
+ return;
+ }
+ if (this.isLocationVisit()) {
+ let e = Fn(this.getHeader(`x-inertia-location`));
+ return (zn(this.requestParams.all().url, e), this.locationVisit(e));
+ }
+ let e = {
+ ...this.response,
+ data: this.getDataFromResponse(this.response.data),
+ };
+ if (this.requestParams.all().onHttpException(e) !== !1 && Wt(e))
+ return hr.show(e.data);
+ }
+ isInertiaResponse() {
+ return this.hasHeader(`x-inertia`);
+ }
+ isHttpException() {
+ return this.response.status >= 400;
+ }
+ hasStatus(e) {
+ return this.response.status === e;
+ }
+ getHeader(e) {
+ return this.response.headers[e];
+ }
+ hasHeader(e) {
+ return this.getHeader(e) !== void 0;
+ }
+ isInertiaRedirect() {
+ return this.hasStatus(409) && this.hasHeader(`x-inertia-redirect`);
+ }
+ isLocationVisit() {
+ return this.hasStatus(409) && this.hasHeader(`x-inertia-location`);
+ }
+ locationVisit(e) {
+ try {
+ if (
+ ($t.set($t.locationVisitKey, {
+ preserveScroll: this.requestParams.all().preserveScroll === !0,
+ }),
+ typeof window > `u`)
+ )
+ return;
+ Bn(window.location, e)
+ ? window.location.reload()
+ : (window.location.href = e.href);
+ } catch {
+ return !1;
+ }
+ }
+ async setPage() {
+ let e = this.getPageResponse();
+ return this.shouldSetPage(e)
+ ? (this.mergeProps(e),
+ A.mergeOncePropsIntoResponse(e),
+ this.preserveOptimisticProps(e),
+ this.preserveEqualProps(e),
+ await this.setRememberedState(e),
+ this.requestParams.setPreserveOptions(e),
+ (e.url = j.preserveUrl ? A.get().url : this.pageUrl(e)),
+ this.requestParams.all().onBeforeUpdate(e),
+ Gt(e),
+ A.set(e, {
+ replace: this.requestParams.all().replace,
+ preserveScroll: this.requestParams.all().preserveScroll,
+ preserveState: this.requestParams.all().preserveState,
+ viewTransition: this.requestParams.all().viewTransition,
+ }))
+ : Promise.resolve();
+ }
+ getDataFromResponse(e) {
+ if (typeof e != `string`) return e;
+ try {
+ return JSON.parse(e);
+ } catch {
+ return e;
+ }
+ }
+ shouldSetPage(e) {
+ if (
+ !this.requestParams.all().async ||
+ this.originatingPage.component !== e.component
+ )
+ return !0;
+ if (this.originatingPage.component !== A.get().component) return !1;
+ let t = Fn(this.originatingPage.url),
+ n = Fn(A.get().url);
+ return t.origin === n.origin && t.pathname === n.pathname;
+ }
+ pageUrl(e) {
+ let t = Fn(e.url);
+ return (
+ e.preserveFragment
+ ? (t.hash = this.requestParams.all().url.hash)
+ : zn(this.requestParams.all().url, t),
+ t.pathname + t.search + t.hash
+ );
+ }
+ preserveOptimisticProps(e) {
+ if (N.hasPendingOptimistic())
+ for (let t of Object.keys(e.props))
+ A.hasBaseline(t) &&
+ (A.updateBaseline(t, e.props[t]), (e.props[t] = A.get().props[t]));
+ }
+ preserveEqualProps(e) {
+ if (e.component !== A.get().component) return;
+ let t = A.get().props;
+ Object.entries(e.props).forEach(([n, r]) => {
+ be(r, t[n]) && (e.props[n] = t[n]);
+ });
+ }
+ mergeProps(e) {
+ if (!this.requestParams.isPartial() || e.component !== A.get().component)
+ return;
+ let t = e.mergeProps || [],
+ n = e.prependProps || [],
+ r = e.deepMergeProps || [],
+ i = e.matchPropsOn || [],
+ a = (t, n) => {
+ let r = k(A.get().props, t),
+ a = k(e.props, t);
+ if (Array.isArray(a)) {
+ let o = this.mergeOrMatchItems(r || [], a, t, i, n);
+ We(e.props, t, o);
+ } else if (typeof a == `object` && a) {
+ let n = {...(r || {}), ...a};
+ We(e.props, t, n);
+ }
+ };
+ (t.forEach((e) => a(e, !0)),
+ n.forEach((e) => a(e, !1)),
+ r.forEach((t) => {
+ let n = k(A.get().props, t),
+ r = k(e.props, t),
+ a = (e, t, n) =>
+ Array.isArray(t)
+ ? this.mergeOrMatchItems(e, t, n, i)
+ : typeof t == `object` && t
+ ? Object.keys(t).reduce(
+ (r, i) => (
+ (r[i] = a(e ? e[i] : void 0, t[i], `${n}.${i}`)),
+ r
+ ),
+ {...e}
+ )
+ : t;
+ We(e.props, t, a(n, r, t));
+ }));
+ let o = new Set(
+ [...this.requestParams.all().only, ...this.requestParams.all().except]
+ .filter((e) => e.includes(`.`))
+ .map((e) => e.split(`.`)[0])
+ );
+ for (let t of o) {
+ let n = A.get().props[t];
+ this.isObject(n) &&
+ this.isObject(e.props[t]) &&
+ (e.props[t] = this.deepMergeObjects(n, e.props[t]));
+ }
+ ((e.props = {...A.get().props, ...e.props}),
+ this.shouldPreserveErrors(e) && (e.props.errors = A.get().props.errors),
+ A.get().scrollProps &&
+ (e.scrollProps = {
+ ...(A.get().scrollProps || {}),
+ ...(e.scrollProps || {}),
+ }),
+ A.hasOnceProps() &&
+ (e.onceProps = {
+ ...(A.get().onceProps || {}),
+ ...(e.onceProps || {}),
+ }),
+ this.requestParams.isDeferredPropsRequest() &&
+ (e.flash = {...A.get().flash}));
+ let s = A.get().initialDeferredProps;
+ s && Object.keys(s).length > 0 && (e.initialDeferredProps = s);
+ }
+ shouldPreserveErrors(e) {
+ if (!this.requestParams.all().preserveErrors) return !1;
+ let t = A.get().props.errors;
+ if (!t || Object.keys(t).length === 0) return !1;
+ let n = e.props.errors;
+ return !(n && Object.keys(n).length > 0);
+ }
+ isObject(e) {
+ return e && typeof e == `object` && !Array.isArray(e);
+ }
+ deepMergeObjects(e, t) {
+ let n = {...e};
+ for (let r of Object.keys(t)) {
+ let i = e[r],
+ a = t[r];
+ this.isObject(i) && this.isObject(a)
+ ? (n[r] = this.deepMergeObjects(i, a))
+ : (n[r] = a);
+ }
+ return n;
+ }
+ mergeOrMatchItems(e, t, n, r, i = !0) {
+ let a = Array.isArray(e) ? e : [],
+ o = r.find((e) => e.split(`.`).slice(0, -1).join(`.`) === n);
+ if (!o) return i ? [...a, ...t] : [...t, ...a];
+ let s = o.split(`.`).pop() || ``,
+ c = new Map();
+ return (
+ t.forEach((e) => {
+ this.hasUniqueProperty(e, s) && c.set(e[s], e);
+ }),
+ i
+ ? this.appendWithMatching(a, t, c, s)
+ : this.prependWithMatching(a, t, c, s)
+ );
+ }
+ appendWithMatching(e, t, n, r) {
+ let i = e.map((e) =>
+ this.hasUniqueProperty(e, r) && n.has(e[r]) ? n.get(e[r]) : e
+ ),
+ a = t.filter((t) =>
+ this.hasUniqueProperty(t, r)
+ ? !e.some((e) => this.hasUniqueProperty(e, r) && e[r] === t[r])
+ : !0
+ );
+ return [...i, ...a];
+ }
+ prependWithMatching(e, t, n, r) {
+ let i = e.filter((e) =>
+ this.hasUniqueProperty(e, r) ? !n.has(e[r]) : !0
+ );
+ return [...t, ...i];
+ }
+ hasUniqueProperty(e, t) {
+ return e && typeof e == `object` && t in e;
+ }
+ async setRememberedState(e) {
+ let t = await j.getState(j.rememberedState, {});
+ this.requestParams.all().preserveState &&
+ t &&
+ e.component === A.get().component &&
+ (e.rememberedState = t);
+ }
+ getScopedErrors(e) {
+ return this.requestParams.all().errorBag
+ ? e[this.requestParams.all().errorBag || ``] || {}
+ : e;
+ }
+ },
+ vr = class e {
+ constructor(e, t, {optimistic: n = !1} = {}) {
+ ((this.page = t),
+ (this.requestParams = mr.create(e)),
+ (this.cancelToken = new AbortController()),
+ (this.optimistic = n));
+ }
+ response;
+ cancelToken;
+ requestParams;
+ requestHasFinished = !1;
+ optimistic;
+ static create(t, n, r) {
+ return new e(t, n, r);
+ }
+ isPrefetch() {
+ return this.requestParams.isPrefetch();
+ }
+ isOptimistic() {
+ return this.optimistic;
+ }
+ isPendingOptimistic() {
+ return (
+ this.isOptimistic() && (!this.response || !this.response.isProcessed())
+ );
+ }
+ async send() {
+ (this.requestParams.onCancelToken(() => this.cancel({cancelled: !0})),
+ Jt(this.requestParams.all()),
+ this.requestParams.onStart(),
+ this.requestParams.all().prefetch &&
+ (this.requestParams.onPrefetching(), Zt(this.requestParams.all())));
+ let e = this.requestParams.all().prefetch;
+ return pr
+ .getClient()
+ .request({
+ method: this.requestParams.all().method,
+ url: Rn(this.requestParams.all().url).href,
+ data: this.requestParams.data(),
+ signal: this.cancelToken.signal,
+ headers: this.getHeaders(),
+ onUploadProgress: this.onProgress.bind(this),
+ })
+ .then(
+ (e) => (
+ (this.response = _r.create(this.requestParams, e, this.page)),
+ this.response.handle()
+ )
+ )
+ .catch((e) =>
+ e instanceof rr
+ ? ((this.response = _r.create(
+ this.requestParams,
+ e.response,
+ this.page
+ )),
+ this.response.handle())
+ : Promise.reject(e)
+ )
+ .catch((t) => {
+ if (
+ !(t instanceof ir) &&
+ this.requestParams.all().onNetworkError(t) !== !1 &&
+ Ht(t)
+ )
+ return (
+ e && this.requestParams.onPrefetchError(t),
+ Promise.reject(t)
+ );
+ })
+ .finally(() => {
+ (this.finish(),
+ e &&
+ this.response &&
+ this.requestParams.onPrefetchResponse(this.response));
+ });
+ }
+ finish() {
+ this.requestParams.wasCancelledAtAll() ||
+ (this.requestParams.markAsFinished(), this.fireFinishEvents());
+ }
+ fireFinishEvents() {
+ this.requestHasFinished ||
+ ((this.requestHasFinished = !0),
+ Ut(this.requestParams.all()),
+ this.requestParams.onFinish());
+ }
+ cancel({cancelled: e = !1, interrupted: t = !1}) {
+ this.requestHasFinished ||
+ (this.cancelToken.abort(),
+ this.requestParams.markAsCancelled({cancelled: e, interrupted: t}),
+ this.fireFinishEvents());
+ }
+ onProgress(e) {
+ this.requestParams.data() instanceof FormData &&
+ (qt(e), this.requestParams.all().onProgress(e));
+ }
+ getHeaders() {
+ let e = {
+ ...this.requestParams.headers(),
+ Accept: `text/html, application/xhtml+xml`,
+ 'X-Requested-With': `XMLHttpRequest`,
+ 'X-Inertia': !0,
+ },
+ t = A.get();
+ t.version && (e[`X-Inertia-Version`] = t.version);
+ let n = Object.entries(t.onceProps || {})
+ .filter(([, e]) =>
+ k(t.props, e.prop) === void 0
+ ? !1
+ : !e.expiresAt || e.expiresAt > Date.now()
+ )
+ .map(([e]) => e);
+ return (
+ n.length > 0 && (e[`X-Inertia-Except-Once-Props`] = n.join(`,`)),
+ e
+ );
+ }
+ },
+ yr = class {
+ requests = [];
+ maxConcurrent;
+ interruptible;
+ constructor({maxConcurrent: e, interruptible: t}) {
+ ((this.maxConcurrent = e), (this.interruptible = t));
+ }
+ send(e) {
+ (this.requests.push(e),
+ e.send().finally(() => {
+ this.requests = this.requests.filter((t) => t !== e);
+ }));
+ }
+ interruptInFlight() {
+ this.cancel({interrupted: !0}, !1);
+ }
+ cancelInFlight({prefetch: e = !0, optimistic: t = !0} = {}) {
+ this.requests
+ .filter((t) => e || !t.isPrefetch())
+ .filter((e) => t || !e.isOptimistic())
+ .forEach((e) => e.cancel({cancelled: !0}));
+ }
+ cancel({cancelled: e = !1, interrupted: t = !1} = {}, n = !1) {
+ (!n && !this.shouldCancel()) ||
+ this.requests.shift()?.cancel({cancelled: e, interrupted: t});
+ }
+ shouldCancel() {
+ return this.interruptible && this.requests.length >= this.maxConcurrent;
+ }
+ hasPendingOptimistic() {
+ return this.requests.some((e) => e.isPendingOptimistic());
+ }
+ },
+ br = () => {},
+ xr = class {
+ syncRequestStream = new yr({maxConcurrent: 1, interruptible: !0});
+ asyncRequestStream = new yr({maxConcurrent: 1 / 0, interruptible: !1});
+ clientVisitQueue = new Gn();
+ pendingOptimisticCallback = void 0;
+ init({initialPage: e, resolveComponent: t, swapComponent: n, onFlash: r}) {
+ (A.init({
+ initialPage: e,
+ resolveComponent: t,
+ swapComponent: n,
+ onFlash: r,
+ }),
+ Qn.handle(),
+ Xn.init(),
+ Xn.on(`missingHistoryItem`, () => {
+ typeof window < `u` &&
+ this.visit(window.location.href, {
+ preserveState: !0,
+ preserveScroll: !0,
+ replace: !0,
+ });
+ }),
+ Xn.on(`loadDeferredProps`, (e) => {
+ this.loadDeferredProps(e);
+ }),
+ Xn.on(`historyQuotaExceeded`, (e) => {
+ window.location.href = e;
+ }));
+ }
+ optimistic(e) {
+ return ((this.pendingOptimisticCallback = e), this);
+ }
+ get(e, t = {}, n = {}) {
+ return this.visit(e, {...n, method: `get`, data: t});
+ }
+ post(e, t = {}, n = {}) {
+ return this.visit(e, {preserveState: !0, ...n, method: `post`, data: t});
+ }
+ put(e, t = {}, n = {}) {
+ return this.visit(e, {preserveState: !0, ...n, method: `put`, data: t});
+ }
+ patch(e, t = {}, n = {}) {
+ return this.visit(e, {preserveState: !0, ...n, method: `patch`, data: t});
+ }
+ delete(e, t = {}) {
+ return this.visit(e, {preserveState: !0, ...t, method: `delete`});
+ }
+ reload(e = {}) {
+ return this.doReload(e);
+ }
+ doReload(e = {}) {
+ if (!(typeof window > `u`))
+ return this.visit(window.location.href, {
+ ...e,
+ preserveScroll: !0,
+ preserveState: !0,
+ async: !0,
+ headers: {...(e.headers || {}), 'Cache-Control': `no-cache`},
+ });
+ }
+ remember(e, t = `default`) {
+ j.remember(e, t);
+ }
+ restore(e = `default`) {
+ return j.restore(e);
+ }
+ on(e, t) {
+ return typeof window > `u` ? () => {} : Xn.onGlobalEvent(e, t);
+ }
+ hasPendingOptimistic() {
+ return this.asyncRequestStream.hasPendingOptimistic();
+ }
+ cancelAll({async: e = !0, prefetch: t = !0, sync: n = !0} = {}) {
+ (e && this.asyncRequestStream.cancelInFlight({prefetch: t}),
+ n && this.syncRequestStream.cancelInFlight());
+ }
+ poll(e, t = {}, n = {}) {
+ return er.add(e, () => this.reload({preserveErrors: !0, ...t}), {
+ autoStart: n.autoStart ?? !0,
+ keepAlive: n.keepAlive ?? !1,
+ });
+ }
+ visit(e, t = {}) {
+ ((t.optimistic = t.optimistic ?? this.pendingOptimisticCallback),
+ (this.pendingOptimisticCallback = void 0),
+ t.optimistic && (t.async = t.async ?? !0));
+ let n = this.getPendingVisit(e, {
+ ...t,
+ showProgress: t.showProgress ?? (!t.async || !!t.optimistic),
+ }),
+ r = this.getVisitEvents(t);
+ if (r.onBefore(n) === !1 || !Bt(n)) return;
+ let i = Fn(A.get().url);
+ ((n.only.length > 0 || n.except.length > 0 || n.reset.length > 0
+ ? Vn(n.url, i)
+ : Bn(n.url, i)) ||
+ this.asyncRequestStream.cancelInFlight({prefetch: !1, optimistic: !1}),
+ n.async || this.syncRequestStream.interruptInFlight(),
+ t.optimistic && this.applyOptimisticUpdate(t.optimistic, r),
+ !A.isCleared() && !n.preserveUrl && bn.save());
+ let a = {...n, ...r},
+ o = () => {
+ let e = hn.get(a);
+ e
+ ? (ui.reveal(e.inFlight), hn.use(e, a))
+ : (ui.reveal(!0),
+ (n.async ? this.asyncRequestStream : this.syncRequestStream).send(
+ vr.create(a, A.get(), {optimistic: !!t.optimistic})
+ ));
+ };
+ (Array.isArray(n.component) &&
+ (console.error(
+ `The "component" prop received an array of components (${n.component.join(`, `)}), but only a single component string is supported for instant visits. Pass an explicit component name instead.`
+ ),
+ (n.component = null)),
+ n.component
+ ? j.processQueue().then(() => {
+ this.performInstantSwap(n).then(() => {
+ ((a.preserveState = !0),
+ (a.replace = !0),
+ (a.viewTransition = !1),
+ o());
+ });
+ })
+ : o());
+ }
+ getCached(e, t = {}) {
+ return hn.findCached(this.getPrefetchParams(e, t));
+ }
+ flush(e, t = {}) {
+ hn.remove(this.getPrefetchParams(e, t));
+ }
+ flushAll() {
+ hn.removeAll();
+ }
+ flushByCacheTags(e) {
+ hn.removeByTags(Array.isArray(e) ? e : [e]);
+ }
+ getPrefetching(e, t = {}) {
+ return hn.findInFlight(this.getPrefetchParams(e, t));
+ }
+ prefetch(e, t = {}, n = {}) {
+ if ((t.method ?? (Hn(e) ? e.method : `get`)) !== `get`)
+ throw Error(`Prefetch requests must use the GET method`);
+ let r = this.getPendingVisit(e, {
+ ...t,
+ async: !0,
+ showProgress: !1,
+ prefetch: !0,
+ viewTransition: !1,
+ });
+ if (
+ r.url.origin + r.url.pathname + r.url.search ===
+ window.location.origin +
+ window.location.pathname +
+ window.location.search
+ )
+ return;
+ let i = this.getVisitEvents(t);
+ if (i.onBefore(r) === !1 || !Bt(r)) return;
+ (ui.hide(), this.asyncRequestStream.interruptInFlight());
+ let a = {...r, ...i};
+ new Promise((e) => {
+ let t = () => {
+ A.get() ? e() : setTimeout(t, 50);
+ };
+ t();
+ }).then(() => {
+ hn.add(
+ a,
+ (e) => {
+ this.asyncRequestStream.send(vr.create(e, A.get()));
+ },
+ {cacheFor: Lt.get(`prefetch.cacheFor`), cacheTags: [], ...n}
+ );
+ });
+ }
+ clearHistory() {
+ j.clear();
+ }
+ decryptHistory() {
+ return j.decrypt();
+ }
+ resolveComponent(e, t) {
+ return A.resolve(e, t);
+ }
+ replace(e) {
+ this.clientVisit(e, {replace: !0});
+ }
+ replaceProp(e, t, n) {
+ this.replace({
+ preserveScroll: !0,
+ preserveState: !0,
+ props(n) {
+ let r = typeof t == `function` ? t(k(n, e), n) : t;
+ return We(O(n), e, r);
+ },
+ ...(n || {}),
+ });
+ }
+ appendToProp(e, t, n) {
+ this.replaceProp(
+ e,
+ (e, n) => {
+ let r = typeof t == `function` ? t(e, n) : t;
+ return (Array.isArray(e) || (e = e === void 0 ? [] : [e]), [...e, r]);
+ },
+ n
+ );
+ }
+ prependToProp(e, t, n) {
+ this.replaceProp(
+ e,
+ (e, n) => {
+ let r = typeof t == `function` ? t(e, n) : t;
+ return (Array.isArray(e) || (e = e === void 0 ? [] : [e]), [r, ...e]);
+ },
+ n
+ );
+ }
+ push(e) {
+ this.clientVisit(e);
+ }
+ flash(e, t) {
+ let n = A.get().flash,
+ r;
+ if (typeof e == `function`) r = e(n);
+ else if (typeof e == `string`) r = {...n, [e]: t};
+ else if (e && Object.keys(e).length) r = {...n, ...e};
+ else return;
+ (A.setFlash(r), Object.keys(r).length && Qt(r));
+ }
+ clientVisit(e, {replace: t = !1} = {}) {
+ this.clientVisitQueue.add(() => this.performClientVisit(e, {replace: t}));
+ }
+ performClientVisit(e, {replace: t = !1} = {}) {
+ let n = A.get(),
+ r =
+ typeof e.props == `function`
+ ? Object.fromEntries(
+ Object.values(n.onceProps ?? {}).map((e) => [
+ e.prop,
+ k(n.props, e.prop),
+ ])
+ )
+ : {},
+ i =
+ typeof e.props == `function`
+ ? e.props(n.props, r)
+ : (e.props ?? n.props),
+ a = typeof e.flash == `function` ? e.flash(n.flash) : e.flash,
+ {
+ viewTransition: o,
+ onError: s,
+ onFinish: c,
+ onFlash: l,
+ onSuccess: u,
+ ...d
+ } = e,
+ f = {...n, ...d, flash: a ?? {}, props: i},
+ p = mr.resolvePreserveOption(e.preserveScroll ?? !1, f),
+ m = mr.resolvePreserveOption(e.preserveState ?? !1, f);
+ return A.set(f, {
+ replace: t,
+ preserveScroll: p,
+ preserveState: m,
+ viewTransition: o,
+ })
+ .then(() => {
+ let t = A.get().flash;
+ Object.keys(t).length > 0 && (Qt(t), l?.(t));
+ let n = A.get().props.errors || {};
+ if (Object.keys(n).length === 0) {
+ u?.(A.get());
+ return;
+ }
+ let r = e.errorBag ? n[e.errorBag || ``] || {} : n;
+ s?.(r);
+ })
+ .finally(() => c?.(e));
+ }
+ performInstantSwap(e) {
+ let t = A.get(),
+ n = Object.fromEntries(
+ (t.sharedProps ?? [])
+ .filter((e) => e in t.props)
+ .map((e) => [e, t.props[e]])
+ ),
+ r =
+ typeof e.pageProps == `function`
+ ? e.pageProps(O(t.props), O(n))
+ : e.pageProps,
+ i = r === null ? {...n} : {...r},
+ a = {
+ component: e.component,
+ url: e.url.pathname + e.url.search + e.url.hash,
+ version: t.version,
+ props: {...i, errors: {}},
+ flash: {},
+ clearHistory: !1,
+ encryptHistory: t.encryptHistory,
+ sharedProps: t.sharedProps,
+ rememberedState: {},
+ };
+ return A.set(a, {
+ replace: e.replace,
+ preserveScroll: mr.resolvePreserveOption(e.preserveScroll, a),
+ preserveState: !1,
+ viewTransition: e.viewTransition,
+ });
+ }
+ getPrefetchParams(e, t) {
+ return {
+ ...this.getPendingVisit(e, {
+ ...t,
+ async: !0,
+ showProgress: !1,
+ prefetch: !0,
+ viewTransition: !1,
+ }),
+ ...this.getVisitEvents(t),
+ };
+ }
+ getPendingVisit(e, t) {
+ if (Hn(e)) {
+ let n = e;
+ ((e = n.url), (t.method = t.method ?? n.method));
+ }
+ let n = Lt.get(`visitOptions`),
+ r = (n && n(e.toString(), O(t))) || {},
+ i = {
+ method: `get`,
+ data: {},
+ replace: !1,
+ preserveScroll: !1,
+ preserveState: !1,
+ only: [],
+ except: [],
+ headers: {},
+ errorBag: ``,
+ forceFormData: !1,
+ queryStringArrayFormat: `brackets`,
+ async: !1,
+ showProgress: !0,
+ fresh: !1,
+ reset: [],
+ preserveUrl: !1,
+ preserveErrors: !1,
+ prefetch: !1,
+ invalidateCacheTags: [],
+ viewTransition: !1,
+ component: null,
+ pageProps: null,
+ ...t,
+ ...r,
+ },
+ [a, o] = In(
+ e,
+ i.data,
+ i.method,
+ i.forceFormData,
+ i.queryStringArrayFormat
+ ),
+ s = {
+ cancelled: !1,
+ completed: !1,
+ interrupted: !1,
+ ...i,
+ url: a,
+ data: o,
+ };
+ return (s.prefetch && (s.headers.Purpose = `prefetch`), s);
+ }
+ getVisitEvents(e) {
+ return {
+ onCancelToken: e.onCancelToken || br,
+ onBefore: e.onBefore || br,
+ onBeforeUpdate: e.onBeforeUpdate || br,
+ onStart: e.onStart || br,
+ onProgress: e.onProgress || br,
+ onFinish: e.onFinish || br,
+ onCancel: e.onCancel || br,
+ onSuccess: e.onSuccess || br,
+ onError: e.onError || br,
+ onHttpException: e.onHttpException || br,
+ onNetworkError: e.onNetworkError || br,
+ onFlash: e.onFlash || br,
+ onPrefetched: e.onPrefetched || br,
+ onPrefetching: e.onPrefetching || br,
+ };
+ }
+ applyOptimisticUpdate(e, t) {
+ let n = A.get().props,
+ r = e(O(n));
+ if (!r) return;
+ let i = [];
+ for (let e of Object.keys(r)) be(n[e], r[e]) || i.push(e);
+ if (i.length === 0) return;
+ let a = A.nextOptimisticId(),
+ o = A.get().component;
+ for (let e of i) A.setBaseline(e, O(n[e]));
+ (A.registerOptimistic(a, e), A.setPropsQuietly({...n, ...r}));
+ let s = !0,
+ c = t.onSuccess;
+ t.onSuccess = (e) => ((s = !1), c(e));
+ let l = t.onFinish;
+ t.onFinish = (e) => {
+ if ((A.unregisterOptimistic(a), s && A.get().component === o)) {
+ let e = A.replayOptimistics();
+ Object.keys(e).length > 0 &&
+ A.setPropsQuietly({...A.get().props, ...e});
+ }
+ return (
+ A.pendingOptimisticCount() === 0 && A.clearOptimisticState(),
+ l(e)
+ );
+ };
+ }
+ loadDeferredProps(e) {
+ e &&
+ Object.values(e).forEach((e) => {
+ this.doReload({only: e, deferredProps: !0, preserveErrors: !0});
+ });
+ }
+ },
+ Sr = class {
+ static createWayfinderCallback(...e) {
+ return () =>
+ e.length === 1
+ ? Hn(e[0])
+ ? e[0]
+ : e[0]()
+ : {
+ method: typeof e[0] == `function` ? e[0]() : e[0],
+ url: typeof e[1] == `function` ? e[1]() : e[1],
+ };
+ }
+ static parseUseFormArguments(...e) {
+ return e.length === 0
+ ? {rememberKey: null, data: {}, precognitionEndpoint: null}
+ : e.length === 1
+ ? {rememberKey: null, data: e[0], precognitionEndpoint: null}
+ : e.length === 2
+ ? typeof e[0] == `string`
+ ? {rememberKey: e[0], data: e[1], precognitionEndpoint: null}
+ : {
+ rememberKey: null,
+ data: e[1],
+ precognitionEndpoint: this.createWayfinderCallback(e[0]),
+ }
+ : {
+ rememberKey: null,
+ data: e[2],
+ precognitionEndpoint: this.createWayfinderCallback(e[0], e[1]),
+ };
+ }
+ static parseSubmitArguments(e, t) {
+ return e.length === 3 || (e.length === 2 && typeof e[0] == `string`)
+ ? {method: e[0], url: e[1], options: e[2] ?? {}}
+ : Hn(e[0])
+ ? {...e[0], options: e[1] ?? {}}
+ : {...t(), options: e[0] ?? {}};
+ }
+ static mergeHeadersForValidation(e, t, n) {
+ let r = (e) => ((e.headers = {...(n ?? {}), ...(e.headers ?? {})}), e);
+ return (
+ e && typeof e == `object` && !(`target` in e)
+ ? (e = r(e))
+ : t && typeof t == `object`
+ ? (t = r(t))
+ : typeof e == `string`
+ ? (t = r(t ?? {}))
+ : (e = r(e ?? {})),
+ [e, t]
+ );
+ }
+ };
+function Cr(e) {
+ return e.includes(`.`)
+ ? e
+ .replace(/\\\./g, `__ESCAPED_DOT__`)
+ .split(/(\[[^\]]*\])/)
+ .filter(Boolean)
+ .map((e) =>
+ e.startsWith(`[`) && e.endsWith(`]`)
+ ? e
+ : e.split(`.`).reduce((e, t, n) => (n === 0 ? t : `${e}[${t}]`))
+ )
+ .join(``)
+ .replace(/__ESCAPED_DOT__/g, `.`)
+ : e;
+}
+function wr(e) {
+ let t = [],
+ n = /([^\[\]]+)|\[(\d*)\]/g,
+ r;
+ for (; (r = n.exec(e)) !== null; )
+ r[1] === void 0
+ ? r[2] !== void 0 && t.push(r[2] === `` ? `` : Number(r[2]))
+ : t.push(r[1]);
+ return t;
+}
+function Tr(e, t, n) {
+ let r = e;
+ for (let e = 0; e < t.length - 1; e++)
+ (t[e] in r || (r[t[e]] = {}), (r = r[t[e]]));
+ r[t[t.length - 1]] = n;
+}
+function Er(e) {
+ let t = Object.keys(e),
+ n = t
+ .filter((e) => /^\d+$/.test(e))
+ .map(Number)
+ .sort((e, t) => e - t);
+ return (
+ t.length === n.length &&
+ n.length > 0 &&
+ n[0] === 0 &&
+ n.every((e, t) => e === t)
+ );
+}
+function Dr(e) {
+ if (Array.isArray(e)) return e.map(Dr);
+ if (typeof e != `object` || !e || xn(e)) return e;
+ if (Er(e)) {
+ let t = [];
+ for (let n = 0; n < Object.keys(e).length; n++) t[n] = Dr(e[n]);
+ return t;
+ }
+ let t = {};
+ for (let n in e) t[n] = Dr(e[n]);
+ return t;
+}
+function Or(e) {
+ let t = {};
+ for (let [n, r] of e.entries()) {
+ if (r instanceof File && r.size === 0 && r.name === ``) continue;
+ let e = wr(Cr(n));
+ if (e[e.length - 1] === ``) {
+ let n = e.slice(0, -1),
+ i = k(t, n);
+ if (Array.isArray(i)) i.push(r);
+ else if (i && typeof i == `object` && !xn(i)) {
+ let e = Object.keys(i)
+ .filter((e) => /^\d+$/.test(e))
+ .map(Number)
+ .sort((e, t) => e - t);
+ We(t, n, e.length > 0 ? [...e.map((e) => i[e]), r] : [r]);
+ } else We(t, n, [r]);
+ continue;
+ }
+ Tr(t, e.map(String), r);
+ }
+ return Dr(t);
+}
+var kr = {
+ buildDOMElement(e) {
+ let t = document.createElement(`template`);
+ t.innerHTML = e;
+ let n = t.content.firstChild;
+ if (!e.startsWith(`
diff --git a/resources/js/common/composables/useCraftData.ts b/resources/js/common/composables/useCraftData.ts
index 0812717ef93..f3c5c241151 100644
--- a/resources/js/common/composables/useCraftData.ts
+++ b/resources/js/common/composables/useCraftData.ts
@@ -24,8 +24,11 @@ export interface CraftData {
};
};
site: {
+ id: number;
+ name: string;
+ handle: string;
url: string;
- };
+ } | null;
readOnly: boolean;
allowAdminChanges: boolean;
currentUser: CpUser | null;
diff --git a/resources/js/common/composables/useDragAndDrop.ts b/resources/js/common/composables/useDragAndDrop.ts
index 9511b5850ff..53092d09ef3 100644
--- a/resources/js/common/composables/useDragAndDrop.ts
+++ b/resources/js/common/composables/useDragAndDrop.ts
@@ -154,6 +154,15 @@ export function useDragAndDrop(
},
onDrop() {
setDragState(id, idleDragState);
+
+ // Native HTML drag swallows the trailing pointerup on the source, so
+ // an interactive drag handle (e.g. a button) can stay stuck in
+ // :active/:hover. Briefly disabling pointer events forces the browser
+ // to drop those states.
+ dragElement.style.pointerEvents = 'none';
+ requestAnimationFrame(() => {
+ dragElement.style.pointerEvents = '';
+ });
},
}),
dropTargetForElements({
diff --git a/resources/js/common/composables/useStorage.ts b/resources/js/common/composables/useStorage.ts
new file mode 100644
index 00000000000..b122043c47b
--- /dev/null
+++ b/resources/js/common/composables/useStorage.ts
@@ -0,0 +1,115 @@
+import type {UseStorageOptions} from '@vueuse/core';
+import {useStorage as _useStorage} from '@vueuse/core';
+import type {RemovableRef} from '@vueuse/shared';
+import type {MaybeRefOrGetter} from 'vue';
+
+declare const Craft: {systemUid: string};
+
+function prefixedKey(key: string): string {
+ return `Craft-${Craft.systemUid}.${key}`;
+}
+
+export function useStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter
,
+ storage?: Storage,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ storage?: Storage,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ storage?: Storage,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ storage?: Storage,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ storage?: Storage,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ storage: Storage = localStorage,
+ options?: UseStorageOptions
+) {
+ return _useStorage(prefixedKey(key), initialValue, storage, options);
+}
+
+export function useLocalStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useLocalStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useLocalStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useLocalStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useLocalStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useLocalStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+) {
+ return useStorage(key, initialValue, localStorage, options);
+}
+
+export function useSessionStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useSessionStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useSessionStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useSessionStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useSessionStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+): RemovableRef;
+export function useSessionStorage(
+ key: string,
+ initialValue: MaybeRefOrGetter,
+ options?: UseStorageOptions
+) {
+ return useStorage(key, initialValue, sessionStorage, options);
+}
diff --git a/resources/js/common/form/CheckboxGroup.vue b/resources/js/common/form/CheckboxGroup.vue
index 53d54b4fe61..6b7545b057b 100644
--- a/resources/js/common/form/CheckboxGroup.vue
+++ b/resources/js/common/form/CheckboxGroup.vue
@@ -1,12 +1,17 @@
-
-
-
-
- {{
- option.label
- }}
-
-
+
+
+ setHandleRef(el, option.value)"
+ @reorder="reorder"
+ >
+
+ {{
+ slotOption.label
+ }}
+
+
+
+
+
+
+
setHandleRef(el, option.value)"
+ @reorder="reorder"
+ >
+
+ {{ slotOption.label }}
-
-
-
-
-
- {{
- option.label
- }}
-
-
-
-
+
+
-
+
diff --git a/resources/js/common/form/CheckboxGroupItem.vue b/resources/js/common/form/CheckboxGroupItem.vue
new file mode 100644
index 00000000000..c9ffefc9082
--- /dev/null
+++ b/resources/js/common/form/CheckboxGroupItem.vue
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+ ) =>
+ emit(
+ 'reorder',
+ index,
+ e.detail.direction === 'up' ? index - 1 : index + 1
+ )
+ "
+ >
+
+
+
+
+
+ {{ option.label }}
+
+
+
+
+
+
+
+
+
+ {{ option.label }}
+
+
+
+
+
+
diff --git a/resources/js/common/layouts/AppLayout.vue b/resources/js/common/layouts/AppLayout.vue
index 4351947aa34..5253ec273bd 100644
--- a/resources/js/common/layouts/AppLayout.vue
+++ b/resources/js/common/layouts/AppLayout.vue
@@ -203,7 +203,7 @@
-
+
-
+
+
+
+